Merge pull request #1337 from consul/devise-views

Devise views
This commit is contained in:
Juanjo Bazán
2017-01-11 12:38:41 +01:00
committed by GitHub
10 changed files with 149 additions and 80 deletions

View File

@@ -600,12 +600,28 @@ h2.sidebar-title {
// --------------
.auth-page {
.wrapper {
margin: 0 auto (-$line-height)*14;
}
}
.auth-image {
background: $brand image-url("auth_bg.jpg");
background-repeat: no-repeat;
background-size: cover;
h1:not(.logo) {
@include logo;
@include breakpoint(medium) {
min-height: $line-height*42;
}
h1 {
margin-top: $line-height;
img {
height: rem-calc(80);
width: rem-calc(80);
}
a {
color: white;
@@ -621,15 +637,27 @@ h2.sidebar-title {
}
}
.auth {
.auth-form {
@include breakpoint(medium) {
padding-top: $line-height*4;
}
p, a, .checkbox {
font-size: $small-font-size;
}
}
.panel {
.auth-divider {
border-bottom: 1px solid $border;
height: $line-height/2;
margin: $line-height 0;
text-align: center;
span {
background: white;
border: 0;
font-weight: bold;
padding: 0 $line-height/2;
}
}

View File

@@ -1,35 +1,78 @@
<% if feature?(:twitter_login) || feature?(:facebook_login) || feature?(:google_login) %>
<% if current_page?(new_user_session_path) %>
<div class="row">
<div class="small-12 column">
<div class="margin-bottom text-center">
<strong><%= t("omniauth.info_sign_in") %></strong>
</div>
</div>
<% if feature? :twitter_login %>
<%= link_to t("omniauth.twitter.sign_in"), user_omniauth_authorize_path(:twitter), class: "button-twitter button expanded" %>
<% end %>
<% if feature? :twitter_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.twitter.name"), user_omniauth_authorize_path(:twitter),
title: t("omniauth.twitter.sign_in"),
class: "button-twitter button expanded" %>
</div>
<% end %>
<% if feature? :facebook_login %>
<%= link_to t("omniauth.facebook.sign_in"), user_omniauth_authorize_path(:facebook), class: "button-facebook button expanded" %>
<% end %>
<% if feature? :facebook_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.facebook.name"), user_omniauth_authorize_path(:facebook),
title: t("omniauth.facebook.sign_in"),
class: "button-facebook button expanded" %>
</div>
<% end %>
<% if feature? :google_login %>
<%= link_to t("omniauth.google_oauth2.sign_in"), user_omniauth_authorize_path(:google_oauth2), class: "button-google button expanded" %>
<% end %>
<% if feature? :google_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.google_oauth2.name"), user_omniauth_authorize_path(:google_oauth2),
title: t("omniauth.google_oauth2.sign_in"),
class: "button-google button expanded" %>
</div>
<% end %>
<div class="small-12 column auth-divider">
<span><%= t("omniauth.or_fill") %></span>
</div>
</div>
<hr/>
<% elsif current_page?(new_user_registration_path) %>
<div class="row">
<div class="small-12 column">
<div class="margin-bottom text-center">
<strong><%= t("omniauth.info_sign_up") %></strong>
</div>
</div>
<% if feature? :twitter_login %>
<%= link_to t("omniauth.twitter.sign_up"), user_omniauth_authorize_path(:twitter), class: "button-twitter button expanded" %>
<% end %>
<% if feature? :twitter_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.twitter.name"), user_omniauth_authorize_path(:twitter),
title: t("omniauth.twitter.sign_up"),
class: "button-twitter button expanded" %>
</div>
<% end %>
<% if feature? :facebook_login %>
<%= link_to t("omniauth.facebook.sign_up"), user_omniauth_authorize_path(:facebook), class: "button-facebook button expanded" %>
<% end %>
<% if feature? :facebook_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.facebook.name"), user_omniauth_authorize_path(:facebook),
title: t("omniauth.facebook.sign_up"),
class: "button-facebook button expanded" %>
</div>
<% end %>
<% if feature? :google_login %>
<%= link_to t("omniauth.google_oauth2.sign_up"), user_omniauth_authorize_path(:google_oauth2), class: "button-google button expanded" %>
<% end %>
<% if feature? :google_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.google_oauth2.name"), user_omniauth_authorize_path(:google_oauth2),
title: t("omniauth.google_oauth2.sign_up"),
class: "button-google button expanded" %>
</div>
<% end %>
<hr/>
<div class="small-12 column auth-divider">
<span><%= t("omniauth.or_fill") %></span>
</div>
</div>
<% end %>
<% end %>

View File

@@ -15,7 +15,9 @@
<%= hidden_field_tag :confirmation_token,@confirmation_token %>
<%= f.submit(t("devise_views.confirmations.new.submit"), class: "button expanded") %>
<div class="small-12 medium-6 small-centered">
<%= f.submit(t("devise_views.confirmations.new.submit"), class: "button expanded") %>
</div>
</div>
<% end %>

View File

@@ -7,7 +7,9 @@
<div class="small-12 column">
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.passwords.new.email_label") %>
<%= f.submit t("devise_views.passwords.new.send_submit"), class: "button expanded" %>
<div class="small-12 medium-6 small-centered">
<%= f.submit t("devise_views.passwords.new.send_submit"), class: "button expanded" %>
</div>
</div>
<% end %>

View File

@@ -10,17 +10,17 @@
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="row">
<div class="small-12 columns">
<div class="small-12 column">
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.sessions.new.email_label"), tabindex: "1" %>
</div>
<div class="small-12 columns">
<div class="small-12 column">
<%= link_to t("devise_views.shared.links.new_password"), new_password_path(resource_name), class: "float-right", tabindex: "3" %>
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.sessions.new.password_label"), tabindex: "2" %>
</div>
<% if devise_mapping.rememberable? -%>
<div class="small-12 columns">
<div class="small-12 column">
<%= f.label :remember_me do %>
<%= f.check_box :remember_me, title: t('devise_views.sessions.new.remember_me'), label: false, tabindex: "4" %>
<span class="checkbox"><%= t("devise_views.sessions.new.remember_me") %></span>
@@ -28,7 +28,7 @@
</div>
<% end -%>
<div class="small-12 columns">
<div class="small-12 medium-6 small-centered">
<%= f.submit(t("devise_views.sessions.new.submit"), class: "button expanded") %>
</div>
</div>

View File

@@ -13,28 +13,28 @@
</head>
<body class="auth-page">
<div class="wrapper margin-top">
<div class="row">
<div class="small-12 medium-8 large-5 column small-centered margin-top">
<h1>
<%= link_to root_path do %>
<%= image_tag('logo_header.png', class: 'show-for-medium float-left', size: '96x96', alt: t("layouts.header.logo")) %>
<%= t("layouts.header.open_gov", open: "#{t('layouts.header.open')}").html_safe %>
<% end %>
</h1>
<div class="wrapper">
<div class="auth-image small-12 medium-3 column">
<h1 class="logo margin">
<%= link_to root_path do %>
<%= image_tag('logo_header.png', class: 'float-left', alt: t("layouts.header.logo")) %>
<%= setting['org_name'] %>
<% end %>
</h1>
</div>
<div class="small-12 medium-9 column">
<div class="row">
<div class="small-12 medium-9 large-7 small-centered column">
<div class="auth-form margin">
<%= render 'layouts/flash' %>
<%= yield %>
</div>
</div>
</div>
</div>
<div class="row auth">
<main>
<div class="small-12 medium-8 large-5 column small-centered panel padding margin-bottom">
<%= render 'layouts/flash' %>
<%= yield %>
</div>
</main>
</div>
<div class="push"></div>
</div>

View File

@@ -33,8 +33,9 @@
terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions", title: t('shared.target_blank_html'), target: "_blank")).html_safe %></span>
<% end %>
<%= f.submit t("devise_views.organizations.registrations.new.submit"), class: "button expanded" %>
<div class="small-12 medium-6 small-centered">
<%= f.submit t("devise_views.organizations.registrations.new.submit"), class: "button expanded" %>
</div>
</div>
</div>
<% end %>

View File

@@ -46,8 +46,9 @@
target: "_blank")).html_safe %>
</span>
<% end %>
<%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %>
<div class="small-12 medium-6 small-centered">
<%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %>
</div>
</div>
</div>
<% end %>