Permalink
Browse files

Added the ability to mark a course type as a 'homeroom'

  • Loading branch information...
1 parent fe48a58 commit f3c3608b976d1b0010d9641327fd076574adde01 @rnhurt committed Nov 9, 2010
Showing with 23 additions and 15 deletions.
  1. +5 −1 app/views/settings/course_types/edit.html.erb
  2. +18 −14 app/views/settings/course_types/index.html.erb
@@ -14,9 +14,13 @@
<br />
<div id='ranges' class='prepend-2 span-13 last'>
- <%#= render :partial => 'scale_range', :collection => @course_type.scale_ranges.sort{|a,b| b.max_score <=> a.max_score} %>
+ <%#= render :partial => 'scale_range', :collection => @course_type.scale_ranges.sort{|a,b| b.max_score <=> a.max_score} %>
</div>
+ <%= f.label :is_homeroom, "Homeroom" %>
+ <%= f.check_box :is_homeroom %>
+ <br />
+
<div class='spacer span-15 last'>
<%= submit_tag 'Save', :class => 'btn positive' %>
<%= link_to 'Cancel', course_types_path, :class => 'btn standard' %>
@@ -7,22 +7,26 @@
:message => "We had some problems saving your changes:" %>
<%= link_to "Add Course Type", new_course_type_path, :class => 'btn positive' %>
+* indicates a HomeRoom course type
<div class="box">
-<ul id="types" class="table">
- <% @course_types.each do |type| %>
- <% content_tag_for :li, type do %>
- <table><tr>
- <td width="90%"><%= link_to type.name, edit_course_type_path(type) %></td>
- <td width="10%"><%= button_to 'Delete', course_type_path(type), :method => :delete,
- :disabled => !type.courses.empty?,
- :class => "btn negative " + (type.courses.empty? ? '' : 'disabled'),
- :confirm => "Are you sure you want to delete\n\n '" + type.name + "'?" %></td>
- <td class="handle">[drag]</td>
- </tr>
- </table>
+ <ul id="types" class="table">
+ <% @course_types.each do |type| %>
+ <% content_tag_for :li, type do %>
+ <table><tr>
+ <td width="90%">
+ <%= "*" if type.is_homeroom? %>
+ <%= link_to type.name, edit_course_type_path(type) %>
+ </td>
+ <td width="10%"><%= button_to 'Delete', course_type_path(type), :method => :delete,
+ :disabled => !type.courses.empty?,
+ :class => "btn negative " + (type.courses.empty? ? '' : 'disabled'),
+ :confirm => "Are you sure you want to delete\n\n '" + type.name + "'?" %></td>
+ <td class="handle">[drag]</td>
+ </tr>
+ </table>
+ <% end %>
<% end %>
- <% end %>
-</ul>
+ </ul>
</div>
<%= sortable_element("types", :url => sort_course_types_path, :handle => 'handle') %>

0 comments on commit f3c3608

Please sign in to comment.