Merge remote-tracking branch 'upstream/bootstrap3' into dev

Conflicts:
	Gemfile.lock
This commit is contained in:
Skud
2014-08-28 08:00:10 +10:00
26 changed files with 332 additions and 283 deletions

View File

@@ -1,6 +1,6 @@
---
language: ruby
env: GROWSTUFF_SITE_NAME="Growstuff (travis)"
env: GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
bundler_args: --without development assets production staging
rvm:
- 2.1.1

View File

@@ -93,7 +93,7 @@ gem 'bluecloth'
gem 'will_paginate', '~> 3.0'
# user signup/login/etc
gem 'devise', '~> 3.0.0'
gem 'devise', '~> 3.2.0'
# nicely formatted URLs
gem 'friendly_id', '~> 4.0.10'

View File

@@ -50,9 +50,7 @@ GEM
addressable (2.3.6)
arel (3.0.3)
bcrypt (3.1.7)
bcrypt-ruby (3.1.5)
bcrypt (>= 3.1.3)
better_errors (2.0.0)
better_errors (1.1.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
@@ -102,10 +100,11 @@ GEM
debugger-ruby_core_source (~> 1.3.5)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.3.5)
devise (3.0.4)
bcrypt-ruby (~> 3.0)
devise (3.2.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.1.3)
docile (1.1.5)
@@ -257,6 +256,7 @@ GEM
libv8 (~> 3.16.14.0)
ref
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
tins (1.3.2)
treetop (1.4.15)
@@ -299,7 +299,7 @@ DEPENDENCIES
csv_shaper
dalli
debugger
devise (~> 3.0.0)
devise (~> 3.2.0)
factory_girl_rails (~> 4.0)
figaro
flickraw

View File

@@ -10,26 +10,37 @@ class RegistrationsController < Devise::RegistrationsController
# we need this subclassed method so that Devise doesn't force people to
# change their password every time they want to edit their settings.
# we also check that they give their current password to change their password.
# Code copied from
# https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-account-without-providing-a-password
def update
# required for settings form to submit when password is left blank
if params[:member][:password].blank?
params[:member].delete("password")
params[:member].delete("password_confirmation")
params[:member].delete("current_password")
end
@member = Member.find(current_member.id)
if @member.update_attributes(params[:member])
successfully_updated = if needs_password?(@member, params)
@member.update_with_password(devise_parameter_sanitizer.sanitize(:account_update))
else
# remove the virtual current_password attribute
# update_without_password doesn't know how to ignore it
params[:member].delete(:current_password)
@member.update_without_password(devise_parameter_sanitizer.sanitize(:account_update))
end
if successfully_updated
set_flash_message :notice, :updated
# Sign in the member bypassing validation in case his password changed
# Sign in the member bypassing validation in case their password changed
sign_in @member, :bypass => true
redirect_to edit_member_registration_path
else
render "edit"
end
end
end
# check if we need the current password to update fields
def needs_password?(member, params)
params[:member][:password].present? ||
params[:member][:password_confirmation].present?
end

View File

@@ -1,4 +1,4 @@
= form_for @comment do |f|
= form_for(@comment, :html => {:class => "form-horizontal", :role => "form"}) do |f|
- if @comment.errors.any?
#error_explanation
%h2= "#{pluralize(@comment.errors.count, "error")} prohibited this comment from being saved:"
@@ -6,7 +6,8 @@
- @comment.errors.full_messages.each do |msg|
%li= msg
.field
.form-group
= f.label :body, "Your comment:"
= f.text_area :body, :rows => 6, :class => 'form-control'
%span.help-block
= render :partial => "shared/markdown_help"

View File

@@ -4,6 +4,4 @@
= render :partial => "posts/comments", :locals => {:post => @post || @comment.post}
%p Your comment:
= render 'form'

View File

