Browse Source

forward with the b2 design

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
c51b5f088d
  1. 3
      app/assets/stylesheets/application.css.scss
  2. 4
      app/assets/stylesheets/overrides.css.scss
  3. 30
      app/assets/stylesheets/pages/domains.css.scss
  4. 8
      app/assets/stylesheets/pages/edit_account.css.scss
  5. 29
      app/assets/stylesheets/theme/error_explanation.css.scss
  6. 22
      app/assets/stylesheets/theme/errors.css.scss
  7. 9
      app/helpers/application_helper.rb
  8. 4
      app/views/devise/confirmations/new.html.erb
  9. 4
      app/views/devise/passwords/edit.html.erb
  10. 4
      app/views/devise/passwords/new.html.erb
  11. 68
      app/views/devise/registrations/edit.html.erb
  12. 43
      app/views/devise/registrations/new.html.erb
  13. 33
      app/views/devise/sessions/new.html.erb
  14. 4
      app/views/devise/unlocks/new.html.erb

3
app/assets/stylesheets/application.css.scss

@ -4,8 +4,7 @@
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require theme/error_explanation
*= require pages/edit_account
*= require theme/errors
*= require pages/domains
*= require slides
*/

4
app/assets/stylesheets/overrides.css.scss

@ -1,3 +1,7 @@
.active-scaffold-header div.actions {
top: 0;
}
.active-scaffold {
input[type="submit"], input[type="reset"], button {
@extend .btn;

30
app/assets/stylesheets/pages/domains.css.scss

@ -3,33 +3,3 @@
font-weight: bold;
text-shadow: none;
}
#as_domains-active-scaffold tr.shared-domain {
&.record {
background-color: mix(#E6F2FF, lighten(yellow, 30%));
}
&.record td {
border-bottom: solid 1px #C5DBF7;
border-left: solid 1px #C5DBF7;
}
&.even-record {
background-color: mix(#fff, lighten(yellow, 40%));
}
&.even-record td {
border-left-color: #ddd;
}
&.record td.sorted {
background-color: mix(#B9DCFF, lighten(yellow, 30%));
border-bottom-color: #AFD0F5;
}
&.even-record td.sorted {
background-color: mix(#E6F2FF, lighten(yellow, 40%));
border-bottom-color: #AFD0F5;
}
&.record td.actions table td {
border: none;
}
}

8
app/assets/stylesheets/pages/edit_account.css.scss

@ -1,8 +0,0 @@
.danger-zone {
h3 {
color: #cc4831;
}
p {
color: #cc4831;
}
}

29
app/assets/stylesheets/theme/error_explanation.css.scss

@ -1,29 +0,0 @@
@import 'compass/css3/border-radius';
@import 'compass/css3/text-shadow';
.content {
#error_explanation {
@include border-top-radius(6px);
border-left: 1px solid #993624;
border-right: 1px solid #993624;
border-bottom: 1px solid #993624;
h2 {
background-color: #cc4831;
color: white;
padding: 10px 15px;
margin: 0;
@include text-shadow(none);
@include border-top-radius(6px);
}
}
.field_with_errors {
display: inline;
label {
color: #cc4831;
}
input, textarea, select {
border: 1px solid #cc4831;
}
}
}

22
app/assets/stylesheets/theme/errors.css.scss

@ -0,0 +1,22 @@
@import 'compass/css3/border-radius';
@import 'twitter/bootstrap/variables';
@import 'twitter/bootstrap/alerts';
#error_explanation {
@extend .alert;
@extend .alert-error;
h2 {
color: $errorText;
}
}
.field_with_errors {
display: table;
label {
color: $errorText;
}
input, textarea, select {
border: 1px solid $errorBorder;;
}
}

9
app/helpers/application_helper.rb

@ -1,11 +1,18 @@
module ApplicationHelper
FLASH_ALIASES = HashWithIndifferentAccess.new(
error: :error, success: :success,
alert: :alert, warning: :alert, warn: :alert,
info: :info, notice: :info
)
# for each record in the rails flash this
# function wraps the message in an appropriate div
# and displays it
def flash_display(clazz = '')
flashes = flash.select{|key, msg| msg.present?}.collect { |key, msg|
content_tag :div, msg, :class => "message #{key}"
content = '<a class="close" data-dismiss="alert">Ă—</a> '.html_safe + msg
content_tag(:div, content, :class => "alert alert-#{FLASH_ALIASES[key]}")
}.join
flashes.present? ? content_tag(:div, flashes.html_safe, :class => clazz) : nil
end

4
app/views/devise/confirmations/new.html.erb

@ -1,4 +1,6 @@
<h2>Resend confirmation instructions</h2>
<div class="page-header">
<h1>Resend confirmation instructions</h1>
</div>
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>

4
app/views/devise/passwords/edit.html.erb

@ -1,4 +1,6 @@
<h2>Change your password</h2>
<div class="page-header">
<h1>Change your password</h1>
</div>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>

4
app/views/devise/passwords/new.html.erb

@ -1,4 +1,6 @@
<h2>Forgot your password?</h2>
<div class="page-header">
<h1>Forgot your password?</h1>
</div>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>

68
app/views/devise/registrations/edit.html.erb

@ -1,48 +1,40 @@
<div id="box">
<div class="block" id="block-login">
<div class="page-header">
<h1>Edit <%= resource_name.to_s.humanize %></h1>
</div>
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<div class="content login">
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name),
:html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name),
:html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :first_name %>
<%= f.text_field :first_name %></div>
<div><%= f.label :first_name %>
<%= f.text_field :first_name %></div>
<div><%= f.label :last_name %>
<%= f.text_field :last_name %></div>
<div><%= f.label :last_name %>
<%= f.text_field :last_name %></div>
<div><%= f.label :email %>
<%= f.email_field :email %></div>
<div><%= f.label :email %>
<%= f.email_field :email %></div>
<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password %></div>
<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password %></div>
<div><%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %></div>
<div><%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %></div>
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password %></div>
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password %></div>
<div><%= f.submit "Update", class: 'btn-primary' %>
<%= link_to "Back", :back %></div>
<% end %>
<div><%= f.submit "Update", class: 'btn-primary' %>
<%= link_to "Back", :back %></div>
<% end %>
<hr />
<hr />
<div class="danger-zone">
<h3>Danger zone</h3>
<p>
If you cancel your account all your data will be deleted!
<%= button_to "Cancel account", registration_path(resource_name),
class: 'btn-danger',
confirm: "All your data will be deleted! Are you sure?",
method: :delete %>
</p>
</div>
</div>
</div>
</div>
<div class="alert alert-error">
<h3>Danger zone</h3>
<%= link_to "Cancel account", registration_path(resource_name),
class: 'btn btn-danger pull-right',
confirm: "All your data will be deleted! Are you sure?",
method: :delete %>
<p>If you cancel your account all your data will be deleted!</p>
</div>

