1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-27 15:37:43 +00:00

update logic of show folder share icon

if current user has 'is_admin' library permssion, show folder share icon
This commit is contained in:
lian 2018-08-24 17:54:42 +08:00
parent 142b1e7750
commit c8b51b7bfc
4 changed files with 7 additions and 4 deletions

View File

@ -485,7 +485,7 @@
</div>
<% } %>
<% if (!encrypted && (app.pageOptions.can_generate_share_link || app.pageOptions.can_generate_upload_link || is_repo_owner)) { %>
<% if (!encrypted && (app.pageOptions.can_generate_share_link || app.pageOptions.can_generate_upload_link || is_repo_owner || is_admin)) { %>
<button class="btn-white hidden-sm-down" id="share-cur-dir">{% trans "Share" %}</button>
<span class="sf2-icon-share hidden-md-up mobile-icon" id="share-cur-dir" aria-label="{% trans "Share" %}"></span>
<% } %>
@ -582,7 +582,7 @@
<a class="op-icon download sf2-icon-download sf2-x vh download-dir" href="#" title="{% trans "Download" %}" aria-label="{% trans "Download" %}"></a>
<% if (!repo_encrypted && (can_generate_share_link || can_generate_upload_link || is_repo_owner)) { %>
<% if (!repo_encrypted && (can_generate_share_link || can_generate_upload_link || is_repo_owner || is_admin)) { %>
<a href="#" class="op-icon share sf2-icon-share sf2-x vh" title="{% trans "Share" %}" aria-label="{% trans "Share" %}"></a>
<% } %>
<% if (dirent.perm == 'rw') { %>
@ -658,7 +658,7 @@
<div class="hide sf-dropdown-menu">
<ul>
<li><a class="op download download-dir" href="#">{% trans "Download" %}</a></li>
<% if (!repo_encrypted && (can_generate_share_link || can_generate_upload_link || is_repo_owner)) { %>
<% if (!repo_encrypted && (can_generate_share_link || can_generate_upload_link || is_repo_owner || is_admin)) { %>
<li><a href="#" class="op share">{% trans "Share" %}</a></li>
<% } %>
<% if (dirent.perm == 'rw') { %>
@ -1016,7 +1016,7 @@
<ul>
<li><a class="op download-dir" href="#">{% trans "Download" %}</a></li>
<% if (!repo_encrypted && (can_generate_share_link || can_generate_upload_link || is_repo_owner)) { %>
<% if (!repo_encrypted && (can_generate_share_link || can_generate_upload_link || is_repo_owner || is_admin)) { %>
<li><a class="op share" href="#">{% trans "Share" %}</a></li>
<% } %>

View File

@ -558,6 +558,7 @@ define([
path: dir.path,
repo_id: dir.repo_id,
is_repo_owner: dir.is_repo_owner,
is_admin: dir.is_admin,
site_root: app.pageOptions.site_root
};

View File

@ -120,6 +120,7 @@ define([
category: dir.category,
repo_id: dir.repo_id,
is_repo_owner: dir.is_repo_owner,
is_admin: dir.is_admin,
can_set_folder_perm: can_set_folder_perm,
can_generate_share_link: app.pageOptions.can_generate_share_link,
can_generate_upload_link: app.pageOptions.can_generate_upload_link,

View File

@ -66,6 +66,7 @@ define([
category: dir.category,
repo_id: dir.repo_id,
is_repo_owner: dir.is_repo_owner,
is_admin: dir.is_admin,
repo_encrypted: dir.encrypted,
can_set_folder_perm: can_set_folder_perm,