Changes for sub_roles
Issues: update doesn't create new i18n_variables, role form has bugs
This commit is contained in:
1 parent
d23cf152da
commit
d27d7a623c
62 files changed
+508
-1142
No files matched your search
@@ -0,0 +1,25 @@
|
||||
$('.attributes_block a.delete').live('click', function(){
|
||||
$(this).parents('.list_item').remove();
|
||||
});
|
||||
|
||||
$('#attributes a.remove_existing_record').live('click', function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("#attribute_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
|
||||
$('#attributes_block a.switch').live('click', function(){
|
||||
$(this).parent().toggleClass('disable');
|
||||
var $am = $(this).next('.built_in_state')
|
||||
$am.attr('value', ($am.attr('value') == "false") ? "true" : "false");
|
||||
});
|
||||
|
||||
$('.select_type select').live('change', function(){
|
||||
if(this.value == 'select')
|
||||
{
|
||||
$(this).next().show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).next().hide();
|
||||
}
|
||||
});
|
||||
@@ -1,4 +1,7 @@
|
||||
$("div.editable").live("mouseenter mouseleave",
|
||||
function (event) {
|
||||
$(this).children('.edit_link').toggle();
|
||||
});
|
||||
$("div.editable").live("mouseenter mouseleave", function (event) {
|
||||
$(this).children('.edit_link').toggle();
|
||||
});
|
||||
|
||||
$("#page_design_id").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
|
||||
});
|
||||
@@ -6,4 +6,5 @@
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
//= require page_edit
|
||||
//= require side_bar_history
|
||||
@@ -1,33 +0,0 @@
|
||||
$('#attributes_block a.delete').live('click', function(){
|
||||
$(this).parent().parent().parent().remove();
|
||||
});
|
||||
|
||||
$('#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)) %>");
|
||||
});
|
||||
|
||||
$('#attributes_block a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$(this).parent().parent().hide();
|
||||
});
|
||||
|
||||
$('#attributes_block a.change_built_in').click(function(){
|
||||
$(this).parent().toggleClass('disable');
|
||||
var $am = $(this).next('.built_in_state')
|
||||
$am.attr('value', ($am.attr('value') == "false") ? "true" : "false");
|
||||
});
|
||||
|
||||
$('.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();
|
||||
}
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
$(document).ready(function(){
|
||||
$('#user_active_role').change(function(){
|
||||
$('#role_models .roles_block').hide();
|
||||
$('#active_role').change(function(){
|
||||
$('#roles .attributes_block').hide();
|
||||
$('#'+this.value+'_block').toggle();
|
||||
});
|
||||
});
|
||||
@@ -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 -%>
|
||||
@@ -222,7 +222,7 @@ h1 {
|
||||
.main_list ul {
|
||||
clear:both;
|
||||
}
|
||||
#porfile {
|
||||
#profile {
|
||||
padding-top: 100px;
|
||||
}
|
||||
/*add_buttom*/
|
||||
@@ -336,10 +336,10 @@ h1 {
|
||||
padding: 0;
|
||||
width: 140px;
|
||||
}
|
||||
#porfile .users{
|
||||
#profile .users{
|
||||
margin-left: 180px;
|
||||
}
|
||||
.roles_block {
|
||||
.attributes_block {
|
||||
background: url(<%= asset_path "75.png" %>) repeat left top;
|
||||
min-width:710px;
|
||||
margin-bottom:50px;
|
||||
@@ -352,7 +352,7 @@ h1 {
|
||||
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
|
||||
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
|
||||
}
|
||||
.roles_block h2 {
|
||||
.attributes_block h2 {
|
||||
color: #FFFFFF;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
|
||||
@@ -11,16 +11,18 @@ class Admin::InfosController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
#@attribute = Info.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@attribute = Info.new
|
||||
render :template => 'admin/attributes/new'
|
||||
end
|
||||
|
||||
def edit
|
||||
@attribute = Info.find(params[:id])
|
||||
@i18n_variable = @attribute.i18n_variable
|
||||
render :template => 'admin/attributes/edit'
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -32,6 +34,10 @@ class Admin::InfosController < ApplicationController
|
||||
def update
|
||||
@attribute = Info.find(params[:id])
|
||||
@attribute.update_attributes(params[:info])
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :action => :index }
|
||||
format.js { render 'admin/attributes/toggle_enable' }
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@@ -40,10 +46,18 @@ class Admin::InfosController < ApplicationController
|
||||
redirect_to :action => :index
|
||||
end
|
||||
|
||||
def add_attribute_field
|
||||
@attribute = Info.find(params[:id]) rescue nil
|
||||
if !@attribute
|
||||
@attribute = Info.new
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def set_attribute
|
||||
@attribute_type = 'info'
|
||||
@class = 'infos'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -11,16 +11,18 @@ class Admin::RolesController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
#@attribute = Role.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@attribute = Role.new
|
||||
render :template => 'admin/attributes/new'
|
||||
end
|
||||
|
||||
def edit
|
||||
@attribute = Role.find(params[:id])
|
||||
@i18n_variable = @attribute.i18n_variable
|
||||
render :template => 'admin/attributes/edit'
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -32,7 +34,6 @@ class Admin::RolesController < ApplicationController
|
||||
def update
|
||||
@attribute = Role.find(params[:id])
|
||||
@attribute.update_attributes(params[:role])
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :action => :index }
|
||||
format.js { render 'admin/attributes/toggle_enable' }
|
||||
@@ -49,6 +50,7 @@ class Admin::RolesController < ApplicationController
|
||||
|
||||
def set_attribute
|
||||
@attribute_type = 'role'
|
||||
@class = 'roles'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -68,11 +68,11 @@ class Admin::TranslationsController < ApplicationController
|
||||
result << var if var.document_class.eql?('language')
|
||||
result
|
||||
end
|
||||
@user_role_model_i18n_variables = @i18n_variables.inject([]) do |result, var|
|
||||
result << var if var.document_class.eql?('UserRoleModel')
|
||||
@role_i18n_variables = @i18n_variables.inject([]) do |result, var|
|
||||
result << var if var.document_class.eql?('Role')
|
||||
result
|
||||
end
|
||||
@user_info_model_i18n_variables = @i18n_variables.inject([]) do |result, var|
|
||||
@info_i18n_variables = @i18n_variables.inject([]) do |result, var|
|
||||
result << var if var.document_class.eql?('UserInfoModel')
|
||||
result
|
||||
end
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
class Admin::UserInfoModelsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
||||
|
||||
def index
|
||||
@user_attribute_models = UserInfoModel.all.entries
|
||||
render :template => 'admin/user_attribute_models/index'
|
||||
end
|
||||
|
||||
def show
|
||||
#@user_attribute_model = UserInfoModel.find(params[:id])
|
||||
end
|
||||
|
||||
def new
|
||||
@user_attribute_model = UserInfoModel.new
|
||||
render :template => 'admin/user_attribute_models/new'
|
||||
end
|
||||
|
||||
def edit
|
||||
@user_attribute_model = UserInfoModel.find(params[:id])
|
||||
@i18n_variable = @user_attribute_model.i18n_variable
|
||||
render :template => 'admin/user_attribute_models/edit'
|
||||
end
|
||||
|
||||
def create
|
||||
@user_attribute_model = UserInfoModel.new(params[:user_info_model])
|
||||
@user_attribute_model.save
|
||||
redirect_to :action => :index
|
||||
end
|
||||
|
||||
def update
|
||||
@user_attribute_model = UserInfoModel.find(params[:id])
|
||||
@user_attribute_model.update_attributes(params[:user_info_model])
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :action => :index }
|
||||
format.js { render 'admin/user_attribute_models/toggle_enable' }
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user_attribute_model = UserInfoModel.find(params[:id])
|
||||
@user_attribute_model.destroy
|
||||
|
||||
@user_attribute_model.destroy_i18n_variables
|
||||
|
||||
redirect_to :action => :index
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def set_attribute
|
||||
@attribute = 'info'
|
||||
@class = 'infos'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,60 +0,0 @@
|
||||
class Admin::UserRoleModelsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
||||
|
||||
def index
|
||||
@user_attribute_models = UserRoleModel.all.entries
|
||||
render :template => 'admin/user_attribute_models/index'
|
||||
end
|
||||
|
||||
def show
|
||||
#@user_attribute_model = UserRoleModel.find(params[:id])
|
||||
end
|
||||
|
||||
def new
|
||||
@user_attribute_model = UserRoleModel.new
|
||||
render :template => 'admin/user_attribute_models/new'
|
||||
end
|
||||
|
||||
def edit
|
||||
@user_attribute_model = UserRoleModel.find(params[:id])
|
||||
@i18n_variable = @user_attribute_model.i18n_variable
|
||||
render :template => 'admin/user_attribute_models/edit'
|
||||
end
|
||||
|
||||
def create
|
||||
@user_attribute_model = UserRoleModel.new(params[:user_role_model])
|
||||
@user_attribute_model.save
|
||||
redirect_to :action => :index
|
||||
end
|
||||
|
||||
def update
|
||||
@user_attribute_model = UserRoleModel.find(params[:id])
|
||||
@user_attribute_model.update_attributes(params[:user_role_model])
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :action => :index }
|
||||
format.js { render 'admin/user_attribute_models/toggle_enable' }
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user_attribute_model = UserRoleModel.find(params[:id])
|
||||
@user_attribute_model.destroy
|
||||
|
||||
@user_attribute_model.destroy_i18n_variables
|
||||
|
||||
redirect_to :action => :index
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def set_attribute
|
||||
@attribute = 'role'
|
||||
@class = 'roles'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -10,18 +10,18 @@ class Admin::UsersController < ApplicationController
|
||||
|
||||
def show
|
||||
@user = User.find(params[:id])
|
||||
get_info_role_models
|
||||
get_info_and_roles
|
||||
end
|
||||
|
||||
def new
|
||||
@user = User.new
|
||||
get_info_role_models
|
||||
get_info_and_roles
|
||||
end
|
||||
|
||||
def create
|
||||
@user = User.new(params[:user])
|
||||
if @user.save
|
||||
@user.user_infos.each do |info|
|
||||
@user.infos.each do |info|
|
||||
info.save
|
||||
info.attribute_values.each(&:save)
|
||||
end
|
||||
@@ -38,7 +38,7 @@ class Admin::UsersController < ApplicationController
|
||||
|
||||
def edit
|
||||
@user = User.find(params[:id])
|
||||
get_info_role_models
|
||||
get_info_and_roles
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -55,7 +55,7 @@ class Admin::UsersController < ApplicationController
|
||||
flash[:notice] = t('admin.update_success_user')
|
||||
redirect_to :action => :index
|
||||
else
|
||||
get_info_role_models
|
||||
get_info_and_roles
|
||||
render :action => :edit
|
||||
end
|
||||
end
|
||||
@@ -66,7 +66,7 @@ class Admin::UsersController < ApplicationController
|
||||
else
|
||||
@user = User.find(params[:id])
|
||||
@user.destroy
|
||||
@user.user_attributes.each do |ua|
|
||||
@user.attributes.each do |ua|
|
||||
ua.attribute_values.each(&:destroy)
|
||||
ua.destroy
|
||||
end
|
||||
@@ -77,9 +77,9 @@ class Admin::UsersController < ApplicationController
|
||||
|
||||
protected
|
||||
|
||||
def get_info_role_models
|
||||
@roles = Info.excludes('disabled' => true)
|
||||
@infos = Role.excludes('disabled' => true)
|
||||
def get_info_and_roles
|
||||
@infos = Info.excludes('disabled' => true)
|
||||
@roles = Role.excludes('disabled' => true)
|
||||
end
|
||||
|
||||
def set_attribute
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Admin::UserHelper
|
||||
|
||||
def show_user_attribute(object, key, locale = '')
|
||||
attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) } rescue nil
|
||||
def show_attribute(object, field_id, locale = '')
|
||||
attribute = object.attribute_values.detect {|av| av.attribute_field_id.eql?(field_id) || av[locale.to_s].eql?(locale.to_s) } rescue nil
|
||||
if attribute
|
||||
if locale.to_s.blank?
|
||||
attribute['key']
|
||||
|
||||
@@ -48,5 +48,12 @@ module ApplicationHelper
|
||||
message % item
|
||||
end
|
||||
end
|
||||
|
||||
def add_attribute(partial, f, attribute)
|
||||
new_object = f.object.send(attribute).build
|
||||
fields = f.fields_for(attribute, new_object, :child_index => "new_#{attribute}") do |f|
|
||||
render :partial => partial, :object => new_object, :locals => {:f => f}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -36,7 +36,7 @@ class Design
|
||||
self.files = (attrs << 'images')
|
||||
end
|
||||
|
||||
# Update or create the attribute_model records
|
||||
# Update or create the attribute records
|
||||
def files=(attrs)
|
||||
case attrs.last
|
||||
when 'layout'
|
||||
|
||||
@@ -7,7 +7,7 @@ class Attribute
|
||||
field :built_in, :type => Boolean, :default => false
|
||||
field :disabled, :type => Boolean, :default => false
|
||||
|
||||
embeds_many :attribute_fields
|
||||
has_many :attribute_fields, :autosave => true, :dependent => :destroy
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
accepts_nested_attributes_for :i18n_variable, :allow_destroy => true
|
||||
accepts_nested_attributes_for :attribute_fields, :allow_destroy => true
|
||||
|
||||
@@ -5,12 +5,12 @@ class AttributeField
|
||||
|
||||
field :key
|
||||
field :markup
|
||||
field :locale, :type => Boolean
|
||||
field :locale, :type => Boolean, :default => true
|
||||
field :list_options, :type => Array
|
||||
field :built_in, :type => Boolean, :default => false
|
||||
field :disabled, :type => Boolean, :default => false
|
||||
|
||||
embedded_in :attribute
|
||||
belongs_to :attribute
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
has_many :attribute_values
|
||||
validates_uniqueness_of :key
|
||||
|
||||
@@ -7,7 +7,7 @@ class Role
|
||||
field :built_in, :type => Boolean, :default => false
|
||||
field :disabled, :type => Boolean, :default => false
|
||||
|
||||
embeds_many :sub_roles
|
||||
has_many :sub_roles, :autosave => true, :dependent => :destroy
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
has_many :users
|
||||
accepts_nested_attributes_for :i18n_variable, :allow_destroy => true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class SubRole < Attribute
|
||||
|
||||
|
||||
belongs_to :role
|
||||
has_many :users
|
||||
|
||||
# Get an sub_role from key
|
||||
|
||||
@@ -16,14 +16,18 @@ class User
|
||||
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
|
||||
|
||||
def name
|
||||
infos = self.user_infos.detect {|info| info.key.to_s.eql?('profile') }
|
||||
if infos
|
||||
first_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
last_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
info = Class::Info.first(:conditions => {:key => 'profile'})
|
||||
if info
|
||||
first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
return "#{first_name} #{last_name}"
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
def get_attribute_values
|
||||
@attribute_values ||= self.attribute_values.to_a
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,35 @@
|
||||
<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.i18n_variable.nil? ? 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 %>
|
||||
<%= f.hidden_field :id %>
|
||||
<% 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>
|
||||
@@ -1,36 +0,0 @@
|
||||
<%= 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 %>
|
||||
@@ -1,57 +0,0 @@
|
||||
<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 -%>
|
||||
@@ -2,15 +2,13 @@
|
||||
<%= 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| %>
|
||||
<div id="profile">
|
||||
<%= form_for @attribute, :url => eval("admin_#{@attribute_type}_path(@attribute)") 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'>
|
||||
<%= 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 -%>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -3,32 +3,37 @@
|
||||
<% 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 class="button_bar up">
|
||||
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
|
||||
</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>
|
||||
<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| %>
|
||||
<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">
|
||||
<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' %>
|
||||
<% 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(: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 %>
|
||||
|
||||
</span>
|
||||
</li>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path") %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="button_bar">
|
||||
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,19 +2,13 @@
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile">
|
||||
<%= form_for @attribute, :url => eval("admin_infos_path") do |f| %>
|
||||
<div id="profile">
|
||||
<%= form_for @attribute, :url => eval("admin_#{@attribute_type}s_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'>
|
||||
<%= 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>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -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>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td>
|
||||
<%= text_field_tag "#{@attribute_type}[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:150px" %>
|
||||
</td>
|
||||
<% 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 %>
|
||||
@@ -1,16 +0,0 @@
|
||||
<% 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>
|
||||
@@ -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>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td>
|
||||
<%= text_field_tag "#{@attribute_type}[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:150px" %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='sub_roles' class="attributes_block <%= @class %>">
|
||||
<h2>Sub roles</h2>
|
||||
<% @attribute.sub_roles.each do |sub_role| %>
|
||||
<%= render :partial => 'form_sub', :object => sub_role, :locals => {:f => f} %>
|
||||
<% 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 %>
|
||||
<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_role_temp_id').attr('value', new_id);
|
||||
$('#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} %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
<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>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td>
|
||||
<%= f.text_field "i18n_variable[#{locale}]", :value => (@i18n_variable[locale] if @i18n_variable), :style => "width:150px" %>
|
||||
</td>
|
||||
<% 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 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', '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 %>
|
||||
<%= javascript_include_tag "attribute_form" %>
|
||||
<script>
|
||||
$('.attributes_block 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).next().attr('value', parseInt(new_parent_id) + 1);
|
||||
$(this).parents('.sub_role_attributes').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 %>
|
||||
@@ -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 '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">
|
||||
<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">
|
||||
<%= 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,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,27 +16,27 @@
|
||||
</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 :active_role, @roles.sort_by{|role| role.key }.collect {|role| [ role.i18n_variable[I18n.locale], role.key ]}, :selected => (@user.active_role || 'student') %>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<% @user_info_models.each do |ua| %>
|
||||
<div id="basic_block" class="roles_block <%= @class %>">
|
||||
<% @infos.each do |ua| %>
|
||||
<div id="basic_block" class="attributes_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),
|
||||
<%= render :partial => 'attribute',
|
||||
:object => (@user.infos.detect {|u| u.key == ua.key } || @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?)) %>>
|
||||
<div id='roles'>
|
||||
<% @roles.each do |ua| %>
|
||||
<div id="<%= ua.key %>_block" class="attributes_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>
|
||||
<hr>
|
||||
<%= render :partial => 'user_attribute',
|
||||
:object => (@user.user_roles.detect {|u| u.key == ua.key } || @user.user_roles.build),
|
||||
<%= render :partial => 'attribute',
|
||||
:object => (@user.roles.detect {|u| u.key == ua.key } || @user.roles.build),
|
||||
:locals => {:ua => ua, :type => 'role'} %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
@@ -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>
|
||||
<% a.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>
|
||||
@@ -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>
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %>
|
||||
<%= fields_for "user[#{type}s]", attribute, :index => nil do |f| %>
|
||||
<%= f.hidden_field :key, :value => ua.key %>
|
||||
<%= f.hidden_field :id unless user_attribute.new_record? %>
|
||||
<%= f.hidden_field :id unless attribute.new_record? %>
|
||||
|
||||
<div class="info_input">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
@@ -13,25 +13,25 @@
|
||||
</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 %>
|
||||
<% ua.get_enabled_attribute_fields.each do |attr| %>
|
||||
<% value = attribute.attribute_values.detect{|v| v.key == attr.key } %>
|
||||
<%= hidden_field_tag "user[#{type}s][][attribute_values][][id]", value.id rescue nil %>
|
||||
<%= hidden_field_tag "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 %>
|
||||
<%= hidden_field_tag "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) %>
|
||||
<%= text_field_tag "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) %>
|
||||
<%= text_field_tag "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']) %>
|
||||
<%= select_tag "user[#{type}s][][attribute_values][][non_locale]", options_for_select(attr["options"], value['non_locale']) %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<% end -%>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile">
|
||||
<div id="profile">
|
||||
<%= 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">
|
||||
<div id="profile">
|
||||
<%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="porfile">
|
||||
<div id="profile" class="clear">
|
||||
|
||||
<div id="person">
|
||||
<% if @user.avatar? %>
|
||||
@@ -11,20 +11,18 @@
|
||||
<%= image_tag "person.png" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% @user_info_models.each do |am| %>
|
||||
<div id="basic_block" class="roles_block <%= @class %>">
|
||||
<h2><%= am.i18n_variable[I18n.locale] %></h2>
|
||||
<% @infos.each do |a| %>
|
||||
<div id="basic_block" class="attributes_block <%= @class %>">
|
||||
<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', :locals => {:a => 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="attributes_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_attribute', :locals => {:a => active_role, :object => @user.get_role_from_key(active_role.key)} %>
|
||||
</div>
|
||||
<div class="button_bar">
|
||||
<%= link_to t(:edit), edit_admin_user_path(@user) %>
|
||||
|
||||
@@ -1,36 +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="panel_container">
|
||||
<div id="panel_content">
|
||||
<div class="secondary">
|
||||
<div class="secondary2"><%= yield :secondary %></div>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="main2"><%= yield %></div>
|
||||
</div>
|
||||
<div class="tertiary"><%= yield :tertiary %></div>
|
||||
</div>
|
||||
<div id="panel_footer"><p><%= APP_CONFIG['ruling_digital'] %></p></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user