2011-11-18 08:43:14 +00:00
|
|
|
<div id="UserRole_block" class="roles_block">
|
2011-11-19 13:47:18 +00:00
|
|
|
<h2><%= t("admin.user_#{@attribute}") %></h2>
|
2011-11-18 08:43:14 +00:00
|
|
|
<div class="info_input">
|
|
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
|
|
|
<thead class="list_head">
|
|
|
|
<tr>
|
|
|
|
<td><%= t('admin.key') %></td>
|
|
|
|
<% @site_valid_locales.each do |locale| %>
|
|
|
|
<td style="color:<%= colorize_in_use_locale(locale) %>"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr class="list_item">
|
|
|
|
<td><%= is_new ? (f.text_field :key, {:style => "width:150px"}) : @user_attribute_model.key %></td>
|
|
|
|
<% @site_valid_locales.each do |locale| %>
|
|
|
|
<td>
|
|
|
|
<%= text_field_tag "user_#{@attribute}_model[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:150px" %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
|
2011-11-18 08:43:14 +00:00
|
|
|
<div id="attributes_block" class="roles_block">
|
|
|
|
<h2>Attributes</h2>
|
|
|
|
<div class="info_input">
|
|
|
|
<table id='attributes' border="0" cellspacing="0" cellpadding="0">
|
|
|
|
<thead class="list_head">
|
|
|
|
<tr>
|
|
|
|
<td><%= t('admin.key') %></td>
|
|
|
|
<td><%= t('admin.multilingual') %></td>
|
|
|
|
<% @site_valid_locales.each do |locale| %>
|
|
|
|
<td style="color:<%= colorize_in_use_locale(locale) %>"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
|
|
|
<% end %>
|
|
|
|
<td><%= t('admin.type')%></td>
|
|
|
|
<td> </td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<td colspan="5"><a href="#" class="add"><%= t(:add) %></a></td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
<tbody>
|
|
|
|
<%= render :partial => 'admin/user_attribute_models/attribute_model', :collection => @user_attribute_model.attribute_models %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
<% content_for :page_specific_javascript do %>
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
2011-11-18 08:43:14 +00:00
|
|
|
$('#attributes_block a.delete').live('click', function(){
|
|
|
|
$(this).parent().parent().parent().remove();
|
2011-04-13 10:19:51 +00:00
|
|
|
});
|
|
|
|
|
2011-11-18 08:43:14 +00:00
|
|
|
$('#attributes_block a.add').click(function(){
|
2011-02-01 07:12:23 +00:00
|
|
|
$('#attributes').append("<%= escape_javascript(render(:partial => 'admin/user_attribute_models/attribute_model', :object => @user_attribute_model.attribute_models.build)) %>");
|
2011-04-13 10:19:51 +00:00
|
|
|
});
|
|
|
|
|
2011-11-18 08:43:14 +00:00
|
|
|
$('#attributes_block 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();
|
|
|
|
});
|
2011-05-02 04:07:31 +00:00
|
|
|
|
2011-11-18 08:43:14 +00:00
|
|
|
$('#attributes_block a.change_built_in').click(function(){
|
2011-11-19 13:47:18 +00:00
|
|
|
$(this).parent().toggleClass('disable');
|
2011-05-02 04:07:31 +00:00
|
|
|
var $am = $(this).next('.built_in_state')
|
|
|
|
$am.attr('value', ($am.attr('value') == "false") ? "true" : "false");
|
|
|
|
});
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
$('.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 -%>
|