Merge pull request #1198 from Br3nda/bw/grand-haml-cleanup-of-2017

All the haml clean up
This commit is contained in:
pozorvlak
2017-02-13 22:20:16 +00:00
committed by GitHub
47 changed files with 284 additions and 228 deletions

View File

@@ -28,7 +28,7 @@ before_script:
- bundle exec rake assets:precompile
script:
- bundle exec rubocop --display-cop-names --rails
- bundle exec haml-lint app/views/account_types app/views/admin app/views/alternate_names app/views/account_types app/views/comments app/views/crops app/views/forums app/views/gardens app/views/harvests app/views/notifier app/views/orders app/views/photos
- bundle exec haml-lint app/views/
- script/gemfile_check
- bundle exec script/check_contributors_md
- bundle exec rake db:migrate --trace

View File

@@ -1,17 +1,19 @@
- 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

View File

@@ -1,6 +1,6 @@
.row
.col-md-8
- cache cache_key_for(Crop, 'interesting'), :expires_in => 1.day do
- cache cache_key_for(Crop, 'interesting'), expires_in: 1.day do
%h2= t('.our_crops')
.hidden-xs
- Crop.interesting.first(8).each do |c|
@@ -14,7 +14,7 @@
.col-md-4.hidden-xs
- cache cache_key_for(Planting) do
%h2= t('.recently_planted')
= render partial: 'plantings/list', locals: { :plantings => Planting.interesting.first(6) }
= render partial: 'plantings/list', locals: { plantings: Planting.interesting.first(6) }
.row
.col-md-12
@@ -22,7 +22,7 @@
%p{ style: 'margin-top: 11.25px' }
%strong
#{t('.recently_added')}:
!= Crop.recent.limit(12).map {|c| link_to(c, c) }.join(", ")
!= Crop.recent.limit(12).map { |c| link_to(c, c) }.join(", ")
%p.text-right
= link_to "#{t('.view_all')} »", crops_path

View File

@@ -2,7 +2,7 @@
- posts = Post.limit(6)
- if posts
= render partial: "posts/summary", locals: {posts: posts, howmany: 6 }
= render partial: "posts/summary", locals: { posts: posts, howmany: 6 }
- cache cache_key_for(Forum) do
- forums = Forum.all

View File

@@ -1,30 +1,28 @@
- seeds = Seed.interesting.first(6)
- if seeds.present?
%h2= t('.title')
- cache cache_key_for(Seed) do
- if seeds.size > 0
%table.table.table-striped
%tr
%th= t('.owner')
%th= t('.crop')
%th.hidden-xs.hidden-sm= t('.description')
%th= t('.trade_to')
%th= t('.from')
%th
%table.table.table-striped
- seeds.each do |seed|
%tr
%th= t('.owner')
%th= t('.crop')
%th.hidden-xs.hidden-sm= t('.description')
%th= t('.trade_to')
%th= t('.from')
%th
- seeds.each do |seed|
%tr
%td= link_to seed.owner.login_name, seed.owner
%td= link_to seed.crop.name, seed.crop
%td.hidden-xs.hidden-sm= truncate(seed.description, :length => 40, :separator => ' ')
%td= seed.tradable? ? seed.tradable_to : ''
%td
- if seed.tradable?
= seed.owner.location.blank? ? t('.unspecified') : truncate(seed.owner.location, :length => 25, :separator => ', ')
%td= link_to t('.details'), seed, class: 'btn btn-default btn-xs'
%td= link_to seed.owner.login_name, seed.owner
%td= link_to seed.crop.name, seed.crop
%td.hidden-xs.hidden-sm= truncate(seed.description, length: 40, separator: ' ')
%td= seed.tradable? ? seed.tradable_to : ''
%td
- if seed.tradable? && seed.owner.location.blank?
= t('.unspecified')
- elsif seed.tradable?
= truncate(seed.owner.location, length: 25, separator: ', ')
%td= link_to t('.details'), seed, class: 'btn btn-default btn-xs'
%p.text-right
= link_to "#{t('.view_all')} »", seeds_path

View File