@@ -1,4 +1,4 @@
= form_for @crop, :html => {:class => 'form-horizontal'} do |f|
= form_for @crop, :html => {:class => 'form-horizontal', :role => "form"} do |f|
- if @crop.errors.any?
#error_explanation
%h3= "#{pluralize(@crop.errors.count, "error")} prohibited this crop from being saved:"
@@ -13,31 +13,33 @@
on the Growstuff wiki.
.form-group
= f.label :name, :class => 'control-label'
.controls
= f.text_field :name
%span.help-inline Name in US English; singular; capitalize proper nouns only.
= f.label :name, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :name, :class => 'form-control'
%span.help-block Name in US English; singular; capitalize proper nouns only.
.form-group
= f.label :en_wikipedia_url, 'Wikipedia URL', :class => 'control-label'
.controls
= f.text_field :en_wikipedia_url
%span.help-inline Link to this crop's page on the English language Wikipedia.
= f.label :en_wikipedia_url, 'Wikipedia URL', :class => 'control-label col-md-2'
.col-md-8
= f.text_field :en_wikipedia_url, :class => 'form-control'
%span.help-block Link to this crop's page on the English language Wikipedia.
.form-group
= f.label :parent_id, 'Parent crop', :class => 'control-label'
.controls
= collection_select(:crop, :parent_id, Crop.all, :id, :name, {:include_blank => true})
%span.help-inline Optional. For setting up crop hierarchies for varieties etc.
= f.label :parent_id, 'Parent crop', :class => 'control-label col-md-2'
.col-md-8
= collection_select(:crop, :parent_id, Crop.all, :id, :name, {:include_blank => true}, :class => 'form-control')
%span.help-block Optional. For setting up crop hierarchies for varieties etc.
%p
%span.help-block
You may enter up to 3 scientific names for a crop. Most crops will have only one.
= f.fields_for :scientific_names do |sn|
.control-group
= sn.label :scientific_name, "Scientific name", :class => 'control-label'
.controls
= sn.text_field :scientific_name
.form-group
= sn.label :scientific_name, "Scientific name", :class => 'control-label col-md-2'
.col-md-8
= sn.text_field :scientific_name, :class => 'form-control'
.col-md-2
- if sn.object && sn.object.persisted?
%label.checkbox
= sn.check_box :_destroy
= sn.label :_destroy, "Delete"
.form-actions
= f.submit 'Save', :class => 'btn btn-primary'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'

View File

@@ -0,0 +1,26 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= devise_error_messages!
.row
.col-md-12
%p
= 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"
- else
=link_to 'Connect to Twitter', '/auth/twitter'
.row
.col-md-12
%p
= 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"
- else
=link_to 'Connect to Flickr', '/auth/flickr'

View File

@@ -0,0 +1,31 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= devise_error_messages!
.form-group
= f.label :email, :class => 'control-label col-md-2'
.col-md-8
= f.email_field :email, :class => 'form-control'
%span.help-block If you change your email address you will have to reconfirm.
.form-group
.col-md-offset-2.col-md-8
= f.check_box :show_email
Show email publicly on your profile page
.form-group
.col-md-offset-2.col-md-8
= f.check_box :send_notification_email
Receive emailed copies of Inbox notifications.
.form-group
.col-md-offset-2.col-md-8
= f.check_box :newsletter
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
.help-block
= 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)

View File

@@ -0,0 +1,22 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= devise_error_messages!
.form-group
= f.label :current_password, :class => 'control-label col-md-2'
.col-md-4
= f.password_field :current_password, :class => 'form-control'
.form-group
= f.label :password, "New password", :class => 'control-label col-md-2'
.col-md-4
= 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'
.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)

View File

@@ -0,0 +1,30 @@
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= devise_error_messages!
.form-group
=f.label :location, 'Your location', :class => 'control-label col-md-2'
.col-md-8
=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'
.col-md-8
=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 }
%p
%br/
To change your profile picture, visit
= succeed "." do
= link_to 'gravatar.com', "http://gravatar.com/"
.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)

View File

