-
- - this.tabItemClick('drafts')}>
- {gettext('Drafts')}
+
+ - this.tabItemClick('drafts')}>
+ {gettext('Drafts')}
- - this.tabItemClick('reviews')}>
- {gettext('Reviews')}
+
- this.tabItemClick('reviews')}>
+ {gettext('Reviews')}
diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js
index a4ee2d64eb..e3c808ed31 100644
--- a/frontend/src/utils/constants.js
+++ b/frontend/src/utils/constants.js
@@ -25,6 +25,8 @@ export const enableUploadFolder = window.app.pageOptions.enableUploadFolder ===
export const enableResumableFileUpload = window.app.pageOptions.enableResumableFileUpload === 'True';
export const storages = window.app.pageOptions.storages; // storage backends
export const enableRepoSnapshotLabel = window.app.pageOptions.enableRepoSnapshotLabel;
+export const shareLinkExpireDaysMin = window.app.pageOptions.shareLinkExpireDaysMin;
+export const shareLinkExpireDaysMax = window.app.pageOptions.shareLinkExpireDaysMax;
// wiki
export const slug = window.wiki ? window.wiki.config.slug : '';
diff --git a/media/css/seahub_react.css b/media/css/seahub_react.css
index 75b2bebed2..c8780a7bb3 100644
--- a/media/css/seahub_react.css
+++ b/media/css/seahub_react.css
@@ -16,7 +16,8 @@
* op-icon
* account
* quota
- * side-tabnav
+ * nav, nav-pills
+ * side-panel
* about-dialog
* notifications
* sf-popover
@@ -50,39 +51,38 @@
-webkit-font-smoothing: antialiased;
}
-.sf2-icon-menu:before { content: "\e031"; }
-.sf2-icon-more:before { content: "\e032"; }
-.sf2-icon-x1:before { content:"\e01d"; }
-.sf2-icon-user:before { content:"\e00f"; }
-.sf2-icon-share:before { content:"\e011"; }
-.sf2-icon-organization:before { content:"\e010"; }
-.sf2-icon-group:before { content:"\e00c"; }
-.sf2-icon-star:before { content:"\e012"; }
-.sf2-icon-clock:before { content:"\e002"; }
-.sf2-icon-monitor:before { content:"\e007"; }
.sf2-icon-wrench:before { content:"\e001"; }
+.sf2-icon-clock:before { content:"\e002"; }
.sf2-icon-bell:before { content:"\e003"; }
-.sf2-icon-close:before { content:"\e035"; }
-.sf2-icon-grid-view:before { content:"\e025"; }
-.sf2-icon-list-view:before { content:"\e026"; }
-.sf2-icon-wiki-view:before { content:"\e013"; }
-.sf2-icon-edit:before { content:"\e018"; }
-.sf2-icon-history:before { content:"\e014"; }
-.sf2-icon-trash:before { content:"\e016"; }
-.sf2-icon-download:before { content:"\e008"; }
.sf2-icon-delete:before { content:"\e006"; }
+.sf2-icon-monitor:before { content:"\e007"; }
+.sf2-icon-download:before { content:"\e008"; }
+.sf2-icon-group:before { content:"\e00c"; }
.sf2-icon-link:before { content:"\e00e"; }
+.sf2-icon-user:before { content:"\e00f"; }
+.sf2-icon-organization:before { content:"\e010"; }
+.sf2-icon-share:before { content:"\e011"; }
+.sf2-icon-star:before { content:"\e012"; }
+.sf2-icon-wiki-view:before { content:"\e013"; }
+.sf2-icon-history:before { content:"\e014"; }
+.sf2-icon-cog1:before { content:"\e015"; }
+.sf2-icon-trash:before { content:"\e016"; }
+.sf2-icon-edit:before { content:"\e018"; }
.sf2-icon-caret-down:before { content:"\e01a"; }
-.sf2-icon-two-columns:before { content:"\e036"; }
+.sf2-icon-x1:before { content:"\e01d"; }
+.sf2-icon-minus:before {content:"\e01c"}
.sf2-icon-confirm:before {content:"\e01e"}
.sf2-icon-cancel:before {content:"\e01f"}
-.sf2-icon-tag:before {content:"\e037"}
-.sf2-icon-minus:before {content:"\e01c"}
-.sf2-icon-move:before {content:"\e029"}
-.sf2-icon-copy:before {content:"\e028"}
-.sf2-icon-cog1:before { content:"\e015"; }
.sf2-icon-user2:before { content:"\e020"; }
-.sf2-icon-x3:before { content: "\e035"; }
+.sf2-icon-grid-view:before { content:"\e025"; }
+.sf2-icon-list-view:before { content:"\e026"; }
+.sf2-icon-copy:before {content:"\e028"}
+.sf2-icon-move:before {content:"\e029"}
+.sf2-icon-menu:before { content: "\e031"; }
+.sf2-icon-more:before { content: "\e032"; }
+.sf2-icon-close:before { content:"\e035"; }
+.sf2-icon-two-columns:before { content:"\e036"; }
+.sf2-icon-tag:before {content:"\e037"}
/* common class and element style*/
a { color:#eb8205; }
@@ -154,6 +154,14 @@ ul,ol,li {
cursor: pointer;
}
+.user-select-none {
+ -moz-user-select:none;
+ -webkit-user-select:none;
+ -ms-user-select:none;
+ -khtml-user-select:none;
+ user-select: none;
+}
+
/* UI Widget */
/**** caret ****/
@@ -383,13 +391,58 @@ a.op-icon:focus {
text-decoration:none;
}
-/**** side-tabnav ****/
-.side-textnav .hd,
-.side-info .hd {
- padding-bottom:4px;
- border-bottom:1px solid #ddd;
- margin-bottom:1em;
+/* sf-nav-link */
+.nav .nav-item {
+ padding: 0;
}
+.nav .nav-item .nav-link{
+ padding: 0.5rem 0;
+ margin-right: 0.5rem;
+ color: #8A948F;
+ font-weight: normal;
+ transition: none;
+}
+
+.nav .nav-item .nav-link.active {
+ color: #eb8205;
+ text-decoration: none;
+ border-bottom: 0.125rem solid #eb8205;
+}
+
+.nav-pills .nav-item .nav-link {
+ padding: 0.25rem;
+ color: #333;
+}
+
+.nav-pills .nav-item .nav-link:hover {
+ background-color: #feefb8;
+}
+
+.nav-pills .nav-item .nav-link.active {
+ background-color: #feac74;
+ font-weight: bold;
+ color: #fff;
+ border: none;
+}
+
+/* side-panel */
+.side-panel {
+ user-select: none;
+ height:100%;
+}
+
+.side-nav {
+ flex:auto;
+ display:flex;
+ flex-direction:column;
+ justify-content:space-between; /* make .side-nav-footer on the bottom */
+ overflow:hidden; /* for ff */
+}
+
+.side-nav:hover {
+ overflow-y:auto;
+}
+
@media (max-width: 767px) {
.side-nav {
background: #f8f8f8;
@@ -408,28 +461,16 @@ a.op-icon:focus {
left:0;
}
}
-.side-nav {
- padding:20px;
- overflow:hidden;
- border-right:1px solid #eee;
-}
-.side-nav:hover {
- overflow-y:auto;
-}
-.home-side-nav {
- flex:auto;
- display:flex;
- flex-direction:column;
- justify-content:space-between; /* make .side-nav-footer on the bottom */
- overflow:hidden; /* for ff */
-}
+
.side-nav-con {
overflow:hidden;
padding:20px;
}
+
.side-nav-con:hover {
overflow-y:auto;
}
+
.side-nav-footer {
display:flex;
flex-shrink:0;
@@ -438,86 +479,83 @@ a.op-icon:focus {
border-top:1px solid #eee;
font-size: 13px;
}
+
.side-nav-footer .item {
color:#666;
font-weight: normal;
margin-right:10px;
}
+
.side-nav-footer .last-item {
margin-left:auto;
}
-.side-tabnav .hd {
- margin-bottom:0.5em;
+
+.side-nav-con .nav {
+ margin-bottom: 1rem;
}
-.side-tabnav h3.hd,
-.side-tabnav .hd h3 {
- color:#f7941d;
+
+.side-nav-con .nav .nav-item,
+.side-nav-con .nav .nav-item .nav-link {
+ display: block;
+ padding-right: 0;
+ margin-right: 0;
}
-.side-tabnav .hd h3 {
- margin-bottom:0;
+
+.side-nav-con .active [class^="sf2-icon-"],
+.side-nav-con .active .sharp {
+ background-color: #feac74;
+ color: #fff;
+ border: none;
}
-.side-tabnav .hd .avatar { /*for 'group'*/
- vertical-align:middle;
- border-radius:1000px;
- margin:0 6px 0 4px;
-}
-.side-tabnav .grp-name { /*for 'group'*/
+
+.side-nav-con [class^="sf2-icon-"] {
display:inline-block;
- max-width:130px;
- font-weight:normal;
-}
-.side-tabnav-tabs {
- margin-bottom:1em;
-}
-.side-tabnav-tabs .tab {
- border-radius:2px;
- overflow:hidden;
-}
-.side-tabnav-tabs .tab a { /* for IE 11: no border-radius here */
- display:block;
- font-size:15px;
- padding:4px 4px 4px 0;
- color:#333;
- font-weight:normal;
-}
-.side-tabnav-tabs .tab a:focus {
- text-decoration:none;
-}
-.side-tabnav-tabs .tab ul a {
- font-size:14px;
- line-height:24px;
- padding:0;
-}
-.side-tabnav-tabs .tab a:hover {
- background-color:#feefb8;
- text-decoration:none;
-}
-.side-tabnav-tabs .tab [class^="sf2-icon-"] {
- display:inline-block;
- width:42px;
- margin-right:5px;
+ width:2.625rem;
+ margin-right:0.325rem;
text-align:center;
vertical-align:middle;
- font-size:24px;
+ font-size:1.5rem;
line-height:1;
color:#999;
}
-.side-tabnav-tabs .tab .fas {
- height: 24px;
+.side-nav-con .sharp {
+ display:inline-block;
+ width:2.625rem;
+ margin-right:0.25rem;
+ text-align:right;
+ color:#aaa;
+}
+
+.side-nav-con .toggle-icon {
+ height: 1.5rem;
display: flex;
align-items: center;
justify-content: center;
+ color:#999;
}
-.side-nav-toggle {
- margin-right:0.9375rem;
- height: 1.875rem;
- line-height: 1.875rem;
- font-size:1.5rem;
- color:#999;
- cursor: pointer;
+.side-nav-con .draft-info {
+ position: relative;
+ line-height: 1.5rem;
}
+
+.side-nav-con .draft-info .badge {
+ right: -1.5rem;
+}
+
+.side-nav-con .sub-nav {
+ display: block;
+ overflow: hidden;
+}
+
+.side-nav-con .sub-nav .nav-link {
+ padding: 0;
+ display: block;
+ font-size: 0.875rem;
+ line-height: 1.5rem;
+}
+
.side-panel-slide {
transition: all .3s ease-in-out;
}
@@ -526,55 +564,6 @@ a.op-icon:focus {
transition: all .3s ease-in-out;
height: 0;
}
-#group-nav .sharp,
-#share-admin-nav .sharp {
- display:inline-block;
- width:42px;
- margin-right:5px;
- text-align:right;
- color:#aaa;
-}
-#group-nav .toggle-icon,
-#share-admin-nav .toggle-icon {
- color:#999;
-}
-.side-tabnav-tabs .tab-cur a,
-.side-tabnav-tabs .tab-cur a:hover {
- background-color:#feac74;
-}
-.side-tabnav-tabs .tab-cur [class^="sf2-icon-"],
-.side-tabnav-tabs .tab-cur a,
-#group-nav .tab-cur .sharp,
-#share-admin-nav .tab-cur .sharp {
- color:#fff;
-}
-.side-tabnav-tabs .tab-cur a {
- font-weight:bold;
-}
-.side-textnav .hd {
- margin:2em 0 .5em;
-}
-.side-textnav-tabs .tab a {
- display:block;
- padding:10px 0;
- font-weight:normal;
- color:#999;
- border-bottom:1px solid #eee;
- margin-bottom:3px;
-}
-.side-textnav-tabs .tab-cur a,
-.side-textnav-tabs .tab a:hover {
- color:#de3f1c;
- text-decoration:none;
-}
-
-.user-select-none {
- -moz-user-select:none;
- -webkit-user-select:none;
- -ms-user-select:none;
- -khtml-user-select:none;
- user-select: none;
-}
#notifications {
position:relative;
@@ -763,6 +752,15 @@ a.op-icon:focus {
text-align: center;
}
+.side-nav-toggle {
+ margin-right:0.9375rem;
+ height: 1.875rem;
+ line-height: 1.875rem;
+ font-size:1.5rem;
+ color:#999;
+ cursor: pointer;
+}
+
/* begin path navigation */
.path-containter { /* for the real path */
font-size: 1rem;
@@ -906,6 +904,7 @@ table .menu-toggle {
color: #222;
font-weight: bold;
}
+.err-message,
.err-message h2{
color: red;
}
@@ -1025,14 +1024,6 @@ table .menu-toggle {
align-items: center;
}
-.nav-link {
- color: #8a948f;
- padding: .3em .1em;
-}
-.nav-link.active {
- color: #eb8205;
- border-bottom: 2px solid #eb8205;
-}
.item-meta-info {
display: inline-block;
margin-right: 8px;
diff --git a/seahub/templates/base_for_react.html b/seahub/templates/base_for_react.html
index 229080522b..7c52d81dd6 100644
--- a/seahub/templates/base_for_react.html
+++ b/seahub/templates/base_for_react.html
@@ -59,6 +59,8 @@
return storages;
})(),
enableRepoSnapshotLabel: {% if enable_repo_snapshot_label %} true {% else %} false {% endif %},
+ shareLinkExpireDaysMin: "{{ share_link_expire_days_min }}",
+ shareLinkExpireDaysMax: "{{ share_link_expire_days_max }}",
}
};
diff --git a/seahub/templates/react_app.html b/seahub/templates/react_app.html
index 9abffed33f..2cbf422fbb 100644
--- a/seahub/templates/react_app.html
+++ b/seahub/templates/react_app.html
@@ -2,12 +2,6 @@
{% load render_bundle from webpack_loader %}
{% block extra_script %}
-
+
{% render_bundle 'app' %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/seahub/views/__init__.py b/seahub/views/__init__.py
index d6b828e80e..12cef89403 100644
--- a/seahub/views/__init__.py
+++ b/seahub/views/__init__.py
@@ -1215,7 +1215,9 @@ def react_fake_view(request):
return render(request, "react_app.html", {
'storages': get_library_storages(request),
- 'enable_repo_snapshot_label': settings.ENABLE_REPO_SNAPSHOT_LABEL
+ 'enable_repo_snapshot_label': settings.ENABLE_REPO_SNAPSHOT_LABEL,
+ 'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN,
+ 'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX,
})
@login_required