@@ -1,8 +1,9 @@
- cache("homepage_stats") do
%p.stats
= t('.message_html', { member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path),
number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path),
number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path),
number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path) })
= t('.message_html',
member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path),
number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path),
number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path),
number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path))

View File

@@ -7,6 +7,6 @@
!= cms_snippet_content(:footer2)
.col-md-4#footer3
!= cms_snippet_content(:footer3)
%div(style="float: right;")
%a(href="http://opendefinition.org/ossd/")
%img(src="http://assets.okfn.org/images/ok_buttons/os_80x15_blue.png" alt="")
%div{ style: "float: right;" }
%a{ href: "http://opendefinition.org/ossd/" }
%img{ src: "http://assets.okfn.org/images/ok_buttons/os_80x15_blue.png", alt: "" }

View File

@@ -1,33 +1,36 @@
.sr-only
=link_to t(".skip"), "#skipnav"
.navbar.navbar-default.navbar-fixed-top(role="navigation")
= link_to t(".skip"), "#skipnav"
.navbar.navbar-default.navbar-fixed-top{ role: "navigation" }
.container
.navbar-header
%button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse")
%button.navbar-toggle{ 'data-target': "#navbar-collapse", 'data-toggle': "collapse" }
%span.sr-only= t('.toggle_navigation')
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand.hidden-xs(href=root_path)
= image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME'])
%a.navbar-brand.visible-xs(href=root_path)
= image_tag("growstuff-apple-touch-icon-precomposed.png", :size => "50x50", :class=>"img-responsive", :alt => ENV['GROWSTUFF_SITE_NAME'])
%a.navbar-brand.hidden-xs{ href: root_path }
= image_tag("growstuff-brand.png", size: "200x50", alt: ENV['GROWSTUFF_SITE_NAME'])
%a.navbar-brand.visible-xs{ href: root_path }
= image_tag("growstuff-apple-touch-icon-precomposed.png",
size: "50x50",
class: "img-responsive",
alt: ENV['GROWSTUFF_SITE_NAME'])
.form.navbar-form.pull-left
= form_tag crops_search_path, :method => :get, :id => 'navbar-search' do
= label_tag :term, "Search crop database:", :class => 'sr-only'
= form_tag crops_search_path, method: :get, id: 'navbar-search' do
= label_tag :term, "Search crop database:", class: 'sr-only'
.input
.input-group
= text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops'
= text_field_tag 'term', nil, class: 'search-query input-medium form-control', placeholder: 'Search crops'
.input-group-btn
%button.btn.btn-default{:style => "height: 34px;"}
= submit_tag "Search", :class => 'btn sr-only'
%button.btn.btn-default{ style: "height: 34px;" }
= submit_tag "Search", class: 'btn sr-only'
%span.glyphicon.glyphicon-search
.navbar-collapse.collapse#navbar-collapse
%ul.nav.navbar-nav.navbar-right
%li.dropdown<
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path}
%a.dropdown-toggle{ 'data-toggle': 'dropdown', href: crops_path }
= t('.crops')
%b.caret
%ul.dropdown-menu
@@ -36,7 +39,7 @@
%li= link_to t('.plantings'), plantings_path
%li= link_to t('.harvests'), harvests_path
%li.dropdown<
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path}
%a.dropdown-toggle{ 'data-toggle': 'dropdown', href: members_path }
= t('.community')
%b.caret
%ul.dropdown-menu
@@ -48,39 +51,40 @@
- if member_signed_in?
%li.dropdown<
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => root_path}
- if current_member.notifications.unread_count > 0
%a.dropdown-toggle{ 'data-toggle': 'dropdown', href: root_path }
- if current_member.notifications.unread_count.positive?
= t('.your_stuff', unread_count: current_member.notifications.unread_count)
- else
= t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name))
= t('.current_memberlogin_name', current_memberlogin_name: current_member.login_name)
%b.caret
%ul.dropdown-menu
%li= link_to t('.profile'), member_path(current_member)
%li= link_to t('.gardens'), gardens_by_owner_path(:owner => current_member.slug)
%li= link_to t('.plantings'), plantings_by_owner_path(:owner => current_member.slug)
%li= link_to t('.harvest'), harvests_by_owner_path(:owner => current_member.slug)
%li= link_to t('.seeds'), seeds_by_owner_path(:owner => current_member.slug)
%li= link_to t('.posts'), posts_by_author_path(:author => current_member.slug)
%li= link_to t('.gardens'), gardens_by_owner_path(owner: current_member.slug)
%li= link_to t('.plantings'), plantings_by_owner_path(owner: current_member.slug)
%li= link_to t('.harvest'), harvests_by_owner_path(owner: current_member.slug)
%li= link_to t('.seeds'), seeds_by_owner_path(owner: current_member.slug)
%li= link_to t('.posts'), posts_by_author_path(author: current_member.slug)
%li= link_to t('.account'), orders_path
%li
- if current_member.notifications.unread_count > 0
= link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), notifications_path)
- if current_member.notifications.unread_count.positive?
= link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count),
notifications_path)
- else
= link_to(t('.inbox'), notifications_path)
- if current_member.role?(:crop_wrangler) || current_member.role?(:admin)
%li{:class => 'divider', :role => 'presentation'}
%li.divider{ role: 'presentation' }
- if current_member.role?(:crop_wrangler)
%li= link_to t('.crop_wrangling'), wrangle_crops_path
- if current_member.role?(:admin)
%li= link_to t('.admin'), admin_path
%li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete
%li= link_to t('.sign_out'), destroy_member_session_path, method: :delete
- else
%li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin'
%li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup'
%li= link_to t('.sign_in'), new_member_session_path, id: 'navbar-signin'
%li= link_to t('.sign_up'), new_member_registration_path, id: 'navbar-signup'
- # anchor tag for accessibility link to skip the navigation menu
%a{:name => 'skipnav'}
-# anchor tag for accessibility link to skip the navigation menu
%a{ name: 'skipnav' }

View File

@@ -5,24 +5,33 @@
= yield(:opengraph)
- else
= tag("meta", property: "og:image", content: image_url('facebook-thumbnail.png'))
= tag("meta", property: "og:title", content: "#{content_for?(:title) ? yield(:title) + " - #{ ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME']}")
= tag("meta", property: "og:title",
content: (content_for?(:title) ? yield(:title) + " - " : "") + ENV['GROWSTUFF_SITE_NAME'])
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: root_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
- if (content_for?(:member_rss_login_name) && content_for(:member_rss_slug))
= auto_discovery_link_tag(:rss, { :controller => "/members", :action => 'show', :format => "rss", :id => yield(:member_rss_slug) }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] }- #{yield(:member_rss_login_name)}'s posts" })
= auto_discovery_link_tag(:rss, { :controller => "/posts", :format => "rss" }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] } - Recent posts from all members" })
= auto_discovery_link_tag(:rss, { :controller => "/crops", :format => "rss" }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] } - Recently added crops" })
= auto_discovery_link_tag(:rss, { :controller => "/plantings", :format => "rss" }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] } - Recent plantings from all members" })
- if content_for?(:member_rss_login_name) && content_for(:member_rss_slug)
= auto_discovery_link_tag(:rss,
{ controller: "/members", action: 'show', format: "rss", id: yield(:member_rss_slug) },
title: "#{ENV['GROWSTUFF_SITE_NAME']}- #{yield(:member_rss_login_name)}'s posts")
= auto_discovery_link_tag(:rss,
{ controller: "/posts", format: "rss" },
title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recent posts from all members")
= auto_discovery_link_tag(:rss,
{ controller: "/crops", format: "rss" },
title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recently added crops")
= auto_discovery_link_tag(:rss,
{ controller: "/plantings", format: "rss" },
title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recent plantings from all members")
%title
= content_for?(:title) ? yield(:title) + " - #{ ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME']
= content_for?(:title) ? yield(:title) + " - #{ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME']
= csrf_meta_tags
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
= stylesheet_link_tag "application", :media => "all"
= stylesheet_link_tag "application", media: "all"
%link(href="/growstuff-apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed")
%link{ href: "/growstuff-apple-touch-icon-precomposed.png", rel: "apple-touch-icon-precomposed" }
= favicon_link_tag 'favicon.ico'

View File

@@ -1,10 +1,10 @@
!!! 5
%html(lang="en" prefix="og: http://ogp.me/ns#")
= render :partial => "layouts/meta"
%html{ lang: "en", prefix: "og: http://ogp.me/ns#" }
= render partial: "layouts/meta"
%body
= render :partial => "layouts/header"
= render partial: "layouts/header"
#maincontainer.container
.container#maincontainer
.row
.col-md-12
- if content_for?(:title)
@@ -17,11 +17,11 @@
%p
.btn-group
= yield(:buttonbar)
= render :partial => "shared/flash_messages", flash: flash
= render partial: "shared/flash_messages", flash: flash
= yield
%footer
= render :partial => "layouts/footer"
= render partial: "layouts/footer"
/
Javascripts
\==================================================

View File

@@ -3,17 +3,17 @@
- if twitter_auth
%p
= image_tag "twitter_32.png", :size => "32x32", alt: 'Twitter logo'
= image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo'
= link_to twitter_auth.name, "http://twitter.com/#{twitter_auth.name}"
- if flickr_auth
%p
= image_tag "flickr_32.png", :size => "32x32", alt: 'Flickr logo'
= image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo'
= link_to flickr_auth.name, "http://flickr.com/photos/#{flickr_auth.uid}"
- if facebook_auth
%p
= image_tag "facebook_32.png", :size => "32x32", alt: 'Facebook logo'
= image_tag "facebook_32.png", size: "32x32", alt: 'Facebook logo'
= link_to facebook_auth.name, "http://facebook.com/profile/#{facebook_auth.uid}"
- if member.show_email

View File

@@ -10,11 +10,11 @@
%li.navbar-right
= link_to new_garden_path, class: 'btn' do
Add New Garden
.tab-content{style: "padding-top: 1em"}
.tab-content{ style: "padding-top: 1em" }
- first_garden = true
- gardens.each do |g|
%div{ class: ['tab-pane', first_garden ? 'active' : ''], id: "garden#{g.id}"}
%div{ class: ['tab-pane', first_garden ? 'active' : ''], id: "garden#{g.id}" }
- first_garden = false
.container
@@ -30,7 +30,7 @@
= link_to 'tell us more.', edit_garden_path(g)
- if g.photos.size > 0 or (can? :edit, g and can? :create, Photo)
- if !g.photos.empty? || (can?(:edit, g) && can?(:create, Photo))
.row
%h3 Photos
%p= localize_plural(g.photos, Photo)
@@ -40,16 +40,16 @@
.col-md-2.six-across
= render partial: 'photos/thumbnail', locals: { photo: p }
.row
- if can? :create, Photo and can? :edit, g
- if can?(:create, Photo) && can?(:edit, g)
%p
= link_to "Add photo", new_photo_path(type: "garden", id: g.id), class: 'btn btn-primary'
%h3 What's planted here?
.row
- if g.featured_plantings.size > 0
- unless g.featured_plantings.empty?
- g.featured_plantings.each.with_index do |planting|
.col-xs-12.col-lg-6
= render partial: "plantings/thumbnail", locals: {:planting => planting}
= render partial: "plantings/thumbnail", locals: { planting: planting }
%p
= link_to "More about this garden...", url_for(g)

View File

@@ -2,34 +2,34 @@
%ul.list-inline
%li
- unless member.plantings.empty?
- if !member.plantings.empty?
= link_to localize_plural(member.plantings, Planting), plantings_by_owner_path(owner: member)
- else
0 plantings
%li
- unless member.harvests.empty?
- if !member.harvests.empty?
= link_to localize_plural(member.harvests, Harvest), harvests_by_owner_path(owner: member)
- else
0 harvests
%li
- unless member.seeds.empty?
- if !member.seeds.empty?
= link_to localize_plural(member.seeds, Seed), seeds_by_owner_path(owner: member)
- else
0 seeds
%li
- unless member.posts.empty?
- if !member.posts.empty?
= link_to localize_plural(member.posts, Post), posts_by_author_path(author: member)
- else
0 posts
%li
- unless member.followed.empty?
- if !member.followed.empty?
= link_to localize_plural(member.followed, Follow), member_follows_path(member)
- else
0 following
%li
- unless member.followers.empty?
- if !member.followers.empty?
= link_to pluralize(member.followers.size, "follower"), member_followers_path(member)
- else
0 followers

View File

@@ -13,7 +13,7 @@
%small
%br/
Recently planted:
!= member.plantings.first(3).map{|p| link_to p.crop_name, p }.join(", ")
!= member.plantings.first(3).map { |p| link_to p.crop_name, p }.join(", ")
%p
%small
Joined
@@ -21,4 +21,7 @@
ago.
%p
%small
= [localize_plural(member.gardens, Garden), localize_plural(member.plantings, Planting), localize_plural(member.seeds, Seed)].join(", ")
= [localize_plural(member.gardens, Garden),
localize_plural(member.plantings, Planting),
localize_plural(member.seeds, Seed)].join(", ")

View File

@@ -2,7 +2,7 @@
%p Sign up for a Growstuff account to track your veggie garden and connect with other local growers.
= form_for(current_member, as: 'member', url: finish_signup_path(current_member), html: { role: 'form'}) do |f|
= form_for(current_member, as: 'member', url: finish_signup_path(current_member), html: { role: 'form' }) do |f|
- if @show_errors && current_member.errors.any?
.alert.alert-danger
- current_member.errors.full_messages.each do |msg|
@@ -31,10 +31,10 @@
.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: 'devise/registrations/newsletter_blurb'
.actions
= f.submit 'Continue', class: 'btn btn-primary'
= f.submit 'Continue', class: 'btn btn-primary'

View File

@@ -1,9 +1,12 @@
= content_for :title, t(".title", site_name: "#{ENV['GROWSTUFF_SITE_NAME']}")
= content_for :title, t(".title", site_name: ENV['GROWSTUFF_SITE_NAME'])
= form_tag(members_path, method: :get, class: 'form-inline', role: 'form') do
.form-group
= label_tag :sort, "Sort by:", class: 'sr-only'
= select_tag "sort", options_for_select({"Sort alphabetically" => 'alpha', "Sort by recently joined" => "recently_joined"}, @sort || 'alpha'), class: 'form-control'
= select_tag "sort",
options_for_select({ "Sort alphabetically": 'alpha', "Sort by recently joined": "recently_joined" },
@sort || 'alpha'),
class: 'form-control'
= submit_tag "Show", class: 'btn btn-primary'
.pagination

View File

@@ -6,7 +6,7 @@
= form_tag(nearby_members_path, method: :get, class: 'form-inline') do
= label_tag :distance, "Find members within", class: 'control-label'
= text_field_tag :distance, @distance, class: 'input-mini'
= select_tag :units, options_for_select({"miles" => :mi, "km" => :km}, @units), class: 'input-small'
= select_tag :units, options_for_select({ "miles": :mi, "km": :km }, @units), class: 'input-small'
= label_tag :location, "of", class: 'control-label'
= text_field_tag :location, @location
= submit_tag "Search", class: 'btn btn-primary'

View File

@@ -12,14 +12,14 @@
= link_to 'Edit profile', edit_member_registration_path, class: 'btn btn-default'
- if @member == current_member && !@member.paid?
= link_to "Upgrade account", shop_path, class: 'btn btn-default'
- if can? :create, Notification and current_member != @member
= link_to 'Send message', new_notification_path(:recipient_id => @member.id), class: 'btn btn-default'
- if can?(:create, Notification) && current_member != @member
= link_to 'Send message', new_notification_path(recipient_id: @member.id), class: 'btn btn-default'
- if current_member and current_member != @member # must be logged in, can't follow yourself
- if current_member && current_member != @member # must be logged in, can't follow yourself
- follow = current_member.get_follow(@member)
- if !follow and can? :create, Follow # not already following
= link_to 'Follow', follows_path(:followed_id => @member.id), method: :post, class: 'btn btn-default'
- if follow and can? :destroy, follow # already following
- if !follow && can?(:create, Follow) # not already following
= link_to 'Follow', follows_path(followed_id: @member.id), method: :post, class: 'btn btn-default'
- if follow && can?(:destroy, follow) # already following
= link_to 'Unfollow', follow_path(follow), method: :delete, class: 'btn btn-default'
- content_for :member_rss_login_name, @member.login_name
@@ -35,4 +35,7 @@
= render partial: "avatar", locals: { member: @member }
= render partial: "account", locals: { member: @member }
= render partial: "stats", locals: { member: @member }
= render partial: "contact", locals: { member: @member, :twitter_auth => @twitter_auth, :flickr_auth => @flickr_auth, :facebook_auth => @facebook_auth }
= render partial: "contact", locals: { member: @member,
twitter_auth: @twitter_auth,
flickr_auth: @flickr_auth,
facebook_auth: @facebook_auth }

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
%rss{version: 2.0}
%rss{ version: 2.0 }
%channel
%title #{@member.login_name}'s recent posts (#{ENV['GROWSTUFF_SITE_NAME']})
%link= member_url(@member)
- @posts.each do |post|
%item
%title #{post.subject} by #{post.author.login_name}
%pubDate= post.created_at.to_s(:rfc822)
%pubdate= post.created_at.to_s(:rfc822)
%link= post_url(post)
%guid= post_url(post)
%description

View File

@@ -10,4 +10,4 @@
.well
:growstuff_markdown
#{ strip_tags(notification.body) }
#{ strip_tags(notification.body) }

View File

@@ -15,3 +15,4 @@
= link_to 'Plant something', new_planting_path, class: 'btn btn-primary'
- else
= render partial: 'shared/signin_signup', locals: { to: "track what you've planted" }

View File

@@ -1,2 +1,3 @@
.progress
%div{ class: "progress-bar progress-bar-#{status}", role: "progressbar", style: "width: #{progress}" }

View File

@@ -45,7 +45,6 @@
planting, method: :delete,
data: { confirm: 'Are you sure?' },
class: 'btn btn-default btn-xs'
.row
.col-xs-12.col-md-4
%dl

View File

@@ -27,7 +27,6 @@
= link_to @planting.garden, @planting.garden
- unless @planting.owner.location.blank?
(#{@planting.owner.location})
%dt Quantity:
%dd
= display_planting_quantity(@planting)

View File

@@ -1,17 +1,19 @@
= form_for @product do |f|
- if @product.errors.any?
#error_explanation
%h2= "#{pluralize(@product.errors.size, "error")} prohibited this product from being saved:"
%h2
= pluralize(@product.errors.size, "error")
prohibited this product from being saved:
%ul
- @product.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :name
= f.text_field :name, :class => 'form-control'
= f.text_field :name, class: 'form-control'
.field
= f.label :description
= f.text_area :description, :class => 'form-control'
= f.text_area :description, class: 'form-control'
.field
= f.label :min_price, "Minimum price (in cents)"
= f.text_field :min_price
@@ -21,7 +23,7 @@
.field
= f.label :account_type
= collection_select(:product, :account_type_id, AccountType.all, :id,
:name, :selected => @product.account_type_id )
:name, selected: @product.account_type_id)
.field
= f.label :paid_months
= f.text_field :paid_months

View File

@@ -22,7 +22,7 @@
%td= product.paid_months
%td= link_to 'Show', product
%td= link_to 'Edit', edit_product_path(product)
%td= link_to 'Destroy', product, :method => :delete, :data => { :confirm => 'Are you sure?' }
%td= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' }
%br

View File

@@ -1,7 +1,9 @@
= form_for @scientific_name, :html => {:class => 'form-horizontal', :role => "form"} do |f|
= form_for @scientific_name, html: { class: 'form-horizontal', role: "form" } do |f|
- if @scientific_name.errors.any?
#error_explanation
%h2= "#{pluralize(@scientific_name.errors.size, "error")} prohibited this scientific_name from being saved:"
%h2
= pluralize(@scientific_name.errors.size, "error")
prohibited this scientific_name from being saved:
%ul
- @scientific_name.errors.full_messages.each do |msg|
%li= msg
@@ -9,17 +11,19 @@
%p
%span.help-block
For detailed crop wrangling guidelines, please consult the
=link_to "crop wrangling guide", "http://wiki.growstuff.org/index.php/Crop_wrangling"
= link_to "crop wrangling guide", "http://wiki.growstuff.org/index.php/Crop_wrangling"
on the Growstuff wiki.
.form-group
= f.label :crop_id, :class => 'control-label col-md-2'
= f.label :crop_id, class: 'control-label col-md-2'
.col-md-8
= collection_select(:scientific_name, :crop_id, Crop.all, :id, :name, { :selected => @scientific_name.crop_id || @crop.id }, :class => 'form-control')
= collection_select(:scientific_name, :crop_id, Crop.all, :id,
:name, { selected: @scientific_name.crop_id || @crop.id },
class: 'form-control')
.form-group
= f.label :name, :class => 'control-label col-md-2'
= f.label :name, class: 'control-label col-md-2'
.col-md-8
= f.text_field :name, :class => 'form-control'
= f.text_field :name, 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'

View File

@@ -1,7 +1,7 @@
- content_for :title, "Listing scientific names"
- if can? :create, ScientificName
%p= link_to 'New Scientific name', new_scientific_name_path, :class => 'btn btn-primary'
%p= link_to 'New Scientific name', new_scientific_name_path, class: 'btn btn-primary'
%table
%tr
@@ -17,7 +17,8 @@
%td= link_to 'Show', scientific_name
%td
- if can? :edit, scientific_name
= link_to 'Edit', edit_scientific_name_path(scientific_name), :class => 'btn btn-default btn-xs'
= link_to 'Edit', edit_scientific_name_path(scientific_name), class: 'btn btn-default btn-xs'
%td
- if can? :destroy, scientific_name
= link_to 'Delete', scientific_name, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
= link_to 'Delete', scientific_name, method: :delete, data: { confirm: 'Are you sure?' },
class: 'btn btn-default btn-xs'

View File

@@ -9,7 +9,7 @@
%p#notice= notice
= render :partial => 'crops/approval_status_message', :locals => { :crop => @scientific_name.crop }
= render partial: 'crops/approval_status_message', locals: { crop: @scientific_name.crop }
%p
%b Scientific name:
@@ -20,6 +20,6 @@
- if can? :edit, @scientific_name
= link_to 'Edit', edit_scientific_name_path(@scientific_name), :class => 'btn btn-default btn-xs'
= link_to 'Edit', edit_scientific_name_path(@scientific_name), class: 'btn btn-default btn-xs'
\|
= link_to 'Back', scientific_names_path

View File

@@ -9,7 +9,8 @@
.row
.col-md-4
= link_to image_tag((seed.crop.default_photo ? seed.crop.default_photo.thumbnail_url : 'placeholder_150.png'),
alt: seed.crop.name, class: 'img'), seed.crop
alt: seed.crop.name, class: 'img'),
seed.crop
.col-md-8
%dl.dl-horizontal
%dt Crop :

View File

@@ -9,5 +9,5 @@
%strong Paid until:
= current_member.account.paid_until_string
- if !current_member.paid?
= link_to "Upgrade and support #{ENV['GROWSTUFF_SITE_NAME']}", shop_path, :class => 'btn btn-primary'
- unless current_member.paid?
= link_to "Upgrade and support #{ENV['GROWSTUFF_SITE_NAME']}", shop_path, class: 'btn btn-primary'

View File

@@ -1,2 +1,2 @@
%span.help-block.optional
= I18n.t 'optional', :scope => 'forms'
= I18n.t 'optional', scope: 'forms'

View File

@@ -1,5 +1,5 @@
You can use
=link_to 'Markdown', 'http://daringfireball.net/projects/markdown/syntax/'
= link_to 'Markdown', 'http://daringfireball.net/projects/markdown/syntax/'
to format your text.
%br/
For instance, *italic*, **bold**, or a link [like this](http://to.some.site.com/).

View File

@@ -1,6 +1,6 @@
=link_to 'Sign in', new_member_session_path
= link_to 'Sign in', new_member_session_path
or
=link_to 'sign up', new_member_registration_path
= link_to 'sign up', new_member_registration_path
to
= succeed "." do
= to