diff --git a/media/css/seahub.css b/media/css/seahub.css index 8fd55362da..665a368486 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -337,8 +337,7 @@ input.btn-disabled:hover {/*for input*/ .side-tabnav-tabs .tab a, .checkbox, .checkbox-checked, -.modalCloseImg, -#discuss { +.modalCloseImg { background:transparent url('../img/bg.png') no-repeat scroll 0 0; } .op-list li { @@ -1187,7 +1186,7 @@ textarea:-moz-placeholder {/* for FF */ } #right-panel .hd button, .tabnav button, -.repo-file-list-topbar button, +.repo-file-list-topbar .op-btn, .wiki-top .op-btn { height:29px; background:#fff; @@ -1716,6 +1715,9 @@ textarea:-moz-placeholder {/* for FF */ .repo-op .op-btn [class^="sf-icon-"] { margin-right:3px; } +.repo-op .op-btn { + vertical-align:middle; +} #featured-filetype { margin:5px 0; } @@ -1929,10 +1931,46 @@ textarea:-moz-placeholder {/* for FF */ margin-top:8px; } /* file upload */ -.fileupload-buttonbar .start, +.repo-op .upload-file-btn { + display: inline-block; + height: auto; + padding: 5px 6px; + border: 1px solid #c5c5c5; + border-radius: 2px; + position:relative; + overflow:hidden; +} +.fixed-upload-file-dialog { + width: 540px; + position: fixed; + bottom: 0; + right: 10px; + background: #fff; + border: 1px solid #ddd; + border-radius: 3px; + box-shadow: 0 0 6px #ddd; +} +.fixed-upload-file-dialog .hd { + padding: 6px 10px; + background: #f0f0f0; + margin:0; +} +.fixed-upload-file-dialog .con { + height:114px; + overflow-y:auto; +} +.fixed-upload-file-dialog .ops { + position:absolute; + top:10px; + right:10px; +} +.fixed-upload-file-dialog .close, .fileupload-buttonbar .cancel { *margin-left:5px; } +.fileupload-progress { + margin-top:5px; +} .fileinput-button { display:inline-block; line-height:19px; @@ -1943,7 +1981,8 @@ textarea:-moz-placeholder {/* for FF */ font-size:13px; color:#333; } -.fileinput-button input { +.fileinput-button input, +#upload-file input { position: absolute; top: 0; right: 0; @@ -1958,6 +1997,7 @@ textarea:-moz-placeholder {/* for FF */ } .table .name { width:60%; + padding-left:10px; } .table .size { width:14%; @@ -1965,16 +2005,19 @@ textarea:-moz-placeholder {/* for FF */ .template-upload .start { text-align:right; } -.template-upload .start { - text-align:right; +.fixed-upload-file-dialog .fileupload-buttonbar .cancel, +.template-upload .btn { + background: transparent; + border: none; + color: #e83; +} +.fixed-upload-file-dialog .fileupload-buttonbar .cancel { + color:#909090; } .template-upload .start, .template-upload .cancel { width:13%; } -.fileupload-progress { - margin-top:10px; -} .ui-progressbar, .progress { background-color: #F7F7F7; @@ -2009,6 +2052,7 @@ textarea:-moz-placeholder {/* for FF */ *padding-left:1.9em; margin-top:5px; } + /* repo-history */ #back { margin-top:3px; @@ -2431,9 +2475,6 @@ textarea:-moz-placeholder {/* for FF */ margin-left:64px; } /*file upload*/ -#upload-file-form { - margin-top:10px; -} .files-add { position: relative; overflow: hidden; @@ -2680,11 +2721,12 @@ textarea:-moz-placeholder {/* for FF */ #md-edit-help { width:550px; } -#fileview-toolbar { +/* for repo, file_view page. */ +#side-toolbar { position:fixed; right:0; } -.fileview-toolbar .item { +.side-toolbar .item { width:59px; height:40px; padding-top:18px; @@ -2695,11 +2737,11 @@ textarea:-moz-placeholder {/* for FF */ border-right:0; border-top:0; } -.fileview-toolbar .item:first-child { +.side-toolbar .item:first-child { border-top:1px solid #c0c0c0; border-top-left-radius:3px; } -.fileview-toolbar .item:last-child { +.side-toolbar .item:last-child { border-bottom-left-radius:3px; } /* shareadmin & useradmin */ @@ -2715,43 +2757,13 @@ textarea:-moz-placeholder {/* for FF */ border:1px solid #ddd; border-radius:2px; } -/*bottom bar*/ -#bottom-bar { - position:fixed; - bottom:0; - right:10px; - background:#fff; - border-style:solid; - border-width:1px; - border-color:#f2f2f2 #cacaca #919191; - border-top-left-radius:4px; - border-top-right-radius:4px; -} -#discuss, #click-into-group { - color:#424242; - font-size:15px; - line-height:21px; - padding:3px 16px; - border:none; -} -#discuss { - padding-left: 42px; - background-color:#fff; - background-position: 16px -162px; -} -#click-into-group { - background:#fff; - border-left:1px solid #ebebeb; -} -#bottom-bar button:focus { - outline:none; -} #to-group, #discuss-to-group { width:400px; padding:0 15px; position:fixed; - right:10px; + right:0; + border-radius:5px 0 0 5px; background:#fff; border:1px solid #cbcbcb; box-shadow: 0 2px 4px rgba(0,0,0,.2); @@ -2775,22 +2787,38 @@ textarea:-moz-placeholder {/* for FF */ #discussions-to-grp .reply-input { width:270px; } -#to-group-caret, -#discuss-to-group-caret { - width:28px; - position:fixed; -} #to-group, -#discuss-to-group, -#to-group-caret, -#discuss-to-group-caret { +#discuss-to-group { z-index:12; /* to be on top of 'fixed-hd' in repo.html*/ } /*to-group*/ #to-group { - min-width:100px; width:auto; - padding:6px 0; + min-width:250px; + padding:0 12px 10px; + right:78px; +} +#to-group .outer-caret { + position:absolute; + top: 15px; + right: -15px; +} +#to-group .outer-caret, +#to-group .inner-caret { + border-color:transparent #cbcbcb; + border-right-width:0; +} +#to-group .inner-caret { + border-left-color:#fff; + top:-15px; + left:-16px; +} +#to-group ul { + padding-left: 20px; + list-style-type: disc; +} +#to-group a { + padding:1px 3px; } /*discuss to group*/ #discuss-to-group-form .checkbox-label { diff --git a/media/img/close.png b/media/img/close.png new file mode 100644 index 0000000000..5ac5f89882 Binary files /dev/null and b/media/img/close.png differ diff --git a/media/img/minus.png b/media/img/minus.png new file mode 100644 index 0000000000..923ee279f6 Binary files /dev/null and b/media/img/minus.png differ diff --git a/media/js/jquery.fileupload.min.js b/media/js/jquery.fileupload.min.js index 43ac78f8ca..913d9102c0 100644 --- a/media/js/jquery.fileupload.min.js +++ b/media/js/jquery.fileupload.min.js @@ -43,4 +43,30 @@ * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ -(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","tmpl","load-image","./jquery.fileupload-fp"],factory);}else{factory(window.jQuery,window.tmpl,window.loadImage);}}(function($,tmpl,loadImage){var parentWidget=($.blueimpFP||$.blueimp).fileupload;$.widget("blueimpUI.fileupload",parentWidget,{options:{autoUpload:false,maxNumberOfFiles:undefined,maxFileSize:undefined,minFileSize:undefined,acceptFileTypes:/.+$/i,previewSourceFileTypes:/^image\/(gif|jpeg|png)$/,previewSourceMaxFileSize:5000000,previewMaxWidth:80,previewMaxHeight:80,previewAsCanvas:true,uploadTemplateId:"template-upload",downloadTemplateId:"template-download",filesContainer:undefined,prependFiles:false,dataType:"json",add:function(e,data){var that=$(this).data("fileupload"),options=that.options,files=data.files;$(this).fileupload("process",data).done(function(){that._adjustMaxNumberOfFiles(-files.length);data.isAdjusted=true;data.files.valid=data.isValidated=that._validate(files);data.context=that._renderUpload(files).data("data",data);options.filesContainer[options.prependFiles?"prepend":"append"](data.context);that._renderPreviews(files,data.context);that._forceReflow(data.context);that._transition(data.context).done(function(){if((that._trigger("added",e,data)!==false)&&(options.autoUpload||data.autoUpload)&&data.autoUpload!==false&&data.isValidated){data.submit();}});});},send:function(e,data){var that=$(this).data("fileupload");if(!data.isValidated){if(!data.isAdjusted){that._adjustMaxNumberOfFiles(-data.files.length);}if(!that._validate(data.files)){return false;}}if(data.context&&data.dataType&&data.dataType.substr(0,6)==="iframe"){data.context.find(".progress").addClass(!$.support.transition&&"progress-animated").find(".bar").css("width",parseInt(100,10)+"%");}return that._trigger("sent",e,data);},done:function(e,data){$(".saving-tip",$(this)).addClass("hide");var that=$(this).data("fileupload"),template;if(data.context){data.context.each(function(index){var file=($.isArray(data.result)&&data.result[index])||{error:"emptyResult"};file.size=data.files[index].size;if(file.error){file.error=data.result.error||"emptyResult";file.name=data.files[index].name;that._adjustMaxNumberOfFiles(1);}that._transition($(this)).done(function(){var node=$(this);template=that._renderDownload([file]).css("height",node.height()).replaceAll(node);that._forceReflow(template);that._transition(template).done(function(){data.context=$(this);that._trigger("completed",e,data);});});});}else{template=that._renderDownload(data.result).appendTo(that.options.filesContainer);that._forceReflow(template);that._transition(template).done(function(){data.context=$(this);that._trigger("completed",e,data);});}},fail:function(e,data){$(".saving-tip",$(this)).addClass("hide");var that=$(this).data("fileupload"),template;that._adjustMaxNumberOfFiles(data.files.length);if(data.context){data.context.each(function(index){if(data.errorThrown!=="abort"){var file=data.files[index];var r_error;if(data.jqXHR.responseText){try{r_error=$.parseJSON(data.jqXHR.responseText).error;}catch(e){r_error="";}}if(data.dataType=="iframe json"){data.errorThrown="";}file.error=r_error||file.error||data.errorThrown||"can not connect the file server";that._transition($(this)).done(function(){var node=$(this);template=that._renderDownload([file]).replaceAll(node);that._forceReflow(template);that._transition(template).done(function(){data.context=$(this);that._trigger("failed",e,data);});});}else{that._transition($(this)).done(function(){$(this).remove();that._trigger("failed",e,data);});}});}else{if(data.errorThrown!=="abort"){that._adjustMaxNumberOfFiles(-data.files.length);data.context=that._renderUpload(data.files).appendTo(that.options.filesContainer).data("data",data);that._forceReflow(data.context);that._transition(data.context).done(function(){data.context=$(this);that._trigger("failed",e,data);});}else{that._trigger("failed",e,data);}}},progress:function(e,data){if(data.context){data.context.find(".bar").css("width",parseInt(data.loaded/data.total*100,10)+"%");}},progressall:function(e,data){var $this=$(this);$this.find(".fileupload-progress").find(".bar").css("width",parseInt(data.loaded/data.total*100,10)+"%").end().find(".progress-extended").each(function(){$(this).html($this.data("fileupload")._renderExtendedProgress(data));});if(data.loaded>0&&data.loaded==data.total){$this.find(".saving-tip").removeClass("hide");}},start:function(e){var that=$(this).data("fileupload");that._transition($(this).find(".fileupload-progress")).done(function(){that._trigger("started",e);});},stop:function(e){var that=$(this).data("fileupload");that._transition($(this).find(".fileupload-progress")).done(function(){$(this).find(".bar").css("width","0%");$(this).find(".progress-extended").html(" ");that._trigger("stopped",e);});},destroy:function(e,data){var that=$(this).data("fileupload");if(data.url){$.ajax(data);}that._adjustMaxNumberOfFiles(1);that._transition(data.context).done(function(){$(this).remove();that._trigger("destroyed",e,data);});}},_enableDragToDesktop:function(){var link=$(this),url=link.prop("href"),name=link.prop("download"),type="application/octet-stream";link.bind("dragstart",function(e){try{e.originalEvent.dataTransfer.setData("DownloadURL",[type,name,url].join(":"));}catch(err){}});},_adjustMaxNumberOfFiles:function(operand){if(typeof this.options.maxNumberOfFiles==="number"){this.options.maxNumberOfFiles+=operand;if(this.options.maxNumberOfFiles<1){this._disableFileInputButton();}else{this._enableFileInputButton();}}},_formatFileSize:function(bytes){if(typeof bytes!=="number"){return"";}if(bytes>=1000000000){return(bytes/1000000000).toFixed(2)+" GB";}if(bytes>=1000000){return(bytes/1000000).toFixed(2)+" MB";}return(bytes/1000).toFixed(2)+" KB";},_formatBitrate:function(bits){if(typeof bits!=="number"){return"";}else{var Bs=bits/8;}if(Bs>=1000000000){return(Bs/1000000000).toFixed(2)+" GB/s";}if(Bs>=1000000){return(Bs/1000000).toFixed(2)+" MB/s";}if(Bs>=1000){return(Bs/1000).toFixed(2)+" KB/s";}return Bs+" B/s";},_formatTime:function(seconds){var date=new Date(seconds*1000),days=parseInt(seconds/86400,10);days=days?days+"d ":"";return days+("0"+date.getUTCHours()).slice(-2)+":"+("0"+date.getUTCMinutes()).slice(-2)+":"+("0"+date.getUTCSeconds()).slice(-2);},_formatPercentage:function(floatValue){return(floatValue*100).toFixed(2)+" %";},_renderExtendedProgress:function(data){return this._formatBitrate(data.bitrate)+" | "+this._formatTime((data.total-data.loaded)*8/data.bitrate)+" | "+this._formatPercentage(data.loaded/data.total)+" | "+this._formatFileSize(data.loaded)+" / "+this._formatFileSize(data.total);},_hasError:function(file){if(file.error){return file.error;}if(this.options.maxNumberOfFiles<0){return"maxNumberOfFiles";}if(!(this.options.acceptFileTypes.test(file.type)||this.options.acceptFileTypes.test(file.name))){return"acceptFileTypes";}if(this.options.maxFileSize&&file.size>this.options.maxFileSize){return"maxFileSize";}if(typeof file.size==="number"&&file.size0&&data.loaded==data.total){$this.find(".saving-tip").removeClass("hide");}},start:function(e){var that=$(this).data("fileupload");that._transition($(this).find(".fileupload-progress")).done(function(){that._trigger("started",e);});},stop:function(e){var that=$(this).data("fileupload");that._transition($(this).find(".fileupload-progress")).done(function(){$(this).find(".bar").css("width","0%");$(this).find(".progress-extended").html(" ");that._trigger("stopped",e);});},destroy:function(e,data){var that=$(this).data("fileupload");if(data.url){$.ajax(data);}that._adjustMaxNumberOfFiles(1);that._transition(data.context).done(function(){$(this).remove();that._trigger("destroyed",e,data);});}},_enableDragToDesktop:function(){var link=$(this),url=link.prop("href"),name=link.prop("download"),type="application/octet-stream";link.bind("dragstart",function(e){try{e.originalEvent.dataTransfer.setData("DownloadURL",[type,name,url].join(":"));}catch(err){}});},_adjustMaxNumberOfFiles:function(operand){if(typeof this.options.maxNumberOfFiles==="number"){this.options.maxNumberOfFiles+=operand;if(this.options.maxNumberOfFiles<1){this._disableFileInputButton();}else{this._enableFileInputButton();}}},_formatFileSize:function(bytes){if(typeof bytes!=="number"){return"";}if(bytes>=1000000000){return(bytes/1000000000).toFixed(2)+" GB";}if(bytes>=1000000){return(bytes/1000000).toFixed(2)+" MB";}return(bytes/1000).toFixed(2)+" KB";},_formatBitrate:function(bits){if(typeof bits!=="number"){return"";}else{var Bs=(bits/8).toFixed(0);}if(Bs>=1000000000){return(Bs/1000000000).toFixed(1)+" GB/s";}if(Bs>=1000000){return(Bs/1000000).toFixed(1)+" MB/s";}if(Bs>=1000){return(Bs/1000).toFixed(0)+" KB/s";}return Bs+" B/s";},_formatTime:function(seconds){var date=new Date(seconds*1000),days=parseInt(seconds/86400,10);days=days?days+"d ":"";return days+("0"+date.getUTCHours()).slice(-2)+":"+("0"+date.getUTCMinutes()).slice(-2)+":"+("0"+date.getUTCSeconds()).slice(-2);},_formatPercentage:function(floatValue){return(floatValue*100).toFixed(2)+" %";},_renderExtendedProgress:function(data){return this._formatBitrate(data.bitrate)+" | "+this._formatTime((data.total-data.loaded)*8/data.bitrate)+" | "+this._formatPercentage(data.loaded/data.total)+" | "+this._formatFileSize(data.loaded)+" / "+this._formatFileSize(data.total);},_hasError:function(file){if(file.error){return file.error;}if(this.options.maxNumberOfFiles<0){return"maxNumberOfFiles";}if(!(this.options.acceptFileTypes.test(file.type)||this.options.acceptFileTypes.test(file.name))){return"acceptFileTypes";}if(this.options.maxFileSize&&file.size>this.options.maxFileSize){return"maxFileSize";}if(typeof file.size==="number"&&file.size {% if (file.error) { %} - {%=file.name%} + {%=file.name%} {%=o.formatFileSize(file.size)%} {%=locale.fileupload.error%} {%=locale.fileupload.errors[file.error] || file.error%} {% } else if (o.files.valid && !i) { %} - + {%=file.name%}
{%=o.formatFileSize(file.size)%} {% if (!o.options.autoUpload) { %} {% } %} {% } else { %} - {%=file.name%} + {%=file.name%} {%=o.formatFileSize(file.size)%} {% } %} {% if (!i) { %} {% } %} @@ -43,14 +41,14 @@ def upload_js(): {% else %} {% upload_js %} {% endif %} +{% endif %} {% endblock %} diff --git a/seahub/templates/snippets/bottom_bar.html b/seahub/templates/snippets/bottom_bar.html index 84801ecd53..127a7100ab 100644 --- a/seahub/templates/snippets/bottom_bar.html +++ b/seahub/templates/snippets/bottom_bar.html @@ -1,17 +1,41 @@ {% load i18n %} {% load url from future %} -var Bottom_bar = '
{% if groups %}{% endif %}
'; -$('#wrapper').append(Bottom_bar); -$('#main-panel').css('margin-bottom', $('#bottom-bar').outerHeight() + 2); + +// set 'side toolbar' & 'groups' popup position +function setToolbarPos() { + var toolbar = $('#side-toolbar'); + + // set toolbar pos + toolbar.css({'top': ($(window).height() - toolbar.outerHeight())/2}); + + // set 'groups' popup position + $('#to-group').css({'top': parseInt(toolbar.css('top')) + 59}); +} +$(window).load(function() { + var to_top = $(''); + to_top.click(function() { + $(window).scrollTop(0); + }).appendTo($('#side-toolbar')); + $(window).scroll(function() { + if ($(window).scrollTop() > 0) { + to_top.show(); + } else { + to_top.hide(); + } + }); + setToolbarPos(); +}).resize(setToolbarPos); + {% if groups %} function getAndHandleDiscussions(data_html) { - $('#discussions-to-grp').html(data_html).css({'max-height': parseInt($(window).height() * 0.9 - $('#bottom-bar').height() - $('#discuss-to-group-caret').height() - $('#discuss-to-group-form').outerHeight())}).removeClass('hide'); // 'parseInt' to fix '.msg-main top border missing when the ul's max-height is xxx.5px' + $('#discussions-to-grp').html(data_html).css({'max-height': parseInt($(window).height() * 0.8 - $('#discuss-to-group-form').outerHeight())}).removeClass('hide'); // 'parseInt' to fix '.msg-main top border missing when the ul's max-height is xxx.5px' + var popup = $('#discuss-to-group'); + popup.css({'top':($(window).height() - popup.outerHeight())/2}); {% include 'group/msg_js.html' %} } $('#discuss').click(function() { var popup = $('#discuss-to-group'), - caret = $('#discuss-to-group-caret'), form = $('#discuss-to-group-form'), path = '{{ path }}'; @@ -20,13 +44,10 @@ $('#discuss').click(function() { path = cur_path; $('[name="path"]', form).val(path); // modify attachment dir name - $('#discuss-to-group-form .att-name').html($('#cur-dir-name').html()); + $('.att-name', form).html($('#cur-dir-name').html()); } if (popup.hasClass('hide')) { - popup.removeClass('hide'); - caret.removeClass('hide'); - caret.css({'left': $(this).offset().left}); $.ajax({ url: form.attr('action'), dataType: 'json', @@ -36,6 +57,7 @@ $('#discuss').click(function() { }, success: function(data) { getAndHandleDiscussions(data['html']); + popup.removeClass('hide'); }, error: function(jqXHR, textStatus, errorThrown) { var err_str = ''; @@ -47,14 +69,18 @@ $('#discuss').click(function() { }); } else { popup.addClass('hide'); - caret.addClass('hide'); } }); +// click 'close' to close discuss popup +$('#discuss-to-group .close').click(function () { + $('#discuss-to-group').addClass('hide'); +}); + $(document).click(function(e) { var target = e.target || event.srcElement; - if (!$('#discuss, #discuss-to-group, #discuss-to-group-caret').is(target) && !($('#discuss, #discuss-to-group, #discuss-to-group-caret').find('*').is(target))) { - $('#discuss-to-group, #discuss-to-group-caret').addClass('hide'); + if (!$('#discuss, #discuss-to-group').is(target) && !($('#discuss, #discuss-to-group').find('*').is(target))) { + $('#discuss-to-group').addClass('hide'); } }); @@ -114,7 +140,6 @@ $('#discuss-submit').click(function() { return false; }); -$('#main').append('
{{ repo_group_str|escapejs }}
'); $('#click-into-group').click(function() { {% if groups|length == 1 %} // only one group, just turn to group page @@ -124,28 +149,13 @@ $('#click-into-group').click(function() { {% else %} // more than one group, then let user choose - if ($('#to-group').hasClass('hide')) { - $('#to-group, #to-group-caret').removeClass('hide'); - $('#to-group-caret').css('left', $('#click-into-group').offset().left + $('#click-into-group').width()/3); - if ($('#to-group').offset().left > $('#click-into-group').offset().left) { - $('#to-group').css('left', $('#click-into-group').offset().left); - } - } else { - $('#to-group, #to-group-caret').addClass('hide'); - } + $('#to-group').toggleClass('hide'); {% endif %} }); $(document).click(function(e) { var target = e.target || event.srcElement; - if (!$('#click-into-group, #to-group, #to-group-caret').is(target) && !($('#to-group, #to-group-caret').find('*').is(target))) { - $('#to-group, #to-group-caret').addClass('hide'); + if (!$('#click-into-group, #to-group').is(target) && !($('#click-into-group, #to-group').find('*').is(target))) { + $('#to-group').addClass('hide'); } }); {% endif %} - -$(function() { - var btn_height = $('#bottom-bar').outerHeight(); - $('#discuss-to-group-caret, #to-group-caret').css({'bottom': btn_height}); - $('#to-group').css({'bottom': btn_height + $('#to-group-caret').outerHeight()}); - $('#discuss-to-group').css({'bottom': btn_height + $('#discuss-to-group-caret').outerHeight()}); -}); diff --git a/seahub/templates/snippets/group_recommend_form.html b/seahub/templates/snippets/group_recommend_form.html index d175e71625..a1c0e02beb 100644 --- a/seahub/templates/snippets/group_recommend_form.html +++ b/seahub/templates/snippets/group_recommend_form.html @@ -33,9 +33,5 @@ + {% trans -
-
-
-
-
diff --git a/seahub/templates/snippets/repo_dir_data.html b/seahub/templates/snippets/repo_dir_data.html index 818fba3d05..facd378e9c 100644 --- a/seahub/templates/snippets/repo_dir_data.html +++ b/seahub/templates/snippets/repo_dir_data.html @@ -11,7 +11,19 @@

