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

74 lines
2.1 KiB
Plaintext
Raw Normal View History

<table>
<tr>
<th><%= t('admin.key') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
<tr>
2011-02-01 02:46:26 +00:00
<td><%= is_new ? (f.text_field :key, {:style => "width:130px"}) : @user_role_model.key %></td>
<% @site_valid_locales.each do |locale| %>
<td>
2011-02-01 02:46:26 +00:00
<%= text_field_tag "user_role_model[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:130px" %>
</td>
<% end %>
</tr>
</table>
2011-02-01 02:46:26 +00:00
<fieldset id='field_set_attributes'>
<legend>
<%= t('admin.attributes')%>
</legend>
2011-02-01 02:46:26 +00:00
<table id='attributes'>
<tr>
<th><%= t('admin.key') %></th>
<th><%= t('admin.multilingual') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
<th><%= t('admin.type')%></th>
<th></th>
</tr>
2011-02-01 02:46:26 +00:00
<%= render :partial => 'attribute_model', :collection => @user_role_model.attribute_models %>
</table>
<a href="#" class="add">(<%= t(:add) %>)</a>
</fieldset>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
2011-02-01 02:46:26 +00:00
$('#field_set_attributes a.remove').live('click', function(){
$(this).parent().parent().remove();
});
2011-02-01 02:46:26 +00:00
$('#field_set_attributes a.add').click(function(){
$('#attribute').append("<%= escape_javascript(render(:partial => 'attribute_model', :object => @user_role_model.attribute_models.build)) %>");
});
2011-02-01 02:46:26 +00:00
$('#field_set_attributes a.remove_existing_record').click(function(){
$(this).next('.should_destroy').attr('value', 1);
$(this).parent().parent().hide();
});
$('.select_mulitlingual input').live('click', function(){
$(this).next().attr('value', this.checked);
});
$('.select_type select').live('change', function(){
if(this.value == 'select')
{
$(this).next().show();
}
else
{
$(this).next().hide();
}
});
</script>
<% end -%>