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/public/stylesheets/, site/features/step_definitions/, ...
Date: Tue, 05 Jul 2011 15:09:51
Message-Id: ae943141a998fcfae527cbea977f41967be347a2.betelgeuse@gentoo
1 commit: ae943141a998fcfae527cbea977f41967be347a2
2 Author: Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
3 AuthorDate: Wed Jun 29 11:50:13 2011 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 5 09:58:12 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/council-webapp.git;a=commit;h=ae943141
7
8 Display buttons on Agenda item view page in cleaner way
9
10 ---
11 site/app/views/agenda_items/show.dryml | 10 ++++++++--
12 site/features/agenda_items.feature | 10 ++++++++++
13 .../features/step_definitions/agenda_item_steps.rb | 12 ++++++++++++
14 site/features/step_definitions/within_steps.rb | 2 +-
15 site/public/stylesheets/application.css | 4 ++++
16 5 files changed, 35 insertions(+), 3 deletions(-)
17
18 diff --git a/site/app/views/agenda_items/show.dryml b/site/app/views/agenda_items/show.dryml
19 index 1713266..b0b425d 100644
20 --- a/site/app/views/agenda_items/show.dryml
21 +++ b/site/app/views/agenda_items/show.dryml
22 @@ -1,16 +1,22 @@
23 <show-page>
24 - <append-content:>
25 + <append-content-body:>
26 + <div>
27 + <span class="one-button-form">
28 <form if="&this.editable_by?(current_user, :agenda) and this.agenda.nil?">
29 <input value="&Agenda.current.id" type="hidden" name="agenda_item[agenda_id]"/>
30 <submit label="Add to current agenda"/>
31 </form>
32 + </span>
33
34 + <span class="one-button-form">
35 <form if="&this.editable_by?(current_user, :rejected)">
36 <input value="&!this.rejected?" type="hidden" name="agenda_item[rejected]"/>
37 <submit label="Reject" unless="&this.rejected"/>
38 <submit label="Un-reject" if="&this.rejected"/>
39 </form>
40 - </append-content:>
41 + </span>
42 + </div>
43 + </append-content-body:>
44
45 <after-collection:>
46 <form if="&VotingOption.new.creatable_by?(current_user)" action="&create_voting_option_path">
47
48 diff --git a/site/features/agenda_items.feature b/site/features/agenda_items.feature
49 index 114b8a4..18d301f 100644
50 --- a/site/features/agenda_items.feature
51 +++ b/site/features/agenda_items.feature
52 @@ -44,3 +44,13 @@ Feature: Suggest Agenda Items
53 When I am on newest agenda item page
54 Then I should not see "Add to current agenda" button
55 And I should not see "Reject" button
56 +
57 + Scenario: Reject and Add to current agenda buttons displayed nicely
58 + Given example agenda item
59 + And an agenda
60 + And I am logged in as a council member
61 + When I am on the first suggested agenda page
62 + Then I should see "Reject" button inside content body
63 + And "Reject" button should be inline
64 + And I should see "Add to current agenda" button inside content body
65 + And "Add to current agenda" button should be inline
66
67 diff --git a/site/features/step_definitions/agenda_item_steps.rb b/site/features/step_definitions/agenda_item_steps.rb
68 index 22348e8..5bf5de2 100644
69 --- a/site/features/step_definitions/agenda_item_steps.rb
70 +++ b/site/features/step_definitions/agenda_item_steps.rb
71 @@ -27,3 +27,15 @@ Given /^agenda item in current agenda$/ do
72 Agenda.create!
73 AgendaItem.create! :agenda => Agenda.last, :title => 'Item in current agenda'
74 end
75 +
76 +Then /^I should see "([^"]*)" button inside content body$/ do |arg1|
77 + within('.content-body') do
78 + page.all(:xpath, "//input[@type='submit'][@value='#{arg1}']").should_not be_empty
79 + end
80 +end
81 +
82 +Then /^"([^"]*)" button should be inline$/ do |arg1|
83 + within('.one-button-form') do
84 + page.all(:xpath, "//input[@type='submit'][@value='#{arg1}']").should_not be_empty
85 + end
86 +end
87
88 diff --git a/site/features/step_definitions/within_steps.rb b/site/features/step_definitions/within_steps.rb
89 index 821eb61..a36a4af 100644
90 --- a/site/features/step_definitions/within_steps.rb
91 +++ b/site/features/step_definitions/within_steps.rb
92 @@ -2,9 +2,9 @@
93 'as current agenda' => '.current-agenda',
94 'as agenda state' => '.state-tag.view.agenda-state',
95 'as transition' => '.transition',
96 + 'inside content body' => '.content-body',
97 'in the notices' => '.flash.notice',
98 'in the errors' => '.error-messages',
99 - 'in the content body' => '.content-body',
100 'in the agenda items' => '.agenda-items',
101 'in the agendas collection' => '.collection.agendas',
102 'as empty collection message' => '.empty-collection-message',
103
104 diff --git a/site/public/stylesheets/application.css b/site/public/stylesheets/application.css
105 index e69de29..2ac85eb 100644
106 --- a/site/public/stylesheets/application.css
107 +++ b/site/public/stylesheets/application.css
108 @@ -0,0 +1,4 @@
109 +.one-button-form{
110 + float: left;
111 + margin: 5pt;
112 +}