mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-16 15:19:06 +00:00
Merge branch '5.1'
Conflicts: seahub/group/templates/group/group_base.html seahub/templates/home_base.html seahub/templates/js/sysadmin-templates.html seahub/templates/js/templates.html seahub/templates/libraries.html seahub/templates/pub_base.html static/scripts/app/views/group-discussions.js
This commit is contained in:
@@ -65,6 +65,7 @@ define([
|
||||
_this.$days_input.prop('disabled', false).removeClass('input-disabled');
|
||||
_this.$days_input.attr('value', data.keep_days);
|
||||
}
|
||||
_this.$radios.filter(':checked').focus();
|
||||
|
||||
if (!app.pageOptions.enable_repo_history_setting) {
|
||||
_this.$('.history-settings-notice').removeClass('hide');
|
||||
|
@@ -546,6 +546,7 @@ define([
|
||||
focus: false,
|
||||
containerCss: {'padding':'20px 25px'}
|
||||
});
|
||||
file_name.focus();
|
||||
$('#simplemodal-container').css({'height':'auto'});
|
||||
|
||||
$('.set-file-type', form).click(function() {
|
||||
@@ -781,7 +782,7 @@ define([
|
||||
var $all_dirent_checkbox = this.$('[type=checkbox]');
|
||||
var $dirents_op = this.$('#multi-dirents-op');
|
||||
|
||||
var $curDirOps = this.$('#upload-file, #add-new-dir, #add-new-file, #share-cur-dir');
|
||||
var $curDirOps = this.$('#cur-dir-ops');
|
||||
|
||||
if ($el.prop('checked')) {
|
||||
$all_dirent_checkbox.prop('checked', true);
|
||||
|
@@ -103,7 +103,7 @@ define([
|
||||
}
|
||||
});
|
||||
|
||||
var $curDirOps = dirView.$('#upload-file, #add-new-dir, #add-new-file, #share-cur-dir');
|
||||
var $curDirOps = dirView.$('#cur-dir-ops');
|
||||
|
||||
if (checked_num > 0) {
|
||||
$dirents_op.css({'display':'inline-block'});
|
||||
@@ -211,6 +211,7 @@ define([
|
||||
}).append(form);
|
||||
$op.hide();
|
||||
$name.hide();
|
||||
$('[name="newname"]', form).focus();
|
||||
|
||||
this._hideMenu();
|
||||
app.ui.freezeItemHightlight = true;
|
||||
|
@@ -17,6 +17,7 @@ define([
|
||||
events: {
|
||||
'mouseenter': 'highlight',
|
||||
'mouseleave': 'rmHighlight',
|
||||
'focus *': 'focusItem',
|
||||
'click .js-del-msg': 'delMessage',
|
||||
'click .js-reply-msg': 'reply'
|
||||
},
|
||||
@@ -67,8 +68,17 @@ define([
|
||||
this.$('.msg-ops').addClass('vh');
|
||||
},
|
||||
|
||||
focusItem: function() {
|
||||
$('.msg.hl', this.$el.parent())
|
||||
.removeClass('hl')
|
||||
.find('.msg-ops').addClass('vh');
|
||||
|
||||
this.highlight();
|
||||
},
|
||||
|
||||
reply: function() {
|
||||
this.parentView.replyTo(this.model.get("user_name"));
|
||||
return false;
|
||||
},
|
||||
|
||||
delMessage: function() {
|
||||
@@ -86,6 +96,7 @@ define([
|
||||
Common.feedback(err, 'error');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
@@ -128,7 +128,6 @@ define([
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.$(".msg-input").focus();
|
||||
app.router.navigate('group/' + this.groupView.group.id + '/discussions/');
|
||||
},
|
||||
|
@@ -18,11 +18,16 @@ define([
|
||||
'click': 'visitMemberProfile'
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
initialize: function(options) {
|
||||
this.is_owner = options.is_owner;
|
||||
},
|
||||
|
||||
render: function() {
|
||||
this.$el.html(this.template(this.model.attributes));
|
||||
var obj = {
|
||||
is_owner: this.is_owner,
|
||||
};
|
||||
$.extend(obj, this.model.attributes);
|
||||
this.$el.html(this.template(obj));
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@@ -29,7 +29,12 @@ define([
|
||||
},
|
||||
|
||||
addOne: function(item, collection, options) {
|
||||
var is_owner = false;
|
||||
if (item.get('email') === this.groupView.group.owner) {
|
||||
is_owner = true;
|
||||
}
|
||||
var view = new ItemView({
|
||||
is_owner: is_owner,
|
||||
model: item
|
||||
});
|
||||
this.$listContainer.append(view.render().el);
|
||||
@@ -77,7 +82,7 @@ define([
|
||||
_this.$error.html(err_msg).show();
|
||||
}
|
||||
});
|
||||
$("#group").append(this.$el);
|
||||
$("#group-members-icon").after(this.$el);
|
||||
}
|
||||
|
||||
});
|
||||
|
@@ -53,7 +53,7 @@ define([
|
||||
'wiki_enabled': this.groupView.group.wiki_enabled
|
||||
}));
|
||||
|
||||
$("#group").append(this.$el);
|
||||
$("#group-settings-icon").after(this.$el);
|
||||
},
|
||||
|
||||
highlightItem: function(e) {
|
||||
@@ -99,7 +99,7 @@ define([
|
||||
var _this = this;
|
||||
|
||||
var $form = $(this.renameTemplate());
|
||||
$form.modal({focus:false});
|
||||
$form.modal();
|
||||
$('#simplemodal-container').css({'width':'auto', 'height':'auto'});
|
||||
|
||||
$form.submit(function() {
|
||||
@@ -160,7 +160,7 @@ define([
|
||||
if (!email) {
|
||||
return false;
|
||||
}
|
||||
if (email == _this.group.owner) {
|
||||
if (email == _this.groupView.group.owner) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -179,6 +179,7 @@ define([
|
||||
},
|
||||
success: function() {
|
||||
// after the transfer, the former owner becomes a common admin of the group.
|
||||
Common.feedback(gettext("Successfully transferred the group. You are now a normal member of the group."), 'success');
|
||||
$.modal.close();
|
||||
},
|
||||
error: function(xhr) {
|
||||
|
@@ -13,7 +13,7 @@ define([
|
||||
'use strict';
|
||||
|
||||
var OrganizationView = Backbone.View.extend({
|
||||
id: 'organization-repos-tmpl',
|
||||
id: 'organization',
|
||||
|
||||
template: _.template($('#organization-repos-tmpl').html()),
|
||||
reposHdTemplate: _.template($('#shared-repos-hd-tmpl').html()),
|
||||
|
@@ -63,9 +63,9 @@ define([
|
||||
.replace('{lib_name}', '<span class="op-target">' + Common.HTMLescape(this.model.get('name')) + '</span>');
|
||||
var confirm_popup = $(this.repoDelConfirmTemplate({
|
||||
content: confirm_msg
|
||||
}))
|
||||
.appendTo(op_container)
|
||||
.css({
|
||||
}));
|
||||
del_icon.after(confirm_popup);
|
||||
confirm_popup.css({
|
||||
'left': del_icon.position().left,
|
||||
'top': del_icon.position().top + del_icon.height() + 2,
|
||||
'width': 180
|
||||
@@ -144,6 +144,7 @@ define([
|
||||
}).append(form);
|
||||
$op_td.hide();
|
||||
$name_span.hide();
|
||||
$('[name="newname"]', form).focus();
|
||||
|
||||
this.togglePopup();
|
||||
app.ui.freezeItemHightlight = true;
|
||||
|
@@ -77,7 +77,9 @@ define([
|
||||
'click #cancel-share-download-link': 'cancelShareDownloadLink',
|
||||
'click #delete-download-link': 'deleteDownloadLink',
|
||||
'click #generate-download-link-form .generate-random-password': 'generateRandomDownloadPassword',
|
||||
'keydown #generate-download-link-form .generate-random-password': 'generateRandomDownloadPassword',
|
||||
'click #generate-download-link-form .show-or-hide-password': 'showOrHideDownloadPassword',
|
||||
'keydown #generate-download-link-form .show-or-hide-password': 'showOrHideDownloadPassword',
|
||||
|
||||
// upload link
|
||||
'submit #generate-upload-link-form': 'generateUploadLink',
|
||||
@@ -86,7 +88,9 @@ define([
|
||||
'click #cancel-share-upload-link': 'cancelShareUploadLink',
|
||||
'click #delete-upload-link': 'deleteUploadLink',
|
||||
'click #generate-upload-link-form .generate-random-password': 'generateRandomUploadPassword',
|
||||
'keydown #generate-upload-link-form .generate-random-password': 'generateRandomUploadPassword',
|
||||
'click #generate-upload-link-form .show-or-hide-password': 'showOrHideUploadPassword',
|
||||
'keydown #generate-upload-link-form .show-or-hide-password': 'showOrHideUploadPassword',
|
||||
|
||||
// dir private share
|
||||
'click #add-dir-user-share-item .submit': 'dirUserShare',
|
||||
@@ -131,7 +135,11 @@ define([
|
||||
});
|
||||
},
|
||||
|
||||
generateRandomPassword: function(form) {
|
||||
generateRandomPassword: function(e, form) {
|
||||
if (e.type == 'keydown' && e.which != 32) { // enable only Space key
|
||||
return;
|
||||
}
|
||||
|
||||
var random_password_length = app.pageOptions.share_link_password_min_length;
|
||||
var random_password = '';
|
||||
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
@@ -141,28 +149,35 @@ define([
|
||||
$('input[name=password], input[name=password_again]', form).attr('type', 'text').val(random_password);
|
||||
$('.show-or-hide-password', form)
|
||||
.attr('title', gettext('Hide'))
|
||||
.attr('aria-label', gettext('Hide'))
|
||||
.removeClass('icon-eye').addClass('icon-eye-slash');
|
||||
},
|
||||
|
||||
generateRandomDownloadPassword: function() {
|
||||
this.generateRandomPassword($('#generate-download-link-form'));
|
||||
generateRandomDownloadPassword: function(e) {
|
||||
this.generateRandomPassword(e, $('#generate-download-link-form'));
|
||||
},
|
||||
|
||||
showOrHidePassword: function(form) {
|
||||
showOrHidePassword: function(e, form) {
|
||||
if (e.type == 'keydown' && e.which != 32) { // enable only Space key
|
||||
return;
|
||||
}
|
||||
|
||||
var icon = $('.show-or-hide-password', form),
|
||||
passwd_input = $('input[name=password], input[name=password_again]', form);
|
||||
icon.toggleClass('icon-eye icon-eye-slash');
|
||||
if (icon.hasClass('icon-eye')) {
|
||||
icon.attr('title', gettext('Show'));
|
||||
icon.attr('aria-label', gettext('Show'));
|
||||
passwd_input.attr('type', 'password');
|
||||
} else {
|
||||
icon.attr('title', gettext('Hide'));
|
||||
icon.attr('aria-label', gettext('Hide'));
|
||||
passwd_input.attr('type', 'text');
|
||||
}
|
||||
},
|
||||
|
||||
showOrHideDownloadPassword: function() {
|
||||
this.showOrHidePassword($('#generate-download-link-form'));
|
||||
showOrHideDownloadPassword: function(e) {
|
||||
this.showOrHidePassword(e, $('#generate-download-link-form'));
|
||||
},
|
||||
|
||||
generateLink: function(options) {
|
||||
@@ -401,15 +416,15 @@ define([
|
||||
});
|
||||
},
|
||||
|
||||
generateRandomUploadPassword: function() {
|
||||
this.generateRandomPassword($('#generate-upload-link-form'));
|
||||
generateRandomUploadPassword: function(e) {
|
||||
this.generateRandomPassword(e, $('#generate-upload-link-form'));
|
||||
},
|
||||
|
||||
showOrHideUploadPassword: function() {
|
||||
this.showOrHidePassword($('#generate-upload-link-form'));
|
||||
showOrHideUploadPassword: function(e) {
|
||||
this.showOrHidePassword(e, $('#generate-upload-link-form'));
|
||||
},
|
||||
|
||||
generateUploadLink: function(e) {
|
||||
generateUploadLink: function() {
|
||||
this.generateLink({
|
||||
link_type: 'upload',
|
||||
form: this.$('#generate-upload-link-form'),
|
||||
|
Reference in New Issue
Block a user