diff --git a/Changelog.md b/Changelog.md index b3f31c494..faee6be27 100644 --- a/Changelog.md +++ b/Changelog.md @@ -32,6 +32,7 @@ * Add a white background to images shown in the lightbox [#4475](https://github.com/diaspora/diaspora/issues/4475) * Refactor getting_started page, test if facebook is available, fix [#4520](https://github.com/diaspora/diaspora/issues/4520) * Avoid publishing empty posts [#4542](https://github.com/diaspora/diaspora/pull/4542) +* Refactor mobile header, fix [#4579](https://github.com/diaspora/diaspora/issues/4579) ## Features * Add oEmbed content to the mobile view [#4343](https://github.com/diaspora/diaspora/pull/4353) diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index 6a4f8c37b..bb45effd4 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -308,84 +308,68 @@ body { .right { float: right; } -.navbar { - @include box-shadow(0,1px,2px,#333); -} - -.navbar-inner { - @include box-shadow(0,1px,2px,#333); - - background: { - image: image-url("header-bg-long.jpg"); - } - - width: 100%; +header { + position: fixed; + top: 0px; + left: 0px; + right: 0px; + min-width: 250px; z-index: 10; + background: url("header-bg-long.jpg") rgb(40,35,35); + @include box-shadow(0, 1px, 2px, #333); + border-bottom: 1px solid #222; - border: { - bottom: 1px solid #222; + #header_title { display: inline-block; } + + #nav_badges { + float: right; + margin: 4px 12px; + + .badge { + display: inline; + margin-left: 3px; + padding: 8px 3px; + padding-bottom: 9px; + font-weight: bold; + font-size: smaller; + width: 28px; + } + + .badge:hover .badge_count { + background-color: #bd0902; + } + + a { + padding: 5px 0px; + } } -} -#nav_badges { - display: inline-block; - float: right; - padding: 4px 12px; - - a:hover { - text-decoration: none; - } - - .badge { - position: relative; - display: inline; - margin-left: 3px; - padding: 8px 3px; - padding-bottom: 9px; - font-weight: bold; + .badge_count { + -moz-border-radius: 2px 2px 2px 2px; + -webkit-border-radius: 2px 2px 2px 2px; + border-radius: 2px 2px 2px 2px; + z-index: 3; + position: absolute; + top: 1px; + padding: 0 2px; + padding-bottom: 1px; + background-color: $red; + line-height: 12px; + color: white; font-size: smaller; - width: 28px; } - - .badge:hover .badge_count { - background-color: #bd0902; + + #notification { + right: 140px; } - - a { - padding: 5px 0px; + + #conversation { + right: 110px; } -} -.badge_count { - -moz-border-radius: 2px 2px 2px 2px; - -webkit-border-radius: 2px 2px 2px 2px; - border-radius: 2px 2px 2px 2px; - z-index: 3; - position: absolute; - top: 1px; - padding: 0 2px; - padding-bottom: 1px; - background-color: $red; - line-height: 12px; - color: white; - font-size: smaller; -} - -#notification { - right: 140px; -} - -#conversation { - right: 110px; -} - -.badge-inverse { - background-color: #333333 !important; -} - -#header_title { - position: relative; - top: -3px; + .badge-inverse { + background-color: #333333 !important; + } } footer { diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 87ba79c98..705419866 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -46,28 +46,26 @@ = yield(:head) %body - .navbar.navbar-fixed-top - .navbar-inner - .container{:style => "position: relative;"} - = link_to(image_tag('branding/header-logo2x.png', :height => 40, :width => 40, :id => 'header_title'), stream_path) + %header + = link_to(image_tag('branding/header-logo2x.png', height: 40, width: 40), stream_path, id: 'header_title') - - if user_signed_in? - #nav_badges - = link_to(image_tag('icons/my_activity.png', :class => 'my_activity'), activity_stream_path, :class => "badge badge-inverse", :id => "my_activity_badge") - = link_to(image_tag('icons/notifications_grey.png', :height => 16, :width => 16, :id => 'notification-flag'), notifications_path, :class => "badge badge-inverse", :id => "notification_badge") - - if current_user.unread_notifications.count > 0 - .badge_count{:id => "notification"} - = current_user.unread_notifications.count - = link_to(image_tag('icons/mail_grey.png', :height => 11, :width => 17), conversations_path, :class => "badge badge-inverse", :id => "conversations_badge") - - if current_user.unread_message_count > 0 - .badge_count{:id => "conversation"} - = current_user.unread_message_count - = link_to(image_tag('icons/search_grey.png', :height => 14, :width => 14), people_path, :class => "badge badge-inverse", :id => "people_badge") - = link_to(image_tag('icons/user_grey.png', :height => 16, :width => 16), contacts_path, :class => "badge badge-inverse", :id => "contacts_badge") - - if yield(:header_action).present? - = yield(:header_action) - - else - = link_to(image_tag('icons/compose_mobile2.png', :class => 'compose_icon'), new_status_message_path) + - if user_signed_in? + #nav_badges + = link_to(image_tag('icons/my_activity.png', class: 'my_activity'), activity_stream_path, class: "badge badge-inverse", id: "my_activity_badge") + = link_to(image_tag('icons/notifications_grey.png', height: 16, width: 16, id: 'notification-flag'), notifications_path, class: "badge badge-inverse", id: "notification_badge") + - if current_user.unread_notifications.count > 0 + .badge_count{id: "notification"} + = current_user.unread_notifications.count + = link_to(image_tag('icons/mail_grey.png', height: 11, width: 17), conversations_path, class: "badge badge-inverse", id: "conversations_badge") + - if current_user.unread_message_count > 0 + .badge_count{id: "conversation"} + = current_user.unread_message_count + = link_to(image_tag('icons/search_grey.png', height: 14, width: 14), people_path, class: "badge badge-inverse", id: "people_badge") + = link_to(image_tag('icons/user_grey.png', height: 16, width: 16), contacts_path, class: "badge badge-inverse", id: "contacts_badge") + - if yield(:header_action).present? + = yield(:header_action) + - else + = link_to(image_tag('icons/compose_mobile2.png', class: 'compose_icon'), new_status_message_path) #main.container{:role => "main"} .row