_activities.html.erb 1.34 KB
Newer Older
1 2 3 4 5 6 7
<div class="contextual">
<%= link_to(l(:button_reset), project_enumerations_path(@project),
            :method => :delete,
            :data => {:confirm => l(:text_are_you_sure)},
            :class => 'icon icon-del') %>
</div>

jplang's avatar
jplang committed
8
<%= form_tag(project_enumerations_path(@project), :method => :put, :class => "tabular") do %>
9 10 11 12 13 14

<table class="list">
  <thead><tr>
    <th><%= l(:field_name) %></th>
    <th><%= l(:enumeration_system_activity) %></th>
    <% TimeEntryActivity.new.available_custom_fields.each do |value| %>
jplang's avatar
jplang committed
15
    <th><%= value.name %></th>
16
    <% end %>
17
    <th><%= toggle_checkboxes_link('input.enumerations_active') %> <%= l(:field_active) %></th>
18 19 20
  </tr></thead>

  <% @project.activities(true).each do |enumeration| %>
jplang's avatar
jplang committed
21
  <%= fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %>
22
  <tr>
23
    <td class="name">
24
      <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %>
jplang's avatar
jplang committed
25
      <%= enumeration %>
26
    </td>
27
    <td class="tick"><%= checked_image !enumeration.project %></td>
28
    <% enumeration.custom_field_values.each do |value| %>
29
    <td>
30 31 32
      <%= custom_field_tag "enumerations[#{enumeration.id}]", value %>
    </td>
    <% end %>
33
    <td>
34
      <%= ff.check_box :active, :class => 'enumerations_active' %>
35 36 37 38 39 40 41 42
    </td>
  </tr>
  <% end %>
  <% end %>
</table>

<%= submit_tag l(:button_save) %>
<% end %>