Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
Tidy up need and source forms with Bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanHatch committed Apr 23, 2013
1 parent 7b255be commit 7fdde19
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
12 changes: 7 additions & 5 deletions app/views/needs/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
<% end %>
<%= f.inputs :id => 'overview' do %>
<%= f.input :title, :label => 'Need *' %>
<%= f.input :description, :label => 'Context', :hint => "provide some information about the circumstances surrounding this need" %>
<%= f.input :tag_list, :as => :string, :label => 'Tags', :hint => "separate tags with commas" %>
<%= f.input :title, :label => 'Need *', :input_html => { :class => "input-block-level" } %>
<%= f.input :description, :label => 'Context', :hint => "provide some information about the circumstances surrounding this need", :input_html => { :class => "input-block-level" } %>
<%= f.input :tag_list, :as => :string, :label => 'Tags', :hint => "separate tags with commas", :input_html => { :class => "input-block-level" } %>
<% end %>
<% if f.object.persisted? %>
<%= f.inputs :id => 'metadata', :name => 'Product decision' do %>
<%= f.input :kind %>
<%= f.input :status, :collection => Need::STATUSES %>
<%= f.input :url %>
<%= f.input :url, :input_html => { :class => "input-block-level" } %>
<%= f.input :priority, :as => 'select', :collection => Need::PRIORITIES_FOR_SELECT if @need.format_assigned?%>
<%= f.input :reason_for_formatting_decision if @need.format_assigned? %>
<% if @need.format_assigned? %>
<%= f.input :reason_for_formatting_decision, :input_html => { :class => "input-block-level" } %>
<% end %>
<%= f.input :writing_department, :label => 'Writing team' %>
<% i = 0 %><%= f.semantic_fields_for :accountabilities, accountabilities_for(@need) do |accountability| %>
Expand Down
8 changes: 5 additions & 3 deletions app/views/needs/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Editing need</h1>
<section class="span12 centred">
<h1>Editing need</h1>

<%= render 'form' %>
<%= render 'form' %>
</section>

<% content_for :current_state, @need.status %>
<% content_for :current_state, @need.status %>
10 changes: 6 additions & 4 deletions app/views/needs/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<h1>Enter a new need</h1>
<section class="span12 centred">
<h1>Enter a new need</h1>

<p class="hints">Pithily capture a user need, e.g. pay my council tax, find out about childcare, find a job</p>
<p class="hints">Pithily capture a user need, e.g. pay my council tax, find out about childcare, find a job</p>

<%= render 'form' %>
<%= render 'form' %>
</section>

<% content_for :current_state, 'new' %>
<% content_for :current_state, 'new' %>
6 changes: 3 additions & 3 deletions app/views/sources/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<% end %>
<%= f.inputs do %>
<%= f.input :title, :as => :string %>
<%= f.input :title, :as => :string, :input_html => { :class => "input-block-level" } %>
<%= f.input :kind, :as => :select, :collection => Source::KINDS.map {|k| [k.humanize, k]} %>
<%= f.input :url, :label => "URL", :as => :string %>
<%= f.input :body, :label => "Notes", :as => :text, :rows => "4" %>
<%= f.input :url, :label => "URL", :as => :string, :input_html => { :class => "input-block-level" } %>
<%= f.input :body, :label => "Notes", :as => :text, :rows => "4", :input_html => { :class => "input-block-level" } %>
<% end %>
<%= f.actions %>
Expand Down
6 changes: 4 additions & 2 deletions app/views/sources/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Edit source</h1>
<section class="span12 centred">
<h1>Edit source</h1>

<%= render 'form' %>
<%= render 'form' %>
</section>

<% content_for :current_state, @need.status %>
6 changes: 4 additions & 2 deletions app/views/sources/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Add source</h1>
<section class="span12 centred">
<h1>Add source</h1>

<%= render 'form' %>
<%= render 'form' %>
</section>

<% content_for :current_state, @need.status %>

0 comments on commit 7fdde19

Please sign in to comment.