diff --git a/media/css/seahub.css b/media/css/seahub.css index 543f882d17..c529a2c2b4 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -16,6 +16,11 @@ * (TODO: complete this TOC) * */ +/* + * z-index: + * popover: 20 + * + */ /****** icon-xx ********/ /* Font Awesome 3.2.1 by Dave Gandy - http://fortawesome.github.com/Font-Awesome */ @@ -493,7 +498,8 @@ a.op-icon:focus { background:#dfdfdf; } .no-deco, -.no-deco:hover { +.no-deco:hover, +.no-deco:focus { text-decoration:none; } .input-disabled {/* for type="password/text" etc*/ @@ -1174,6 +1180,7 @@ textarea:-moz-placeholder {/* for FF */ border-radius:3px; box-shadow:0 0 4px #ccc; position:absolute; + z-index: 20; } .popover-hd { padding:5px 0 3px; @@ -1193,9 +1200,19 @@ textarea:-moz-placeholder {/* for FF */ padding:0 10px; overflow:auto; } +a.popover-item { + display:block; + color:#444; + font-weight:normal; + line-height:31px; + text-decoration:none; + padding:0 10px; + margin:5px -10px; +} /**** user-item ****/ /* e.g. group member in 'group members' panel */ .user-item { - margin:5px 0; + padding:0 10px; + margin:5px -10px; } .user-item .txt { margin-left:40px; @@ -1425,16 +1442,16 @@ button.dropdown-toggle:focus { text-decoration:underline; } /* top-bar */ -#msg-count { +#notifications { position:relative; - margin:10px 32px 0 25px; + margin:10px 0 0 25px; } -#msg-count .sf2-icon-bell { +#notifications .sf2-icon-bell { font-size:24px; line-height:1; color:#999; } -#msg-count .num { +#notifications .num { position:absolute; color:#fff; font-size:12px; @@ -1445,70 +1462,47 @@ button.dropdown-toggle:focus { top:0; left:15px; } -#notice-popup { - position:absolute; +#notice-popover { top:38px; right:-80px; - width:240px; - background:#fff; - border:1px solid #c9c9c9; - border-radius:3px; - box-shadow:0 0 1px #f3f3f3; - z-index:20; } -#notice-popup .hd { - text-align:center; - padding:5px 0 3px; - border-bottom:1px solid #dfdfe1; - margin:0 10px; +#notice-popover .outer-caret { + right:82px; } -#notice-popup .con { - padding:0 10px; - overflow:auto; -} -#notice-popup a { +#notice-popover a { font-weight:normal; } -#notice-popup .close { - position:absolute; - top:.5em; - right:10px; - cursor:pointer; -} -#notice-popup .close { - font-size:16px; - color:#b9b9b9; - margin:0; -} -#notice-popup li { +#notice-popover li { padding:9px 0 3px; border-bottom:1px solid #dfdfe1; } -#notice-popup .unread { +#notice-popover li.unread { background:#f5f5f7; + padding-right:10px; + padding-left:8px; border-left:2px solid #feac74; margin:0 -10px; - padding-left:8px; - padding-right:10px; } -#notice-popup .avatar { +#notice-popover .avatar { border-radius:1000px; float:left; } -#notice-popup .brief { +#notice-popover .brief { margin-left:40px; margin-top:0; } -#notice-popup .time { +#notice-popover .time { color:#999; text-align:right; margin:0; + clear:both; } -#notice-popup .all { +#notice-popover .all { color:#a4a4a4; } #account { position:relative; + margin-left:32px; } #account .avatar { vertical-align:middle; @@ -1518,12 +1512,37 @@ button.dropdown-toggle:focus { cursor: pointer; color: #d6d6d6; } -#user-info-popup .avatar { +.account-popup .avatar { float:left; } -#user-info-popup .txt { +.account-popup .txt { margin-left:45px; } +.account-popup { + right:0; + top:48px; + font-size:13px; +} +.account-popup .outer-caret { + top:-10px; + left:200px; +} +.account-popup .popover-con { + padding:0; +} +.account-popup .item { + display:block; + padding:8px 18px; + border-bottom:1px solid #ddd; +} +.account-popup a.item { + color:#333; + font-weight:normal; +} +.account-popup a.item:hover { + background:#fafafa; + text-decoration:none; +} #account .manage { position:absolute; left:60px; @@ -1552,72 +1571,7 @@ button.dropdown-toggle:focus { background:#eee; text-decoration:none; } -#send-msg-popup, -.top-info-popup { - background:#fff; - border:1px solid #ddd; - box-shadow:0 0 5px #ccc; - position:absolute; - right:0; - z-index:100;/* for pages with jquery tabs*/ -} -#send-msg-popup { - width:430px; - padding:18px; - top:38px; - right:10px; -} -.top-info-popup { - width:200px; - text-align:left; - top:48px; - font-size:13px; - border-radius:4px; -} -#user-info-popup { - width:220px; -} -#notice-popup .outer-caret { - left:143px; -} -#user-info-popup .outer-caret { - top:-10px; - left:181px; -} -.top-info-popup .item { - display:block; - padding:8px 18px; - border-top:1px solid #ddd; -} -.top-info-popup a.item { - color:#333; - font-weight:normal; -} -.top-info-popup a.item:hover { - background:#fafafa; - text-decoration:none; -} -#msg-file-share { - margin-top:8px; - position:relative; -} -#msg-file-share-btn { - color:#999; - background:#fff; - border-radius:0; -} -#msg-file-share .icon-remove { - position:absolute; - right:20px; - top:0; - cursor:pointer; - font-size:1.2em; - color:#888; -} -#msg-file-tree { - padding:4px 0; - border:1px solid #ddd; -} + .select2-container .avatar, .select2-results .select2-result-label .avatar { vertical-align:middle; @@ -3371,11 +3325,6 @@ img.thumbnail { .group-setting-list { border-bottom:1px solid #e3e3e5; } -.group-setting-item { - line-height:31px; - cursor:pointer; - margin:5px 0; -} #add-group-members-form .submit { margin:0 0 0 5px; } diff --git a/media/js/base.js b/media/js/base.js index ea26db829f..8000bddb14 100644 --- a/media/js/base.js +++ b/media/js/base.js @@ -14,121 +14,6 @@ if ($('.messages')[0]) { $(function() { - var msg_ct = $("#msg-count"); - - // for login page, and pages without 'header' such as 'file view' page. - if (msg_ct.length == 0) { - return false; - } - // original title - var orig_doc_title = document.title; - msg_ct.data('orig_doc_title', orig_doc_title); // for 'mark all read' in 'notice list' page - var reqUnreadNum = function() { - $.ajax({ - url: msg_ct.data('url'), - dataType: 'json', - cache: false, - success: function(data) { - var count = data['count'], - num = $('.num', msg_ct); - num.html(count); - if (count > 0) { - num.removeClass('hide'); - document.title = '(' + count + ')' + orig_doc_title; - } else { - num.addClass('hide'); - document.title = orig_doc_title; - } - } - }); - }; - reqUnreadNum(); - // request every 30s - setInterval(reqUnreadNum, 30*1000); - - $('#notice-icon').click(function() { - var popup = $('#notice-popup'); - popup.toggleClass('hide'); - if (!popup.hasClass('hide')) { - $('.con', popup).css({'max-height':$(window).height() - $('#header').outerHeight() - $('#notice-popup .hd').outerHeight() - 3}); - var loading_tip = $('.loading-tip', popup), - notice_list = $('#notice-list'); - notice_list.addClass('hide'); - loading_tip.show(); - $('.error', popup).addClass('hide'); - $.ajax({ - url: popup.data('url'), - dataType: 'json', - success: function(data) { - loading_tip.hide(); - notice_list.html(data['notice_html']).removeClass('hide'); - - // set a notice to be read when in it is clicked - $('.unread a', notice_list).click(function() { - var notice_id = $(this).parents('.unread').data('id'); - var link_href = $(this).attr('href'); - $.ajax({ - url: notice_list.data('url') + '?notice_id=' + e(notice_id), - type: 'POST', - dataType: 'json', - beforeSend: prepareCSRFToken, - success: function(data) { - location.href = link_href; - }, - error: function() { - location.href = link_href; - } - }); - return false; - }); - - $('.detail', notice_list).click(function() { - location.href = $('.brief a', $(this).parent()).attr('href'); - }); - }, - error: function (xhr, textStatus, errorThrown) { - if (xhr.responseText) { - var error = $.parseJSON(xhr.responseText).error; - loading_tip.hide(); - if ($('.error', popup).length == 0) { - loading_tip.after('

' + error + '

'); - } else { - $('.error', popup).removeClass('hide'); - } - } - } - }); - } - - return false; - }); - $(window).resize(function() { - var popup = $('#notice-popup'); - if (!popup.hasClass('hide')) { - $('.con', popup).css({'max-height':$(window).height() - $('#header').outerHeight() - $('#notice-popup .hd').outerHeight() - 3}); - } - }); - - $('#notice-popup .close').click(function() { - $('#notice-popup').addClass('hide'); - if ($('#notice-list .unread').length > 0) { - // set all unread notice to be read - var url = $(this).data('url'); - $.ajax({ - url: url, - type: 'POST', - dataType: 'json', - beforeSend: prepareCSRFToken, - success: function() { - $('.num', msg_ct).html(0).addClass('hide'); - document.title = orig_doc_title; - } - }); - } - - return false; - }); - $('#my-info').click(function() { var popup = $('#user-info-popup'); popup.toggleClass('hide'); @@ -173,8 +58,6 @@ $(document).click(function(e) { } }; closePopup($('#user-info-popup'), $('#my-info')); - closePopup($('#top-nav-grp-info'), $('#top-nav-grp')); - closePopup($('#notice-popup'), $('#notice-icon')); }); // search: disable submit when input nothing diff --git a/seahub/templates/base.html b/seahub/templates/base.html index 9080dc9a89..3d01957225 100644 --- a/seahub/templates/base.html +++ b/seahub/templates/base.html @@ -46,40 +46,26 @@ {% include 'snippets/search_form.html' %} {% endif %} -
- - - 0 - -
-
-

{% trans "Notifications" %}

- - -
-
{% avatar request.user 36 %} -
+