Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

many ui improvements

  • Loading branch information...
commit c76733235429b8f6850c84300045ee1f7cecfd1e 1 parent f849b32
mipearson authored
2  app/controllers/submissions_controller.rb
@@ -11,11 +11,13 @@ def create
11 11 params[:submission]['kind'] = (params['commit'] == 'I am working on ...' ? 'project' : 'interest')
12 12
13 13 Submission.create!(params[:submission])
  14 + flash[:notice] = 'Submission received.'
14 15 redirect_to(submissions_url)
15 16 end
16 17
17 18 def delete
18 19 Submission.find_by_id(params[:submission][:id]).delete
  20 + flash[:notice] = 'Submission deleted.'
19 21 redirect_to(submissions_url)
20 22 end
21 23 end
4 app/views/submissions/_submission.erb
... ... @@ -1,8 +1,8 @@
1 1 <% form_for(submission, :url => { :action => 'delete'}) do |f| %>
2 2 <div id='submission_<%=submission.id %>'>
3 3 <%= f.hidden_field :id %>
4   - <%= f.submit 'x', :class => 'deleter'%>
  4 + <%= f.submit 'x', :class => 'deleter' %>
5 5 <em><%= submission.submission %></em>
6   - <strong><%= submission.name %> at <%= submission.created_at %></strong>
  6 + <strong><%= time_ago_in_words(submission.created_at) %> ago by <%= submission.name %> </strong>
7 7 </div>
8 8 <% end %>
13 app/views/submissions/index.html.erb
@@ -22,21 +22,26 @@
22 22 </div>
23 23 <div class="clearBoth"></div>
24 24 <div class="content">
  25 + <% if flash[:notice ]%>
  26 + <div class="submissionMsg">
  27 + <strong><%= flash[:notice] %></strong>
  28 + </div>
  29 + <% end %>
25 30 <div class="workage">
26   - <div class="contentPadding">
  31 + <div class="contentPaddingLeft">
27 32 <h2>I am working on</h2>
28 33 <%= render :partial => 'submission', :collection => @projects %>
29 34 </div>
30 35 </div>
31 36 <div class="workage nextDoor">
32   - <div class="contentPadding">
33   - <h2>I want to work on</h2>
  37 + <div class="contentPaddingRight">
  38 + <h2>I am interested in</h2>
34 39 <%= render :partial => 'submission', :collection => @interests %>
35 40 </div>
36 41 </div>
37 42 </div>
38 43 <div class="clearBoth"></div>
39   - <div class="contentPadding">
  44 + <div class="contentPaddingRight">
40 45 <div class="credits">
41 46 by Michael Pearson, Sam Weller and Keith Pitt<br>
42 47 available on BananaJour as 'what'<br>
17 features/step_definitions/what_steps.rb
@@ -9,11 +9,11 @@
9 9 end
10 10
11 11 When /^I enter a project definition$/ do
12   - fill_in "Submission", :with => 'My Project'
  12 + fill_in "submission_submission", :with => 'My Project'
13 13 end
14 14
15 15 When /^I enter my name$/ do
16   - fill_in 'Name', :with => 'Bob Bobson'
  16 + fill_in 'submission_name', :with => 'Bob Bobson'
17 17 end
18 18
19 19 When /^I click 'I am working on \.\.\.'$/ do
@@ -22,13 +22,12 @@
22 22
23 23 Then /^I should see my project information in on the What page$/ do
24 24 # todo FIX SELECTOR SCOPE
25   - page.should have_selector('div#projects')
26 25 page.should contain 'My Project'
27 26 page.should contain 'Bob Bobson'
28 27 end
29 28
30 29 When /^I enter what I am interested in working on$/ do
31   - fill_in "Submission", :with => 'I like stuff'
  30 + fill_in "submission_submission", :with => 'I like stuff'
32 31 end
33 32
34 33 When /^I click 'I am interested in \.\.\.'$/ do
@@ -69,3 +68,13 @@
69 68 Then /^that submission should no longer be present on the What page$/ do
70 69 page.should_not contain 'cocks'
71 70 end
  71 +
  72 +Then /^I should see confirmation that my submission was received$/ do
  73 + page.should contain 'Submission received.'
  74 +end
  75 +
  76 +Then /^I should see confirmation that a submission was deleted$/ do
  77 + page.should contain 'Submission deleted.'
  78 +end
  79 +
  80 +
5 features/what.feature
@@ -11,6 +11,7 @@ Scenario: User is working on a project
11 11 And I enter my name
12 12 And I click 'I am working on ...'
13 13 Then I should see my project information in on the What page
  14 + And I should see confirmation that my submission was received
14 15
15 16 Scenario: User is interested in a topic
16 17 Given that I am viewing the What page
@@ -18,14 +19,16 @@ Scenario: User is interested in a topic
18 19 And I enter my name
19 20 And I click 'I am interested in ...'
20 21 Then I should see my 'interested in' information in the What page
  22 + And I should see confirmation that my submission was received
21 23
22 24 Scenario: User wishes to delete an entry
23 25 Given that there is a submission that I wish to delete
24 26 And that I am viewing the What page
25 27 When I delete that submission
26 28 Then that submission should no longer be present on the What page
  29 + And I should see confirmation that a submission was deleted
27 30
28 31 Scenario: Viewing the page
29 32 Given that there are several projects and interests already entered
30 33 When I view the What page
31   - Then I should see all of the projects and interests
  34 + Then I should see all of the projects and interests
BIN  public/images/delete.gif
32 public/javascripts/screen.css
@@ -60,7 +60,7 @@ h2 {
60 60
61 61 .workage strong {
62 62 margin-bottom: 1.5em;
63   - color: #ccc;
  63 + color: #aaa;
64 64 }
65 65
66 66 form {
@@ -99,8 +99,12 @@ textarea {
99 99 float: right;
100 100 }
101 101
102   -.contentPadding {
103   - padding-right: 4em;
  102 +.contentPaddingRight {
  103 + padding-left: 1.75em;
  104 +}
  105 +
  106 +.contentPaddingLeft {
  107 + padding-right: 1.75em;
104 108 }
105 109
106 110 .credits {
@@ -110,5 +114,27 @@ textarea {
110 114
111 115 .new_submission {
112 116 float: right;
  117 +}
  118 +
  119 +.submissionMsg {
  120 + /*background-color: #eee;*/
  121 + border: 1px solid #ccc;
  122 + padding: 0.5em;
  123 + margin-bottom: 1em;
  124 + /* width: 100%; */
  125 +}
113 126
  127 +.deleter {
  128 + float: right;
  129 + background: url(../images/delete.gif) no-repeat;
  130 + border: none;
  131 + height: 20px;
  132 + width: 16px;
  133 + border: 1px solid white;
  134 + text-indent: -1000px;
  135 +}
  136 +
  137 +.deleter:hover {
  138 + border: 1px solid #ccc;
  139 +}
114 140 }

0 comments on commit c767332

Please sign in to comment.
Something went wrong with that request. Please try again.