1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

My librarys (#2584)

This commit is contained in:
杨顺强
2018-11-30 17:18:41 +08:00
committed by Daniel Pan
parent ef3a1407a3
commit 4880622795
15 changed files with 550 additions and 26 deletions

View File

@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import moment from 'moment';
import { Link } from '@reach/router';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
import { gettext, siteRoot, loginUrl, isPro } from '../../utils/constants';
@@ -50,7 +51,7 @@ class Content extends Component {
);
const table = (
<table className="table table-hover table-vcenter">
<table>
{window.innerWidth >= 768 ? desktopThead : mobileThead}
<TableBody items={items} />
</table>
@@ -173,7 +174,7 @@ class Item extends Component {
const desktopItem = (
<tr onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>
<td><img src={data.icon_url} title={data.icon_title} alt={data.icon_title} width="24" /></td>
<td><a href={data.url}>{data.repo_name}</a></td>
<td><Link to={`${siteRoot}library/${data.repo_id}/${data.repo_name}/`}>{data.repo_name}</Link></td>
<td>
{ isPro && data.is_admin ?
<a href="#" className={shareIconClassName} title={gettext("Share")} onClick={this.share}></a>
@@ -190,7 +191,7 @@ class Item extends Component {
<tr onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>
<td><img src={data.icon_url} title={data.icon_title} alt={data.icon_title} width="24" /></td>
<td>
<a href={data.url}>{data.repo_name}</a><br />
<Link to={`${siteRoot}library/${data.repo_id}/${data.repo_name}/`}>{data.repo_name}</Link><br />
<span className="item-meta-info" title={data.owner_contact_email}>{data.owner_name}</span>
<span className="item-meta-info">{Utils.formatSize({bytes: data.size})}</span>
<span className="item-meta-info" title={moment(data.last_modified).format('llll')}>{moment(data.last_modified).fromNow()}</span>