Orbit/app/views/admin/user_attribute_models/_attribute_model.html.erb

41 lines
2.1 KiB
Plaintext
Raw Normal View History

2011-02-01 07:12:23 +00:00
<%= fields_for "user_#{@attribute}_model[attribute_models][]", attribute_model, :index => nil do |f| %>
<tr>
2011-02-01 02:46:26 +00:00
<td><%= attribute_model.new_record? ? (f.text_field :key, {:style => "width:130px"}) : attribute_model.key %></td>
<td class='select_mulitlingual' style='text-align:center'>
2011-02-01 02:46:26 +00:00
<%= check_box_tag "locale[]", value = '', attribute_model.locale.nil? ? true : attribute_model.locale %>
2011-02-01 07:12:23 +00:00
<%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][locale]", attribute_model.locale.nil? ? true : attribute_model.locale %>
</td>
<% @site_valid_locales.each do |locale| %>
2011-02-01 07:12:23 +00:00
<td><%= text_field_tag "user_#{@attribute}_model[attribute_models][][i18n_variable][#{locale}]", (attribute_model.i18n_variable[locale] rescue nil), :style => "width:130px" %></td>
<% end %>
<td class='select_type'>
<%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %>
2011-02-01 02:46:26 +00:00
<div <%= attribute_model[:markup].eql?('select') ? nil : "style='display:none'"%>>
<%= t('admin.options') %>:
2011-02-01 07:12:23 +00:00
<%= text_field_tag "user_#{@attribute}_model[attribute_models][][select_list_options]", attribute_model.select_list_options, :style => "width:130px" %>
</div>
</td>
<td>
2011-02-01 02:46:26 +00:00
<% if attribute_model.new_record? %>
<a href="#" class="remove">(<%= t(:delete) %>)</a>
<% else %>
2011-05-02 04:07:31 +00:00
<% if attribute_model.is_built_in? %>
<a href="#" class="change_built_in" id="<%= attribute_model.id %>">
<span style="display:<%= attribute_model.is_disabled? ? 'none' : 'inline' %>"><%= t(:disable) %></span>
<span style="display:<%= attribute_model.is_disabled? ? 'inline' : 'none' %>"><%= t(:enable) %></span>
</a>
<%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][disabled]", attribute_model.is_disabled? , :class => 'built_in_state' %>
<% else %>
<a href="#" class="remove_existing_record">(<%= t(:delete) %>)</a>
<%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %>
<% end %>
<%= f.hidden_field :id %>
2011-01-28 06:44:08 +00:00
<%= f.hidden_field :key %>
<% end %>
</td>
</tr>
<% end %>