@@ -1,98 +1,25 @@
- content_for :title, "Settings for #{current_member.login_name}"
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f|
= devise_error_messages!
%ul.nav.nav-tabs{:role => 'tablist'}
%li.active
%a{:href => '#profile', :role => 'tab', 'data-toggle' => 'tab'}
Profile
%li
%a{:href => '#email', :role => 'tab', 'data-toggle' => 'tab'}
Email
%li
%a{:href => '#apps', :role => 'tab', 'data-toggle' => 'tab'}
Apps
%li
%a{:href => '#password', :role => 'tab', 'data-toggle' => 'tab'}
Password
%h2 Email settings
.form-group
= f.label :email, :class => 'control-label'
.controls
= f.email_field :email
%span.help-inline If you change your email address you will have to reconfirm.
.form-group
.controls
= f.check_box :show_email
Show email publicly on your profile page
.form-group
.controls
= f.check_box :send_notification_email
Receive emailed copies of Inbox notifications.
.form-group
.controls
= f.check_box :newsletter
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
.help-inline
= render :partial => 'newsletter_blurb'
%h2 Profile details
.form-group
%label.control-label
Profile picture
.controls
= render :partial => "members/avatar", :locals => { :member => @member }
%p
%br/
To change your profile picture, visit
= succeed "." do
= link_to 'gravatar.com', "http://gravatar.com/"
.form-group
=f.label :location, 'Your location', :class => 'control-label'
.controls
=f.text_field :location, :autocomplete => "off"
%span.help-inline 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'
.controls
=f.text_area :bio, :rows => 6, :class => 'form-control'
%h2 Linked accounts
.form-group
.controls
%p
= 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"
- else
=link_to 'Connect to Twitter', '/auth/twitter'
%p
= 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"
- else
=link_to 'Connect to Flickr', '/auth/flickr'
%h2 Change password
%p
%span.help-block Leave blank if you don't want to change your password.
.form-group
= f.label :current_password, :class => 'control-label'
.controls
= f.password_field :current_password
.form-group
= f.label :password, "New password", :class => 'control-label'
.controls
= f.password_field :password, :autocomplete => "off"
.form-group
= f.label :password_confirmation, :class => 'control-label'
.controls= f.password_field :password_confirmation
.form-actions
= f.submit "Save", :class => 'btn btn-primary'
=f.hidden_field(:tos_agreement, :value => true)
.tab-content
.tab-pane.active#profile
= render :partial => 'edit_profile'
.tab-pane#email
= render :partial => 'edit_email'
.tab-pane#apps
= render :partial => 'edit_apps'
.tab-pane#password
= render :partial => 'edit_password'

View File

@@ -6,39 +6,42 @@
= devise_error_messages!
.form-group
= f.label :login_name, :class => "control-label"
.controls
= f.text_field :login_name
= f.label :login_name, :class => "control-label col-md-2"
.col-md-8
= 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"
.controls
= f.email_field :email
= f.label :email, :class => "control-label col-md-2"
.col-md-8
= 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"
.controls= f.password_field :password
= 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"
.controls= f.password_field :password_confirmation
= f.label :password_confirmation, :class => "control-label col-md-2"
.col-md-8= f.password_field :password_confirmation, :class => 'form-control'
.form-group
.controls
.col-md-offset-2.col-md-8
= f.check_box :tos_agreement
I agree to the
= succeed "." do
= link_to 'Terms of Service', url_for(:action => 'tos', :controller => '/policy')
.form-group
.controls
.col-md-offset-2.col-md-8
= f.check_box :newsletter, :checked => true
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
.help-inline
= render :partial => 'newsletter_blurb'
.form-actions
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit "Sign up", :class => 'btn btn-primary'
= render "devise/shared/links"
.form-group
.col-md-offset-2.col-md-8
= render "devise/shared/links"

View File

@@ -4,21 +4,25 @@
= devise_error_messages!
.form-group
= f.label :login, :class => "control-label"
.controls= f.text_field :login
= f.label :login, :class => "control-label col-md-2"
.col-md-8
= f.text_field :login, :class => 'form-control'
.form-group
= f.label :password, :class => "control-label"
.controls= f.password_field :password
= f.label :password, :class => "control-label col-md-2"
.col-md-8
= f.password_field :password, :class => 'form-control'
- if devise_mapping.rememberable?
.form-group
.controls
.col-md-8.col-md-offset-2
= f.check_box :remember_me
Remember me
.form-actions
= f.submit "Sign in", :class => 'btn btn-primary'
.form-group
.form-actions.col-md-8.col-md-offset-2
= f.submit "Sign in", :class => 'btn btn-primary'
= render "devise/shared/links"
.form-group
.col-md-8.col-md-offset-2
= render "devise/shared/links"

View File

@@ -1,4 +1,4 @@
= form_for @forum, :html => { :class => 'form-horizontal' } do |f|
= form_for @forum, :html => { :class => 'form-horizontal', :role => "form" } do |f|
- if @forum.errors.any?
#error_explanation
%h2= "#{pluralize(@forum.errors.count, "error")} prohibited this forum from being saved:"
@@ -7,13 +7,17 @@
%li= msg
.form-group
= f.label :name, :class => 'control-label'
.controls= f.text_field :name, :class => 'form-control'
= f.label :name, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :name, :class => 'form-control'
.form-group
= f.label :description, :class => 'control-label'
.controls= f.text_area :description, :rows => 6, :class => 'form-control'
= f.label :description, :class => 'control-label col-md-2'
.col-md-8
= f.text_area :description, :rows => 6, :class => 'form-control'
.form-group
= f.label :owner_id, :class => 'control-label'
.controls= collection_select(:forum, :owner_id, Member.all, :id, :login_name)
.form-actions
= f.submit 'Save', :class => 'btn btn-primary'
= f.label :owner_id, :class => 'control-label col-md-2'
.col-md-8
= collection_select(:forum, :owner_id, Member.all, :id, :login_name, {}, :class => 'form-control')
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'

View File

@@ -1,7 +1,3 @@
- content_for :title, "Editing forum"
= render 'form'
= link_to 'Show', @forum
\|
= link_to 'Back', forums_path

View File

@@ -1,5 +1,3 @@
- content_for :title, "New Forum"
= render 'form'
= link_to 'Back', forums_path

View File

@@ -1,4 +1,4 @@
= form_for(@garden, :html => {:class => "form-horizontal"}) do |f|
= form_for(@garden, :html => {:class => "form-horizontal", :role => "form"}) do |f|
- if @garden.errors.any?
#error_explanation
%h2= "#{pluralize(@garden.errors.count, "error")} prohibited this garden from being saved:"
@@ -7,19 +7,19 @@
%li= msg
.form-group
= f.label :name, :class => 'control-label'
.controls
= f.text_field :name
= f.label :name, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :name, :class => 'form-control'
.form-group
= f.label :description, :class => 'control-label'
.controls
= f.text_area :description, :rows => 6
= f.label :description, :class => 'control-label col-md-2'
.col-md-8
= f.text_area :description, :rows => 6, :class => 'form-control'
.form-group
= f.label :location, :class => 'control-label'
.controls
= f.text_field :location, :value => @garden.location || current_member.location
= f.label :location, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :location, :value => @garden.location || current_member.location, :class => 'form-control'
%span.help-block
If you have a location set in your profile, it will be used when
you create a new garden.
@@ -29,18 +29,18 @@
=link_to "Change your location.", edit_member_registration_path
.form-group
= f.label :area, :class => 'control-label'
.controls
= f.number_field :area, :class => 'input-small'
= f.select(:area_unit, Garden::AREA_UNITS_VALUES, {:include_blank => false}, :class => 'input-medium')
= f.label :area, :class => 'control-label col-md-2'
.col-md-2
= f.number_field :area, :class => 'input-small form-control'
.col-md-2
= f.select(:area_unit, Garden::AREA_UNITS_VALUES, {:include_blank => false}, :class => 'form-control')
.form-group
= f.label 'Active? ', :class => 'control-label'
.controls
= f.label 'Active? ', :class => 'control-label col-md-2'
.col-md-8
= f.check_box :active
%span.help-inline
You can mark a garden as inactive if you no longer use it.
You can mark a garden as inactive if you no longer use it.
.form-actions
= f.submit 'Save Garden', :class => 'btn btn-primary'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save Garden', :class => 'btn btn-primary'

View File

@@ -1,5 +1,3 @@
%h1 New garden
= render 'form'
= link_to 'Back', gardens_path

View File

@@ -1,4 +1,4 @@
= form_for(@harvest, :html => {:class => "form-horizontal"}) do |f|
= form_for(@harvest, :html => {:class => "form-horizontal", :role => :form}) do |f|
- if @harvest.errors.any?
#error_explanation
%h2= "#{pluralize(@harvest.errors.count, "error")} prohibited this harvest from being saved:"
@@ -7,37 +7,42 @@
%li= msg
.form-group
= f.label 'What did you harvest?', :class => 'control-label'
.controls
= collection_select(:harvest, :crop_id, Crop.all, :id, :name, :selected => @harvest.crop_id || @crop.id)
= collection_select(:harvest, :plant_part_id, PlantPart.all, :id, :name, :selected => @harvest.plant_part_id)
%span.help-block
Can't find what you're looking for?
= link_to "Request new crops.", Growstuff::Application.config.new_crops_request_link
= f.label 'What did you harvest?', :class => 'control-label col-md-2'
.col-md-4
= collection_select(:harvest, :crop_id, Crop.all, :id, :name, { :selected => @harvest.crop_id || @crop.id }, { :class => 'form-control' })
.col-md-4
= collection_select(:harvest, :plant_part_id, PlantPart.all, :id, :name, { :selected => @harvest.plant_part_id }, { :class => 'form-control' })
%span.help-block.col-md-8
Can't find what you're looking for?
= link_to "Request new crops.", Growstuff::Application.config.new_crops_request_link
.form-group
= f.label 'When?', :class => 'control-label'
.controls= f.text_field :harvested_at, :value => @harvest.harvested_at ? @harvest.harvested_at.to_s(:ymd) : '', :class => 'add-datepicker'
= f.label 'When?', :class => 'control-label col-md-2'
.col-md-2
= f.text_field :harvested_at, :value => @harvest.harvested_at ? @harvest.harvested_at.to_s(:ymd) : '', :class => 'add-datepicker form-control'
.form-group
= f.label 'How many?', :class => 'control-label'
.controls
= f.label 'How many?', :class => 'control-label col-md-2'
.col-md-2
-# Some browsers (eg Firefox for Android) assume "number" means
-# "integer" unless you specify step="any":
-# http://blog.isotoma.com/2012/03/html5-input-typenumber-and-decimalsfloats-in-chrome/
= f.number_field :quantity, :class => 'input-small', :step => 'any'
= f.select(:unit, Harvest::UNITS_VALUES, {:include_blank => false}, :class => 'input-medium')
= f.number_field :quantity, :class => 'input-small', :step => 'any', :class => 'form-control'
.col-md-2
= f.select(:unit, Harvest::UNITS_VALUES, {:include_blank => false}, :class => 'input-medium form-control')
.form-group
= f.label 'Weighing:', :class => 'control-label'
.controls
= f.number_field :weight_quantity, :class => 'input-small', :step => 'any'
= f.select(:weight_unit, Harvest::WEIGHT_UNITS_VALUES, {:include_blank => false}, :class => 'input-medium')
in total
= f.label 'Weighing (in total):', :class => 'control-label col-md-2'
.col-md-2
= f.number_field :weight_quantity, :class => 'input-small', :step => 'any', :class => 'form-control'
.col-md-2
= f.select(:weight_unit, Harvest::WEIGHT_UNITS_VALUES, {:include_blank => false}, :class => 'form-control')
.form-group
= f.label 'Notes', :class => 'control-label'
.controls= f.text_area :description, :rows => 6
= f.label 'Notes', :class => 'control-label col-md-2'
.col-md-8
= f.text_area :description, :rows => 6, :class => 'form-control'
.form-actions
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'

View File

