Change role structure
Still needs to: change the views and create sub_roles in the dev.rake
This commit is contained in:
1 parent
e0cdedfa2e
commit
b7ac5478b4
45 files changed
+608
-492
No files matched your search
@@ -0,0 +1,36 @@
|
||||
<%= fields_for "user_#{@attribute_type}_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_type}_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_type}_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_type}_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_type}_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_type}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :key %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -0,0 +1,57 @@
|
||||
<div id="UserRole_block" class="roles_block">
|
||||
<h2><%= t("admin.user_#{@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 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"}) : @attribute.key %></td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td>
|
||||
<%= text_field_tag "user_#{@attribute_type}_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">
|
||||
<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/attributes/attribute_model', :collection => @attribute.attribute_models %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "attribute_form" %>
|
||||
<% end -%>
|
||||
@@ -0,0 +1,16 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile">
|
||||
<%= form_for @attribute, :url => eval("admin_user_#{@attribute_type}_model_path(@user_role_model)") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/attributes/form", :locals => { :f => f, :is_new => false } %>
|
||||
<div id="update" class='buttom clear'>
|
||||
<%= link_to t('update'), "#", :onclick=>"$('#edit_user_role_model_#{@attribute.id}').submit()" %>
|
||||
</div>
|
||||
<div id="back" class='buttom clear'>
|
||||
<%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<% 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_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path") %>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="list_head clear">
|
||||
<span class="<%= @attribute_type %>s"><%= t("admin.#{@attribute_type}") %></span>
|
||||
<span class="action"><%= t('admin.action') %></span>
|
||||
</li>
|
||||
<% @attributes.each do |attribute| %>
|
||||
<li id="attribute_<%= attribute.id %>" class="list_item <%= "#{attribute.is_disabled? ? 'disable' : ''}" %> clear">
|
||||
<span class="<%= @attribute_type %>s <%= attribute.i18n_variable[:key].downcase %>"><%= attribute.i18n_variable[I18n.locale] %></span>
|
||||
<span class="action">
|
||||
|
||||
<%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class => 'edit' %>
|
||||
<% if attribute.is_built_in? %>
|
||||
<%= 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' %>
|
||||
<% else %>
|
||||
<%= link_to t(:delete), eval("admin_#{@attribute_type}_path(attribute)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
|
||||
<% end %>
|
||||
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path") %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile">
|
||||
<%= form_for @attribute, :url => eval("admin_infos_path") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/infos/form", :locals => { :f => f, :is_new => true } %>
|
||||
<div id="create" class='buttom clear'>
|
||||
<%= link_to t('create'), "#", :onclick=>"$('#new_attribute').submit()" %>
|
||||
</div>
|
||||
<div id="back" class='buttom clear'>
|
||||
<%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
$("#enable_<%= @attribute.id %>").toggle();
|
||||
$("#disable_<%= @attribute.id %>").toggle();
|
||||
$("#attribute_<%= @attribute.id %>").toggleClass('disable');
|
||||
@@ -0,0 +1,16 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile">
|
||||
<%= form_for @attribute, :url => eval("admin_user_#{@attribute_type}_model_path(@user_role_model)") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/attributes/form", :locals => { :f => f, :is_new => false } %>
|
||||
<div id="update" class='buttom clear'>
|
||||
<%= link_to t('update'), "#", :onclick=>"$('#edit_user_role_model_#{@attribute.id}').submit()" %>
|
||||
</div>
|
||||
<div id="back" class='buttom clear'>
|
||||
<%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
<div id="search">
|
||||
<input id="user_search" name="user[username]" size="30" type="text" />
|
||||
</div>
|
||||
<div class="member_setup">
|
||||
<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>
|
||||
Reference in new issue
Block a user