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

button align (#3555)

This commit is contained in:
Michael An
2019-05-28 14:38:29 +08:00
committed by Daniel Pan
parent d03b8e58ab
commit b0ae1d7812
5 changed files with 16 additions and 11 deletions

View File

@@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { repoID, slug, serviceURL, isPublicWiki } from '../utils/constants'; import { repoID, slug, serviceURL, isPublicWiki } from '../utils/constants';
import { Utils } from '../utils/utils'; import { Utils } from '../utils/utils';
import { Value } from 'slate';
import { deserialize } from '@seafile/seafile-editor/dist/utils/slate2markdown'; import { deserialize } from '@seafile/seafile-editor/dist/utils/slate2markdown';
import'../css/index-viewer.css'; import'../css/index-viewer.css';
@@ -176,7 +175,7 @@ class IndexContentViewer extends React.Component {
let treeNodes = slateNodes.map((slateNode) => { let treeNodes = slateNodes.map((slateNode) => {
// item has children(unordered list) // item has children(unordered list)
if (slateNode.nodes.length === 2 && (slateNode.nodes[1].type === 'unordered_list' || slateNode.nodes[1].type === 'ordered_list')) { if (slateNode.nodes.length === 2 && (slateNode.nodes[1].type === 'unordered_list' || slateNode.nodes[1].type === 'ordered_list')) {
// slateNode.nodes[0] is paragraph, create TreeNode, set name and href // slateNode.nodes[0] is paragraph, create TreeNode, set name and href
const paragraphNode = slateNode.nodes[0]; const paragraphNode = slateNode.nodes[0];
const treeNode = this.transParagraph(paragraphNode); const treeNode = this.transParagraph(paragraphNode);
// slateNode.nodes[1] is list, set it as TreeNode's children // slateNode.nodes[1] is list, set it as TreeNode's children
@@ -231,6 +230,7 @@ IndexContentViewer.propTypes = viewerPropTypes;
const FolderItemPropTypes = { const FolderItemPropTypes = {
node: PropTypes.object.isRequired, node: PropTypes.object.isRequired,
bindClickEvent: PropTypes.func.isRequired, bindClickEvent: PropTypes.func.isRequired,
currentPath: PropTypes.string,
}; };
class FolderItem extends React.Component { class FolderItem extends React.Component {
@@ -249,7 +249,7 @@ class FolderItem extends React.Component {
} }
renderLink = (node) => { renderLink = (node) => {
const className = node.path === this.props.currentPath ? 'wiki-nav-content wiki-nav-content-highlight' : 'wiki-nav-content' const className = node.path === this.props.currentPath ? 'wiki-nav-content wiki-nav-content-highlight' : 'wiki-nav-content';
if (node.href && node.name) { if (node.href && node.name) {
return <div className={className}><a href={node.href} data-path={node.path}>{node.name}</a></div>; return <div className={className}><a href={node.href} data-path={node.path}>{node.name}</a></div>;
} else if (node.name) { } else if (node.name) {

View File

@@ -22,14 +22,12 @@ class GroupsToolbar extends React.Component {
return ( return (
<div className="main-panel-north border-left-show"> <div className="main-panel-north border-left-show">
<div className="cur-view-toolbar"> <div className="cur-view-toolbar">
<span title="Side Nav Menu" onClick={onShowSidePanel} className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none"></span>
<div className="operation"> <div className="operation">
<Button color="btn btn-secondary operation-item" onClick={this.props.toggleAddGroupModal}> <Button color="btn btn-secondary operation-item my-1" onClick={this.props.toggleAddGroupModal}>
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('New Group')} <i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('New Group')}
</Button> </Button>
</div> </div>
<span title="Side Nav Menu" onClick={onShowSidePanel}
className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none">
</span>
</div> </div>
<CommonToolbar searchPlaceholder={this.props.searchPlaceholder} onSearchedClick={onSearchedClick}/> <CommonToolbar searchPlaceholder={this.props.searchPlaceholder} onSearchedClick={onSearchedClick}/>
</div> </div>

View File

@@ -1,5 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import MediaQuery from 'react-responsive';
import { gettext } from '../../utils/constants'; import { gettext } from '../../utils/constants';
import WikiListItem from './wiki-list-item'; import WikiListItem from './wiki-list-item';
@@ -38,8 +39,14 @@ class WikiListView extends Component {
<table> <table>
<thead> <thead>
<tr> <tr>
<th width="4%"></th> <MediaQuery query="(min-width: 768px)">
<th width="36%">{gettext('Name')}</th> <th width="4%"></th>
<th width="36%">{gettext('Name')}</th>
</MediaQuery>
<MediaQuery query="(max-width: 768px)">
<th width="10%"></th>
<th width="30%">{gettext('Name')}</th>
</MediaQuery>
<th width="25%">{gettext('Owner')}</th> <th width="25%">{gettext('Owner')}</th>
<th width="25%">{gettext('Last Update')}</th> <th width="25%">{gettext('Last Update')}</th>
<th width="10%">{/* operation */}</th> <th width="10%">{/* operation */}</th>

View File

@@ -174,7 +174,7 @@ class PublicSharedView extends React.Component {
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span> <span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span>
<div className="operation"> <div className="operation">
<Dropdown isOpen={this.state.isCreateMenuShow} toggle={this.onAddRepoToggle}> <Dropdown isOpen={this.state.isCreateMenuShow} toggle={this.onAddRepoToggle}>
<DropdownToggle className='btn btn-secondary operation-item'> <DropdownToggle className='btn btn-secondary operation-item my-1'>
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('Add Library')} <i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('Add Library')}
</DropdownToggle> </DropdownToggle>
<DropdownMenu> <DropdownMenu>

View File

@@ -129,7 +129,7 @@ class Wikis extends Component {
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span> <span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span>
<div className="operation"> <div className="operation">
{canPublishRepo && {canPublishRepo &&
<Button className="btn btn-secondary operation-item" onClick={this.onSelectToggle}> <Button className="btn btn-secondary operation-item my-1" onClick={this.onSelectToggle}>
{gettext('Publish a Library')} {gettext('Publish a Library')}
</Button> </Button>
} }