diff --git a/media/css/seahub.css b/media/css/seahub.css index 4ed677efd0..f3508a12ee 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -3496,3 +3496,20 @@ textarea:-moz-placeholder {/* for FF */ #dir-private-share .submit { margin-top:18px; } +.lib-decrypt-form { + padding:25px 40px 30px; +} +.lib-decrypt-form .intro { + font-size:19px; + color:#464646; +} +.lib-decrypt-form .input { + height:30px; + width:194px; + margin-top:10px; +} +.lib-decrypt-form .submit { + width:202px; + height:36px; + margin:21px 0 10px; +} diff --git a/media/img/lock.png b/media/img/lock.png new file mode 100644 index 0000000000..f710329a90 Binary files /dev/null and b/media/img/lock.png differ diff --git a/media/scripts/app/views/dir.js b/media/scripts/app/views/dir.js index a999b26390..dd09d1aadf 100644 --- a/media/scripts/app/views/dir.js +++ b/media/scripts/app/views/dir.js @@ -101,16 +101,24 @@ define([ var $el_con = _this.$('.repo-file-list-topbar, .repo-file-list').hide(); var $error = _this.$('.error'); var err_msg; + var decrypt_lib = false; if (response.responseText) { - err_msg = response.responseJSON.error; + if (response.responseJSON.lib_need_decrypt) { + decrypt_lib = true; + } else { + err_msg = response.responseJSON.error; + } } else { err_msg = gettext('Please check the network.'); } - $error.html(err_msg).show(); + if (err_msg) { + $error.html(err_msg).show(); + } - if (response.responseJSON.lib_need_decrypt) { + if (decrypt_lib) { var form = $($('#repo-decrypt-form-template').html()); - _this.$el.append(form); + form.modal({containerCss: {'padding': '1px'}}); + $('#simplemodal-container').css({'height':'auto'}); form.submit(function() { var passwd = $.trim($('[name="password"]', form).val()); if (!passwd) { @@ -127,8 +135,7 @@ define([ username: app.pageOptions.username }, after_op_success: function() { - form.remove(); - $error.html('').hide(); + $.modal.close(); $el_con.show(); _this.showDir(category, repo_id, path); } diff --git a/seahub/templates/js/lib-op-popups.html b/seahub/templates/js/lib-op-popups.html index 3e3f370185..3daa340680 100644 --- a/seahub/templates/js/lib-op-popups.html +++ b/seahub/templates/js/lib-op-popups.html @@ -104,12 +104,13 @@