1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

modify tag css

This commit is contained in:
shanshuirenjia
2018-12-18 13:36:55 +08:00
parent b01d3ebea8
commit 30357d3195
7 changed files with 41 additions and 36 deletions

View File

@@ -80,7 +80,7 @@ class DirTool extends React.Component {
onListTagCancel={this.onListRepoTagToggle} onListTagCancel={this.onListRepoTagToggle}
onCreateRepoTag={this.onCreateRepoTagToggle} onCreateRepoTag={this.onCreateRepoTagToggle}
onUpdateRepoTag={this.onUpdateRepoTagToggle} onUpdateRepoTag={this.onUpdateRepoTagToggle}
onListFileCancel={this.onListTaggedFileToggle} onListTaggedFiles={this.onListTaggedFileToggle}
/> />
} }
{ {
@@ -101,7 +101,8 @@ class DirTool extends React.Component {
{ {
this.state.isListTaggedFileShow && this.state.isListTaggedFileShow &&
<ListTaggedFilesDialog <ListTaggedFilesDialog
repoTagId={this.state.currentTag.id} repoID={this.props.repoID}
currentTag={this.state.currentTag}
toggleCancel={this.onListTaggedFileToggle} toggleCancel={this.onListTaggedFileToggle}
/> />
} }

View File

@@ -9,7 +9,7 @@ import '../../css/repo-tag.css';
const tagListItemPropTypes = { const tagListItemPropTypes = {
item: PropTypes.object.isRequired, item: PropTypes.object.isRequired,
onTagUpdate: PropTypes.func.isRequired, onTagUpdate: PropTypes.func.isRequired,
onListFileCancel: PropTypes.func.isRequired, onListTaggedFiles: PropTypes.func.isRequired,
}; };
class TagListItem extends React.Component { class TagListItem extends React.Component {
@@ -18,8 +18,8 @@ class TagListItem extends React.Component {
this.props.onTagUpdate(this.props.item); this.props.onTagUpdate(this.props.item);
} }
onListFileCancel = () => { onListTaggedFiles = () => {
this.props.onListFileCancel(this.props.item) this.props.onListTaggedFiles(this.props.item)
} }
render() { render() {
@@ -28,7 +28,9 @@ class TagListItem extends React.Component {
<li className="tag-list-item"> <li className="tag-list-item">
<span className={`tag-demo bg-${color}`}> <span className={`tag-demo bg-${color}`}>
<span className="tag-name">{this.props.item.name}</span> <span className="tag-name">{this.props.item.name}</span>
<span className="tag-files" onClick={this.onListFileCancel}>{this.props.item.fileCount}{' '}{gettext('files')}</span> <span className="tag-files" onClick={this.onListTaggedFiles}>
{this.props.item.fileCount}{' '}{gettext('files')}
</span>
</span> </span>
<i className="tag-edit fa fa-pencil" onClick={this.onTagUpdate}></i> <i className="tag-edit fa fa-pencil" onClick={this.onTagUpdate}></i>
</li> </li>
@@ -43,7 +45,7 @@ const listTagPropTypes = {
onListTagCancel: PropTypes.func.isRequired, onListTagCancel: PropTypes.func.isRequired,
onCreateRepoTag: PropTypes.func.isRequired, onCreateRepoTag: PropTypes.func.isRequired,
onUpdateRepoTag: PropTypes.func.isRequired, onUpdateRepoTag: PropTypes.func.isRequired,
onListFileCancel: PropTypes.func.isRequired, onListTaggedFiles: PropTypes.func.isRequired,
}; };
class ListTagDialog extends React.Component { class ListTagDialog extends React.Component {
@@ -78,23 +80,25 @@ class ListTagDialog extends React.Component {
<Modal isOpen={true} toggle={this.toggle}> <Modal isOpen={true} toggle={this.toggle}>
<ModalHeader toggle={this.toggle}>{gettext('Tags')}</ModalHeader> <ModalHeader toggle={this.toggle}>{gettext('Tags')}</ModalHeader>
<ModalBody> <ModalBody>
{ {this.state.repotagList.length === 0 && (
this.state.repotagList.length === 0 &&
<div className="tag-list tag-list-container"> <div className="tag-list tag-list-container">
{gettext('Click new tag button to create tags.')} {gettext('Click new tag button to create tags.')}
</div> </div>
} )}
{ this.state.repotagList.length > 0 && {this.state.repotagList.length > 0 && (
<ul className="tag-list tag-list-container"> <ul className="tag-list tag-list-container">
{this.state.repotagList.map((repoTag, index) => { {this.state.repotagList.map((repoTag, index) => {
return ( return (
<TagListItem key={index} item={repoTag} onTagUpdate={this.props.onUpdateRepoTag} <TagListItem
onListFileCancel={this.props.onListFileCancel} key={index}
item={repoTag}
onTagUpdate={this.props.onUpdateRepoTag}
onListTaggedFiles={this.props.onListTaggedFiles}
/> />
); );
})} })}
</ul> </ul>
} )}
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button color="primary" onClick={this.props.onCreateRepoTag}>{gettext('New Tag')}</Button> <Button color="primary" onClick={this.props.onCreateRepoTag}>{gettext('New Tag')}</Button>

View File

@@ -1,13 +1,14 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { gettext, repoID } from '../../utils/constants'; import { gettext } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import moment from 'moment'; import moment from 'moment';
import { Utils } from '../../utils/utils'; import { Utils } from '../../utils/utils';
const propTypes = { const propTypes = {
repoTagId: PropTypes.number.isRequired, repoID: PropTypes.string.isRequired,
currentTag: PropTypes.object.isRequired,
toggleCancel: PropTypes.func.isRequired, toggleCancel: PropTypes.func.isRequired,
}; };
@@ -25,8 +26,8 @@ class ListTaggedFilesDialog extends React.Component {
} }
getTaggedFiles = () => { getTaggedFiles = () => {
let repoTagId = this.props.repoTagId; let { repoID, currentTag } = this.props;
seafileAPI.listTaggedFiles(repoID, repoTagId).then(res => { seafileAPI.listTaggedFiles(repoID, currentTag.id).then(res => {
let taggedFileList = []; let taggedFileList = [];
res.data.tagged_files !== undefined && res.data.tagged_files !== undefined &&
res.data.tagged_files.forEach(file => { res.data.tagged_files.forEach(file => {
@@ -50,11 +51,11 @@ class ListTaggedFilesDialog extends React.Component {
<ModalHeader toggle={this.toggle}>{gettext('Tagged Files')}</ModalHeader> <ModalHeader toggle={this.toggle}>{gettext('Tagged Files')}</ModalHeader>
<ModalBody> <ModalBody>
<table> <table>
<thead> <thead className="table-thread-hidden">
<tr> <tr>
<th width='30%'>{gettext('Name')}</th> <th width='50%' className="ellipsis">{gettext('Name')}</th>
<th width='30%'>{gettext('Size')}</th> <th width='25%'>{gettext('Size')}</th>
<th width='40%'>{gettext('Last Update')}</th> <th width='25%'>{gettext('Last Update')}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -50,7 +50,7 @@ class SharedRepoListView extends React.Component {
let isShowTableThread = this.props.isShowTableThread !== undefined ? this.props.isShowTableThread : true; let isShowTableThread = this.props.isShowTableThread !== undefined ? this.props.isShowTableThread : true;
return ( return (
<table> <table>
<thead className={isShowTableThread ? '' : 'vh'}> <thead className={isShowTableThread ? '' : 'table-thread-hidden'}>
<tr> <tr>
<th width="4%"><span className="sr-only">{gettext("Library Type")}</span></th> <th width="4%"><span className="sr-only">{gettext("Library Type")}</span></th>
<th width="40%">{gettext("Name")} <th width="40%">{gettext("Name")}

View File

@@ -17,24 +17,13 @@
font-size: 1rem; font-size: 1rem;
font-weight: normal; font-weight: normal;
padding: 0.25rem; padding: 0.25rem;
border-bottom: 1px solid #e6e6e6;
margin: 0.75rem 0 0; margin: 0.75rem 0 0;
} }
.group-list-panel thead th { /* overwrite bootstrap styles */
padding: 0;
font-size: 0;
border: 0;
}
.cur-view-content-groups td { /* overwrite bootstrap styles */
border-top:0;
}
.group-list-panel .group-item-empty-tip { .group-list-panel .group-item-empty-tip {
color: #a4a4a4; color: #a4a4a4;
text-align: center; text-align: center;
padding: 4px 0; padding: 4px 0;
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }

View File

@@ -34,7 +34,7 @@
.tag-demo .tag-files { .tag-demo .tag-files {
margin-right: 0.5rem; margin-right: 0.5rem;
cursor: pointer; cursor: pointer;
text-decoration: underline; border-bottom: 1px solid;
} }
.tag-list-item .tag-edit { .tag-list-item .tag-edit {

View File

@@ -186,6 +186,16 @@ ul,ol,li {
color: #fff; color: #fff;
} }
.table-thread-hidden {
border-bottom: 1px solid #e6e6e6;
}
.table-thread-hidden th {
padding: 0;
font-size: 0;
border: 0;
}
/* UI Widget */ /* UI Widget */
/**** caret ****/ /**** caret ****/