Merge pull request #6483 from Flaburgan/add-not-connected-header-to-mobile
Add header on not connected pages on mobile version
This commit is contained in:
commit
67922f8ad4
10 changed files with 83 additions and 79 deletions
|
|
@ -78,6 +78,7 @@ Contributions are very welcome, the hard work is done!
|
||||||
* Correctly display location in post preview [#6429](https://github.com/diaspora/diaspora/pull/6429)
|
* Correctly display location in post preview [#6429](https://github.com/diaspora/diaspora/pull/6429)
|
||||||
* Do not fail when submitting an empty comment in the mobile view [#6543](https://github.com/diaspora/diaspora/pull/6543)
|
* Do not fail when submitting an empty comment in the mobile view [#6543](https://github.com/diaspora/diaspora/pull/6543)
|
||||||
* Limit flash message width on small devices [#6529](https://github.com/diaspora/diaspora/pull/6529)
|
* Limit flash message width on small devices [#6529](https://github.com/diaspora/diaspora/pull/6529)
|
||||||
|
* Add navbar on mobile when not logged in [#6483](https://github.com/diaspora/diaspora/pull/6483)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Support color themes [#6033](https://github.com/diaspora/diaspora/pull/6033)
|
* Support color themes [#6033](https://github.com/diaspora/diaspora/pull/6033)
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,12 @@ $mobile-navbar-height: 46px;
|
||||||
min-height: $mobile-navbar-height !important;
|
min-height: $mobile-navbar-height !important;
|
||||||
max-height: $mobile-navbar-height !important;
|
max-height: $mobile-navbar-height !important;
|
||||||
|
|
||||||
|
.login {
|
||||||
|
color: $white;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
@ -17,6 +23,16 @@ $mobile-navbar-height: 46px;
|
||||||
min-height: $mobile-navbar-height;
|
min-height: $mobile-navbar-height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-nav {
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-top: 0;
|
||||||
|
li { float: left; }
|
||||||
|
}
|
||||||
|
|
||||||
#header-title {
|
#header-title {
|
||||||
padding: 7px 15px;
|
padding: 7px 15px;
|
||||||
margin: 0 0 0 -15px;
|
margin: 0 0 0 -15px;
|
||||||
|
|
|
||||||
|
|
@ -652,24 +652,11 @@ input#user_password, #user_username, #user_password_confirmation, #user_email {
|
||||||
padding: 1px
|
padding: 1px
|
||||||
}
|
}
|
||||||
|
|
||||||
.session_mobile {
|
|
||||||
margin-top: -55px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1.session {
|
h1.session {
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
font-weight: 200;
|
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 {
|
form p.checkbox_select {
|
||||||
position: relative;
|
position: relative;
|
||||||
label {
|
label {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,4 @@
|
||||||
= link_to AppConfig.settings.pod_name, root_path, class: "navbar-brand"
|
= link_to AppConfig.settings.pod_name, root_path, class: "navbar-brand"
|
||||||
|
|
||||||
.collapse.navbar-collapse#navbar-collapse
|
.collapse.navbar-collapse#navbar-collapse
|
||||||
%ul.nav.navbar-nav.navbar-right
|
= render "layouts/header_not_connected"
|
||||||
- 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'
|
|
||||||
|
|
|
||||||
|
|
@ -4,32 +4,36 @@
|
||||||
= link_to(image_tag("mobile/asterisk_white_mobile.png", class: "img-responsive"),
|
= link_to(image_tag("mobile/asterisk_white_mobile.png", class: "img-responsive"),
|
||||||
stream_path, id: "header-title", class: "navbar-brand")
|
stream_path, id: "header-title", class: "navbar-brand")
|
||||||
|
|
||||||
%ul.nav.navbar-nav#nav-badges
|
- if user_signed_in?
|
||||||
-# Notifications
|
%ul.nav.navbar-nav#nav-badges
|
||||||
%li
|
-# Notifications
|
||||||
= link_to notifications_path, class: "badge-link", id: "notification-badge" do
|
%li
|
||||||
%i.entypo-bell
|
= link_to notifications_path, class: "badge-link", id: "notification-badge" do
|
||||||
- if current_user.unread_notifications.size > 0
|
%i.entypo-bell
|
||||||
%span.badge.badge-important#notification
|
- if current_user.unread_notifications.size > 0
|
||||||
= current_user.unread_notifications.size
|
%span.badge.badge-important#notification
|
||||||
|
= current_user.unread_notifications.size
|
||||||
|
|
||||||
-# Conversations
|
-# Conversations
|
||||||
%li
|
%li
|
||||||
= link_to conversations_path, class: "badge-link", id: "conversations-badge" do
|
= link_to conversations_path, class: "badge-link", id: "conversations-badge" do
|
||||||
%i.entypo-mail
|
%i.entypo-mail
|
||||||
- if current_user.unread_message_count > 0
|
- if current_user.unread_message_count > 0
|
||||||
%span.badge.badge-important#conversation
|
%span.badge.badge-important#conversation
|
||||||
= current_user.unread_message_count
|
= current_user.unread_message_count
|
||||||
|
|
||||||
-# Publisher
|
-# Publisher
|
||||||
%li
|
%li
|
||||||
= link_to new_status_message_path, class: "badge-link", id: "compose-badge" do
|
= link_to new_status_message_path, class: "badge-link", id: "compose-badge" do
|
||||||
%i.diaspora-custom-compose
|
%i.diaspora-custom-compose
|
||||||
|
|
||||||
-# Menu
|
-# Menu
|
||||||
%li
|
%li
|
||||||
%button.navbar-toggle#menu-badge{type: "button"}
|
%button.navbar-toggle#menu-badge{type: "button"}
|
||||||
%span.sr-only
|
%span.sr-only
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
|
|
||||||
|
- else
|
||||||
|
= render "layouts/header_not_connected"
|
||||||
|
|
|
||||||
4
app/views/layouts/_header_not_connected.haml
Normal file
4
app/views/layouts/_header_not_connected.haml
Normal file
|
|
@ -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"
|
||||||
|
|
@ -51,8 +51,8 @@
|
||||||
= include_gon(:camel_case => true)
|
= include_gon(:camel_case => true)
|
||||||
%body
|
%body
|
||||||
#app
|
#app
|
||||||
|
= render "layouts/header"
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
= render "layouts/header"
|
|
||||||
= render "layouts/drawer"
|
= render "layouts/drawer"
|
||||||
|
|
||||||
#main{:role => "main"}
|
#main{:role => "main"}
|
||||||
|
|
|
||||||
|
|
@ -2,42 +2,37 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
.session_mobile
|
.stream#main_stream
|
||||||
.landing
|
- flash.each do |name, msg|
|
||||||
%h1.session
|
.expose#flash-container
|
||||||
= pod_name
|
.flash-message{class: "message alert alert-#{flash_class name}"}
|
||||||
|
= msg
|
||||||
|
|
||||||
#main_stream.stream
|
#login_form
|
||||||
- flash.each do |name, msg|
|
.login-container
|
||||||
.expose#flash-container
|
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
||||||
.flash-message{class: "message alert alert-#{flash_class name}"}
|
%fieldset
|
||||||
= msg
|
%legend
|
||||||
|
= image_tag("branding/logos/header-logo2x.png", height: 40, width: 40)
|
||||||
|
= t("devise.sessions.new.login")
|
||||||
|
|
||||||
#login_form
|
.form-group
|
||||||
.login-container
|
= f.label :username, t("username")
|
||||||
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
= f.text_field :username, autofocus: true, class: "form-control", autocapitalize: "none", autocorrect: "off"
|
||||||
%fieldset
|
|
||||||
%legend
|
|
||||||
= image_tag("branding/logos/header-logo2x.png", height: 40, width: 40)
|
|
||||||
= t("devise.sessions.new.login")
|
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
= f.label :username, t("username")
|
= f.label :password, t("password")
|
||||||
= f.text_field :username, autofocus: true, class: "form-control", autocapitalize: "none", autocorrect: "off"
|
= f.password_field :password, class: "form-control"
|
||||||
|
= hidden_field(:user, :remember_me, value: 1)
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
= f.label :password , t("password")
|
= f.submit t("devise.sessions.new.sign_in"), class: "btn btn-primary"
|
||||||
= f.password_field :password, class: "form-control"
|
- if display_registration_link?
|
||||||
= hidden_field(:user, :remember_me, value: 1)
|
= link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name),
|
||||||
|
class: "btn btn-default pull-right"
|
||||||
|
|
||||||
.form-group
|
%footer
|
||||||
= f.submit t("devise.sessions.new.sign_in"), class: "btn btn-primary"
|
- if display_password_reset_link?
|
||||||
- if display_registration_link?
|
= link_to t("devise.passwords.new.forgot_password"), new_password_path(resource_name)
|
||||||
= link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name),
|
|
||||||
class: "btn btn-default pull-right"
|
|
||||||
|
|
||||||
%footer
|
= link_to t("layouts.application.toggle"), toggle_mobile_path
|
||||||
- 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
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ Feature: editing the getting started in the mobile view
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I am on the login page
|
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 fill in the new user form
|
||||||
And I submit the form
|
And I submit the form
|
||||||
Then I should be on the getting started page
|
Then I should be on the getting started page
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Feature: New user registration
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I am on the login page
|
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
|
Scenario: user signs up and goes to getting started
|
||||||
When I fill in the new user form
|
When I fill in the new user form
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue