Gentoo Archives: gentoo-commits

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/council-webapp:master commit in: site/app/controllers/, site/config/locales/, site/features/step_definitions/, ...
Date: Mon, 01 Aug 2011 14:31:36
Message-Id: 94e39240466caf637ba3aaef6122851b8c7aeda1.betelgeuse@gentoo
1 commit: 94e39240466caf637ba3aaef6122851b8c7aeda1
2 Author: Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
3 AuthorDate: Thu Jul 28 13:00:41 2011 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 1 14:28:22 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/council-webapp.git;a=commit;h=94e39240
7
8 Show use hints for users
9
10 ---
11 site/app/controllers/users_controller.rb | 13 +++++----
12 site/config/hobo_routes.rb | 1 -
13 site/config/locales/app.en.yml | 9 +++++++
14 site/features/agenda_items.feature | 9 -------
15 site/features/hints.feature | 25 ++++++++++++++++++++
16 .../features/step_definitions/agenda_item_steps.rb | 5 ----
17 6 files changed, 41 insertions(+), 21 deletions(-)
18
19 diff --git a/site/app/controllers/users_controller.rb b/site/app/controllers/users_controller.rb
20 index 4fd360c..945e259 100644
21 --- a/site/app/controllers/users_controller.rb
22 +++ b/site/app/controllers/users_controller.rb
23 @@ -2,14 +2,15 @@ class UsersController < ApplicationController
24
25 hobo_user_controller
26
27 - auto_actions :all, :except => [ :index, :new, :create ]
28 + auto_actions :all, :except => [ :index, :new, :create, :do_signup ]
29
30 - def create
31 - hobo_create do
32 + def do_signup
33 + do_creator_action(:signup) do
34 if valid?
35 - self.current_user = this
36 - flash[:notice] = t("hobo.messages.you_are_site_admin", :default=>"You are now the site administrator")
37 - redirect_to home_page
38 + flash[:notice] = ht(:"#{model.to_s.underscore}.messages.signup.success", :default=>["Thanks for signing up!"])
39 + else
40 + this.password = HoboFields::Types::PasswordString.new
41 + this.password_confirmation = HoboFields::Types::PasswordString.new
42 end
43 end
44 end
45
46 diff --git a/site/config/hobo_routes.rb b/site/config/hobo_routes.rb
47 index a426e53..0e82a10 100644
48 --- a/site/config/hobo_routes.rb
49 +++ b/site/config/hobo_routes.rb
50 @@ -24,7 +24,6 @@ Council::Application.routes.draw do
51 # Resource routes for controller "users"
52 get 'users/:id/edit(.:format)' => 'users#edit', :as => 'edit_user'
53 get 'users/:id(.:format)' => 'users#show', :as => 'user', :constraints => { :id => %r([^/.?]+) }
54 - post 'users(.:format)' => 'users#create', :as => 'create_user'
55 put 'users/:id(.:format)' => 'users#update', :as => 'update_user', :constraints => { :id => %r([^/.?]+) }
56 delete 'users/:id(.:format)' => 'users#destroy', :as => 'destroy_user', :constraints => { :id => %r([^/.?]+) }
57
58
59 diff --git a/site/config/locales/app.en.yml b/site/config/locales/app.en.yml
60 index ecf802b..d19ea21 100644
61 --- a/site/config/locales/app.en.yml
62 +++ b/site/config/locales/app.en.yml
63 @@ -6,5 +6,14 @@ en:
64
65 activerecord:
66 attribute_help:
67 + agenda:
68 + email_reminder_sent: "Email reminders will be sent only if this field is unchecked."
69 agenda_item:
70 + agenda: "If you set it to 'No Agenda available.' it will be listed as 'Suggested item'"
71 + body: "You can use markdown in the body of agenda item"
72 + discussion: "Best choice is address of first message in discussion on archives.gentoo.org."
73 + discussion_time: "If you provide address on archives.gentoo.org in discussion field application will manage this field on it's own."
74 + 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"
75 timelimits: "Enter reminders for this item. Each line should be a separate reminder in 'mm:ss <reminder message>' format"
76 + user:
77 + irc_nick: "Nick you use on freenode (it's important if you are council member)."
78
79 diff --git a/site/features/agenda_items.feature b/site/features/agenda_items.feature
80 index 5a6dad7..2507e2d 100644
81 --- a/site/features/agenda_items.feature
82 +++ b/site/features/agenda_items.feature
83 @@ -58,12 +58,3 @@ Feature: Suggest Agenda Items
84 Scenario: View discussion times
85 Given some agenda item with discussion times
86 Then I should see discussion times when viewing agenda items
87 -
88 - Scenario: Show view hint on timelimits format
89 - Given I am logged in as a council member
90 - When I follow "Suggest agenda item"
91 - Then I should see hint on timelimits format
92 -
93 - Given example agenda item
94 - When I am on newest agenda item edit page
95 - Then I should see hint on timelimits format
96
97 diff --git a/site/features/hints.feature b/site/features/hints.feature
98 new file mode 100644
99 index 0000000..436476a
100 --- /dev/null
101 +++ b/site/features/hints.feature
102 @@ -0,0 +1,25 @@
103 +Feature: Hints
104 + As user
105 + I want to see hints in forms
106 + So I will know what I enter
107 +
108 + Scenario: Agenda hints
109 + Given I am logged in as a council member
110 + When I am on the current agenda page
111 + And I follow "Edit"
112 + Then I should see "Email reminders will be sent only if this field is unchecked."
113 +
114 + Scenario: Agenda item hints
115 + Given I am logged in as a council member
116 + When I follow "Suggest agenda item"
117 + Then I should see "If you set it to 'No Agenda available.' it will be listed as 'Suggested item'"
118 + Then I should see "You can use markdown in the body of agenda item"
119 + Then I should see "Best choice is address of first message in discussion on archives.gentoo.org."
120 + Then I should see "If you provide address on archives.gentoo.org in discussion field application will manage this field on it's own."
121 + 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"
122 + Then I should see "Enter reminders for this item. Each line should be a separate reminder in 'mm:ss <reminder message>' format"
123 +
124 + Scenario: User hints
125 + When I am on the home page
126 + And I follow "Signup"
127 + Then I should see "Nick you use on freenode (it's important if you are council member)."
128
129 diff --git a/site/features/step_definitions/agenda_item_steps.rb b/site/features/step_definitions/agenda_item_steps.rb
130 index 4b18f7b..b600bad 100644
131 --- a/site/features/step_definitions/agenda_item_steps.rb
132 +++ b/site/features/step_definitions/agenda_item_steps.rb
133 @@ -52,8 +52,3 @@ Then /^I should see discussion times when viewing agenda items$/ do
134 Then "I should see \"#{item.discussion_time}\""
135 end
136 end
137 -
138 -Then /^I should see hint on timelimits format$/ do
139 - Then 'I should see "Enter reminders for this item. Each line should be a ' +
140 - 'separate reminder in \'mm:ss <reminder message>\' format" within ".input-help"'
141 -end