public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/council-webapp:master commit in: site/public/stylesheets/, site/features/step_definitions/, ...
@ 2011-07-05 15:09 Petteri Räty
  0 siblings, 0 replies; only message in thread
From: Petteri Räty @ 2011-07-05 15:09 UTC (permalink / raw
  To: gentoo-commits

commit:     ae943141a998fcfae527cbea977f41967be347a2
Author:     Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
AuthorDate: Wed Jun 29 11:50:13 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue Jul  5 09:58:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/council-webapp.git;a=commit;h=ae943141

Display buttons on Agenda item view page in cleaner way

---
 site/app/views/agenda_items/show.dryml             |   10 ++++++++--
 site/features/agenda_items.feature                 |   10 ++++++++++
 .../features/step_definitions/agenda_item_steps.rb |   12 ++++++++++++
 site/features/step_definitions/within_steps.rb     |    2 +-
 site/public/stylesheets/application.css            |    4 ++++
 5 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/site/app/views/agenda_items/show.dryml b/site/app/views/agenda_items/show.dryml
index 1713266..b0b425d 100644
--- a/site/app/views/agenda_items/show.dryml
+++ b/site/app/views/agenda_items/show.dryml
@@ -1,16 +1,22 @@
 <show-page>
-  <append-content:>
+  <append-content-body:>
+    <div>
+    <span class="one-button-form">
     <form if="&this.editable_by?(current_user, :agenda) and this.agenda.nil?">
       <input value="&Agenda.current.id" type="hidden" name="agenda_item[agenda_id]"/>
       <submit label="Add to current agenda"/>
     </form>
+    </span>
 
+    <span class="one-button-form">
     <form if="&this.editable_by?(current_user, :rejected)">
       <input value="&!this.rejected?" type="hidden" name="agenda_item[rejected]"/>
       <submit label="Reject" unless="&this.rejected"/>
       <submit label="Un-reject" if="&this.rejected"/>
     </form>
-  </append-content:>
+    </span>
+    </div>
+  </append-content-body:>
 
   <after-collection:>
     <form if="&VotingOption.new.creatable_by?(current_user)" action="&create_voting_option_path">

diff --git a/site/features/agenda_items.feature b/site/features/agenda_items.feature
index 114b8a4..18d301f 100644
--- a/site/features/agenda_items.feature
+++ b/site/features/agenda_items.feature
@@ -44,3 +44,13 @@ Feature: Suggest Agenda Items
     When I am on newest agenda item page
     Then I should not see "Add to current agenda" button
     And I should not see "Reject" button
+
+  Scenario: Reject and Add to current agenda  buttons displayed nicely
+    Given example agenda item
+    And an agenda
+    And I am logged in as a council member
+    When I am on the first suggested agenda page
+    Then I should see "Reject" button inside content body
+    And "Reject" button should be inline
+    And I should see "Add to current agenda" button inside content body
+    And "Add to current agenda" button should be inline

diff --git a/site/features/step_definitions/agenda_item_steps.rb b/site/features/step_definitions/agenda_item_steps.rb
index 22348e8..5bf5de2 100644
--- a/site/features/step_definitions/agenda_item_steps.rb
+++ b/site/features/step_definitions/agenda_item_steps.rb
@@ -27,3 +27,15 @@ Given /^agenda item in current agenda$/ do
   Agenda.create!
   AgendaItem.create! :agenda => Agenda.last, :title => 'Item in current agenda'
 end
+
+Then /^I should see "([^"]*)" button inside content body$/ do |arg1|
+  within('.content-body') do
+    page.all(:xpath, "//input[@type='submit'][@value='#{arg1}']").should_not be_empty
+  end
+end
+
+Then /^"([^"]*)" button should be inline$/ do |arg1|
+  within('.one-button-form') do
+    page.all(:xpath, "//input[@type='submit'][@value='#{arg1}']").should_not be_empty
+  end
+end

diff --git a/site/features/step_definitions/within_steps.rb b/site/features/step_definitions/within_steps.rb
index 821eb61..a36a4af 100644
--- a/site/features/step_definitions/within_steps.rb
+++ b/site/features/step_definitions/within_steps.rb
@@ -2,9 +2,9 @@
   'as current agenda' => '.current-agenda',
   'as agenda state' => '.state-tag.view.agenda-state',
   'as transition' => '.transition',
+  'inside content body' => '.content-body',
   'in the notices' => '.flash.notice',
   'in the errors' => '.error-messages',
-  'in the content body' => '.content-body',
   'in the agenda items' => '.agenda-items',
   'in the agendas collection' => '.collection.agendas',
   'as empty collection message' => '.empty-collection-message',

diff --git a/site/public/stylesheets/application.css b/site/public/stylesheets/application.css
index e69de29..2ac85eb 100644
--- a/site/public/stylesheets/application.css
+++ b/site/public/stylesheets/application.css
@@ -0,0 +1,4 @@
+.one-button-form{
+  float: left;
+  margin: 5pt;
+}



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-05 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-05 15:09 [gentoo-commits] proj/council-webapp:master commit in: site/public/stylesheets/, site/features/step_definitions/, Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox