2011-04-13 10:19:51 +00:00
|
|
|
<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>
|
2011-04-13 10:19:51 +00:00
|
|
|
<% @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" %>
|
2011-04-13 10:19:51 +00:00
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2011-02-01 02:46:26 +00:00
|
|
|
<fieldset id='field_set_attributes'>
|
2011-04-13 10:19:51 +00:00
|
|
|
<legend>
|
|
|
|
<%= t('admin.attributes')%>
|
|
|
|
</legend>
|
|
|
|
|
2011-02-01 02:46:26 +00:00
|
|
|
<table id='attributes'>
|
2011-04-13 10:19:51 +00:00
|
|
|
<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 %>
|
2011-04-13 10:19:51 +00:00
|
|
|
</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(){
|
2011-04-13 10:19:51 +00:00
|
|
|
$(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-04-13 10:19:51 +00:00
|
|
|
});
|
|
|
|
|
2011-02-01 02:46:26 +00:00
|
|
|
$('#field_set_attributes a.remove_existing_record').click(function(){
|
2011-04-13 10:19:51 +00:00
|
|
|
$(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 -%>
|