haml clean up for devise views

This commit is contained in:
Brenda Wallace
2017-02-10 21:09:16 +13:00
parent 0f520c0928
commit 93202fc13c
14 changed files with 119 additions and 90 deletions

View File

@@ -1,17 +1,21 @@
- content_for :title, "Resend confirmation instructions"
= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) do |f|
= form_for(resource, as: resource_name,
url: confirmation_path(resource_name),
html: { method: :post,
class: 'form-horizontal',
role: 'form' }) do |f|
= devise_error_messages!
%p Enter either your login name or your email address to resend the confirmation email.
.form-group
= f.label :login, :class => 'control-label col-md-2'
= f.label :login, class: 'control-label col-md-2'
.col-md-8
= f.text_field :login, :class => 'form-control'
= f.text_field :login, class: 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Resend confirmation instructions", :class => 'btn btn-primary'
= f.submit "Resend confirmation instructions", class: 'btn btn-primary'
.form-group
.col-md-offset-2.col-md-8

View File

@@ -5,7 +5,7 @@
Your account on #{site_name} has been created. You just need to confirm
your email address through the link below:
%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token)
%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token)
%p
Once you're confirmed, you can sign in with your login name
@@ -17,9 +17,9 @@
We're excited to have you as a member, and hope you'll enjoy
what #{site_name} has to offer. Take a look around the site,
= succeed "," do
= link_to('plant some things', url_for(:controller => '/crops', :only_path => false))
= link_to('plant some things', url_for(controller: '/crops', only_path: false))
and feel free to drop in on the
= link_to 'forums', url_for(:controller => '/forums', :only_path => false)
= link_to 'forums', url_for(controller: '/forums', only_path: false)
if you have any questions or feedback.
%p

View File

@@ -5,7 +5,7 @@
Someone has requested a link to reset your password on #{site_name}.
We presume this was you, in which case you can do so through this link:
%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token)
%p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token)
%p
If it wasn't you, then someone's made a typo or has been messing
@@ -17,5 +17,5 @@
%p
The #{site_name} team.
%br/
=link_to root_url, root_url
= link_to root_url, root_url

View File

@@ -8,7 +8,7 @@
forgotten your password. In either case, use the link below to unlock
your account:
%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token)
%p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token)
%p
If you have actually forgotten your password, you can
@@ -20,4 +20,4 @@
%p
The #{site_name} team.
%br/
=link_to root_url, root_url
= link_to root_url, root_url

View File

@@ -1,21 +1,23 @@
- content_for :title, "Change your password"
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => 'form-horizontal', :role => 'form' }) do |f|
= form_for(resource, as: resource_name,
url: password_path(resource_name),
html: { method: :put, class: 'form-horizontal', role: 'form' }) do |f|
= devise_error_messages!
= f.hidden_field :reset_password_token
.form-group
= f.label :password, "New password", :class => 'control-label col-md-2'
= f.label :password, "New password", class: 'control-label col-md-2'
.col-md-8
= f.password_field :password, :class => 'form-control'
= f.password_field :password, class: 'form-control'
.form-group
= f.label :password_confirmation, "Confirm new password", :class => 'control-label col-md-2'
= f.label :password_confirmation, "Confirm new password", class: 'control-label col-md-2'
.col-md-8
= f.password_field :password_confirmation, :class => 'form-control'
= f.password_field :password_confirmation, class: 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Change my password", :class => 'btn btn-primary'
= f.submit "Change my password", class: 'btn btn-primary'
= render "devise/shared/links"

View File

@@ -1,15 +1,18 @@
- content_for :title, "Forgot your password?"
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) do |f|
= form_for(resource, as: resource_name,
url: password_path(resource_name),
html: { method: :post,
class: 'form-horizontal', role: 'form' }) do |f|
= devise_error_messages!
.form-group
= f.label :login, :class => 'control-label col-md-2'
= f.label :login, class: 'control-label col-md-2'
.col-md-8
= f.text_field :login, :class => 'form-control'
= f.text_field :login, class: 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Send me reset password instructions", :class => 'btn btn-primary'
= f.submit "Send me reset password instructions", class: 'btn btn-primary'
.form-group
.col-md-offset-2.col-md-8

View File

