Browse files

many ui improvements

  • Loading branch information...
1 parent f849b32 commit c76733235429b8f6850c84300045ee1f7cecfd1e @mipearson committed Apr 17, 2010
View
2 app/controllers/submissions_controller.rb
@@ -11,11 +11,13 @@ def create
params[:submission]['kind'] = (params['commit'] == 'I am working on ...' ? 'project' : 'interest')
Submission.create!(params[:submission])
+ flash[:notice] = 'Submission received.'
redirect_to(submissions_url)
end
def delete
Submission.find_by_id(params[:submission][:id]).delete
+ flash[:notice] = 'Submission deleted.'
redirect_to(submissions_url)
end
end
View
4 app/views/submissions/_submission.erb
@@ -1,8 +1,8 @@
<% form_for(submission, :url => { :action => 'delete'}) do |f| %>
<div id='submission_<%=submission.id %>'>
<%= f.hidden_field :id %>
- <%= f.submit 'x', :class => 'deleter'%>
+ <%= f.submit 'x', :class => 'deleter' %>
<em><%= submission.submission %></em>
- <strong><%= submission.name %> at <%= submission.created_at %></strong>
+ <strong><%= time_ago_in_words(submission.created_at) %> ago by <%= submission.name %> </strong>
</div>
<% end %>
View
13 app/views/submissions/index.html.erb
@@ -22,21 +22,26 @@
</div>
<div class="clearBoth"></div>
<div class="content">
+ <% if flash[:notice ]%>
+ <div class="submissionMsg">
+ <strong><%= flash[:notice] %></strong>
+ </div>
+ <% end %>
<div class="workage">
- <div class="contentPadding">
+ <div class="contentPaddingLeft">
<h2>I am working on</h2>
<%= render :partial => 'submission', :collection => @projects %>
</div>
</div>
<div class="workage nextDoor">
- <div class="contentPadding">
- <h2>I want to work on</h2>
+ <div class="contentPaddingRight">
+ <h2>I am interested in</h2>
<%= render :partial => 'submission', :collection => @interests %>
</div>
</div>
</div>
<div class="clearBoth"></div>
- <div class="contentPadding">
+ <div class="contentPaddingRight">
<div class="credits">
by Michael Pearson, Sam Weller and Keith Pitt<br>
available on BananaJour as 'what'<br>
View
17 features/step_definitions/what_steps.rb
@@ -9,11 +9,11 @@
end
When /^I enter a project definition$/ do
- fill_in "Submission", :with => 'My Project'
+ fill_in "submission_submission", :with => 'My Project'
end
When /^I enter my name$/ do
- fill_in 'Name', :with => 'Bob Bobson'
+ fill_in 'submission_name', :with => 'Bob Bobson'
end
When /^I click 'I am working on \.\.\.'$/ do
@@ -22,13 +22,12 @@
Then /^I should see my project information in on the What page$/ do
# todo FIX SELECTOR SCOPE
- page.should have_selector('div#projects')
page.should contain 'My Project'
page.should contain 'Bob Bobson'
end
When /^I enter what I am interested in working on$/ do
- fill_in "Submission", :with => 'I like stuff'
+ fill_in "submission_submission", :with => 'I like stuff'
end
When /^I click 'I am interested in \.\.\.'$/ do
@@ -69,3 +68,13 @@
Then /^that submission should no longer be present on the What page$/ do
page.should_not contain 'cocks'
end
+
+Then /^I should see confirmation that my submission was received$/ do
+ page.should contain 'Submission received.'
+end
+
+Then /^I should see confirmation that a submission was deleted$/ do
+ page.should contain 'Submission deleted.'
+end
+
+
View
5 features/what.feature
@@ -11,21 +11,24 @@ Scenario: User is working on a project
And I enter my name
And I click 'I am working on ...'
Then I should see my project information in on the What page
+ And I should see confirmation that my submission was received
Scenario: User is interested in a topic
Given that I am viewing the What page
When I enter what I am interested in working on
And I enter my name
And I click 'I am interested in ...'
Then I should see my 'interested in' information in the What page
+ And I should see confirmation that my submission was received
Scenario: User wishes to delete an entry
Given that there is a submission that I wish to delete
And that I am viewing the What page
When I delete that submission
Then that submission should no longer be present on the What page
+ And I should see confirmation that a submission was deleted
Scenario: Viewing the page
Given that there are several projects and interests already entered
When I view the What page
- Then I should see all of the projects and interests
+ Then I should see all of the projects and interests
View
BIN public/images/delete.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
32 public/javascripts/screen.css
@@ -60,7 +60,7 @@ h2 {
.workage strong {
margin-bottom: 1.5em;
- color: #ccc;
+ color: #aaa;
}
form {
@@ -99,8 +99,12 @@ textarea {
float: right;
}
-.contentPadding {
- padding-right: 4em;
+.contentPaddingRight {
+ padding-left: 1.75em;
+}
+
+.contentPaddingLeft {
+ padding-right: 1.75em;
}
.credits {
@@ -110,5 +114,27 @@ textarea {
.new_submission {
float: right;
+}
+
+.submissionMsg {
+ /*background-color: #eee;*/
+ border: 1px solid #ccc;
+ padding: 0.5em;
+ margin-bottom: 1em;
+ /* width: 100%; */
+}
+.deleter {
+ float: right;
+ background: url(../images/delete.gif) no-repeat;
+ border: none;
+ height: 20px;
+ width: 16px;
+ border: 1px solid white;
+ text-indent: -1000px;
+}
+
+.deleter:hover {
+ border: 1px solid #ccc;
+}
}

0 comments on commit c767332

Please sign in to comment.