@@ -8,35 +8,35 @@
.form-group
= f.label 'What did you plant?', :class => 'control-label col-md-2'
.col-md-4
.col-md-8
= collection_select(:planting, :crop_id, Crop.all, :id, :name, {:selected => @planting.crop_id || @crop.id}, {:class => 'form-control'})
%span.help-inline
Can't find what you're looking for?
= link_to "Request new crops.", Growstuff::Application.config.new_crops_request_link
.form-group
= f.label 'Where did you plant it?', :class => 'control-label col-md-2'
.col-md-4
.col-md-8
= collection_select(:planting, :garden_id, Garden.active.where(:owner_id => current_member), :id, :name, {:selected => @planting.garden_id || @garden.id}, {:class => 'form-control'})
%span.help-inline
= link_to "Add a garden.", new_garden_path
.form-group
= f.label 'When?', :class => 'control-label col-md-2'
.col-md-3= f.text_field :planted_at, :value => @planting.planted_at ? @planting.planted_at.to_s(:ymd) : '', :class => 'add-datepicker form-control'
.col-md-2= f.text_field :planted_at, :value => @planting.planted_at ? @planting.planted_at.to_s(:ymd) : '', :class => 'add-datepicker form-control'
.form-group
= f.label 'How many?', :class => 'control-label col-md-2'
.col-md-2
= f.number_field :quantity, :class => 'form-control'
.form-group
= f.label 'Planted from:', :class => 'control-label col-md-2'
.col-md-4
.col-md-8
= f.select(:planted_from, Planting::PLANTED_FROM_VALUES, {:include_blank => true}, :class => 'form-control')
.form-group
= f.label 'Sun or shade?', :class => 'control-label col-md-2'
.col-md-4
.col-md-8
= f.select(:sunniness, Planting::SUNNINESS_VALUES, {:include_blank => true}, :class => 'form-control')
.form-group
= f.label 'Tell us more about it', :class => 'control-label col-md-2'
.col-md-4= f.text_area :description, :rows => 6, :class => 'form-control'
.col-md-8= f.text_area :description, :rows => 6, :class => 'form-control'
.form-group
.form-actions
= f.submit 'Save', :class => 'btn btn-primary col-md-offset-2'
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'

View File

@@ -1,4 +1,4 @@
= form_for @post do |f|
= form_for(@post, :html => {:role => "form"}) do |f|
- if @post.errors.any?
#error_explanation
%h2= "#{pluralize(@post.errors.count, "error")} prohibited this post from being saved:"
@@ -6,16 +6,18 @@
- @post.errors.full_messages.each do |msg|
%li= msg
.form-group
= label_tag :post, "Subject", :class => 'control-label'
= f.text_field :subject, :class => 'form-control'
= label_tag :post, "Subject"
= f.text_field :subject, :class => 'form-control'
- if @post.forum || @forum
= label_tag :body, "What's up?"
- else
= label_tag :body, "What's going on in your food garden?"
= f.text_area :body, :rows => 12, :class => 'form-control'
%span.help-block
= render :partial => "shared/markdown_help"
.form-group
- if @post.forum || @forum
= label_tag :body, "What's up?", :class => 'control-label'
- else
= label_tag :body, "What's going on in your food garden?"
= f.text_area :body, :rows => 12, :class => 'form-control'
%span.help-block
= render :partial => "shared/markdown_help"
- if @post.forum || @forum
- forum = @post.forum || @forum

View File

@@ -1,4 +1,4 @@
= form_for @scientific_name, :html => {:class => 'form-horizontal'} 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.count, "error")} prohibited this scientific_name from being saved:"
@@ -13,12 +13,13 @@
on the Growstuff wiki.
.form-group
= f.label :crop_id, :class => 'control-label'
.controls
= collection_select(:scientific_name, :crop_id, Crop.all, :id, :name, :selected => @scientific_name.crop_id || @crop.id)
= 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')
.form-group
= f.label :scientific_name, :class => 'control-label'
.controls
= f.text_field :scientific_name
.form-actions
= f.submit 'Save', :class => 'btn btn-primary'
= f.label :scientific_name, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :scientific_name, :class => 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'

View File