@@ -1,39 +1,47 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= form_for(resource, as: resource_name,
url: registration_path(resource_name),
html: { method: :put, class: 'form-horizontal' }) do |_f|
%br/
= devise_error_messages!
.row
.col-md-12
%p
= image_tag "twitter_32.png", :size => "32x32", :alt => 'Twitter logo'
= image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo'
- if @twitter_auth
You are connected to Twitter as
= succeed "." do
=link_to @twitter_auth.name, "http://twitter.com/#{@twitter_auth.name}"
= link_to "Disconnect", @twitter_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove"
= link_to @twitter_auth.name, "http://twitter.com/#{@twitter_auth.name}"
= link_to "Disconnect", @twitter_auth,
confirm: "Are you sure you want to remove this connection?",
method: :delete, class: "remove"
- else
=link_to 'Connect to Twitter', '/auth/twitter'
= link_to 'Connect to Twitter', '/auth/twitter'
.row
.col-md-12
%p
= image_tag "flickr_32.png", :size => "32x32", :alt => 'Flickr logo'
= image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo'
- if @flickr_auth
You are connected to Flickr as
= succeed "." do
=link_to @flickr_auth.name, "http://flickr.com/photos/#{@flickr_auth.uid}"
= link_to "Disconnect", @flickr_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove"
= link_to @flickr_auth.name, "http://flickr.com/photos/#{@flickr_auth.uid}"
= link_to "Disconnect", @flickr_auth,
confirm: "Are you sure you want to remove this connection?",
method: :delete, class: "remove"
- else
=link_to 'Connect to Flickr', '/auth/flickr'
= link_to 'Connect to Flickr', '/auth/flickr'
.row
.col-md-12
%p
= image_tag "facebook_32.png", :size => "32x32", :alt => 'Facebook logo'
= image_tag "facebook_32.png", size: "32x32", alt: 'Facebook logo'
- if @facebook_auth
You are connected to Facebook as
= succeed "." do
=link_to @facebook_auth.name, "http://facebook.com/profile/#{@facebook_auth.uid}"
= link_to "Disconnect", @facebook_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove"
= link_to @facebook_auth.name, "http://facebook.com/profile/#{@facebook_auth.uid}"
= link_to "Disconnect", @facebook_auth,
confirm: "Are you sure you want to remove this connection?",
method: :delete, class: "remove"
- else
=link_to 'Connect to Facebook', '/auth/facebook'
= link_to 'Connect to Facebook', '/auth/facebook'

View File

@@ -1,11 +1,13 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= form_for(resource, as: resource_name,
url: registration_path(resource_name),
html: { method: :put, class: 'form-horizontal' }) do |f|
%br/
= devise_error_messages!
.form-group
= f.label :email, :class => 'control-label col-md-2'
= f.label :email, class: 'control-label col-md-2'
.col-md-8
= f.email_field :email, :class => 'form-control'
= f.email_field :email, class: 'form-control'
%span.help-block If you change your email address you will have to reconfirm.
.form-group
@@ -32,10 +34,9 @@
= f.check_box :newsletter
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
.help-block
= render :partial => 'newsletter_blurb'
= render partial: 'newsletter_blurb'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Save", :class => 'btn btn-primary'
=f.hidden_field(:tos_agreement, :value => true)
= f.submit "Save", class: 'btn btn-primary'
= f.hidden_field(:tos_agreement, value: true)

View File

@@ -1,23 +1,25 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= form_for(resource, as: resource_name,
url: registration_path(resource_name),
html: { method: :put, class: 'form-horizontal' }) do |f|
%br/
= devise_error_messages!
.form-group
= f.label :current_password, :class => 'control-label col-md-2'
= f.label :current_password, class: 'control-label col-md-2'
.col-md-4
= f.password_field :current_password, :class => 'form-control'
= f.password_field :current_password, class: 'form-control'
.form-group
= f.label :password, "New password", :class => 'control-label col-md-2'
= f.label :password, "New password", class: 'control-label col-md-2'
.col-md-4
= f.password_field :password, :autocomplete => "off", :class => 'form-control'
= f.password_field :password, autocomplete: "off", class: 'form-control'
.form-group
= f.label :password_confirmation, :class => 'control-label col-md-2'
.col-md-4= f.password_field :password_confirmation, :class => 'form-control'
= f.label :password_confirmation, class: 'control-label col-md-2'
.col-md-4= f.password_field :password_confirmation, class: 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Save", :class => 'btn btn-primary'
= f.submit "Save", class: 'btn btn-primary'
=f.hidden_field(:tos_agreement, :value => true)
= f.hidden_field(:tos_agreement, value: true)

View File

@@ -1,23 +1,25 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= form_for(resource, as: resource_name,
url: registration_path(resource_name),
html: { method: :put, class: 'form-horizontal' }) do |f|
%br/
= devise_error_messages!
.form-group
=f.label :location, 'Your location', :class => 'control-label col-md-2'
= f.label :location, 'Your location', class: 'control-label col-md-2'
.col-md-8
=f.text_field :location, :autocomplete => "off", :class => 'form-control'
= f.text_field :location, autocomplete: "off", class: 'form-control'
%span.help-block This will be displayed on a map. You can be as detailed or vague as you like.
.form-group
=f.label :bio, :class => 'control-label col-md-2'
= f.label :bio, class: 'control-label col-md-2'
.col-md-8
=f.text_area :bio, :rows => 6, :class => 'form-control'
= f.text_area :bio, rows: 6, class: 'form-control'
.form-group
%label.control-label.col-md-2
Profile picture
.col-md-8
= render :partial => "members/avatar", :locals => { :member => @member }
= render partial: "members/avatar", locals: { member: @member }
- unless @member.preferred_avatar_uri.present?
%p
%br/
@@ -27,6 +29,5 @@
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Save", :class => 'btn btn-primary'
=f.hidden_field(:tos_agreement, :value => true)
= f.submit "Save", class: 'btn btn-primary'
= f.hidden_field(:tos_agreement, value: true)