43
app/views/devise/registrations/new.html.erb

@ -1,33 +1,28 @@
<div id="box">
<div class="block" id="block-login">
<h2>Sign up</h2>
<div class="content login">
<div class="page-header">
<h1>Sign up</h1>
</div>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<%= honeypot %>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :first_name %>
<%= f.text_field :first_name %></div>
<%= honeypot %>
<div><%= f.label :last_name %>
<%= f.text_field :last_name %></div>
<div><%= f.label :first_name %>
<%= f.text_field :first_name %></div>
<div><%= f.label :email %>
<%= f.email_field :email %></div>
<div><%= f.label :last_name %>
<%= f.text_field :last_name %></div>
<div><%= f.label :password %>
<%= f.password_field :password %>
<div><%= f.label :email %>
<%= f.email_field :email %></div>
<div><%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %></div>
<div><%= f.label :password %>
<%= f.password_field :password %>
<div><%= f.submit "Sign up", class: 'btn-primary' %></div>
<% end %>
<div><%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %></div>
<%= render :partial => "devise/shared/links" %>
<div><%= f.submit "Sign up", class: 'btn-primary' %></div>
<% end %>
</div>
</div>
</div>
<%= render :partial => "devise/shared/links" %>

33
app/views/devise/sessions/new.html.erb

@ -1,24 +1,19 @@
<div id="box">
<div class="block" id="block-login">
<h2>Sign in</h2>
<div class="content login">
<div class="page-header">
<h1>Sign in</h1>
</div>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div><%= f.label :email %>
<%= f.email_field :email %></div>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div><%= f.label :email %>
<%= f.email_field :email %></div>
<div><%= f.label :password %>
<%= f.password_field :password %></div>
<div><%= f.label :password %>
<%= f.password_field :password %></div>
<% if devise_mapping.rememberable? -%>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
<% end -%>
<% if devise_mapping.rememberable? -%>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
<% end -%>
<div><%= f.submit "Sign in", class: 'btn-primary' %></div>
<% end %>
<div><%= f.submit "Sign in", class: 'btn-primary' %></div>
<% end %>
<%= render :partial => "devise/shared/links" %>
</div>
</div>
</div>
<%= render :partial => "devise/shared/links" %>

4
app/views/devise/unlocks/new.html.erb

@ -1,4 +1,6 @@
<h2>Resend unlock instructions</h2>
<div class="page-header">
<h1>Resend unlock instructions</h1>
</div>
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>

Loading…
Cancel
Save