Revision 912:5e80956cc792 app/views/enumerations

View differences:

app/views/enumerations/_form.html.erb
1
<%= error_messages_for 'enumeration' %>
2
<div class="box">
3
<!--[form:optvalue]-->
4
<%= hidden_field 'enumeration', 'type'  %>
5

  
6
<p><label for="enumeration_name"><%=l(:field_name)%></label>
7
<%= text_field 'enumeration', 'name'  %></p>
8

  
9
<p><label for="enumeration_active"><%=l(:field_active)%></label>
10
<%= check_box 'enumeration', 'active'  %></p>
11

  
12
<p><label for="enumeration_is_default"><%=l(:field_is_default)%></label>
13
<%= check_box 'enumeration', 'is_default'  %></p>
14
<!--[eoform:optvalue]-->
15

  
16
<% @enumeration.custom_field_values.each do |value| %>
17
  <p><%= custom_field_tag_with_label :enumeration, value %></p>
18
<% end %>
19
</div>
app/views/enumerations/_form.rhtml
1
<%= error_messages_for 'enumeration' %>
2
<div class="box">
3
<!--[form:optvalue]-->
4
<%= hidden_field 'enumeration', 'type'  %>
5

  
6
<p><label for="enumeration_name"><%=l(:field_name)%></label>
7
<%= text_field 'enumeration', 'name'  %></p>
8

  
9
<p><label for="enumeration_active"><%=l(:field_active)%></label>
10
<%= check_box 'enumeration', 'active'  %></p>
11

  
12
<p><label for="enumeration_is_default"><%=l(:field_is_default)%></label>
13
<%= check_box 'enumeration', 'is_default'  %></p>
14
<!--[eoform:optvalue]-->
15

  
16
<% @enumeration.custom_field_values.each do |value| %>
17
	<p><%= custom_field_tag_with_label :enumeration, value %></p>
18
<% end %>
19
</div>
app/views/enumerations/destroy.html.erb
1
<h2><%= l(@enumeration.option_name) %>: <%=h @enumeration %></h2>
2

  
3
<% form_tag({}) do %>
4
<div class="box">
5
<p><strong><%= l(:text_enumeration_destroy_question, @enumeration.objects_count) %></strong></p>
6
<p><label for='reassign_to_id'><%= l(:text_enumeration_category_reassign_to) %></label>
7
<%= select_tag 'reassign_to_id', ("<option>--- #{l(:actionview_instancetag_blank_option)} ---</option>" + options_from_collection_for_select(@enumerations, 'id', 'name')) %></p>
8
</div>
9

  
10
<%= submit_tag l(:button_apply) %>
11
<%= link_to l(:button_cancel), :controller => 'enumerations', :action => 'index' %>
12
<% end %>
app/views/enumerations/destroy.rhtml
1
<h2><%= l(@enumeration.option_name) %>: <%=h @enumeration %></h2>
2

  
3
<% form_tag({}) do %>
4
<div class="box">
5
<p><strong><%= l(:text_enumeration_destroy_question, @enumeration.objects_count) %></strong></p>
6
<p><%= l(:text_enumeration_category_reassign_to) %>
7
<%= select_tag 'reassign_to_id', ("<option>--- #{l(:actionview_instancetag_blank_option)} ---</option>" + options_from_collection_for_select(@enumerations, 'id', 'name')) %></p>
8
</div>
9

  
10
<%= submit_tag l(:button_apply) %>
11
<%= link_to l(:button_cancel), :controller => 'enumerations', :action => 'index' %>
12
<% end %>
app/views/enumerations/edit.html.erb
1
<h2><%= link_to l(@enumeration.option_name), :controller => 'enumerations', :action => 'index' %> &#187; <%=h @enumeration %></h2>
2

  
3
<% form_tag({:action => 'update', :id => @enumeration}, :class => "tabular") do %>
4
  <%= render :partial => 'form' %>
5
  <%= submit_tag l(:button_save) %>
6
<% end %>
app/views/enumerations/edit.rhtml
1
<h2><%= link_to l(@enumeration.option_name), :controller => 'enumerations', :action => 'index' %> &#187; <%=h @enumeration %></h2>
2

  
3
<% form_tag({:action => 'update', :id => @enumeration}, :class => "tabular") do %>
4
  <%= render :partial => 'form' %>
