1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

sysadmin reconstruct links page (#4153)

* sysadmin reconstruct links page

* optimize code

* optimize code
This commit is contained in:
Leo
2019-10-19 11:21:49 +08:00
committed by Daniel Pan
parent 0fd1fad77c
commit 36a734d9b4
8 changed files with 513 additions and 11 deletions

View File

@@ -1,8 +1,6 @@
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../utils/constants';
import { Label } from 'reactstrap';
const propTypes = {
gotoPreviousPage: PropTypes.func.isRequired,
@@ -10,7 +8,8 @@ const propTypes = {
currentPage: PropTypes.number.isRequired,
hasNextPage: PropTypes.bool.isRequired,
canResetPerPage: PropTypes.bool.isRequired,
resetPerPage: PropTypes.func
resetPerPage: PropTypes.func,
curPerPage: PropTypes.number,
};
class Paginator extends Component {
@@ -30,6 +29,7 @@ class Paginator extends Component {
}
render() {
let { curPerPage } = this.props;
return (
<Fragment>
<div className="my-6 text-center">
@@ -41,11 +41,11 @@ class Paginator extends Component {
}
</div>
{this.props.canResetPerPage &&
<div>
<div className="text-center">
{gettext('Per page:')}{' '}
<Label onClick={() => {return this.resetPerPage(25);}}>25</Label>
<Label onClick={() => {return this.resetPerPage(50);}}>50</Label>
<Label onClick={() => {return this.resetPerPage(100);}}>100</Label>
<span className={`${curPerPage === 25 ? '' : 'a-simulate '} mr-1`} onClick={() => {return this.resetPerPage(25);}}>25</span>
<span className={`${curPerPage === 50 ? '' : 'a-simulate '} mr-1`} onClick={() => {return this.resetPerPage(50);}}>50</span>
<span className={`${curPerPage === 100 ? '' : 'a-simulate '} mr-1`} onClick={() => {return this.resetPerPage(100);}}>100</span>
</div>
}
</Fragment>