diff --git a/static/js/stream_list.js b/static/js/stream_list.js index 315afcc9ca..79210edc39 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -109,11 +109,13 @@ exports.get_count = function (type, name) { function update_count_in_dom(count_span, value_span, count) { if (count === 0) { count_span.hide(); + count_span.parent(".subscription_block").removeClass("stream-with-count"); value_span.text(''); return; } count_span.show(); + count_span.parent(".subscription_block").addClass("stream-with-count"); value_span.text(count); } diff --git a/static/styles/zulip.css b/static/styles/zulip.css index 26bf4ab18d..d169cd8316 100644 --- a/static/styles/zulip.css +++ b/static/styles/zulip.css @@ -530,6 +530,32 @@ ul.filters { display: none; } +#stream_filters .count { + position: absolute; + right: 20px; + top: 4px; + padding: 2px 3px 1px 3px; + background: #80837f; + color: #ffffff; + border-radius: 1px; + font-size: 11px; + font-weight: normal; +} + +.subject_count { + display: block; + position: absolute; + line-height: 1em; + right: 20px; + top: 2px; + padding: 2px 3px 0px 3px; + background: #a6ada4; + color: #ffffff; + border-radius: 1px; + font-size: 11px; + font-weight: normal; +} + ul.filters i { padding-right: 0.25em; /* Make filter icons the same width so labels line up. */ @@ -1784,10 +1810,25 @@ table.floating_recipient { padding-bottom: 4px; line-height: 12px; padding-top: 4px; + margin-right: 15px; } -.selectable_sidebar_block { +#stream_filters .subscription_block.stream-with-count { + margin-right: 38px; +} + +.subscription_name { display: block; + line-height: 1em; + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.subject-name { + display: block; + line-height: 1.3em; width: 100%; white-space: nowrap; overflow: hidden; @@ -2024,14 +2065,21 @@ ul.expanded_subjects { margin-left: 0px; } -li.expanded_subject .subject_box { - display: block; - width: 100%; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; +li.expanded_subject { + position: relative; } +.expanded_subject .subject_box { + display: block; + margin-right: 38px; +} + +.expanded_subject.zero-subject-unreads .subject_box { + display: block; + margin-right: 0px; +} + + .twitter-tweet { border: 1px solid #ddd; padding: .5em .75em; diff --git a/static/templates/sidebar_subject_list.handlebars b/static/templates/sidebar_subject_list.handlebars index df45fc6341..f8faa4fe7a 100644 --- a/static/templates/sidebar_subject_list.handlebars +++ b/static/templates/sidebar_subject_list.handlebars @@ -1,13 +1,13 @@