1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

[share] only enable 'private share' for encrypted lib

This commit is contained in:
llj
2015-05-13 17:35:14 +08:00
parent 25f5816735
commit f32227b3a8
4 changed files with 20 additions and 5 deletions

View File

@@ -318,12 +318,14 @@
<h3 class="hd"><%= title %></h3>
<div id="share-tabs" class="left-right-tabs ovhd">
<ul class="left-right-tabs-nav fleft"> {# TODO: better var name? #}
<% if (!repo_encrypted) { %>
<li class="tab"><a href="#download-link-share" class="a">{% trans "Download Link" %}</a></li>
<% } %>
<% if (!is_dir && is_repo_owner) { %>
<li class="tab"><a href="#file-private-share" class="a">{% trans "Private Share" %}</a></li>
<% } %>
<% if (is_dir) { %>
<% if (user_perm == 'rw') { %>
<% if (user_perm == 'rw' && !repo_encrypted) { %>
<li class="tab"><a href="#dir-upload-link-share" class="a">{% trans "Upload Link" %}</a></li>
<% } %>
<% if (!is_virtual && is_repo_owner) { %>
@@ -334,6 +336,7 @@
<div class="fright">
<img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" class="loading-tip" />
<% if (!repo_encrypted) { %>
<div id="download-link-share" class="tabs-panel">
<form id="generate-download-link-form" action="" class="hide">
<label class="checkbox-label">
@@ -373,9 +376,10 @@
</form>
</div>
</div>
<% } %>
<% if (is_dir) { %>
<% if (user_perm == 'rw') { %>
<% if (user_perm == 'rw' && !repo_encrypted) { %>
<div id="dir-upload-link-share" class="tabs-panel hide">
<p class="tip">{% trans "You can share the generated link to others and then they can upload files to this directory via the link." %}</p>
<form id="generate-upload-link-form" action="" class="hide">
@@ -411,7 +415,11 @@
<% } %>
<% if (!is_virtual && is_repo_owner) { %>
<% if (!repo_encrypted) { %>
<div id="dir-private-share" class="tabs-panel hide">
<% } else { %>
<div id="dir-private-share" class="tabs-panel"> {# enc lib only has 'dir-private-share' #}
<% } %>
<form id="dir-private-share-form" action="" class="hide">
<label class="label">{% trans "People:" %}</label><br />
<input type="hidden" name="emails" class="w100" /><br />

View File

@@ -169,6 +169,7 @@ define([
'is_virtual': dir.is_virtual,
'user_perm': dir.user_perm,
'repo_id': dir.repo_id,
'repo_encrypted': false,
'is_dir': this.model.get('is_dir') ? true : false,
'dirent_path': dirent_path,
'obj_name': obj_name

View File

@@ -92,6 +92,7 @@ define([
'is_virtual': this.model.get('virtual'),
'user_perm': this.model.get('permission'),
'repo_id': this.model.get('id'),
'repo_encrypted': this.model.get('encrypted'),
'is_dir': true,
'dirent_path': '/',
'obj_name': this.model.get('name')

View File

@@ -18,6 +18,7 @@ define([
this.is_virtual = options.is_virtual;
this.user_perm = options.user_perm;
this.repo_id = options.repo_id;
this.repo_encrypted = options.repo_encrypted;
this.dirent_path = options.dirent_path;
this.obj_name = options.obj_name;
this.is_dir = options.is_dir;
@@ -33,12 +34,14 @@ define([
this.$("#share-tabs").tabs();
if (!this.repo_encrypted) {
this.downloadLinkPanelInit();
}
if (!this.is_dir && this.is_repo_owner) {
this.filePrivateSharePanelInit();
}
if (this.is_dir) {
if (this.user_perm == 'rw') {
if (this.user_perm == 'rw' && !this.repo_encrypted) {
this.uploadLinkPanelInit();
}
if (!this.is_virtual && this.is_repo_owner) {
@@ -55,7 +58,8 @@ define([
is_repo_owner: this.is_repo_owner,
is_virtual: this.is_virtual,
user_perm: this.user_perm,
repo_id: this.repo_id
repo_id: this.repo_id,
repo_encrypted: this.repo_encrypted
}));
return this;
@@ -472,6 +476,7 @@ define([
});
form.removeClass('hide');
this.$('.loading-tip').hide();
},
dirPrivateShare: function () {