Merge with sub_roles
This commit is contained in:
1 parent
fc591ee308
commit
62aaf79491
308 files changed
+2844
-17841
No files matched your search
@@ -0,0 +1,3 @@
|
||||
<div class="auth_unit">
|
||||
<%= unit%>
|
||||
<div>
|
||||
@@ -0,0 +1,32 @@
|
||||
<% content_for :secondary do %>
|
||||
<div id='user_list'>
|
||||
<div class="role_list">
|
||||
<h1>User Role</h1>
|
||||
<ul class="list">
|
||||
<% @roles.each do |role| %>
|
||||
<li class="set_1"><%= link_to content_tag(:span, "Role") %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<h1><%= t('admin.list_app_auths') %></h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th><%= t('admin.app.name') %></th>
|
||||
<th><%= t('admin.description') %></th>
|
||||
</tr>
|
||||
|
||||
<% @app_auth_data.each do |app| %>
|
||||
<tr>
|
||||
<td><%= app[0][:app_obj].title %></td>
|
||||
<% app[0][:auth_field].each do |unit| %>
|
||||
<td>
|
||||
<%= render :partial => "auth_unit",:locals => {:unit => unit } %>
|
||||
</td>
|
||||
<%end%>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
@@ -0,0 +1,34 @@
|
||||
<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>
|
||||
<%= f.fields_for :i18n_variable, (attribute_field.new_record? ? attribute_field.build_i18n_variable : attribute_field.i18n_variable) do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= f.text_field locale, :style => "width:130px" %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<td class='select_type'>
|
||||
<%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %>
|
||||
<div <%= attribute_field[:markup].eql?('select') ? nil : "style='display:none'"%>>
|
||||
<%= t('admin.options') %>:
|
||||
<%= f.select "select_list_options", attribute_field.select_list_options, :style => "width:130px" %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="action">
|
||||
<% if attribute_field.new_record? %>
|
||||
<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"><%= t(:delete) %></a>
|
||||
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,14 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="profile">
|
||||
<%= form_for @attribute, :url => eval("admin_#{@attribute_type}_path(@attribute)") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/#{@attribute_type}s/form", :locals => { :f => f, :is_new => false } %>
|
||||
<div class='button_bar'>
|
||||
<%= link_back %>
|
||||
<%= link_to t('update'), "#", :onclick=>"$('#edit_#{@attribute_type}_#{@attribute.id}').submit()" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -0,0 +1,39 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div class="main_list">
|
||||
<div class="button_bar up">
|
||||
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="<%= @attribute_type %>s"><%= t("admin.#{@attribute_type}") %></td>
|
||||
<td class="action"><%= t('admin.action') %></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @attributes.each do |attribute| %>
|
||||
<tr id="attribute_<%= attribute.id %>" class="have <%= "#{attribute.is_disabled? ? 'disable' : ''}" %>">
|
||||
<td class="<%= @attribute_type %>s <%= attribute.key.downcase %>"><%= attribute.i18n_variable[I18n.locale] %></span>
|
||||
<td class="action">
|
||||
|
||||
<%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class => 'edit' %>
|
||||
<%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %>
|
||||
<%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %>
|
||||
<% if !attribute.is_built_in? %>
|
||||
<%= link_to t(:delete), eval("admin_#{@attribute_type}_path(attribute)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="button_bar">
|
||||
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="profile">
|
||||
<%= form_for @attribute, :url => eval("admin_#{@attribute_type}s_path") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/#{@attribute_type}s/form", :locals => { :f => f, :is_new => true } %>
|
||||
<div class="button_bar">
|
||||
<%= link_back %>
|
||||
<%= link_to t('create'), "#", :onclick=>"$('#new_#{@attribute_type}').submit()" %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
$("#enable_<%= @attribute.id %>").toggle();
|
||||
$("#disable_<%= @attribute.id %>").toggle();
|
||||
$("#attribute_<%= @attribute.id %>").toggleClass('disable');
|
||||
@@ -18,7 +18,7 @@
|
||||
<% end %>
|
||||
</ul>
|
||||
<p class="new_file">
|
||||
<%= fields_for "design[" + field_name + "][]", object.send(field_name).build, :index => nil do |f| %>
|
||||
<%= fields_for "design[new_files][" + field_name + "][]", object.send(field_name).build, :index => nil do |f| %>
|
||||
<%= f.file_field :file, :class => "multi_files" %>
|
||||
</p>
|
||||
<% end %>
|
||||
@@ -0,0 +1,10 @@
|
||||
<h1><%= t('admin.new_design') %></h1>
|
||||
|
||||
<%= form_for :design, :url => admin_designs_path do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit t('create') %> <%= link_back %>
|
||||
</p>
|
||||
<% end %>
|
||||
@@ -1,6 +1,6 @@
|
||||
<h1><%= t('admin.editing_design') %></h1>
|
||||
|
||||
<%= form_for @design, :url => admin_design_path(@design) do |f| %>
|
||||
<%= form_for @design, :url => admin_design_path(@design),:html => {:multipart => true} do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
<p>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="main2">
|
||||
<h1><%= t('admin.new_design') %></h1>
|
||||
|
||||
<%= form_for :design, :url => admin_designs_path do |f| %>
|
||||
<%= form_for :design, :url => admin_designs_path, :html => {:multipart => true} do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
<%= f.submit t('create') %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
rcom.modalWindow({loadHtml:"<%= escape_javascript(render(:partial => 'new')) %>"});
|
||||
@@ -0,0 +1,3 @@
|
||||
<%= f.fields_for :attribute_fields, attribute_field do |f| %>
|
||||
<%= render :partial => 'admin/attributes/attribute_field', :object => attribute_field, :locals => {:f => f} %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,70 @@
|
||||
<div class="attributes_block <%= @class %>">
|
||||
<h2><%= t("admin.#{@attribute_type}") %></h2>
|
||||
<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><%= 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"}) : @attribute.key %></td>
|
||||
<%= f.fields_for :i18n_variable, (@attribute.new_record? ? @attribute.build_i18n_variable : @attribute.i18n_variable) do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= f.text_field locale, :style => "width:150px" %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="attributes_block <%= @class %>">
|
||||
<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><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
<td><%= t('admin.type')%></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<%= hidden_field_tag 'attribute_field_count', @attribute.attribute_fields.count %>
|
||||
<a href="#" class="add"><%= t(:add) %></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% @attribute.attribute_fields.each do |attribute_field| %>
|
||||
<%= render :partial => 'attribute_field', :object => attribute_field, :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "attribute_form" %>
|
||||
<script>
|
||||
$('.attributes_block a.add').live('click', function(){
|
||||
var new_id = $(this).prev().attr('value');
|
||||
var old_id = new RegExp("new_attribute_fields", "g");
|
||||
$(this).prev().attr('value', parseInt(new_id) + 1);
|
||||
$('#attributes').append(("<%= escape_javascript(add_attribute 'admin/attributes/attribute_field', f, :attribute_fields) %>").replace(old_id, new_id));
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
@@ -0,0 +1 @@
|
||||
<%= f.select :module_app, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
|
||||
@@ -0,0 +1 @@
|
||||
$('#app_page_url').html("<%= escape_javascript(select 'page','app_frontend_url', @module_app.app_pages) %>");
|
||||
@@ -30,8 +30,13 @@
|
||||
<%= f.select :theme_id, @default_design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= t('admin.module_app') %>
|
||||
<%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %>
|
||||
<span id="app_page_url"></span>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :is_published, "#{t('admin.is_published')} ?" %>
|
||||
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
|
||||
</p>
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= parse_page_edit(@item).html_safe %>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "page_edit" %>
|
||||
<% end -%>
|
||||
<%= parse_page_edit(@item).html_safe %>
|
||||
@@ -0,0 +1,3 @@
|
||||
<%= f.fields_for :attribute_fields, attribute_field do |f| %>
|
||||
<%= render :partial => 'admin/attributes/attribute_field', :object => attribute_field, :locals => {:f => f} %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,50 @@
|
||||
<div class="attributes_block <%= @class %>">
|
||||
<h2><%= t("admin.#{@attribute_type}") %></h2>
|
||||
<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><%= 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"}) : @attribute.key %></td>
|
||||
<%= f.fields_for :i18n_variable, (@attribute.new_record? ? @attribute.build_i18n_variable : @attribute.i18n_variable) do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= f.text_field locale, :style => "width:150px" %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='sub_roles' class="attributes_block <%= @class %>">
|
||||
<h2>Sub roles</h2>
|
||||
<% @attribute.sub_roles.each_with_index do |sub_role, i| %>
|
||||
<%= render :partial => 'form_sub', :object => sub_role, :locals => {:f => f, :i => i} %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='add_sub_role' class="info_input attributes_block">
|
||||
<%= hidden_field_tag 'attribute_field_count', @attribute.sub_roles.count %>
|
||||
<a href="#" class="add"><%= t(:add) %></a>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "attribute_form" %>
|
||||
<script>
|
||||
$('#add_sub_role a.add').live('click', function(){
|
||||
var new_id = $(this).prev().attr('value');
|
||||
var old_id = new RegExp("new_sub_roles", "g");
|
||||
$(this).prev().attr('value', parseInt(new_id) + 1);
|
||||
$('#sub_roles').append(("<%= escape_javascript(add_attribute 'admin/roles/sub_role', f, :sub_roles) %>").replace(old_id, new_id));
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
@@ -0,0 +1,3 @@
|
||||
<%= f.fields_for :sub_roles, form_sub do |f| %>
|
||||
<%= render :partial => 'sub_role', :object => form_sub, :locals => {:f => f, :i => i} %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
<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><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="list_item">
|
||||
<td><%= sub_role.new_record? ? (f.text_field :key, {:style => "width:150px"}) : sub_role.key %></td>
|
||||
<%= f.fields_for :i18n_variable, (sub_role.new_record? ? sub_role.build_i18n_variable : sub_role.i18n_variable) do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= f.text_field locale, :style => "width:150px" %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="attributes_block <%= @class %>">
|
||||
<h2>Attributes</h2>
|
||||
<div class="info_input">
|
||||
<table class="sub_role_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><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
<td><%= t('admin.type')%></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td id='add_attribute' colspan="5">
|
||||
<%= hidden_field_tag 'attribute_field_count', sub_role.attribute_fields.count %>
|
||||
<a href="#" class="add"><%= t(:add) %></a>
|
||||
<%= hidden_field_tag 'sub_role_temp_id', (i rescue 'new_sub_roles') %>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% sub_role.attribute_fields.each do |attribute_field| %>
|
||||
<%= render :partial => 'attribute_field', :object => attribute_field, :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<script>
|
||||
$('#add_attribute a.add').live('click', function(){
|
||||
var new_parent_id = $(this).next().attr('value');
|
||||
var old_parent_id = new RegExp("new_sub_roles", "g");
|
||||
var new_id = $(this).prev().attr('value');
|
||||
var old_id = new RegExp("new_attribute_fields", "g");
|
||||
$(this).prev().attr('value', parseInt(new_id) + 1);
|
||||
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'admin/attributes/attribute_field', f, :attribute_fields) %>").replace(old_id, new_id).replace(old_parent_id, new_parent_id));
|
||||
});
|
||||
</script>
|
||||
<% end unless !sub_role.new_record? %>
|
||||
@@ -1,36 +0,0 @@
|
||||
<%= fields_for "user_#{@attribute}_model[attribute_models][]", attribute_model, :index => nil do |f| %>
|
||||
<tr class="list_item">
|
||||
<td><%= attribute_model.new_record? ? (f.text_field :key) : attribute_model.key %></td>
|
||||
<td class='select_mulitlingual' style='text-align:center'>
|
||||
<%= check_box_tag "locale[]", value = '', attribute_model.locale.nil? ? true : attribute_model.locale %>
|
||||
<%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][locale]", attribute_model.locale.nil? ? true : attribute_model.locale %>
|
||||
</td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<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"} %>
|
||||
<div <%= attribute_model[:markup].eql?('select') ? nil : "style='display:none'"%>>
|
||||
<%= t('admin.options') %>:
|
||||
<%= text_field_tag "user_#{@attribute}_model[attribute_models][][select_list_options]", attribute_model.select_list_options, :style => "width:130px" %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="action">
|
||||
<% if attribute_model.new_record? %>
|
||||
<a href="#" class="delete"><%= t(:delete) %></a>
|
||||
<% else %>
|
||||
<% if attribute_model.is_built_in? %>
|
||||
<a href="#" class="change_built_in switch" id="<%= attribute_model.id %>"></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 delete"><%= t(:delete) %></a>
|
||||
<%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :key %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -1,57 +0,0 @@
|
||||
<div id="UserRole_block" class="roles_block <%= @class %>">
|
||||
<h2><%= t("admin.user_#{@attribute}") %></h2>
|
||||
<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><%= 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>
|
||||
|
||||
|
||||
<div id="attributes_block" class="roles_block <%= @class %>">
|
||||
<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><%= 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>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "user_attribute_model_form" %>
|
||||
<% end -%>
|
||||
@@ -1,31 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%= @title || APP_CONFIG['orbit'] %></title>
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<%= stylesheet_link_tag "admin" %>
|
||||
<%= javascript_include_tag "admin" %>
|
||||
<%= yield :page_specific_css %>
|
||||
<%= yield :page_specific_javascript %>
|
||||
<%= csrf_meta_tag %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="panel_banner_link" >
|
||||
<div id="orbit"><%= render 'layouts/drop_down_menu' %></div>
|
||||
<div class="hmenu">
|
||||
<div class="lang"><%= render 'layouts/lang_menu' %></div>
|
||||
<%= render 'devise/menu/login_items' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div id="sidebar"><%= yield :secondary %></div>
|
||||
<div class="main">
|
||||
<%= yield %>
|
||||
</div>
|
||||
<div class="tertiary"><%= yield :tertiary %></div>
|
||||
<div id="panel_footer"><p><%= APP_CONFIG['ruling_digital'] %></p></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,14 +0,0 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile" class="clear">
|
||||
<%= form_for @user_attribute_model, :url => eval("admin_user_#{@attribute}_model_path(@user_role_model)") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/user_attribute_models/form", :locals => { :f => f, :is_new => false } %>
|
||||
<div class="button_bar">
|
||||
<%= link_to t('update'), "#", :onclick=>"$('#edit_user_role_model_#{@user_attribute_model.id}').submit()" %>
|
||||
<%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
@@ -1,14 +0,0 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile">
|
||||
<%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<div class="button_bar">
|
||||
<%= link_back %>
|
||||
<%= link_to t('update'), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
@@ -1,41 +0,0 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div class="main_list clear">
|
||||
<div class="button_bar up">
|
||||
<%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path"), :class => 'new' %>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="<%= @attribute %>s"><%= t("admin.#{@attribute}") %></td>
|
||||
<td class="action"><%= t('admin.action') %></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @user_attribute_models.each do |user_attribute_model| %>
|
||||
<tr id="attribute_<%= user_attribute_model.id %>" class="have <%= "#{user_attribute_model.is_disabled? ? 'disable' : ''}" %>">
|
||||
<td class="<%= @attribute %>s <%= user_attribute_model.i18n_variable[:key].downcase %>"><%= user_attribute_model.i18n_variable[I18n.locale] %></td>
|
||||
<td class="action">
|
||||
<%= link_to t(:edit), eval("edit_admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'edit' %>
|
||||
<% if user_attribute_model.is_built_in? %>
|
||||
<%= link_to t(:enable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? 'none' : ''}", :class => 'switch' %>
|
||||
<%= link_to t(:disable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? '' : 'none'}", :class => 'switch' %>
|
||||
<% else %>
|
||||
<%= link_to t(:enable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? 'none' : ''}", :class => 'switch' %>
|
||||
<%= link_to t(:disable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? '' : 'none'}", :class => 'switch' %>
|
||||
<%= link_to t(:delete), eval("admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="button_bar">
|
||||
<%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path"), :class => 'new' %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,18 +0,0 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile" class="clear">
|
||||
<%= form_for @user_attribute_model, :url => eval("admin_user_#{@attribute}_models_path") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/user_attribute_models/form", :locals => { :f => f, :is_new => true } %>
|
||||
<div class="button_bar">
|
||||
<%= link_back %>
|
||||
<%= link_to t('create'), "#", :onclick=>"$('#new_user_attribute_model').submit()" %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
$("#enable_<%= @user_attribute_model.id %>").toggle();
|
||||
$("#disable_<%= @user_attribute_model.id %>").toggle();
|
||||
$("#attribute_<%= @user_attribute_model.id %>").toggleClass('disable');
|
||||
@@ -1,32 +0,0 @@
|
||||
<p>
|
||||
<%= f.label :name %>
|
||||
<%= f.text_field :name %>
|
||||
</p>
|
||||
|
||||
<fieldset>
|
||||
<% @user_attribute.attrs.each_with_index do |attr, i| %>
|
||||
<p>
|
||||
<label><%= attr["key"] %></label>
|
||||
<%= hidden_field_tag "user_attribute[attrs][][key]", attr["key"] %>
|
||||
<%= text_field_tag "user_attribute[attrs][][name]", attr["name"] %>
|
||||
<%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field", "select"], attr["type"]) %>
|
||||
<a href="#" class="remove">(remove)</a>
|
||||
</p>
|
||||
<% end -%>
|
||||
|
||||
<p id="newone">
|
||||
<label>Key</label>
|
||||
<%= text_field_tag "user_attribute[attrs][][key]", "" %>
|
||||
<label>Name</label>
|
||||
<%= text_field_tag "user_attribute[attrs][][name]", "" %>
|
||||
<%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field"], "") %>
|
||||
<a href="#" class="remove">(remove)</a>
|
||||
</p>
|
||||
|
||||
<a href="#" class="add">(add)</a>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "user_attribute_form" %>
|
||||
<% end -%>
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
<h1>Editing user attribute: <%= @user_attribute.key %></h1>
|
||||
|
||||
<% form_for @user_attribute, :url => admin_user_attribute_path(@user_attribute) do |f| %>
|
||||
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit %>
|
||||
</p>
|
||||
|
||||
<% end -%>
|
||||
@@ -1,34 +0,0 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div class="main_list">
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="list_head clear">
|
||||
<span class="<%= @attribute %>s"><%= t("admin.#{@attribute}") %></span>
|
||||
<span class="action"><%= t('admin.action') %></span>
|
||||
</li>
|
||||
<% @user_attribute_models.each do |user_attribute_model| %>
|
||||
<li id="attribute_<%= user_attribute_model.id %>" class="list_item <%= "#{user_attribute_model.is_disabled? ? 'disable' : ''}" %> clear">
|
||||
<span class="<%= @attribute %>s <%= user_attribute_model.i18n_variable[:key].downcase %>"><%= user_attribute_model.i18n_variable[I18n.locale] %></span>
|
||||
<span class="action">
|
||||
|
||||
<%= link_to t(:edit), eval("edit_admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'edit' %>
|
||||
<% if user_attribute_model.is_built_in? %>
|
||||
<%= link_to t(:enable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? 'none' : ''}", :class => 'switch' %>
|
||||
<%= link_to t(:disable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? '' : 'none'}", :class => 'switch' %>
|
||||
<% else %>
|
||||
<%= link_to t(:delete), eval("admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
|
||||
<% end %>
|
||||
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,16 +0,0 @@
|
||||
<h1>New user attribute: <%= @user_attribute.key %></h1>
|
||||
|
||||
<% form_for @user_attribute, :url => admin_user_attributes_path do |f| %>
|
||||
|
||||
<p>
|
||||
<%= f.label :key, "Key" %>
|
||||
<%= f.text_field :key %>
|
||||
</p>
|
||||
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit %>
|
||||
</p>
|
||||
|
||||
<% end -%>
|
||||
@@ -16,28 +16,21 @@
|
||||
</label>
|
||||
<label>
|
||||
<span><%= t('admin.role') %>:</span>
|
||||
<%= f.select :active_role, @user_role_models.sort_by{|role| role.key }.collect {|role| [ role.i18n_variable[I18n.locale], role.key ]}, :selected => (@user.active_role || 'student') %>
|
||||
<%= f.select :role_id, @roles.sort_by{|role| role.key }.collect {|role| [ role.i18n_variable[I18n.locale], role.id ]}, :selected => (@user.role_id || Role.get_role_from_key('student')) %>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<% @user_info_models.each do |ua| %>
|
||||
<div id="basic_block" class="roles_block <%= @class %>">
|
||||
<h2><%= ua.i18n_variable[I18n.locale] %></h2>
|
||||
<hr>
|
||||
<%= render :partial => 'user_attribute',
|
||||
:object => (@user.user_infos.detect {|u| u.key == ua.key } || @user.user_infos.build),
|
||||
:locals => {:ua => ua, :type => 'info'} %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<div id='role_models'>
|
||||
<% @user_role_models.each do |ua| %>
|
||||
<div id="<%= ua.key %>_block" class="roles_block <%= @class %>" <%= raw(' style="display: none;"') unless ((@user.active_role.eql?(ua.key) rescue nil) || (ua.key.eql?('student') && @user.new_record?)) %>>
|
||||
<h2><%= ua.i18n_variable[I18n.locale] %></h2>
|
||||
<%= render :partial => 'info', :collection => @infos, :locals => {:f => f} %>
|
||||
|
||||
|
||||
<div id='roles'>
|
||||
<% @roles.each do |role| %>
|
||||
<div id="<%= role.id %>_block" class="attributes_block <%= @class %>" <%= raw(' style="display: none;"') unless ((@user.role.id.eql?(role.id) rescue nil) || (role.key.eql?('student') && @user.new_record?)) %>>
|
||||
<h2><%= role.i18n_variable[I18n.locale] %></h2>
|
||||
<hr>
|
||||
<%= render :partial => 'user_attribute',
|
||||
:object => (@user.user_roles.detect {|u| u.key == ua.key } || @user.user_roles.build),
|
||||
:locals => {:ua => ua, :type => 'role'} %>
|
||||
<%= render :partial => 'sub_role_selector', :locals => {:f => f, :role => role} %>
|
||||
<%= render :partial => 'sub_role', :collection => role.sub_roles, :locals => {:f => f, :role => role} %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<div id="basic_block" class="attributes_block <%= @class %>">
|
||||
<h2><%= info.i18n_variable[I18n.locale] %></h2>
|
||||
<hr>
|
||||
<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><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% info.get_enabled_attribute_fields.each do |attr| %>
|
||||
<%= f.fields_for :attribute_values, @user.get_value_from_field_id(attr.id) do |f| %>
|
||||
<tr class="list_item">
|
||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= f.text_field locale %></td>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<td colspan=<%= @site_valid_locales.size %>>
|
||||
<% if attr["markup"] == "text_field" %>
|
||||
<%= f.text_field :non_locale %>
|
||||
<% elsif attr["markup"] == "select" %>
|
||||
<%= f.select :non_locale, options_for_select(attr["options"], value['non_locale']) %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<% end -%>
|
||||
<%= f.hidden_field :attribute_field_id, :value => attr.id %>
|
||||
<%= f.hidden_field :key, :value => attr.key %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div class="info_input">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<thead class="list_head">
|
||||
<td><%= t("admin.key") %></td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% show_attribute.get_enabled_attribute_fields.each do |attr| %>
|
||||
<tr class="list_item">
|
||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td>
|
||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||
<%= show_attribute(@user, attr.id, locale) %>
|
||||
<% else %>
|
||||
<%= show_attribute(@user, attr.id) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
<div id="sub_role_<%= show_sub_role.id %>" class="info_input">
|
||||
<h2><%= show_sub_role.i18n_variable[I18n.locale] %></h2>
|
||||
<%= render :partial => 'show_attribute', :object => show_sub_role %>
|
||||
</div>
|
||||
@@ -1,27 +0,0 @@
|
||||
<div class="info_input">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<thead class="list_head">
|
||||
<td><%= t("admin.key") %></td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% am.get_enabled_attribute_models.each do |attr| %>
|
||||
<tr class="list_item">
|
||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
||||
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td>
|
||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||
<%= show_user_attribute(object, attr.key, locale) %>
|
||||
<% else %>
|
||||
<%= show_user_attribute(object, attr.key) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -2,10 +2,10 @@
|
||||
<input id="user_search" name="user[username]" size="30" type="text" />
|
||||
</div>
|
||||
<div class="member_setup <%= @class %>">
|
||||
<h1><%= t('admin.setup_member') %></h1>
|
||||
<ul class="list">
|
||||
<li class="set_1"><%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %></li>
|
||||
<li class="set_2"><%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %></li>
|
||||
<li class="set_3"><%= link_to content_tag(:span, t('admin.list_user_infos')), admin_user_info_models_path %></li>
|
||||
</ul>
|
||||
<h1><%= t('admin.setup_member') %></h1>
|
||||
<ul class="list">
|
||||
<li class="set_1"><%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %></li>
|
||||
<li class="set_2"><%= link_to content_tag(:span, t('admin.list_roles')), admin_roles_path %></li>
|
||||
<li class="set_3"><%= link_to content_tag(:span, t('admin.list_infos')), admin_infos_path %></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
<div id="sub_role_<%= sub_role.id %>" class="info_input" <%= raw(' style="display: none;"') unless @user.sub_role_ids.include?(sub_role.id) %>>
|
||||
<h2><%= sub_role.i18n_variable[I18n.locale] %></h2>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<thead class="list_head">
|
||||
<tr>
|
||||
<td><%= t("admin.key") %></td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% sub_role.get_enabled_attribute_fields.each do |attr| %>
|
||||
<%= f.fields_for :attribute_values, @user.get_value_from_field_id(attr.id) do |f| %>
|
||||
<tr class="list_item">
|
||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= f.text_field locale %></td>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<td colspan=<%= @site_valid_locales.size %>>
|
||||
<% if attr["markup"] == "text_field" %>
|
||||
<%= f.text_field :non_locale %>
|
||||
<% elsif attr["markup"] == "select" %>
|
||||
<%= f.select :non_locale, options_for_select(attr["options"], value['non_locale']) %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<% end -%>
|
||||
<%= f.hidden_field :attribute_field_id, :value => attr.id %>
|
||||
<%= f.hidden_field :key, :value => attr.key %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
<% role.sub_roles.each do |sub_role| %>
|
||||
<%= sub_role.i18n_variable[I18n.locale] %>
|
||||
<%= check_box_tag "user[sub_role_ids][]", sub_role.id, @user.sub_role_ids.include?(sub_role.id), :class => 'sub_role_select' %>
|
||||
<% end %>
|
||||
@@ -1,44 +0,0 @@
|
||||
<%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %>
|
||||
<%= f.hidden_field :key, :value => ua.key %>
|
||||
<%= f.hidden_field :id unless user_attribute.new_record? %>
|
||||
|
||||
<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><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% ua.get_enabled_attribute_models.each do |attr| %>
|
||||
<% value = user_attribute.attribute_values.detect{|v| v.key == attr.key } %>
|
||||
<%= hidden_field_tag "user[user_#{type}s][][attribute_values][][id]", value.id rescue nil %>
|
||||
<%= hidden_field_tag "user[user_#{type}s][][attribute_values][][key]", attr.key %>
|
||||
<tr class="list_item">
|
||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||
<%= hidden_field_tag "user[user_#{type}s][][attribute_values][][non_locale]", nil %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td>
|
||||
<%= text_field_tag "user[user_#{type}s][][attribute_values][][#{locale}]", (value[locale] rescue nil) %>
|
||||
</td>
|
||||
<% end -%>
|
||||
<% else %>
|
||||
<td colspan=<%= @site_valid_locales.size %>>
|
||||
<% if attr["markup"] == "text_field" %>
|
||||
<%= text_field_tag "user[user_#{type}s][][attribute_values][][non_locale]", (value['non_locale'] rescue nil) %>
|
||||
<% elsif attr["markup"] == "select" %>
|
||||
<%= select_tag "user[user_#{type}s][][attribute_values][][non_locale]", options_for_select(attr["options"], value['non_locale']) %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<% end -%>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile" class="clear">
|
||||
<div id="profile" class="clear">>
|
||||
<%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @users.each do |user| %>
|
||||
<% active_role = UserRoleModel.get_role_model_from_key(user.active_role) %>
|
||||
<tr class="have">
|
||||
<td class="roles <%= active_role.key.downcase rescue nil %>"><%= active_role.i18n_variable[I18n.locale] rescue nil %></td>
|
||||
<td class="roles <%= user.role.key.downcase rescue nil %>"><%= user.role.i18n_variable[I18n.locale] rescue nil %></td>
|
||||
<td class="name"><%= user.name ? user.name : 'bob' %></td>
|
||||
<td class="email"><%= user.email %></td>
|
||||
<td class="admin"><%= user.admin ? t(:yes_) : t(:no_) %></td>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile" class="clear">
|
||||
<div id="profile" class="clear">
|
||||
<%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
|
||||
@@ -2,29 +2,28 @@
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile" class="clear">
|
||||
<div id="profile" class="clear">
|
||||
|
||||
<div id="person">
|
||||
<% if @user.avatar? %>
|
||||
<%= image_tag(@user.avatar.thumb.url) %>
|
||||
<% if @user.avatar? %>
|
||||
<%= image_tag(@user.avatar.thumb.url) %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png" %>
|
||||
<%= image_tag "person.png" %>
|
||||
<% end %>
|
||||
<label><span><%= @user.email %></span></label>
|
||||
</div>
|
||||
|
||||
<% @user_info_models.each do |am| %>
|
||||
<% @infos.each do |a| %>
|
||||
<div id="basic_block" class="roles_block <%= @class %>">
|
||||
<h2><%= am.i18n_variable[I18n.locale] %></h2>
|
||||
<h2><%= a.i18n_variable[I18n.locale] %></h2>
|
||||
<hr>
|
||||
<%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %>
|
||||
<%= render :partial => 'show_attribute', :object => a %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<div id="<%= @user.active_role %>_block" class="roles_block <%= @class %>">
|
||||
<% active_role = UserRoleModel.get_role_model_from_key(@user.active_role) %>
|
||||
<h2><%= active_role.i18n_variable[I18n.locale] %></h2>
|
||||
<div id="<%= @user.role.key %>_block" class="roles_block <%= @class %>">
|
||||
<h2><%= @user.role.i18n_variable[I18n.locale] %></h2>
|
||||
<hr>
|
||||
<%= render :partial => 'show_user_attribute', :locals => {:am => active_role, :object => @user.get_role_from_model_key(active_role.key)} %>
|
||||
<%= render :partial => 'show_sub_role', :collection => @user.sub_roles %>
|
||||
</div>
|
||||
<div class="button_bar">
|
||||
<%= link_to t(:edit), edit_admin_user_path(@user) %>
|
||||
|
||||
Reference in new issue
Block a user