Orbit/app/views/admin/attributes/_attribute_field.html.erb

35 lines
1.6 KiB
Plaintext
Raw Normal View History

2011-12-23 10:34:21 +00:00
<tr id="<%= "attribute_#{attribute_field.id}" if !attribute_field.new_record? %>" class="list_item">
<td><%= attribute_field.new_record? ? (f.text_field :key) : attribute_field.key %></td>
<td class='select_mulitlingual' style='text-align:center'>
<%= f.check_box :locale %>
</td>
2012-07-25 21:58:09 +00:00
<%= f.fields_for :title_translations do |f| %>
2011-12-23 10:34:21 +00:00
<% @site_valid_locales.each do |locale| %>
2012-07-25 21:58:09 +00:00
<td><%= f.text_field locale, :style => "width:130px", :value => (attribute_field.title_translations[locale] rescue nil) %></td>
2011-12-23 10:34:21 +00:00
<% end %>
<% end %>
<td class='select_type'>
2012-09-13 10:39:27 +00:00
2011-12-23 10:34:21 +00:00
<%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %>
<div <%= attribute_field[:markup].eql?('select') ? nil : "style='display:none'"%>>
<%= t('admin.options') %>:
2012-09-13 10:39:27 +00:00
<%= f.select "select_list_options", {'1'=>"A",'2'=>"B",'3'=>"C"}, :style => "width:130px" %>
<%#= collection_select(:select_list_options, method, collection, value_method, text_method, options = {}, html_options = {}) %>
2011-12-23 10:34:21 +00:00
</div>
</td>
<td class="action">
<% if attribute_field.new_record? %>
2011-12-23 10:34:21 +00:00
<a href="#" class="delete"><%= t(:delete) %></a>
<% else %>
<%= f.hidden_field :id %>
<% if attribute_field.is_built_in? %>
<a href="#" class="switch" id="<%= attribute_field.id %>"></a>
<%= f.hidden_field :disabled, :value => attribute_field.is_disabled? , :class => 'built_in_state' %>
<% else %>
<a href="#" class="remove_existing_record delete"><%= t(:delete) %></a>
2011-12-23 10:34:21 +00:00
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
<% end %>
<% end %>
</td>
</tr>