From 96af4a0aec35f815dbb034c299ed949663cf2590 Mon Sep 17 00:00:00 2001 From: fla Date: Sat, 10 Oct 2015 12:21:43 +0200 Subject: [PATCH 1/3] 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"} From 119ded6fdceaa3e2005bcab517e606906f91b9e5 Mon Sep 17 00:00:00 2001 From: fla Date: Sat, 24 Oct 2015 15:07:52 +0200 Subject: [PATCH 2/3] remove landing header on sign in mobile page --- app/assets/stylesheets/mobile/mobile.scss | 13 ----- app/views/sessions/new.mobile.haml | 61 +++++++++++------------ features/mobile/getting_started.feature | 2 +- features/mobile/signs_up.feature | 2 +- 4 files changed, 30 insertions(+), 48 deletions(-) diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index 4ad15e0e3..022d05e99 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -651,24 +651,11 @@ input#user_password, #user_username, #user_password_confirmation, #user_email { padding: 1px } -.session_mobile { - margin-top: -55px; -} - h1.session { font-size: 40px; font-weight: 200; } -.landing { - padding: 20px; - margin: -10px -20px 10px -20px; - background-color:#4b4b4b; - z-index: 10; - position: relative; - text-align: center; -} - form p.checkbox_select { position: relative; label { diff --git a/app/views/sessions/new.mobile.haml b/app/views/sessions/new.mobile.haml index 799839fa5..e33a4bd9a 100644 --- a/app/views/sessions/new.mobile.haml +++ b/app/views/sessions/new.mobile.haml @@ -2,42 +2,37 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -.session_mobile - .landing - %h1.session - = pod_name +.stream#main_stream + - flash.each do |name, msg| + .expose#flash-container + .flash-message{class: "message alert alert-#{flash_class name}"} + = msg - #main_stream.stream - - flash.each do |name, msg| - .expose#flash-container - .flash-message{class: "message alert alert-#{flash_class name}"} - = msg + #login_form + .login-container + = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| + %fieldset + %legend + = image_tag("branding/logos/header-logo2x.png", height: 40, width: 40) + = t("devise.sessions.new.login") - #login_form - .login-container - = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| - %fieldset - %legend - = image_tag("branding/logos/header-logo2x.png", height: 40, width: 40) - = t("devise.sessions.new.login") + .form-group + = f.label :username, t("username") + = f.text_field :username, autofocus: true, class: "form-control", autocapitalize: "none", autocorrect: "off" - .form-group - = f.label :username, t("username") - = f.text_field :username, autofocus: true, class: "form-control", autocapitalize: "none", autocorrect: "off" + .form-group + = f.label :password, t("password") + = f.password_field :password, class: "form-control" + = hidden_field(:user, :remember_me, value: 1) - .form-group - = f.label :password , t("password") - = f.password_field :password, class: "form-control" - = hidden_field(:user, :remember_me, value: 1) + .form-group + = f.submit t("devise.sessions.new.sign_in"), class: "btn btn-primary" + - if display_registration_link? + = link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name), + class: "btn btn-default pull-right" - .form-group - = f.submit t("devise.sessions.new.sign_in"), class: "btn btn-primary" - - if display_registration_link? - = link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name), - class: "btn btn-default pull-right" +%footer + - if display_password_reset_link? + = link_to t("devise.passwords.new.forgot_password"), new_password_path(resource_name) - %footer - - if display_password_reset_link? - = link_to t("devise.passwords.new.forgot_password"), new_password_path(resource_name) - - = link_to t("layouts.application.toggle"), toggle_mobile_path + = link_to t("layouts.application.toggle"), toggle_mobile_path diff --git a/features/mobile/getting_started.feature b/features/mobile/getting_started.feature index 7e51ec151..3e60a0c5b 100644 --- a/features/mobile/getting_started.feature +++ b/features/mobile/getting_started.feature @@ -3,7 +3,7 @@ Feature: editing the getting started in the mobile view Background: Given I am on the login page - When I follow "Sign up" + When I follow "Sign up" within ".navbar" And I fill in the new user form And I submit the form Then I should be on the getting started page diff --git a/features/mobile/signs_up.feature b/features/mobile/signs_up.feature index a17a1a085..6eb75c3f9 100644 --- a/features/mobile/signs_up.feature +++ b/features/mobile/signs_up.feature @@ -6,7 +6,7 @@ Feature: New user registration Background: Given I am on the login page - And I follow "Sign up" + And I follow "Sign up" within "#login_form" Scenario: user signs up and goes to getting started When I fill in the new user form From 3a1235e2b2c75f7dcace24cd110908b2b444d422 Mon Sep 17 00:00:00 2001 From: fla Date: Tue, 29 Dec 2015 23:24:23 +0100 Subject: [PATCH 3/3] Unify not connected header on desktop and mobile --- app/assets/stylesheets/mobile/header.scss | 11 ++++++++++- app/views/layouts/_header.html.haml | 5 +---- app/views/layouts/_header.mobile.haml | 4 +--- app/views/layouts/_header_not_connected.haml | 4 ++++ 4 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 app/views/layouts/_header_not_connected.haml diff --git a/app/assets/stylesheets/mobile/header.scss b/app/assets/stylesheets/mobile/header.scss index f5cf6a147..20123442b 100644 --- a/app/assets/stylesheets/mobile/header.scss +++ b/app/assets/stylesheets/mobile/header.scss @@ -12,7 +12,6 @@ $mobile-navbar-height: 46px; .login { color: $white; - float: right; font-weight: bold; padding: 13px; } @@ -24,6 +23,16 @@ $mobile-navbar-height: 46px; min-height: $mobile-navbar-height; } + .navbar-right { + float: right; + } + + .navbar-nav { + margin-bottom: 0; + margin-top: 0; + li { float: left; } + } + #header-title { padding: 7px 15px; margin: 0 0 0 -15px; diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 2f281b09e..e7ee595a3 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -19,7 +19,4 @@ = link_to AppConfig.settings.pod_name, root_path, class: "navbar-brand" .collapse.navbar-collapse#navbar-collapse - %ul.nav.navbar-nav.navbar-right - - 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' + = render "layouts/header_not_connected" diff --git a/app/views/layouts/_header.mobile.haml b/app/views/layouts/_header.mobile.haml index 5dcaa7795..05f2549a7 100644 --- a/app/views/layouts/_header.mobile.haml +++ b/app/views/layouts/_header.mobile.haml @@ -36,6 +36,4 @@ %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" + = render "layouts/header_not_connected" diff --git a/app/views/layouts/_header_not_connected.haml b/app/views/layouts/_header_not_connected.haml new file mode 100644 index 000000000..a3d1bcae3 --- /dev/null +++ b/app/views/layouts/_header_not_connected.haml @@ -0,0 +1,4 @@ +%ul.nav.navbar-nav.navbar-right + - 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"