This repository has been archived by the owner on Dec 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaned up in-place-editing of houses by moving line items into a par…
…tial and abstracting options for select boxes into helpers
- Loading branch information
1 parent
d463264
commit 195d8cd
Showing
6 changed files
with
68 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
module HousesHelper | ||
|
||
def permanent_chores_start_week_options | ||
(1..15).collect {|i|[i,i]} | ||
end | ||
|
||
def using_online_sign_off_options | ||
[['Yes', 1], ['No', 0]] | ||
end | ||
|
||
def sign_off_verification_mode_options | ||
[["None", 0], ["Without password", 1], ["With password", 2]] | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<tr> | ||
<td><%= best_in_place house, :name %></td> | ||
<td><%= house.semester_start_date %></td> | ||
<td><%= house.semester_end_date %></td> | ||
<td><%= best_in_place house, :permanent_chores_start_week, :type => :select, :collection => reverse_elements(permanent_chores_start_week_options) %></td> | ||
<td><%= best_in_place house, :hours_per_week %></td> | ||
<td><%= best_in_place house, :sign_off_by_hours_after %></td> | ||
<td><%= best_in_place house, :using_online_sign_off, :type => :select, :collection => reverse_elements(using_online_sign_off_options) %></td> | ||
<td><%= best_in_place house, :sign_off_verification_mode, :type => :select, :collection => reverse_elements(sign_off_verification_mode_options) %></td> | ||
<td><%= best_in_place house, :blow_off_penalty_factor %></td> | ||
<td><%= best_in_place house, :wsm_email %></td> | ||
<td><%= link_to 'x', house, :confirm => 'Are you sure you want to delete this house?', :method => :delete, :remote => true, :class => 'delete_button' %></td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<tr id="new_item_line"> | ||
<td class="new_item_field"> | ||
<%= f.text_field :name %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.text_field :semester_start_date %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.text_field :semester_end_date %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.select(:permanent_chores_start_week, options_for_select(permanent_chores_start_week_options)) %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.text_field :hours_per_week %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.text_field :sign_off_by_hours_after %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.select(:using_online_sign_off, options_for_select(using_online_sign_off_options, 0)) %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.select(:sign_off_verification_mode, options_for_select(sign_off_verification_mode_options, 2)) %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.text_field :blow_off_penalty_factor %> | ||
</td> | ||
<td class="new_item_field"> | ||
<%= f.text_field :wsm_email %> | ||
</td> | ||
<td class="actions"> | ||
<%= f.submit "Create" %> | ||
</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters