aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-07-28 15:00:41 +0200
committerPetteri Räty <petsku@petteriraty.eu>2011-08-01 17:28:22 +0300
commit94e39240466caf637ba3aaef6122851b8c7aeda1 (patch)
tree9bad217db2c2b62e577fa04bdcc768224a261d61
parentImprove front page (diff)
downloadcouncil-webapp-94e39240466caf637ba3aaef6122851b8c7aeda1.tar.gz
council-webapp-94e39240466caf637ba3aaef6122851b8c7aeda1.tar.bz2
council-webapp-94e39240466caf637ba3aaef6122851b8c7aeda1.zip
Show use hints for users
-rw-r--r--site/app/controllers/users_controller.rb13
-rw-r--r--site/config/hobo_routes.rb1
-rw-r--r--site/config/locales/app.en.yml9
-rw-r--r--site/features/agenda_items.feature9
-rw-r--r--site/features/hints.feature25
-rw-r--r--site/features/step_definitions/agenda_item_steps.rb5
6 files changed, 41 insertions, 21 deletions
diff --git a/site/app/controllers/users_controller.rb b/site/app/controllers/users_controller.rb
index 4fd360c..945e259 100644
--- a/site/app/controllers/users_controller.rb
+++ b/site/app/controllers/users_controller.rb
@@ -2,14 +2,15 @@ class UsersController < ApplicationController
hobo_user_controller
- auto_actions :all, :except => [ :index, :new, :create ]
+ auto_actions :all, :except => [ :index, :new, :create, :do_signup ]
- def create
- hobo_create do
+ def do_signup
+ do_creator_action(:signup) do
if valid?
- self.current_user = this
- flash[:notice] = t("hobo.messages.you_are_site_admin", :default=>"You are now the site administrator")
- redirect_to home_page
+ flash[:notice] = ht(:"#{model.to_s.underscore}.messages.signup.success", :default=>["Thanks for signing up!"])
+ else
+ this.password = HoboFields::Types::PasswordString.new
+ this.password_confirmation = HoboFields::Types::PasswordString.new
end
end
end
diff --git a/site/config/hobo_routes.rb b/site/config/hobo_routes.rb
index a426e53..0e82a10 100644
--- a/site/config/hobo_routes.rb
+++ b/site/config/hobo_routes.rb
@@ -24,7 +24,6 @@ Council::Application.routes.draw do
# Resource routes for controller "users"
get 'users/:id/edit(.:format)' => 'users#edit', :as => 'edit_user'
get 'users/:id(.:format)' => 'users#show', :as => 'user', :constraints => { :id => %r([^/.?]+) }
- post 'users(.:format)' => 'users#create', :as => 'create_user'
put 'users/:id(.:format)' => 'users#update', :as => 'update_user', :constraints => { :id => %r([^/.?]+) }
delete 'users/:id(.:format)' => 'users#destroy', :as => 'destroy_user', :constraints => { :id => %r([^/.?]+) }
diff --git a/site/config/locales/app.en.yml b/site/config/locales/app.en.yml
index ecf802b..d19ea21 100644
--- a/site/config/locales/app.en.yml
+++ b/site/config/locales/app.en.yml
@@ -6,5 +6,14 @@ en:
activerecord:
attribute_help:
+ agenda:
+ email_reminder_sent: "Email reminders will be sent only if this field is unchecked."
agenda_item:
+ agenda: "If you set it to 'No Agenda available.' it will be listed as 'Suggested item'"
+ body: "You can use markdown in the body of agenda item"
+ discussion: "Best choice is address of first message in discussion on archives.gentoo.org."
+ discussion_time: "If you provide address on archives.gentoo.org in discussion field application will manage this field on it's own."
+ rejected: "Rejected items are not shown on Suggested Items list. You don't have to go to edit page of item to reject it - there is a Reject button on item show page"
timelimits: "Enter reminders for this item. Each line should be a separate reminder in 'mm:ss <reminder message>' format"
+ user:
+ irc_nick: "Nick you use on freenode (it's important if you are council member)."
diff --git a/site/features/agenda_items.feature b/site/features/agenda_items.feature
index 5a6dad7..2507e2d 100644
--- a/site/features/agenda_items.feature
+++ b/site/features/agenda_items.feature
@@ -58,12 +58,3 @@ Feature: Suggest Agenda Items
Scenario: View discussion times
Given some agenda item with discussion times
Then I should see discussion times when viewing agenda items
-
- Scenario: Show view hint on timelimits format
- Given I am logged in as a council member
- When I follow "Suggest agenda item"
- Then I should see hint on timelimits format
-
- Given example agenda item
- When I am on newest agenda item edit page
- Then I should see hint on timelimits format
diff --git a/site/features/hints.feature b/site/features/hints.feature
new file mode 100644
index 0000000..436476a
--- /dev/null
+++ b/site/features/hints.feature
@@ -0,0 +1,25 @@
+Feature: Hints
+ As user
+ I want to see hints in forms
+ So I will know what I enter
+
+ Scenario: Agenda hints
+ Given I am logged in as a council member
+ When I am on the current agenda page
+ And I follow "Edit"
+ Then I should see "Email reminders will be sent only if this field is unchecked."
+
+ Scenario: Agenda item hints
+ Given I am logged in as a council member
+ When I follow "Suggest agenda item"
+ Then I should see "If you set it to 'No Agenda available.' it will be listed as 'Suggested item'"
+ Then I should see "You can use markdown in the body of agenda item"
+ Then I should see "Best choice is address of first message in discussion on archives.gentoo.org."
+ Then I should see "If you provide address on archives.gentoo.org in discussion field application will manage this field on it's own."
+ Then I should see "Rejected items are not shown on Suggested Items list. You don't have to go to edit page of item to reject it - there is a Reject button on item show page"
+ Then I should see "Enter reminders for this item. Each line should be a separate reminder in 'mm:ss <reminder message>' format"
+
+ Scenario: User hints
+ When I am on the home page
+ And I follow "Signup"
+ Then I should see "Nick you use on freenode (it's important if you are council member)."
diff --git a/site/features/step_definitions/agenda_item_steps.rb b/site/features/step_definitions/agenda_item_steps.rb
index 4b18f7b..b600bad 100644
--- a/site/features/step_definitions/agenda_item_steps.rb
+++ b/site/features/step_definitions/agenda_item_steps.rb
@@ -52,8 +52,3 @@ Then /^I should see discussion times when viewing agenda items$/ do
Then "I should see \"#{item.discussion_time}\""
end
end
-
-Then /^I should see hint on timelimits format$/ do
- Then 'I should see "Enter reminders for this item. Each line should be a ' +
- 'separate reminder in \'mm:ss <reminder message>\' format" within ".input-help"'
-end