mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-24 04:48:03 +00:00
add link for tagged file
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { gettext, siteRoot } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import moment from 'moment';
|
||||
import { Utils } from '../../utils/utils';
|
||||
@@ -49,7 +49,7 @@ class ListTaggedFilesDialog extends React.Component {
|
||||
return (
|
||||
<Modal isOpen={true} toggle={this.toggle}>
|
||||
<ModalHeader toggle={this.toggle}>{gettext('Tagged Files')}</ModalHeader>
|
||||
<ModalBody>
|
||||
<ModalBody className="dialog-list-container">
|
||||
<table>
|
||||
<thead className="table-thread-hidden">
|
||||
<tr>
|
||||
@@ -60,9 +60,18 @@ class ListTaggedFilesDialog extends React.Component {
|
||||
</thead>
|
||||
<tbody>
|
||||
{taggedFileList.map((taggedFile, index) => {
|
||||
let path = Utils.joinPath(taggedFile.parent_path, taggedFile.filename);
|
||||
let href = '';
|
||||
if (Utils.isMarkdownFile(path)) {
|
||||
href = siteRoot + 'wiki/lib/' + this.props.repoID + Utils.encodePath(path);
|
||||
} else {
|
||||
href = siteRoot + 'lib/' + this.props.repoID + '/file' + Utils.encodePath(path);
|
||||
}
|
||||
return (
|
||||
<tr key={index}>
|
||||
<td>{taggedFile.filename}</td>
|
||||
<td className="name">
|
||||
<a href={href} target='_blank'>{taggedFile.filename}</a>
|
||||
</td>
|
||||
<td>{Utils.bytesToSize(taggedFile.size)}</td>
|
||||
<td>{moment.unix(taggedFile.mtime).fromNow()}</td>
|
||||
</tr>
|
||||
|
@@ -17,6 +17,7 @@
|
||||
font-size: 1rem;
|
||||
font-weight: normal;
|
||||
padding: 0.25rem;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
margin: 0.75rem 0 0;
|
||||
}
|
||||
|
||||
@@ -24,6 +25,5 @@
|
||||
color: #a4a4a4;
|
||||
text-align: center;
|
||||
padding: 4px 0;
|
||||
border-top: 1px solid #e6e6e6;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
@@ -182,14 +182,11 @@ ul,ol,li {
|
||||
color: #16181b;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.link-dropdown-item:active {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.table-thread-hidden {
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.table-thread-hidden th {
|
||||
padding: 0;
|
||||
font-size: 0;
|
||||
|
Reference in New Issue
Block a user