mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 04:10:47 +00:00
[wiki] modification
This commit is contained in:
@@ -3191,9 +3191,13 @@ button.sf-dropdown-toggle:focus {
|
|||||||
border-bottom:1px solid #e8e8e8;
|
border-bottom:1px solid #e8e8e8;
|
||||||
}
|
}
|
||||||
#wiki-page-list {
|
#wiki-page-list {
|
||||||
line-height:1.8;
|
|
||||||
margin-top:1.6em;
|
margin-top:1.6em;
|
||||||
}
|
}
|
||||||
|
.wiki-page-list-item {
|
||||||
|
word-break:break-all;
|
||||||
|
line-height:1.6;
|
||||||
|
margin:3px 0;
|
||||||
|
}
|
||||||
.wiki-page-link,
|
.wiki-page-link,
|
||||||
.wiki-page-link:hover {
|
.wiki-page-link:hover {
|
||||||
font-size:1.15em;
|
font-size:1.15em;
|
||||||
@@ -3202,11 +3206,11 @@ button.sf-dropdown-toggle:focus {
|
|||||||
margin-left:5px;
|
margin-left:5px;
|
||||||
}
|
}
|
||||||
#wiki-area {
|
#wiki-area {
|
||||||
padding: 30px 0 0;
|
padding:30px 0 0;
|
||||||
}
|
}
|
||||||
#wiki-last-modified,
|
#wiki-last-modified,
|
||||||
#wiki-page-last-modified {
|
#wiki-page-last-modified {
|
||||||
margin-top: 10px;
|
margin-top:40px;
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
@@ -53,17 +53,30 @@
|
|||||||
<a href="{{ SITE_ROOT }}#invitations/"><span aria-hidden="true" class="sf2-icon-invite"></span>{% trans "Invite People" %}</a>
|
<a href="{{ SITE_ROOT }}#invitations/"><span aria-hidden="true" class="sf2-icon-invite"></span>{% trans "Invite People" %}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3 class="hd">{% trans "Share Admin" %}</h3>
|
<li class="tab" id="share-admin-nav">
|
||||||
<ul class="side-tabnav-tabs">
|
<a href="#" class="ellipsis" title="{% trans "Share Admin" %}"><span class="toggle-icon icon-caret-left fright" aria-hidden="true"></span><span aria-hidden="true" class="sf2-icon-wrench"></span>{% trans "Share Admin" %}</a>
|
||||||
{% if user.permissions.can_add_repo %}
|
<ul class="hide">
|
||||||
<li class="tab {% block cur_share_libs %}{% endblock %}"><a href="{{ SITE_ROOT }}#share-admin-libs/"><span class="sf2-icon-library" aria-hidden="true"></span>{% trans "Libraries" %}</a></li>
|
{% if user.permissions.can_add_repo %}
|
||||||
<li class="tab {% block cur_share_folders %}{% endblock %}"><a href="{{ SITE_ROOT }}#share-admin-folders/"><span class="sf2-icon-folder" aria-hidden="true"></span>{% trans "Folders" %}</a></li>
|
<li>
|
||||||
{% endif %}
|
<a href="{{ SITE_ROOT }}#share-admin-libs/"><span aria-hidden="true" class="sharp">#</span>{% trans "Libraries" %}</a>
|
||||||
<li class="tab {% block cur_share_links %}{% endblock %}"><a href="{{ SITE_ROOT }}#share-admin-share-links/"><span class="sf2-icon-link" aria-hidden="true"></span>{% trans "Links" %}</a></li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ SITE_ROOT }}#share-admin-folders/"><span aria-hidden="true" class="sharp">#</span>{% trans "Folders" %}</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if user.permissions.can_generate_share_link %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ SITE_ROOT }}#share-admin-share-links/"><span aria-hidden="true" class="sharp">#</span>{% trans "Links" %}</a>
|
||||||
|
</li>
|
||||||
|
{% elif user.permissions.can_generate_upload_link %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ SITE_ROOT }}#share-admin-upload-links/"><span aria-hidden="true" class="sharp">#</span>{% trans "Links" %}</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -100,5 +113,11 @@ $('#group-nav a:first').on('click', function() {
|
|||||||
$('#group-nav .grp-list').slideToggle();
|
$('#group-nav .grp-list').slideToggle();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
$('#share-admin-nav').on('click', 'a:first', function() {
|
||||||
|
var $shareAdmin = $('#share-admin-nav');
|
||||||
|
$('.toggle-icon', $shareAdmin).toggleClass('icon-caret-left icon-caret-down');
|
||||||
|
$('ul', $shareAdmin).slideToggle(250);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -1401,8 +1401,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<li class="tab" id="share-admin-nav">
|
<li class="tab" id="share-admin-nav">
|
||||||
<a href="#" class="ellipsis" title="{% trans "Share Admin" %}"><span class="toggle-icon icon-caret-left fright" aria-hidden="true"></span><span aria-hidden="true" class="sf2-icon-wrench"></span>{% trans "Share Admin" %}</a>
|
<a href="#" class="ellipsis" title="{% trans "Share Admin" %}"><span class="toggle-icon <% if (show_share_admin) { %> icon-caret-down <% } else { %> icon-caret-left <% } %> fright" aria-hidden="true"></span><span aria-hidden="true" class="sf2-icon-wrench"></span>{% trans "Share Admin" %}</a>
|
||||||
|
<% if (show_share_admin) { %>
|
||||||
|
<ul>
|
||||||
|
<% } else { %>
|
||||||
<ul class="hide">
|
<ul class="hide">
|
||||||
|
<% } %>
|
||||||
<% if (can_add_repo) { %>
|
<% if (can_add_repo) { %>
|
||||||
<li class="<% if (cur_tab == 'share-admin-repos') { %>tab-cur<% } %>">
|
<li class="<% if (cur_tab == 'share-admin-repos') { %>tab-cur<% } %>">
|
||||||
<a href="{{ SITE_ROOT }}#share-admin-libs/"><span aria-hidden="true" class="sharp">#</span>{% trans "Libraries" %}</a>
|
<a href="{{ SITE_ROOT }}#share-admin-libs/"><span aria-hidden="true" class="sharp">#</span>{% trans "Libraries" %}</a>
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
<span class="loading-icon loading-tip"></span>
|
<span class="loading-icon loading-tip"></span>
|
||||||
<p class="error hide"></p>
|
<p class="error hide"></p>
|
||||||
<div id="wiki-page" class="hide">
|
<div id="wiki-page" class="hide">
|
||||||
<h1 id="wiki-page-name" class="bold"></h1>
|
<!--h1 id="wiki-page-name" class="bold"></h1-->
|
||||||
<div id="wiki-content"></div>
|
<div id="wiki-content"></div>
|
||||||
<p id="wiki-page-last-modified"></p>
|
<p id="wiki-page-last-modified"></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -109,7 +109,7 @@ function showCurrentPage() {
|
|||||||
success: function(data) { // { meta: {wiki page object}, content: string }
|
success: function(data) { // { meta: {wiki page object}, content: string }
|
||||||
$error.hide();
|
$error.hide();
|
||||||
|
|
||||||
$('#wiki-page-name').html(HTMLescape(data.meta.name));
|
//$('#wiki-page-name').html(HTMLescape(data.meta.name));
|
||||||
|
|
||||||
$('#wiki-content')
|
$('#wiki-content')
|
||||||
.html(addAnchorsToHeaders(marked(data.content)))
|
.html(addAnchorsToHeaders(marked(data.content)))
|
||||||
@@ -152,6 +152,15 @@ function showCurrentPage() {
|
|||||||
showCurrentPage();
|
showCurrentPage();
|
||||||
|
|
||||||
// show page list
|
// show page list
|
||||||
|
var isHiDPI = function() {
|
||||||
|
var pixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1;
|
||||||
|
if (pixelRatio > 1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $container = $('#wiki-pages-container');
|
var $container = $('#wiki-pages-container');
|
||||||
var $list = $('ul', $container);
|
var $list = $('ul', $container);
|
||||||
@@ -165,6 +174,7 @@ showCurrentPage();
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
var str = '';
|
var str = '';
|
||||||
var pages = data.data;
|
var pages = data.data;
|
||||||
|
var icon_size = isHiDPI() ? 192 : 24;
|
||||||
// sort by name
|
// sort by name
|
||||||
pages.sort(function(a, b) {
|
pages.sort(function(a, b) {
|
||||||
// make 'home' as the first one
|
// make 'home' as the first one
|
||||||
@@ -182,7 +192,7 @@ showCurrentPage();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(pages).each(function(index, item) {
|
$(pages).each(function(index, item) {
|
||||||
str += '<li><img src="{{MEDIA_URL}}img/file/24/txt.png" class="vam" /><a href="' + item.link + '" class="wiki-page-link vam">' + HTMLescape(item.name) + '</a></li>';
|
str += '<li class="wiki-page-list-item"><img src="{{MEDIA_URL}}img/file/' + icon_size + '/txt.png" width="24" class="vam" /><a href="' + item.link + '" class="wiki-page-link vam">' + HTMLescape(item.name) + '</a></li>';
|
||||||
});
|
});
|
||||||
$list.html($(str)).show();
|
$list.html($(str)).show();
|
||||||
},
|
},
|
||||||
|
@@ -283,25 +283,25 @@ define([
|
|||||||
showShareAdminRepos: function() {
|
showShareAdminRepos: function() {
|
||||||
this.switchCurrentView(this.shareAdminReposView);
|
this.switchCurrentView(this.shareAdminReposView);
|
||||||
this.shareAdminReposView.show();
|
this.shareAdminReposView.show();
|
||||||
this.sideNavView.setCurTab('share-admin-repos');
|
this.sideNavView.setCurTab('share-admin-repos', {'show_share_admin': true});
|
||||||
},
|
},
|
||||||
|
|
||||||
showShareAdminFolders: function() {
|
showShareAdminFolders: function() {
|
||||||
this.switchCurrentView(this.shareAdminFoldersView);
|
this.switchCurrentView(this.shareAdminFoldersView);
|
||||||
this.shareAdminFoldersView.show();
|
this.shareAdminFoldersView.show();
|
||||||
this.sideNavView.setCurTab('share-admin-folders');
|
this.sideNavView.setCurTab('share-admin-folders', {'show_share_admin': true});
|
||||||
},
|
},
|
||||||
|
|
||||||
showShareAdminShareLinks: function() {
|
showShareAdminShareLinks: function() {
|
||||||
this.switchCurrentView(this.shareAdminShareLinksView);
|
this.switchCurrentView(this.shareAdminShareLinksView);
|
||||||
this.shareAdminShareLinksView.show();
|
this.shareAdminShareLinksView.show();
|
||||||
this.sideNavView.setCurTab('share-admin-links');
|
this.sideNavView.setCurTab('share-admin-links', {'show_share_admin': true});
|
||||||
},
|
},
|
||||||
|
|
||||||
showShareAdminUploadLinks: function() {
|
showShareAdminUploadLinks: function() {
|
||||||
this.switchCurrentView(this.shareAdminUploadLinksView);
|
this.switchCurrentView(this.shareAdminUploadLinksView);
|
||||||
this.shareAdminUploadLinksView.show();
|
this.shareAdminUploadLinksView.show();
|
||||||
this.sideNavView.setCurTab('share-admin-links');
|
this.sideNavView.setCurTab('share-admin-links', {'show_share_admin': true});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -25,6 +25,7 @@ define([
|
|||||||
'show_group_list': this.group_expanded, // when cur_tab is not 'group'
|
'show_group_list': this.group_expanded, // when cur_tab is not 'group'
|
||||||
'groups': app.pageOptions.groups,
|
'groups': app.pageOptions.groups,
|
||||||
'mods_enabled': app.pageOptions.user_mods_enabled,
|
'mods_enabled': app.pageOptions.user_mods_enabled,
|
||||||
|
'show_share_admin': false, // show 'share admin' nav list or not
|
||||||
'can_add_repo': app.pageOptions.can_add_repo,
|
'can_add_repo': app.pageOptions.can_add_repo,
|
||||||
'can_generate_share_link': app.pageOptions.can_generate_share_link,
|
'can_generate_share_link': app.pageOptions.can_generate_share_link,
|
||||||
'can_generate_upload_link': app.pageOptions.can_generate_upload_link
|
'can_generate_upload_link': app.pageOptions.can_generate_upload_link
|
||||||
|
Reference in New Issue
Block a user