{% if user_perm == 'rw' %} + + {% if repo.encrypted and repo.enc_version == 2 and not server_crypto %} + {% else %} + {% if no_quota %} + + {% else %} +
+ {% trans "Upload"%} + +
+ {% endif %} + {% endif %} {% if repo.encrypted and repo.enc_version == 2 and not server_crypto %} {% else %} diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index fb6c583bca..d340e475cc 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -19,38 +19,6 @@ #file-op .avatar { border-radius:1000px; } -#discuss-to-group, -#to-group { - right:0; - border-radius:5px 0 0 5px; -} -#to-group { - min-width:250px; - padding:0 12px 10px; - right:78px; -} -#to-group .outer-caret { - position:absolute; - top: 15px; - right: -15px; -} -#to-group .outer-caret, -#to-group .inner-caret { - border-color:transparent #cbcbcb; - border-right-width:0; -} -#to-group .inner-caret { - border-left-color:#fff; - top:-15px; - left:-16px; -} -#to-group ul { - padding-left: 20px; - list-style-type: disc; -} -#to-group a { - padding:1px 3px; -} {% endblock %} @@ -117,8 +85,8 @@ {% include "snippets/file_share_popup.html" %} -
-
    +
    +
      {% if groups %}
    • {% trans
    • {% trans
    • @@ -230,7 +198,7 @@ $('#star').click(function() { // set 'side toolbar' & 'groups' popup position function setToolbarPos() { - var toolbar = $('#fileview-toolbar'); + var toolbar = $('#side-toolbar'); // set toolbar pos toolbar.css({'top': ($(window).height() - toolbar.outerHeight())/2}); @@ -239,10 +207,10 @@ function setToolbarPos() { $('#to-group').css({'top': parseInt(toolbar.css('top')) + 59}); } $(window).load(function() { - var to_top = $('
      • {% trans
      '); + var to_top = $('
      • {% trans
      '); to_top.click(function() { $(window).scrollTop(0); - }).appendTo($('#fileview-toolbar')); + }).appendTo($('#side-toolbar')); $(window).scroll(function() { if ($(window).scrollTop() > 0) { to_top.show(); @@ -265,10 +233,9 @@ function handleDiscussions(html) { // show discuss popup $('#file-discuss-icon').click(function() { var popup = $('#discuss-to-group'); - popup.toggleClass('hide'); // get discussions - if (!popup.hasClass('hide')) { + if (popup.hasClass('hide')) { $.ajax({ url: $('#discuss-to-group-form').attr('action'), dataType: 'json', @@ -278,9 +245,12 @@ $('#file-discuss-icon').click(function() { }, success: function(data) { handleDiscussions(data['html']); + popup.removeClass('hide'); }, error: ajaxErrorHandler }); + } else { + popup.addClass('hide'); } }); // click 'close' to close discuss popup diff --git a/seahub/templates/view_shared_upload_link.html b/seahub/templates/view_shared_upload_link.html index 6b3ee81b46..da80a3561b 100644 --- a/seahub/templates/view_shared_upload_link.html +++ b/seahub/templates/view_shared_upload_link.html @@ -32,10 +32,6 @@ {% trans "Add Files" %} -