1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-01 23:38:37 +00:00

Merge pull request #3474 from haiwen/file-view

[file view] removed 'open via client'
This commit is contained in:
Daniel Pan 2019-05-16 17:19:09 +08:00 committed by GitHub
commit c2ff293ec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 19 deletions

View File

@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants';
const { err, filePerm, fileType, repoID, filePath } = window.app.pageOptions;
const { err } = window.app.pageOptions;
const propTypes = {
errorMsg: PropTypes.string
@ -18,22 +18,11 @@ class FileViewTip extends React.Component {
errorMsg = <p className="error">{err || this.props.errorMsg}</p>;
}
let canOpenViaClient = false;
if (filePerm == 'rw' && (fileType == 'Document' || fileType == 'SpreadSheet')) {
canOpenViaClient = true;
}
return (
<div className="file-view-content flex-1 o-auto">
<div className="file-view-tip">
{errorMsg}
<a href="?dl=1" className="btn btn-secondary">{gettext('Download')}</a>
{canOpenViaClient && (
<React.Fragment>
<a className="open-via-client" href={`seafile://openfile?repo_id=${repoID}&path=${encodeURIComponent(filePath)}`}>{gettext('Open via Client')}</a>
<p className="tip">{gettext('Please install the desktop client to open file via client.')}</p>
</React.Fragment>
)}
</div>
</div>
);

View File

@ -40,13 +40,6 @@ body {
background: #f4f4f4;
border-right: 4px solid transparent;
}
.open-via-client {
display: block;
margin-top: 25px;
color: #333;
font-weight: normal;
text-decoration: underline;
}
.tip {
color: #808080;
}