/
index.html.erb
36 lines (34 loc) · 1.17 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<% content_for :left do %>
<%= render :partial => 'settings/settings_list' %>
<% end %>
<%= error_messages_for "term" %>
<table class='master'>
<thead>
<th>Name</th>
<th>School Year</th>
<th>Begin Date</th>
<th>End Date</th>
<th>Active?</th>
<th width='1'></th>
</thead>
<tbody>
<tr class="<%= cycle('odd', 'even')%>">
<td colspan='0'>
<%= link_to "Add Period", new_term_path(), :class => 'btn positive' %>
</td>
</tr>
<% for term in @terms %>
<tr class="<%= cycle('odd', 'even')%>" onclick="location.href='<%= url_for(term) + '/edit' %>'">
<td><%= link_to term.name, edit_term_path(term) %></td>
<%= content_tag :td, term.school_year %>
<%= content_tag :td, term.begin_date %>
<%= content_tag :td, term.end_date %>
<%= content_tag :td, ( check_box_tag :active, term.active, term.active, :disabled => true ) %>
<td><%= button_to 'Delete', term, :method => :delete,
:disabled => !term.courses.empty?,
:class => "btn negative " + (term.courses.empty? ? '' : 'disabled'),
:confirm => "Are you sure you want to delete the '" + term.name + "' grading period?" %></td>
</tr>
<% end %>
</tbody>
</table>