diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-04 17:04:50 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-04 17:04:50 +0000 |
commit | c216ab325bc56123819fb5b700a759753959ead8 (patch) | |
tree | a90493432ae7a2ca681c193e65627d16341bf53e /app/views/enumerations | |
parent | 479b9b54336c3fa5ce3f9fccb56307a52b48dd0c (diff) | |
download | redmine-c216ab325bc56123819fb5b700a759753959ead8.tar.gz redmine-c216ab325bc56123819fb5b700a759753959ead8.zip |
Added position on Enumeration model.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@800 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/enumerations')
-rw-r--r-- | app/views/enumerations/list.rhtml | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/app/views/enumerations/list.rhtml b/app/views/enumerations/list.rhtml index f7756ce30..f92ca0a31 100644 --- a/app/views/enumerations/list.rhtml +++ b/app/views/enumerations/list.rhtml @@ -1,19 +1,25 @@ <h2><%=l(:label_enumerations)%></h2> - + <% Enumeration::OPTIONS.each do |option, name| %> +<h3><%= l(name) %></h3> + +<% enumerations = Enumeration.get_values(option) %> +<% if enumerations.any? %> +<table class="list"> +<% enumerations.each do |enumeration| %> +<tr class="<%= cycle('odd', 'even') %>"> + <td><%= link_to enumeration.name, :action => 'edit', :id => enumeration %></td> + <td style="width:15%;"> + <%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => enumeration, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %> + <%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => enumeration, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> - + <%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => enumeration, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %> + <%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => enumeration, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %> + </td> +</tr> +<% end %> +</table> +<% reset_cycle %> +<% end %> - <% if params[:opt]==option %> - - <h3><%= l(name) %></h3> - <ul> - <% for value in Enumeration.find(:all, :conditions => ["opt = ?", option]) %> - <li><%= link_to value.name, :action => 'edit', :id => value %></li> - <% end %> - </ul> - <p><%= link_to l(:label_enumeration_new), { :action => 'new', :opt => option }, :class => "icon icon-add" %></p> - - <% else %> - <h3><%= link_to l(name), :opt => option %></h3> - <% end %> - -<% end %>
\ No newline at end of file +<p><%= link_to l(:label_enumeration_new), { :action => 'new', :opt => option } %></p> +<% end %> |