From 96af4a0aec35f815dbb034c299ed949663cf2590 Mon Sep 17 00:00:00 2001 From: fla Date: Sat, 10 Oct 2015 12:21:43 +0200 Subject: [PATCH] Add header on not connected pages on mobile version --- app/assets/stylesheets/mobile/header.scss | 7 +++ app/views/layouts/_header.mobile.haml | 58 +++++++++++++---------- app/views/layouts/application.mobile.haml | 2 +- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/app/assets/stylesheets/mobile/header.scss b/app/assets/stylesheets/mobile/header.scss index c7c6b9ad8..f5cf6a147 100644 --- a/app/assets/stylesheets/mobile/header.scss +++ b/app/assets/stylesheets/mobile/header.scss @@ -10,6 +10,13 @@ $mobile-navbar-height: 46px; min-height: $mobile-navbar-height !important; max-height: $mobile-navbar-height !important; + .login { + color: $white; + float: right; + font-weight: bold; + padding: 13px; + } + .navbar { margin: 0; padding: 0; diff --git a/app/views/layouts/_header.mobile.haml b/app/views/layouts/_header.mobile.haml index 799c2fc79..5dcaa7795 100644 --- a/app/views/layouts/_header.mobile.haml +++ b/app/views/layouts/_header.mobile.haml @@ -4,32 +4,38 @@ = link_to(image_tag("mobile/asterisk_white_mobile.png", class: "img-responsive"), stream_path, id: "header-title", class: "navbar-brand") - %ul.nav.navbar-nav#nav-badges - -# Notifications - %li - = link_to notifications_path, class: "badge-link", id: "notification-badge" do - %i.entypo-bell - - if current_user.unread_notifications.size > 0 - %span.badge.badge-important#notification - = current_user.unread_notifications.size + - if user_signed_in? + %ul.nav.navbar-nav#nav-badges + -# Notifications + %li + = link_to notifications_path, class: "badge-link", id: "notification-badge" do + %i.entypo-bell + - if current_user.unread_notifications.size > 0 + %span.badge.badge-important#notification + = current_user.unread_notifications.size - -# Conversations - %li - = link_to conversations_path, class: "badge-link", id: "conversations-badge" do - %i.entypo-mail - - if current_user.unread_message_count > 0 - %span.badge.badge-important#conversation - = current_user.unread_message_count + -# Conversations + %li + = link_to conversations_path, class: "badge-link", id: "conversations-badge" do + %i.entypo-mail + - if current_user.unread_message_count > 0 + %span.badge.badge-important#conversation + = current_user.unread_message_count - -# Publisher - %li - = link_to new_status_message_path, class: "badge-link", id: "compose-badge" do - %i.diaspora-custom-compose + -# Publisher + %li + = link_to new_status_message_path, class: "badge-link", id: "compose-badge" do + %i.diaspora-custom-compose - -# Menu - %li - %button.navbar-toggle#menu-badge{type: "button"} - %span.sr-only - %span.icon-bar - %span.icon-bar - %span.icon-bar + -# Menu + %li + %button.navbar-toggle#menu-badge{type: "button"} + %span.sr-only + %span.icon-bar + %span.icon-bar + %span.icon-bar + + - else + - if AppConfig.settings.enable_registrations? && !current_page?(controller: "/registrations", action: :new) + %li= link_to t("devise.shared.links.sign_up"), new_user_registration_path, class: "login" + %li= link_to t("devise.shared.links.sign_in"), new_user_session_path, class: "login" diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 5ba79ce0c..5e398611d 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -51,8 +51,8 @@ = include_gon(:camel_case => true) %body #app + = render "layouts/header" - if user_signed_in? - = render "layouts/header" = render "layouts/drawer" #main{:role => "main"}