Ray's modifications
This commit is contained in:
1 parent
861237d65b
commit
65349796d0
105 files changed
+1663
-369
No files matched your search
@@ -1,26 +1,26 @@
|
||||
<%= fields_for "user_#{@attribute}_model[attribute_models][]", attribute_model, :index => nil do |f| %>
|
||||
|
||||
<tr>
|
||||
<td><%= attribute_model.new_record? ? (f.text_field :key, {:style => "width:130px"}) : 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>
|
||||
<% if attribute_model.new_record? %>
|
||||
<a href="#" class="remove">(<%= t(:delete) %>)</a>
|
||||
<% else %>
|
||||
|
||||
<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" id="<%= attribute_model.id %>">
|
||||
<span style="display:<%= attribute_model.is_disabled? ? 'none' : 'inline' %>"><%= t(:disable) %></span>
|
||||
@@ -28,13 +28,13 @@
|
||||
</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">(<%= t(:delete) %>)</a>
|
||||
<%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %>
|
||||
<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 %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :key %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -1,59 +1,73 @@
|
||||
<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>
|
||||
<td><%= is_new ? (f.text_field :key, {:style => "width:130px"}) : @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:130px" %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<fieldset id='field_set_attributes'>
|
||||
<legend>
|
||||
<%= t('admin.attributes')%>
|
||||
</legend>
|
||||
|
||||
<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>
|
||||
<%= render :partial => 'admin/user_attribute_models/attribute_model', :collection => @user_attribute_model.attribute_models %>
|
||||
</table>
|
||||
|
||||
<a href="#" class="add">(<%= t(:add) %>)</a>
|
||||
</fieldset>
|
||||
<div id="UserRole_block" class="roles_block">
|
||||
<h2>User Role</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"}) : @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">
|
||||
<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>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$('#field_set_attributes a.remove').live('click', function(){
|
||||
$(this).parent().parent().remove();
|
||||
$('#attributes_block a.delete').live('click', function(){
|
||||
$(this).parent().parent().parent().remove();
|
||||
});
|
||||
|
||||
$('#field_set_attributes a.add').click(function(){
|
||||
$('#attributes_block a.add').click(function(){
|
||||
$('#attributes').append("<%= escape_javascript(render(:partial => 'admin/user_attribute_models/attribute_model', :object => @user_attribute_model.attribute_models.build)) %>");
|
||||
});
|
||||
|
||||
$('#field_set_attributes a.remove_existing_record').click(function(){
|
||||
$('#attributes_block a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$(this).parent().parent().hide();
|
||||
});
|
||||
|
||||
$('#field_set_attributes a.change_built_in').click(function(){
|
||||
$('#attributes_block a.change_built_in').click(function(){
|
||||
$(this).children().toggle();
|
||||
var $am = $(this).next('.built_in_state')
|
||||
$am.attr('value', ($am.attr('value') == "false") ? "true" : "false");
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<h1><%= t("admin.editing_user_#{@attribute}") %>: <%= @user_attribute_model.key %></h1>
|
||||
<% content_for :body_id do %>roles_list<% end -%>
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<%= t("admin.user_#{@attribute}")%>
|
||||
</legend>
|
||||
<% content_for :secondary do %>
|
||||
<div class="member_setup">
|
||||
<h1>Member Setup</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>
|
||||
</ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<%= 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 } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit t('update') %> <%= link_back %>
|
||||
</p>
|
||||
|
||||
<div id="porfile">
|
||||
<%= 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='buttom clear'>
|
||||
<%= f.submit t('update') %> <%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
@@ -1,12 +1,12 @@
|
||||
<% content_for :body_id do %>roles_list<% end -%>
|
||||
|
||||
<% content_for :secondary do %>
|
||||
<div id='roles_list'>
|
||||
<div class="member_setup">
|
||||
<h1>Member Setup</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>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="member_setup">
|
||||
<h1>Member Setup</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>
|
||||
</ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
@@ -35,24 +35,26 @@
|
||||
<% end %>
|
||||
</table> -->
|
||||
|
||||
<div id="add_new" class="clear">
|
||||
<%= link_to t('admin.new_user_role'), new_admin_user_role_model_path %>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="list_head clear">
|
||||
<span class="roles">Roles</span>
|
||||
<span class="action">Action</span>
|
||||
</li>
|
||||
<% @user_attribute_models.each do |user_attribute_model| %>
|
||||
<div class="main_list">
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t('admin.new_user_role'), new_admin_user_role_model_path %>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="list_head clear">
|
||||
<span class="roles">Roles</span>
|
||||
<span class="action">Action</span>
|
||||
</li>
|
||||
<% @user_attribute_models.each do |user_attribute_model| %>
|
||||
<li class="list_item clear">
|
||||
<span class="roles <%= user_attribute_model.i18n_variable[I18n.locale].downcase %>"><%= user_attribute_model.i18n_variable[I18n.locale] %></span>
|
||||
<span class="roles <%= 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' %>
|
||||
<%= link_to t(:delete), eval("admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'delete', :confirm => t('sure?'), :method => :delete unless user_attribute_model.is_built_in? %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="add_new" class="clear">
|
||||
<%= link_to t('admin.new_user_role'), new_admin_user_role_model_path %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t('admin.new_user_role'), new_admin_user_role_model_path %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,19 +1,25 @@
|
||||
<h1><%= t("admin.new_user_#{@attribute}") %></h1>
|
||||
<% content_for :body_id do %>roles_list<% end -%>
|
||||
|
||||
<fieldset id='field_set_attributes'>
|
||||
<legend>
|
||||
<%= t("admin.user_#{@attribute}")%>
|
||||
</legend>
|
||||
<% content_for :secondary do %>
|
||||
<div class="member_setup">
|
||||
<h1>Member Setup</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>
|
||||
</ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<%= 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 } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit t('create') %> <%= link_back %>
|
||||
</p>
|
||||
|
||||
<div id="porfile">
|
||||
<%= 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='buttom clear'>
|
||||
<%= f.submit t('create') %> <%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</fieldset>
|
||||
Reference in new issue
Block a user