View File

@@ -1,25 +1,25 @@
- content_for :title, "Settings for #{current_member.login_name}"
%ul.nav.nav-tabs{:role => 'tablist'}
%ul.nav.nav-tabs{ role: 'tablist' }
%li.active
%a{:href => '#profile', :role => 'tab', 'data-toggle' => 'tab'}
%a{ href: '#profile', role: 'tab', 'data-toggle': 'tab' }
Profile
%li
%a{:href => '#email', :role => 'tab', 'data-toggle' => 'tab'}
%a{ href: '#email', role: 'tab', 'data-toggle': 'tab' }
Email
%li
%a{:href => '#apps', :role => 'tab', 'data-toggle' => 'tab'}
%a{ href: '#apps', role: 'tab', 'data-toggle': 'tab' }
Apps
%li
%a{:href => '#password', :role => 'tab', 'data-toggle' => 'tab'}
%a{ href: '#password', role: 'tab', 'data-toggle': 'tab' }
Password
.tab-content
.tab-pane.active#profile
= render :partial => 'edit_profile'
= render partial: 'edit_profile'
.tab-pane#email
= render :partial => 'edit_email'
= render partial: 'edit_email'
.tab-pane#apps
= render :partial => 'edit_apps'
= render partial: 'edit_apps'
.tab-pane#password
= render :partial => 'edit_password'
= render partial: 'edit_password'

View File

@@ -2,28 +2,30 @@
%p Sign up for a Growstuff account to track your veggie garden and connect with other local growers.
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:class => "form-horizontal"}) do |f|
= form_for(resource, as: resource_name,
url: registration_path(resource_name),
html: { class: "form-horizontal" }) do |f|
= devise_error_messages!
.form-group
= f.label :login_name, :class => "control-label col-md-2"
= f.label :login_name, class: "control-label col-md-2"
.col-md-8
= f.text_field :login_name, :class => 'form-control'
= f.text_field :login_name, class: 'form-control'
%span.help-inline This is the name that will show on the website.
.form-group
= f.label :email, :class => "control-label col-md-2"
= f.label :email, class: "control-label col-md-2"
.col-md-8
= f.email_field :email, :class => 'form-control'
= f.email_field :email, class: 'form-control'
%span.help-inline We'll use this address to contact you (we never spam!)
.form-group
= f.label :password, :class => "control-label col-md-2"
.col-md-8= f.password_field :password, :class => 'form-control'
= f.label :password, class: "control-label col-md-2"
.col-md-8= f.password_field :password, class: 'form-control'
.form-group
= f.label :password_confirmation, :class => "control-label col-md-2"
.col-md-8= f.password_field :password_confirmation, :class => 'form-control'
= f.label :password_confirmation, class: "control-label col-md-2"
.col-md-8= f.password_field :password_confirmation, class: 'form-control'
.form-group
.col-md-offset-2.col-md-8.checkbox
@@ -35,14 +37,14 @@
.form-group
.col-md-offset-2.col-md-8.checkbox
%label
= f.check_box :newsletter, :checked => true
= f.check_box :newsletter, checked: true
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
.help-inline
= render :partial => 'newsletter_blurb'
= render partial: 'newsletter_blurb'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Sign up", :class => 'btn btn-primary'
= f.submit "Sign up", class: 'btn btn-primary'
.form-group
.col-md-offset-2.col-md-8

View File

@@ -1,17 +1,19 @@
- content_for :title, "Sign in"
= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "form-horizontal"}) do |f|
= form_for(resource, as: resource_name,
url: session_path(resource_name),
html: { class: "form-horizontal" }) do |f|
= devise_error_messages!
.form-group
= f.label :login, :class => "control-label col-md-2"
= f.label :login, class: "control-label col-md-2"
.col-md-8
= f.text_field :login, :class => 'form-control'
= f.text_field :login, class: 'form-control'
.form-group
= f.label :password, :class => "control-label col-md-2"
= f.label :password, class: "control-label col-md-2"
.col-md-8
= f.password_field :password, :class => 'form-control'
= f.password_field :password, class: 'form-control'
- if devise_mapping.rememberable?
.form-group
@@ -22,7 +24,7 @@
.form-group
.form-actions.col-md-8.col-md-offset-2
= f.submit "Sign in", :class => 'btn btn-primary'
= f.submit "Sign in", class: 'btn btn-primary'
.form-group
.col-md-8.col-md-offset-2

View File

@@ -1,15 +1,19 @@
- content_for :title, "Resend unlock instructions"
= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) do |f|
= form_for(resource, as: resource_name,
url: unlock_path(resource_name),
html: { method: :post,
class: 'form-horizontal',
role: 'form' }) do |f|
= devise_error_messages!
.form-group
= f.label :email, :class => 'control-label col-md-2'
= f.label :email, class: 'control-label col-md-2'
.col-md-8
= f.email_field :email, :class => 'form-control'
= f.email_field :email, class: 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Resend unlock instructions", :class => 'btn btn-primary'
= f.submit "Resend unlock instructions", class: 'btn btn-primary'
.form-group
.col-md-offset-2.col-md-8