5
  <%= submit_tag l(:button_save) %>
6
<% end %>
7

  
8
<% form_tag({:action => 'destroy', :id => @enumeration}) do %>
9
  <%= submit_tag l(:button_delete) %>
10
<% end %>
app/views/enumerations/index.html.erb
1
<h2><%=l(:label_enumerations)%></h2>
2

  
3
<% Enumeration.get_subclasses.each do |klass| %>
4
<h3><%= l(klass::OptionName) %></h3>
5

  
6
<% enumerations = klass.shared %>
7
<% if enumerations.any? %>
8
<table class="list"><thead>
9
<tr>
10
    <th><%= l(:field_name) %></th>
11
    <th style="width:15%;"><%= l(:field_is_default) %></th>
12
    <th style="width:15%;"><%= l(:field_active) %></th>
13
    <th style="width:15%;"></th>
14
    <th align="center" style="width:10%;"> </th>
15
</tr></thead>
16
<% enumerations.each do |enumeration| %>
17
<tr class="<%= cycle('odd', 'even') %>">
18
    <td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td>
19
    <td class="center" style="width:15%;"><%= checked_image enumeration.is_default? %></td>
20
    <td class="center" style="width:15%;"><%= checked_image enumeration.active? %></td>
21
    <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td>
22
    <td class="buttons">
23
    <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration },
24
                                   :method => :post,
25
                                   :confirm => l(:text_are_you_sure),
26
                                   :class => 'icon icon-del' %>
27
    </td>
28
</tr>
29
<% end %>
30
</table>
31
<% reset_cycle %>
32
<% end %>
33

  
34
<p><%= link_to l(:label_enumeration_new), { :action => 'new', :type => klass.name } %></p>
35
<% end %>
36

  
37
<% html_title(l(:label_enumerations)) -%>
app/views/enumerations/list.rhtml
1
<h2><%=l(:label_enumerations)%></h2>
2

  
3
<% Enumeration.get_subclasses.each do |klass| %>
4
<h3><%= l(klass::OptionName) %></h3>
5

  
6
<% enumerations = klass.shared %>
7
<% if enumerations.any? %>
8
<table class="list"><thead>
9
<tr>
10
    <th><%= l(:field_name) %></th>
11
    <th style="width:15%;"><%= l(:field_is_default) %></th>
12
    <th style="width:15%;"><%= l(:field_active) %></th>
13
    <th style="width:15%;"></th>
14
    <th align="center" style="width:10%;"> </th>
15
</tr></thead>
16
<% enumerations.each do |enumeration| %>
17
<tr class="<%= cycle('odd', 'even') %>">
18
    <td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td>
19
    <td class="center" style="width:15%;"><%= checked_image enumeration.is_default? %></td>
20
    <td class="center" style="width:15%;"><%= checked_image enumeration.active? %></td>
21
    <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td>
22
    <td class="buttons">
23
    <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration }, 
24
    															 :method => :post,
25
    															 :confirm => l(:text_are_you_sure),
26
    															 :class => 'icon icon-del' %>
27
    </td>
28
</tr>
29
<% end %>
30
</table>
31
<% reset_cycle %>
32
<% end %>
33

  
34
<p><%= link_to l(:label_enumeration_new), { :action => 'new', :type => klass.name } %></p>
35
<% end %>
36

  
37
<% html_title(l(:label_enumerations)) -%>
app/views/enumerations/new.html.erb
1
<h2><%= link_to l(@enumeration.option_name), :controller => 'enumerations', :action => 'index' %> &#187; <%=l(:label_enumeration_new)%></h2>
2

  
3
<% form_tag({:action => 'create'}, :class => "tabular") do %>
4
  <%= render :partial => 'form' %>
5
  <%= submit_tag l(:button_create) %>
6
<% end %>
app/views/enumerations/new.rhtml
1
<h2><%= link_to l(@enumeration.option_name), :controller => 'enumerations', :action => 'index' %> &#187; <%=l(:label_enumeration_new)%></h2>
2

  
3
<% form_tag({:action => 'create'}, :class => "tabular") do %>
4
  <%= render :partial => 'form' %>
5
  <%= submit_tag l(:button_create) %>
6
<% end %>

Also available in: Unified diff