@@ -1,4 +1,4 @@
= form_for(@seed, :html => {:class => "form-horizontal"}) do |f|
= form_for(@seed, :html => {:class => "form-horizontal", :role => "form"}) do |f|
- if @seed.errors.any?
#error_explanation
%h2= "#{pluralize(@seed.errors.count, "error")} prohibited this seed from being saved:"
@@ -7,23 +7,33 @@
%li= msg
.form-group
= f.label 'Crop:', :class => 'control-label'
.controls= collection_select(:seed, :crop_id, Crop.all, :id, :name, :selected => @seed.crop_id || @crop.id)
= f.label 'Crop:', :class => 'control-label col-md-2'
.col-md-8
= collection_select(:seed, :crop_id, Crop.all, :id, :name, { :selected => @seed.crop_id || @crop.id }, { :class => 'form-control' })
.form-group
= f.label 'Quantity:', :class => 'control-label'
.controls
= f.number_field :quantity, :class => 'input-small'
= f.label 'Quantity:', :class => 'control-label col-md-2'
.col-md-2
= f.number_field :quantity, :class => 'form-control'
.form-group
= f.label 'Plant before:', :class => 'control-label'
.controls= f.text_field :plant_before, :value => @seed.plant_before ? @seed.plant_before.to_s(:ymd) : '', :class => 'add-datepicker'
= f.label 'Plant before:', :class => 'control-label col-md-2'
.col-md-2
= f.text_field :plant_before, :class => 'add-datepicker form-control', :value => @seed.plant_before ? @seed.plant_before.to_s(:ymd) : ''
.form-group
= f.label 'Description:', :class => 'control-label'
.controls= f.text_area :description, :rows => 6
= f.label 'Description:', :class => 'control-label col-md-2'
.col-md-8
= f.text_area :description, :rows => 6, :class => 'form-control'
.form-group
= f.label 'Will trade:', :class => 'control-label'
.controls
= f.select(:tradable_to,
options_for_select(Seed::TRADABLE_TO_VALUES, :selected => @seed.tradable_to || 'nowhere'))
.col-md-offset-2.col-md-8
%span.help-block
Are you interested in trading or swapping seeds with other
#{ENV['GROWSTUFF_SITE_NAME']} members? If you
list your seeds as available for trade, other members can
contact you to request seeds. You can list any conditions or
other information in the description, above.
.form-group
= f.label 'Will trade:', :class => 'control-label col-md-2'
.col-md-8
= f.select(:tradable_to, Seed::TRADABLE_TO_VALUES, {}, :class => 'form-control')
%span.help_inline
- if current_member.location.blank?
Don't forget to
@@ -34,11 +44,6 @@
=succeed "." do
= link_to current_member.location, place_path(current_member.location)
=link_to "Change your location.", edit_member_registration_path
%span.help-block
Are you interested in trading or swapping seeds with other
#{ENV['GROWSTUFF_SITE_NAME']} members? If you
list your seeds as available for trade, other members can
contact you to request seeds. You can list any conditions or
other information in the description, above.
.form-actions
= f.submit 'Save', :class => 'btn btn-primary'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'

View File

@@ -6,6 +6,8 @@ Devise.setup do |config|
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = "Growstuff <noreply@growstuff.org>"
config.secret_key = ENV['RAILS_SECRET_TOKEN']
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"

View File

@@ -23,10 +23,6 @@ describe 'devise/registrations/edit.html.haml', :type => "view" do
render
end
it 'has a heading' do
assert_select "h2", "Email settings"
end
it 'has a checkbox for email notifications' do
assert_select "input[id=member_send_notification_email][type=checkbox]"
end
@@ -41,10 +37,6 @@ describe 'devise/registrations/edit.html.haml', :type => "view" do
render
end
it 'has a heading' do
assert_select "h2", "Profile details"
end
it 'shows show_email checkbox' do
assert_select "input[id=member_show_email][type=checkbox]"
end
@@ -67,10 +59,6 @@ describe 'devise/registrations/edit.html.haml', :type => "view" do
end
context 'other sites section' do
it 'has a heading' do
render
assert_select "h2", "Linked accounts"
end
context 'not connected to twitter' do
it 'has a link to connect' do
@@ -114,11 +102,6 @@ describe 'devise/registrations/edit.html.haml', :type => "view" do
end
it 'should have a password section' do
render
assert_select "h2", "Change password"
end
end
end