diff --git a/media/css/seahub.css b/media/css/seahub.css index 137768f0b4..9e157761bc 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -920,17 +920,17 @@ textarea:-moz-placeholder {/* for FF */ .top-link .icon-caret-right { margin-left:7px; } -.top-bar-con .my-info { +#my-info { color:#fff; font-weight:bold; - vertical-align:middle; +} +.top-bar-con .spliter { display:inline-block; - padding-right:7px; height:16px; line-height:16px; + vertical-align:middle; border-right:1px solid #aaa; - margin-right:3px; - cursor:pointer; + margin:0 3px; } .top-bar-con .btn { padding:0 6px; @@ -998,9 +998,14 @@ textarea:-moz-placeholder {/* for FF */ top:24px; } #user-info-popup .item { + display:block; padding:8px 18px; border-top:1px solid #ddd; } +#user-info-popup a.item:hover { + background:#fafafa; + text-decoration:none; +} #msg-file-share { margin-top:8px; position:relative; @@ -2580,8 +2585,7 @@ textarea:-moz-placeholder {/* for FF */ margin:0 3px 0 0; } #quit-group { - display:inline-block; - margin-top:3em; + margin-top:4px; font-size:12px; font-weight:normal; color:#888; diff --git a/media/js/base.js b/media/js/base.js index a29cf9ab36..b207cc08d8 100644 --- a/media/js/base.js +++ b/media/js/base.js @@ -13,6 +13,61 @@ if ($('.messages')[0]) { setTimeout(function() { $('.messages').addClass('hide'); }, 10000); } +$(document).ready(function(){ + var msg_ct = $("#msg-count"); + $.ajax({ + url: msg_ct.data('cturl'), + dataType: 'json', + cache: false, + success: function(data) { + if (data['count'] > 0) { + msg_ct.html(data['count']).addClass('msg-count'); + } + } + }); +}); +$('#msg-count').click(function() { + location.href = $(this).data('pgurl'); +}); + +(function () { + var my_info = $('#my-info'); + var popup = $('#user-info-popup'); + + $(window).load(function() { + popup.css({'right': my_info.parent().width() - my_info.position().left - my_info.outerWidth()}); + }); + my_info.click(function() { + var loading_tip = $('.loading-tip', popup); + if (popup.hasClass('hide')) { + popup.removeClass('hide'); + loading_tip.removeClass('hide'); + $.ajax({ + url: my_info.data('url'), + dataType: 'json', + cache: false, + success: function(data) { + loading_tip.addClass('hide'); + popup.html(data['html']); + $('.item:first', popup).css({'border':0}); + } + }); + } else { + popup.addClass('hide'); + } + return false; + }); +})(); + +$(document).click(function(e) { + var target = e.target || event.srcElement, + popup = $('#user-info-popup'), + popup_switch = $('#my-info'); + if (!popup.hasClass('hide') && !popup.is(target) && !popup.find('*').is(target) && !popup_switch.is(target) && !popup_switch.find('*').is(target) ) { + popup.addClass('hide'); + } +}); + // search: disable submit when input nothing $('.search-form').submit(function() { if (!$.trim($(this).find('.search-input').val())) { diff --git a/seahub/group/templates/group/group_base.html b/seahub/group/templates/group/group_base.html index 566c2af549..13dad2a27e 100644 --- a/seahub/group/templates/group/group_base.html +++ b/seahub/group/templates/group/group_base.html @@ -15,6 +15,9 @@ {% if is_staff %} {% endif %} + {% if group.view_perm != 'pub' and not is_staff %} + {% trans "Quit" %} + {% endif %}
{% trans "Total" %}: {{ quota_usage|filesizeformat }} {% if quota > 0 %}/ {{ quota|filesizeformat }} {% endif %}
+{% trans "Used:" %} {{ quota_usage|filesizeformat }} {% if quota > 0 %}/ {{ quota|filesizeformat }} {% endif %}
{% if quota > 0 %} {% endif %} @@ -9,7 +9,7 @@{{ quota_usage|filesizeformat }} {% if quota > 0 %}/ {{ quota|filesizeformat }} {% endif %}
+{% trans "Used:" %} {{ quota_usage|filesizeformat }} {% if quota > 0 %}/ {{ quota|filesizeformat }} {% endif %}
{% if quota > 0 %}