diff --git a/Changelog.md b/Changelog.md index 0d7ecab02..0c1cbe039 100644 --- a/Changelog.md +++ b/Changelog.md @@ -34,6 +34,7 @@ bind to an UNIX socket at `unix:tmp/diaspora.sock`. Please change your local * Replace jquery.autoresize with autosize [#6104](https://github.com/diaspora/diaspora/pull/6104) * Improve mobile conversation design [#6087](https://github.com/diaspora/diaspora/pull/6087) * Replace remaining faceboxes with Bootstrap modals [#6106](https://github.com/diaspora/diaspora/pull/6106) +* Rewrite header using Bootstrap 3 [#6109](https://github.com/diaspora/diaspora/pull/6109) ## Bug fixes * Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852) diff --git a/app/assets/javascripts/app/views/conversations_view.js b/app/assets/javascripts/app/views/conversations_view.js index cd4addf41..c1328e83a 100644 --- a/app/assets/javascripts/app/views/conversations_view.js +++ b/app/assets/javascripts/app/views/conversations_view.js @@ -24,7 +24,7 @@ app.views.Conversations = Backbone.View.extend({ $(".control-icons a").tooltip({placement: "bottom"}); var conv = $(".conversation-wrapper .stream_element.selected"), - cBadge = $("#conversations_badge .badge_count"); + cBadge = $("#conversations-link .badge"); if(conv.hasClass("unread") ){ var unreadCount = parseInt(conv.find(".unread_message_count").text(), 10); diff --git a/app/assets/javascripts/app/views/header_view.js b/app/assets/javascripts/app/views/header_view.js index 814ef3a87..6434f1a89 100644 --- a/app/assets/javascripts/app/views/header_view.js +++ b/app/assets/javascripts/app/views/header_view.js @@ -7,46 +7,29 @@ app.views.Header = app.views.Base.extend({ className: "dark-header", events: { - "click ul.dropdown li:first-child": "toggleUserDropdown", "focusin #q": "toggleSearchActive", "focusout #q": "toggleSearchActive" }, - initialize: function(){ - $(document.body).click($.proxy(this.hideUserDropdown, this)); - - return this; + presenter: function() { + return _.extend({}, this.defaultPresenter(), { + podname: gon.appConfig.settings.podname + }); }, postRenderTemplate: function(){ - new app.views.Notifications({ el: '#notification_dropdown' }); - new app.views.NotificationDropdown({ el: '#notification_badge' }); - new app.views.Search({ el: '#header-search-form' }); + new app.views.Notifications({ el: "#notification-dropdown" }); + this.notificationDropdown = new app.views.NotificationDropdown({ el: "#notification-dropdown" }); + new app.views.Search({ el: "#header-search-form" }); }, menuElement: function(){ return this.$("ul.dropdown"); }, - toggleUserDropdown: function(evt){ - if(evt){ evt.preventDefault(); } - - this.menuElement().toggleClass("active"); - - if($.browser.msie){ - this.$("header").toggleClass('ie-user-menu-active'); - } - }, - - hideUserDropdown: function(evt){ - if(this.menuElement().hasClass("active") && !$(evt.target).parents("#user_menu").length){ - this.menuElement().removeClass("active"); - } - }, - - toggleSearchActive: function(ev){ + toggleSearchActive: function(evt){ // jQuery produces two events for focus/blur (for bubbling) // don't rely on which event arrives first, by allowing for both variants - var is_active = (_.indexOf(['focus','focusin'], ev.type) !== -1); - $(ev.target).toggleClass('active', is_active); + var isActive = (_.indexOf(["focus","focusin"], evt.type) !== -1); + $(evt.target).toggleClass("active", isActive); return false; } }); diff --git a/app/assets/javascripts/app/views/help_view.js b/app/assets/javascripts/app/views/help_view.js index f1ec4618f..d0cf0e4d5 100644 --- a/app/assets/javascripts/app/views/help_view.js +++ b/app/assets/javascripts/app/views/help_view.js @@ -210,7 +210,7 @@ app.views.Help = app.views.StaticContentView.extend({ }, chatEnabled: function(){ - return gon.chatEnabled; + return gon.appConfig.chat.enabled; }, getChatIcons: function(){ diff --git a/app/assets/javascripts/app/views/notification_dropdown_view.js b/app/assets/javascripts/app/views/notification_dropdown_view.js index 43e509019..522a03015 100644 --- a/app/assets/javascripts/app/views/notification_dropdown_view.js +++ b/app/assets/javascripts/app/views/notification_dropdown_view.js @@ -1,8 +1,8 @@ // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later app.views.NotificationDropdown = app.views.Base.extend({ - events:{ - "click #notifications-badge": "toggleDropdown" + events: { + "click #notifications-link": "toggleDropdown" }, initialize: function(){ @@ -12,38 +12,37 @@ app.views.NotificationDropdown = app.views.Base.extend({ this.perPage = 5; this.hasMoreNotifs = true; this.badge = this.$el; - this.dropdown = $('#notification_dropdown'); - this.dropdownNotifications = this.dropdown.find('.notifications'); - this.ajaxLoader = this.dropdown.find('.ajax_loader'); + this.dropdown = $("#notification-dropdown"); + this.dropdownNotifications = this.dropdown.find(".notifications"); + this.ajaxLoader = this.dropdown.find(".ajax_loader"); this.perfectScrollbarInitialized = false; }, toggleDropdown: function(evt){ - evt.preventDefault(); evt.stopPropagation(); + if (!$("#notifications-link .entypo.bell:visible").length) { return true; } + evt.preventDefault(); if(this.dropdownShowing()){ this.hideDropdown(evt); } else{ this.showDropdown(); } }, dropdownShowing: function(){ - return this.dropdown.css('display') === 'block'; + return this.dropdown.hasClass("dropdown-open"); }, showDropdown: function(){ this.resetParams(); this.ajaxLoader.show(); - this.badge.addClass('active'); - this.dropdown.css('display', 'block'); - this.dropdownNotifications.addClass('loading'); + this.dropdown.addClass("dropdown-open"); + this.dropdownNotifications.addClass("loading"); this.getNotifications(); }, hideDropdown: function(evt){ - var inDropdown = $(evt.target).parents().is(this.dropdown); + var inDropdown = $(evt.target).parents().is($(".dropdown-menu", this.dropdown)); var inHovercard = $.contains(app.hovercard.el, evt.target); if(!inDropdown && !inHovercard && this.dropdownShowing()){ - this.badge.removeClass('active'); - this.dropdown.css('display', 'none'); + this.dropdown.removeClass("dropdown-open"); if(this.perfectScrollbarInitialized) { this.dropdownNotifications.perfectScrollbar("destroy"); this.perfectScrollbarInitialized = false; @@ -52,9 +51,9 @@ app.views.NotificationDropdown = app.views.Base.extend({ }, dropdownScroll: function(){ - var isLoading = ($('.loading').length === 1); + var isLoading = ($(".loading").length === 1); if (this.isBottom() && this.hasMoreNotifs && !isLoading){ - this.dropdownNotifications.addClass('loading'); + this.dropdownNotifications.addClass("loading"); this.getNotifications(); } }, @@ -71,7 +70,7 @@ app.views.NotificationDropdown = app.views.Base.extend({ }, isBottom: function(){ - var bottom = this.dropdownNotifications.prop('scrollHeight') - this.dropdownNotifications.height(); + var bottom = this.dropdownNotifications.prop("scrollHeight") - this.dropdownNotifications.height(); var currentPosition = this.dropdownNotifications.scrollTop(); return currentPosition + 50 >= bottom; }, @@ -89,21 +88,21 @@ app.views.NotificationDropdown = app.views.Base.extend({ hideAjaxLoader: function(){ var self = this; - this.ajaxLoader.find('img').fadeTo(200, 0, function(){ + this.ajaxLoader.find("img").fadeTo(200, 0, function(){ self.ajaxLoader.hide(200, function(){ - self.ajaxLoader.find('img').css('opacity', 1); + self.ajaxLoader.find("img").css("opacity", 1); }); }); }, renderNotifications: function(){ var self = this; - this.dropdownNotifications.find('.media.stream_element').remove(); + this.dropdownNotifications.find(".media.stream_element").remove(); $.each(self.notifications, function(index, notifications){ $.each(notifications, function(index, notification){ if($.inArray(notification, notifications) === -1){ var node = self.dropdownNotifications.append(notification.note_html); - $(node).find('.unread-toggle .entypo').tooltip('destroy').tooltip(); + $(node).find(".unread-toggle .entypo").tooltip("destroy").tooltip(); } }); }); diff --git a/app/assets/javascripts/app/views/notifications_view.js b/app/assets/javascripts/app/views/notifications_view.js index 583c8ce0f..00bb5e6c8 100644 --- a/app/assets/javascripts/app/views/notifications_view.js +++ b/app/assets/javascripts/app/views/notifications_view.js @@ -54,7 +54,7 @@ app.views.Notifications = Backbone.View.extend({ var change = unread ? 1 : -1, allNotes = $(".list-group > a:eq(0) .badge"), typeNotes = $(".list-group > a[data-type=" + type + "] .badge"), - headerBadge = $("#notification_badge .badge_count"), + headerBadge = $("#notifications-link .badge"), note = $(".stream_element[data-guid=" + guid + "]"), markAllReadLink = $("a#mark_all_read_link"), translationKey = unread ? "notifications.mark_read" : "notifications.mark_unread"; @@ -70,7 +70,8 @@ app.views.Notifications = Backbone.View.extend({ [allNotes, typeNotes, headerBadge].forEach(function(element){ element.text(function(i, text){ - return parseInt(text) + change }); + return parseInt(text) + change; + }); }); [allNotes, typeNotes].forEach(function(badge) { diff --git a/app/assets/stylesheets/_application.scss b/app/assets/stylesheets/_application.scss index f913a9131..4bc1621b4 100644 --- a/app/assets/stylesheets/_application.scss +++ b/app/assets/stylesheets/_application.scss @@ -18,6 +18,7 @@ @import 'new_styles/interactions'; @import 'new_styles/spinner'; @import 'lightbox'; +@import 'timeago'; @import 'vendor/fileuploader'; @import 'vendor/autoSuggest'; @@ -38,7 +39,6 @@ /* new SPV */ @import 'header'; @import 'footer'; -@import 'bootstrap-headerfix'; @import 'opengraph'; @import 'single-post-view'; @import 'new_styles/poll'; diff --git a/app/assets/stylesheets/autocomplete.scss b/app/assets/stylesheets/autocomplete.scss index 4f3394ae6..5fa51c6c4 100644 --- a/app/assets/stylesheets/autocomplete.scss +++ b/app/assets/stylesheets/autocomplete.scss @@ -42,17 +42,16 @@ } .ac_loading { - background: white image-url('ajax-loader2.gif') right center no-repeat; + background: white image-url('ajax-loader2.gif') right 5px center no-repeat; + background-size: 18px; } .ac_odd { background-color: #fafafa; - background-color: rgba(250,250,250,0.95); } .ac_even { background-color: #fff; - background-color: rgba(255,255,255,0.95); } .ac_over { diff --git a/app/assets/stylesheets/bootstrap-headerfix.scss b/app/assets/stylesheets/bootstrap-headerfix.scss deleted file mode 100644 index 792b44c6c..000000000 --- a/app/assets/stylesheets/bootstrap-headerfix.scss +++ /dev/null @@ -1,52 +0,0 @@ -// A temporary fix for displaying the header in the single post view. -// Should be removed once everything uses Bootstrap. - -header { - .container { - width: 950px; - .header-nav { - span { - a { - font-weight: bold; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - } - } - } - li { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - } - } - #conversations_badge, #notification_badge { - background: none; - } - #notification_badge.active { - border-radius: 0; - } - #global_search { - form { - top: -3px; - input { - color: black; - } - } - } - #notification_dropdown { - h4 { - margin: 0; - } - .right { - a { - font-weight: bold; - } - } - .notification_element { - font-size: 13px; - .timeago { - border: medium none; - cursor: text; - } - } - } -} diff --git a/app/assets/stylesheets/bootstrap-variables.scss b/app/assets/stylesheets/bootstrap-variables.scss index 599a7303a..6c8376e97 100644 --- a/app/assets/stylesheets/bootstrap-variables.scss +++ b/app/assets/stylesheets/bootstrap-variables.scss @@ -16,8 +16,8 @@ // $gray-light: lighten($gray-base, 46.7%) // #777 // $gray-lighter: lighten($gray-base, 93.5%) // #eee -$brand-primary: darken(#0097FF,5%); // darker creation-blue -$brand-success: #8EDE3D; +$brand-primary: darken(#0097FF,5%) !default; // darker creation-blue +$brand-success: #8EDE3D !default; // $brand-info: #5bc0de // $brand-warning: #f0ad4e // $brand-danger: #d9534f @@ -33,7 +33,7 @@ $brand-success: #8EDE3D; // $text-color: $gray-dark //** Global textual link color. -$link-color: rgb(42,156,235); +$link-color: rgb(42,156,235) !default; //** Link hover color set via `darken()` function. // $link-hover-color: darken($link-color, 15%) //** Link hover decoration. @@ -50,9 +50,9 @@ $link-color: rgb(42,156,235); // $font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace // $font-family-base: $font-family-sans-serif -$font-size-base: 13px; +$font-size-base: 13px !default; // $font-size-large: ceil(($font-size-base * 1.25)) // ~18px -$font-size-small: 11px; +$font-size-small: 11px !default; // $font-size-h1: floor(($font-size-base * 2.6)) // ~36px // $font-size-h2: floor(($font-size-base * 2.15)) // ~30px @@ -158,7 +158,7 @@ $font-size-small: 11px; // $btn-primary-bg: $brand-primary // $btn-primary-border: darken($btn-primary-bg, 5%) -$btn-success-color: #333; +$btn-success-color: #333 !default; // $btn-success-bg: $brand-success // $btn-success-border: darken($btn-success-bg, 5%) @@ -328,7 +328,7 @@ $btn-success-color: #333; // $grid-gutter-width: 30px // Navbar collapse //** Point at which the navbar becomes uncollapsed. -// $grid-float-breakpoint: $screen-sm-min +$grid-float-breakpoint: 992px !default; // $screen-md-min //** Point at which the navbar begins collapsing. // $grid-float-breakpoint-max: ($grid-float-breakpoint - 1) @@ -856,7 +856,7 @@ $btn-success-color: #333; //** Blockquote small color // $blockquote-small-color: $gray-light //** Blockquote font size -$blockquote-font-size: $font-size-base; +$blockquote-font-size: $font-size-base !default; //** Blockquote border color // $blockquote-border-color: $gray-lighter //** Page header border color diff --git a/app/assets/stylesheets/color_themes/_color_theme_override.scss b/app/assets/stylesheets/color_themes/_color_theme_override.scss index d21280f41..c9c0385a7 100644 --- a/app/assets/stylesheets/color_themes/_color_theme_override.scss +++ b/app/assets/stylesheets/color_themes/_color_theme_override.scss @@ -1,45 +1,5 @@ /* Raw CSS */ body { - header { - .container { - #nav_badges > #notification_dropdown { - a#mark_all_read_link, .stream_element a { - color: $link-color; - } - - div.view_all { - background-color: $main-color; - } - } - - #global_search > form > input.ac_input { - background-color: $header-search-color; - border-color: $main-color-dark; - - &:hover { - background-color: lighten($header-search-color, 2%); - } - - &:focus { - background-color: white; - } - } - - ul#user_menu.active { - box-shadow: 0 1px 3px $main-color-dark; - background-color: $main-color-dark; - - li { - border-color: darken($main-color-dark, 5%); - - &.user-menu-item a:hover { - background-color: lighten($main-color-dark, 15%); - } - } - } - } - } - a, a.tag, .btn-link, @@ -57,7 +17,6 @@ body { color: fade-out($link-color, 0.4); } - #main_stream .stream_element { &.post_preview { background-color: $main-color-essence; @@ -65,13 +24,9 @@ body { } } - #leftNavBar .hoverable:hover { background-color: $main-color-essence } + #leftNavBar .hoverable:hover { background-color: $main-color-essence; } - .poll_form .progress .bar { background-color: $main-color-dark } + .poll_form .progress .bar { background-color: $main-color-dark; } - #profile_container .profile_header #profile_horizontal_bar ul#profile_nav > li.active { - border-bottom-color: $main-color; - } - - .badge { background-color: $main-color } + .badge { background-color: $brand-primary; } } diff --git a/app/assets/stylesheets/color_themes/dark_green/_style.scss b/app/assets/stylesheets/color_themes/dark_green/_style.scss index 6039cc718..f8fe658e7 100644 --- a/app/assets/stylesheets/color_themes/dark_green/_style.scss +++ b/app/assets/stylesheets/color_themes/dark_green/_style.scss @@ -1,17 +1,18 @@ /* Main color(s) */ -$main-color: #009900; +$brand-primary: #009900; /* Shades */ -$main-color-essence: fade-out($main-color, 0.8); -$main-color-light: lighten($main-color, 10%); -$main-color-dark: darken($main-color, 20%); +$main-color-essence: fade-out($brand-primary, 0.8); +$main-color-light: lighten($brand-primary, 10%); +$main-color-dark: darken($brand-primary, 20%); /* Bootstrap Variables */ -$btn-primary-bg: $main-color; -$link-color: $main-color; +$btn-primary-bg: $brand-primary; +$link-color: $brand-primary; /* Custom Variables */ $header-background-color: $main-color-dark; +$navbar-inverse-bg: $main-color-dark; $header-search-color: lighten($header-background-color, 10%); @import "color_themes/color_theme_override" diff --git a/app/assets/stylesheets/color_themes/egyptian_blue/_style.scss b/app/assets/stylesheets/color_themes/egyptian_blue/_style.scss index c39132caa..1895f02bb 100644 --- a/app/assets/stylesheets/color_themes/egyptian_blue/_style.scss +++ b/app/assets/stylesheets/color_themes/egyptian_blue/_style.scss @@ -1,17 +1,18 @@ /* Main color(s) */ -$main-color: #1034A6; +$brand-primary: #1034A6; /* Shades */ -$main-color-essence: fade-out($main-color, 0.8); -$main-color-light: lighten($main-color, 10%); -$main-color-dark: darken($main-color, 15%); +$main-color-essence: fade-out($brand-primary, 0.8); +$main-color-light: lighten($brand-primary, 10%); +$main-color-dark: darken($brand-primary, 15%); /* Bootstrap Variables */ -$btn-primary-bg: $main-color; -$link-color: $main-color; +$btn-primary-bg: $brand-primary; +$link-color: $brand-primary; /* Custom Variables */ $header-background-color: $main-color-dark; +$navbar-inverse-bg: $main-color-dark; $header-search-color: lighten($header-background-color, 15%); @import "color_themes/color_theme_override" diff --git a/app/assets/stylesheets/color_themes/magenta/_style.scss b/app/assets/stylesheets/color_themes/magenta/_style.scss index 8b13dc77f..0f9b4be1f 100644 --- a/app/assets/stylesheets/color_themes/magenta/_style.scss +++ b/app/assets/stylesheets/color_themes/magenta/_style.scss @@ -1,17 +1,18 @@ /* Main color(s) */ -$main-color: #FF00FF; +$brand-primary: #FF00FF; /* Shades */ -$main-color-essence: fade-out($main-color, 0.8); -$main-color-light: lighten($main-color, 10%); -$main-color-dark: darken($main-color, 30%); +$main-color-essence: fade-out($brand-primary, 0.8); +$main-color-light: lighten($brand-primary, 10%); +$main-color-dark: darken($brand-primary, 30%); /* Bootstrap Variables */ -$btn-primary-bg: darken($main-color, 5%); -$link-color: $main-color; +$btn-primary-bg: darken($brand-primary, 5%); +$link-color: $brand-primary; /* Custom Variables */ $header-background-color: $main-color-dark; +$navbar-inverse-bg: $main-color-dark; $header-search-color: lighten($header-background-color, 10%); @import "color_themes/color_theme_override" diff --git a/app/assets/stylesheets/header.scss b/app/assets/stylesheets/header.scss index cbafb6364..07c582884 100644 --- a/app/assets/stylesheets/header.scss +++ b/app/assets/stylesheets/header.scss @@ -1,433 +1,128 @@ -.timeago { - color: $text-grey; +header > .dark-header > nav { border-bottom: none; -} + box-shadow: 1px 0 2px $black; -body > header { - @include header-gradient($header-background-color); - box-shadow: 0 1px 3px rgba(0,0,0,0.9); - z-index: 1001; - padding: 6px 0; - color: #CCC; - height: 39px; - position: fixed; - width: 100%; - min-width: 620px; - top: 0; - left: 0; - border-bottom: 1px solid darken($header-background-color, 8%); - - > div > div.container { - height: 26px; - } - - .diaspora_header_logo { - float: left; - margin-top: -6px; - height: 38px; - width: 65px; - } - - .ie-user-menu-active { height: 150px; } - - a.header_root_link { - display: inline-block; - margin-top: 5px; - } - - a { - color: #CCC; - color: rgb(147,147,147); - - &:hover, &:focus { - background: none; - color: $highlight-white; - } - &:focus { - outline: thin dotted $border-dark-grey; - text-decoration: none; - } - } - - &.landing { - height: 40px; - .right { top: 10px; } - } - - #nav_badges { - display: inline-block; - margin-top: 2px; - float: left; - width: 61px; - - a:hover { text-decoration: none; } - - .badge { - width: 22px; - position: relative; - top: 2px; - display: inline; - margin: 0 2px; - font-weight: bold; - font-size: smaller; - - .badge_count { - border-radius: 2px; - z-index: 3; - position: absolute; - top: -4px; - left: 15px; - padding: 1px 2px; - background-color: $red; - line-height: 12px; - color: #fff; - } - - &:hover .badge_count { background-color: lighten($red, 5%); } - - .icons-notifications_grey { height: 16px; } - - &.active .icons-notifications_grey:hover { - background-position: sprite-position($icons-sprites, notifications_grey); - } - - .icons-mail_grey { height: 11px } - - a.badge_link { - display: block; - width: 100%; - height: 16px; - float: left; - } - } - - #notification_badge, #conversations_badge { - float: left; - padding: 0px 3px; - } - - #conversations_badge { - padding-top: 3px; - margin-right: 0px; - padding-right: 0px; - } - - #notification_badge.active { - z-index: 10; - background-color: #fff; - border: 1px solid $border-dark-grey; - border-bottom: 0px; - margin-left: 0px; - padding-bottom: 12px; - } - - #notification_dropdown { - background: white; - border: solid $border-dark-grey 1px; - box-shadow: 0 0px 13px rgba(20,20,20,0.5); - left: 300px; - width: 380px; - display: none; - float: left; - color: $grey; - - a { color: $blue; } - a.disabled { - color: $link-disabled-grey; - cursor: default; - } - - .header { - border-bottom: 1px solid $border-grey; - padding: 5px 10px 5px 5px; - - h4 { - padding-bottom: 0; - margin-bottom: 0; - font-size: 16px; - color: $black; - } - - a { - font-size: $font-size-small; - font-weight: bold; - } - } - - .ajax_loader { - border-bottom: 1px solid $border-grey; - padding: 15px; - img { height: 21px; } - } - .notifications{ - overflow: hidden; - position: relative; - max-height: 325px; - - .media.stream_element { - border-bottom: 1px solid $border-grey; - padding: 5px; - min-height: 35px; - line-height: 18px; - margin: 0; - - img.avatar { - width: 35px; - height: 35px; - } - - .media-body { - word-break: break-all; - } - - .pull-right > .aspect_membership_dropdown { display: none; } - .unread-toggle { margin: 10px; } - - .entypo { - cursor: pointer; - color: lighten($black,75%); - font-size: 17px; - line-height: 17px; - } - .tooltip { - position: fixed; - } - - &.unread { - background-color: $background-grey; - color: $black; - .unread-toggle { - .entypo { color: $black; } - } - } - - } - } - - .view_all { - background-color: $blue; - border-bottom: 1px solid $border-dark-grey; - text-align: center; - a { - display: block; - padding: 5px; - color: white; - font-size: 12px; - font-weight: bold; - } - } - } - } - - #global_search { - float: right; - margin-right: 10px; - position: relative; - - form { - position: absolute; - right: 0; - - input { - box-shadow: 0 1px 1px #444; - border-radius: 15px; - @include transition(width); - width: 100px; - background-color: #444; - border: 1px solid #222; - font-size: 13px; - padding: 4px; - margin-top: 1px; - - &:hover { background-color: #555; } - - &.active { - background-color: $highlight-white; - background-color: rgba(160,160,160,0.6); - } - - &:focus { - outline: none; - background-color: white; - width: 200px; - } - - &::input-placeholder { text-shadow: none; } - &::placeholder { text-shadow: none; } - &.ac_loading::-webkit-search-cancel-button { -webkit-appearance: none; } - } - } - } - - ul#user_menu { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - text-shadow: 0 1px 0 #000; - color: rgb(147,147,147); - min-width: 100px; - cursor: pointer; - z-index: 10; - display: inline; - visibility: hidden; - top: -4px; - float: right; - margin: -2px -3px 0px 0px; - padding: 0; - - > li { - display: block; - border-left: 1px solid #333; - border-right: 1px solid #333; - - &:first-child { - visibility: visible; - } - - &:last-child { - border-bottom: 1px solid #333; - } - } - - &.active { - box-shadow: 0 0px 13px rgba(20,20,20,0.5); - background-color: rgb(34,30,30); - visibility: visible; - - > li { - border-color: $border-dark-grey; - } - } - } - - .user-menu-item a { - padding: 4px 8px 4px 40px; - height: 100%; - color: $text-grey; - - &:hover { - background-color: $blue; - color: $highlight-white; - text-decoration: none; - } - } - - .user-menu-trigger { - padding: 10px 25px 10px 40px; - - &:hover { - color: $highlight-white; - .user-name { color: $highlight-white; } - } - } - - .user-name { - - &:hover { - background-color: transparent; - text-decoration: none; - } - - &:focus { outline: none; } - } - - .user-menu-more-indicator { - position: absolute; - right: 5px; - } - - .user-menu-avatar { - height: 25px; - width: 25px; - position: absolute; - left: 8px; - top: 8px; - display: block; - } - - .header-nav { + .navbar-brand { font-weight: bold; - float: left; - height: 100%; - margin-right: 5px; - margin-top: 2px; - - a { - padding: 0 10px; - width: 100%; - &:hover { text-decoration: none; } - } - - > span { - height: 100%; - display: inline-block; - margin-left: -4px; - border-left: 1px solid #333; - border-right: 1px solid #333; - - &:last-child { - margin-left: -5px; - } - } + font-size: $font-size-h3; } - /* When the user is not connected */ - ul#landing_nav { - position: absolute; - top: 4px; - right: 0; - margin: 0; - padding: 0; - - > li { - text-shadow: 0 1px 0 #000; - display: inline; - margin-right: 0.5em; - - a { - color: $blue; - - &.login { - border-radius: 5px; - box-shadow: 0 1px 1px #666; - padding: 5px 8px; - background-color: #000; - border-top: 1px solid #000; - - &:hover { background-color: #222; } + @media (max-width: $grid-float-breakpoint-max) { + .col-lg-10 { padding: 0; } + } + @media (min-width: $grid-float-breakpoint) { + input[type="search"] { + @include transition(width); + margin-top: 2px; + width: 200px; + &:not(.active) { + background-color: $navbar-inverse-bg; + border-color: $gray-light; + width: 150px; + } + } + .navbar-nav:not(.nav-badges) > li > a { font-weight: bold; } + .nav-badges { + margin-left: 20px; + & > li { height: 50px; } + .dropdown > a:focus { outline: 0px none; } + .dropdown-open { + background-color: $dropdown-bg; + & > a { color: $dropdown-link-color; } + .dropdown-menu { display: block; } + } + .dropdown-menu { + border-top: none; + margin-left: -1px; + padding: 0px; + width: 400px; + .avatar { + width: 35px; + height: 35px; } - } - - &:last-child { margin-right: 0; } + .header { + padding: 10px; + border-bottom: 1px solid $border-grey; + h4 { margin: 5px 0; } + } + .notifications { + position: relative; + max-height: 350px; + } + .stream_element.media { + padding: 5px; + .tooltip { position: fixed; } + .unread-toggle { + margin-right: 10px; + opacity: 1; + } + & > .pull-right > .aspect_membership_dropdown { display: none; } + } + .ajax_loader { + border-bottom: 1px solid $border-grey; + padding: 10px; + } + .view_all { + background-color: $link-color; + border-top: 3px solid $white; + text-align: center; + a { + color: $white; + display: block; + font-weight: bold; + padding: 5px; + &:hover { text-decoration: none; } + } + } + } } - } -} - - -/* - * Extract here from application.sass because - * needed for the header in the bootstrap part - */ -ul.dropdown { - padding: 0px; - - li { - display: none; - - a { display: block; } - - &:first-child { - display: block; - - a { - height: auto; - display: inline; + .entypo { + color: inherit; + font-size: $font-size-h3; + vertical-align: middle; + } + .nav-badge { + margin-bottom: -2px; + .badge { + background-color: $brand-danger; + position: absolute; + right: 5px; + top: 10px; + } + } + #user_menu { + &.open .dropdown-toggle { background-color: darken($navbar-inverse-bg, 7%); } + .dropdown-toggle { + margin: 0 1px; + min-width: 160px; + } + .dropdown-menu { + background-color: darken($navbar-inverse-bg, 7%); + border-top: none; + width: 100%; + & > li > a { + color: $gray-light; + padding-left: 55px; + &:hover { + background-color: $link-color; + color: $gray-lighter; + } + } } } } - &.active { - z-index: 30; - li { display: block; } + #user_menu { + .avatar { + height: 30px; + width: 30px; + } + .user-avatar { + height: $navbar-height; + padding: ($navbar-height - 30px)/2 0; + margin-bottom: -$navbar-padding-vertical; + margin-top: -$navbar-padding-vertical; + margin-right: 10px; + } } } diff --git a/app/assets/stylesheets/new_styles/_animations.scss b/app/assets/stylesheets/new_styles/_animations.scss index 93ca29ad3..d5210066e 100644 --- a/app/assets/stylesheets/new_styles/_animations.scss +++ b/app/assets/stylesheets/new_styles/_animations.scss @@ -1,7 +1,7 @@ -/* flash message animations - header height is about 40px */ +/* flash message animations - header height is about 50px */ @keyframes expose { 0% { top : -100px; } - 15% { top : 34px; } - 85% { top : 34px; } + 15% { top : 44px; } + 85% { top : 44px; } 100% { top : -100px; } } diff --git a/app/assets/stylesheets/new_styles/_base.scss b/app/assets/stylesheets/new_styles/_base.scss index 5717a8189..95ecb30d8 100644 --- a/app/assets/stylesheets/new_styles/_base.scss +++ b/app/assets/stylesheets/new_styles/_base.scss @@ -5,7 +5,7 @@ body { } body { - margin-top: 40px; + margin-top: 50px; padding : none; &.lock { @@ -88,5 +88,5 @@ a.tag { word-break: break-all; } @media (max-width: 767px) { body { padding : 0; - } + } } diff --git a/app/assets/stylesheets/notifications.scss b/app/assets/stylesheets/notifications.scss index 099bcc7ca..990247836 100644 --- a/app/assets/stylesheets/notifications.scss +++ b/app/assets/stylesheets/notifications.scss @@ -46,44 +46,6 @@ overflow: visible; } - .stream_element.media { - padding: 10px; - margin: 0px; - line-height: 18px; - border-bottom: 1px solid $border-grey; - &:last-child { border: none !important; } - - &.unread { - background-color: $background-grey; - .unread-toggle { - opacity: 1 !important; - .entypo { color: $black; } - } - } - - &:hover { - .unread-toggle { opacity: 1 !important; } - } - - .avatar { - width: 35px; - height: 35px; - } - - .unread-toggle { - padding: 9px 5px; - .entypo { - cursor: pointer; - color: lighten($black,75%); - font-size: 17px; - line-height: 17px; - } - opacity: 0; - } - - .btn-group.aspect_membership_dropdown { margin: 5px 0; } - } - .pagination { text-align: center; } .no_notifications { text-align: center; } @@ -94,3 +56,43 @@ .mentionIcon { font-weight: bold; } } } + +#notifications_container .stream, header .nav-badges .notifications { + .stream_element.media { + padding: 10px; + margin: 0px; + line-height: 18px; + border-bottom: 1px solid $border-grey; + &:last-child { border: none !important; } + + &.unread { + background-color: $background-grey; + .unread-toggle { + opacity: 1 !important; + .entypo { color: $black; } + } + } + + &:hover { + .unread-toggle { opacity: 1 !important; } + } + + .avatar { + width: 35px; + height: 35px; + } + + .unread-toggle { + padding: 9px 5px; + .entypo { + cursor: pointer; + color: lighten($black,75%); + font-size: 17px; + line-height: 17px; + } + opacity: 0; + } + + .btn-group.aspect_membership_dropdown { margin: 5px 0; } + } +} diff --git a/app/assets/stylesheets/rtl.scss b/app/assets/stylesheets/rtl.scss index 95392bea5..cf8f2865f 100644 --- a/app/assets/stylesheets/rtl.scss +++ b/app/assets/stylesheets/rtl.scss @@ -30,12 +30,6 @@ body { margin-right: -20px; } - -#notification_dropdown { - left: auto; - right: 507px; -} - #view_all_notifications { float: left; margin-right: 0; diff --git a/app/assets/stylesheets/timeago.scss b/app/assets/stylesheets/timeago.scss new file mode 100644 index 000000000..cbc0e917b --- /dev/null +++ b/app/assets/stylesheets/timeago.scss @@ -0,0 +1,3 @@ +.timeago { + color: $text-grey; +} diff --git a/app/assets/templates/header_tpl.jst.hbs b/app/assets/templates/header_tpl.jst.hbs index d7ade2b5a..8d6ce060d 100644 --- a/app/assets/templates/header_tpl.jst.hbs +++ b/app/assets/templates/header_tpl.jst.hbs @@ -1,109 +1,125 @@ -