Ray's modifications
No files matched your search
|
After Width: | Height: | Size: 923 B |
|
After Width: | Height: | Size: 964 B |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 1010 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 963 B |
@@ -16,7 +16,7 @@ body{
|
||||
}
|
||||
|
||||
#panel_banner_link{
|
||||
background: url(<%= asset_path "orbitbar.png" %>) repeat-x scroll 0 0;
|
||||
background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0;
|
||||
height: 52px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
|
||||
@@ -16,7 +16,7 @@ body{
|
||||
}
|
||||
|
||||
#panel_banner_link{
|
||||
background: url(<%= asset_path "orbitbar.png" %>) repeat-x scroll 0 0;
|
||||
background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0;
|
||||
height: 52px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
|
||||
@@ -13,6 +13,7 @@ html,body {
|
||||
height:100%;
|
||||
margin:0;
|
||||
font-family: Helvetica, '微軟正黑體';
|
||||
overflow-x:hidden
|
||||
}
|
||||
ul {
|
||||
list-style:none;
|
||||
@@ -20,6 +21,17 @@ ul {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
input{
|
||||
border:none;
|
||||
padding:5px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
input:focus, select:focus, textarea:focus {
|
||||
outline:none;
|
||||
-moz-outline-radius: 0;
|
||||
}
|
||||
.clear:after {
|
||||
content:".";
|
||||
clear:both;
|
||||
@@ -37,7 +49,7 @@ ul {
|
||||
height: 100%;
|
||||
width:220px;
|
||||
/*background-color:rgba(245,245,245,1);*/
|
||||
background-color:rgba(0,0,0,0.75);
|
||||
background:url(<%= asset_path '75.png' %>) repeat left top;
|
||||
-moz-box-shadow: 3px 0px 4px #472a12; /* Firefox */
|
||||
-webkit-box-shadow: 3px 0px 4px #472a12;/* Safari 和 Chrome */
|
||||
box-shadow: 3px 0px 4px #472a12; /* Opera 10.5 + */
|
||||
@@ -51,9 +63,10 @@ ul {
|
||||
#search input {
|
||||
background:url(<%= asset_path 'search_bg.png' %>) no-repeat left top;
|
||||
border:none;
|
||||
width:174px;
|
||||
width:154px;
|
||||
height:20px;
|
||||
padding-left:20px;
|
||||
padding: 0 20px;
|
||||
font-family:Helvetica;
|
||||
}
|
||||
h1 {
|
||||
background:url(<%= asset_path 'h1_bg.png' %>) repeat-x left top;
|
||||
@@ -127,7 +140,7 @@ h1 {
|
||||
padding-top:70px;
|
||||
}
|
||||
.main_list li {
|
||||
background-color:rgba(0,0,0,0.75);
|
||||
background:url(<%= asset_path '75.png' %>) repeat left top;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
.main_list li span {
|
||||
@@ -140,7 +153,7 @@ h1 {
|
||||
width:18%;
|
||||
}
|
||||
.main_list li.list_head {
|
||||
background-color:inherit;
|
||||
background:none;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.main_list li.list_head span {
|
||||
@@ -175,7 +188,7 @@ h1 {
|
||||
float: right;
|
||||
width:10%;
|
||||
}
|
||||
.main_list li .action a{
|
||||
#main .action a{
|
||||
background-image:url(<%= asset_path 'icon.png' %>);
|
||||
text-indent:-9999px;
|
||||
display:inline-block;
|
||||
@@ -184,43 +197,56 @@ h1 {
|
||||
margin-top:8px;
|
||||
margin-right:10px;
|
||||
}
|
||||
.main_list li .action a.show{
|
||||
#main .action a.show{
|
||||
background-position:left top;
|
||||
}
|
||||
.main_list li .action a.edit{
|
||||
#main .action a.edit{
|
||||
background-position:-19px top;
|
||||
}
|
||||
.main_list li .action a.delete{
|
||||
#main .action a.delete{
|
||||
background-position:-38px top;
|
||||
}
|
||||
.main_list li .action a.show:hover{
|
||||
background-position:left bottom;
|
||||
#main .action a.show:hover{
|
||||
background-position:left -19px;
|
||||
}
|
||||
.main_list li .action a.edit:hover{
|
||||
background-position:-19px bottom;
|
||||
#main .action a.edit:hover{
|
||||
background-position:-19px -19px;
|
||||
}
|
||||
.main_list li .action a.delete:hover{
|
||||
background-position:-38px bottom;
|
||||
#main .action a.delete:hover{
|
||||
background-position:-38px -19px;
|
||||
}
|
||||
.main_list li.list_item .roles {
|
||||
#main .list_item .roles {
|
||||
background-image:url(<%= asset_path 'roles_type.jpg' %>);
|
||||
background-repeat:repeat-x;
|
||||
border-radius: 5px 0 0 5px;
|
||||
-moz-border-radius: 5px 0 0 5px;
|
||||
-webkit-border-radius: 5px 0 0 5px;
|
||||
}
|
||||
#roles_list .roles_block .action a{
|
||||
margin-top:0;
|
||||
margin-right:0;
|
||||
}
|
||||
.student {
|
||||
background-position:0 -5px;
|
||||
}
|
||||
.teacher {
|
||||
background-position:0 -54px;
|
||||
}
|
||||
#add_new {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
#add_new a {
|
||||
background-image:url(<%= asset_path 'icon.png' %>);
|
||||
background-position:-54px -17px;
|
||||
}
|
||||
#add_new a:hover {
|
||||
background-position: -54px 3px;
|
||||
}
|
||||
#confirm a{
|
||||
background-position:4px -70px;
|
||||
}
|
||||
#confirm a:hover{
|
||||
background-position: 4px -51px;
|
||||
}
|
||||
.buttom a {
|
||||
margin-bottom: 20px;
|
||||
background-image:url(<%= asset_path 'icon.png' %>);
|
||||
background-repeat:no-repeat;
|
||||
font-size:12px;
|
||||
color:#FFF;
|
||||
@@ -236,9 +262,185 @@ h1 {
|
||||
-webkit-box-shadow: 3px 0px 4px #180902;/* Safari 和 Chrome */
|
||||
box-shadow: 3px 0px 4px #180902; /* Opera 10.5 + */
|
||||
}
|
||||
#add_new a:hover {
|
||||
background-position: -54px 3px;
|
||||
.buttom a:hover {
|
||||
color:#000;
|
||||
font-weight:bold;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
#porfile{
|
||||
padding-top:100px;
|
||||
}
|
||||
#porfile h2 {
|
||||
color: #FFFFFF;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-shadow: 0 3px 2px #000000;
|
||||
position:absolute;
|
||||
top:-30px;
|
||||
}
|
||||
#porfile label {
|
||||
display:block;
|
||||
text-shadow: 0 1px 0 #FFFFFF;
|
||||
background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top;
|
||||
height: 25px;
|
||||
width:110px;
|
||||
padding: 0 0 0 18px;
|
||||
border:1px solid #d8d8d8;
|
||||
margin-top:10px;
|
||||
color:#666666;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
#porfile label:hover{
|
||||
background-position:left bottom;
|
||||
color:#000;
|
||||
border:1px solid #a6a6a6;
|
||||
}
|
||||
#porfile label input {
|
||||
border:none;
|
||||
margin: 6px 15px 0 0;
|
||||
float:left;
|
||||
}
|
||||
#porfile label span {
|
||||
display:block;
|
||||
float:left;
|
||||
line-height:27px;
|
||||
font-size:12px;
|
||||
}
|
||||
.roles_block {
|
||||
min-width:710px;
|
||||
margin-bottom:50px;
|
||||
position:relative;
|
||||
padding-bottom: 20px;
|
||||
background:url(<%= asset_path '75.png' %>) repeat left top;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
|
||||
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
|
||||
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
|
||||
}
|
||||
#user_list .roles_block {
|
||||
margin-left:180px;
|
||||
}
|
||||
#person {
|
||||
left: 265px;
|
||||
position: fixed;
|
||||
top: 75px;
|
||||
}
|
||||
#person img {
|
||||
background-color:#FFF;
|
||||
padding:5px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
|
||||
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
|
||||
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
|
||||
}
|
||||
#upload, #edit{
|
||||
display:block;
|
||||
text-shadow: 0 1px 0 #FFFFFF;
|
||||
background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top;
|
||||
height: 25px;
|
||||
line-height:27px;
|
||||
color:#666666;
|
||||
width:128px;
|
||||
text-align:center;
|
||||
font-size:12px;
|
||||
border:1px solid #d8d8d8;
|
||||
margin-top:10px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
#upload:hover{
|
||||
background-position:left bottom;
|
||||
color:#000;
|
||||
border:1px solid #a6a6a6;
|
||||
}
|
||||
#main hr{
|
||||
height:8px;
|
||||
border:none;
|
||||
margin:0;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
-moz-border-radius: 5px 5px 0px 0px;
|
||||
-webkit-border-radius: 5px 5px 0px 0px;
|
||||
border-bottom:1px solid #000;
|
||||
}
|
||||
#basic_block hr{
|
||||
background-color:#666666;
|
||||
}
|
||||
#teacher_block hr{
|
||||
background-color:#0071a9;
|
||||
}
|
||||
#student_block hr{
|
||||
background-color:#af0045;
|
||||
}
|
||||
.info_input {
|
||||
padding:10px 20px;
|
||||
}
|
||||
.info_input table {
|
||||
color:#fff;
|
||||
width:100%;
|
||||
font-size:14px;
|
||||
}
|
||||
.info_input table td {
|
||||
padding:5px 10px 5px 0;
|
||||
width: 10%;
|
||||
}
|
||||
.info_input .list_head {
|
||||
background:url(<%= asset_path 'line.png' %>) left bottom repeat-x;
|
||||
}
|
||||
.info_input .list_head td {
|
||||
}
|
||||
.info_input .list_item {
|
||||
color:#AEAEAE;
|
||||
}
|
||||
.info_input .add {
|
||||
display:block;
|
||||
padding-left:22px;
|
||||
font-size:12px;
|
||||
line-height:21px;
|
||||
height:19px;
|
||||
background:url(<%= asset_path 'icon.png' %>) no-repeat -59px 0;
|
||||
margin-top: 10px;
|
||||
color: #DDDDDD;
|
||||
}
|
||||
.info_input .add:hover {
|
||||
color:#FFF;
|
||||
background-position:-59px -19px;
|
||||
}
|
||||
.info_input li {
|
||||
height:30px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.info_input li span {
|
||||
display:inline-block;
|
||||
float:left;
|
||||
color:#fff;
|
||||
font-size:14px;
|
||||
line-height:30px;
|
||||
margin-right:10px;
|
||||
}
|
||||
#user_list .info_input li span {
|
||||
width: 25%;
|
||||
}
|
||||
#roles_list .info_input li span {
|
||||
width:15%;
|
||||
}
|
||||
.info_input li span:last-child {
|
||||
}
|
||||
#person select {
|
||||
background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top;
|
||||
border:1px solid #d8d8d8;
|
||||
margin-top: 10px;
|
||||
width: 130px;
|
||||
padding:3px 6px 3px 14px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border:none;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ body{
|
||||
padding: 0;
|
||||
}
|
||||
#hmenu{
|
||||
background:url(<%= asset_path 'orbitbar.png' %>) repeat-x 0 0;
|
||||
background:url(<%= asset_path 'orbitbar1.png' %>) repeat-x 0 0;
|
||||
height: 50px;
|
||||
position:fixed;
|
||||
top:0;
|
||||
|
||||
@@ -29,7 +29,8 @@ class AttributeModel
|
||||
if self.i18n_variable_id
|
||||
self.i18n_variable.update_attributes(attr)
|
||||
else
|
||||
var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class, :parent_id => self.user_attribute_model.i18n_variable_id}))
|
||||
# var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class, :parent_id => self.user_attribute_model.i18n_variable_id}))
|
||||
var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class}))
|
||||
var.save
|
||||
self.i18n_variable_id = var.id
|
||||
end
|
||||
|
||||
@@ -8,12 +8,11 @@ class User
|
||||
mount_uploader :avatar, AvatarUploader
|
||||
|
||||
field :admin, :type => Boolean, :default => true
|
||||
field :active_roles, :type => Array
|
||||
field :active_role
|
||||
|
||||
has_many :user_attributes
|
||||
has_many :user_roles
|
||||
has_many :user_infos
|
||||
before_save :clean_active_roles
|
||||
|
||||
# Update or create the user_role records
|
||||
def user_roles=(*attrs)
|
||||
@@ -49,21 +48,6 @@ class User
|
||||
self.user_roles.detect {|a| a.key.to_s == key.to_s }
|
||||
end
|
||||
|
||||
# Get the active user_role_models
|
||||
def get_active_role_models
|
||||
self.active_roles.map{ |role| get_role_model(role) } rescue []
|
||||
end
|
||||
|
||||
# Get an user_role_model from key
|
||||
def get_role_model(key)
|
||||
UserRoleModel.first(:conditions => {:key => key})
|
||||
end
|
||||
|
||||
# Get the active roles names or default to '-'
|
||||
def get_roles
|
||||
(self.active_roles.nil? || self.active_roles.empty?) ? '-' : self.active_roles.map{|role| I18nVariable.first(:conditions => {:key => role})[I18n.locale] rescue role}.join(' / ')
|
||||
end
|
||||
|
||||
def name
|
||||
infos = self.user_infos.detect {|info| info.key.to_s.eql?('profile') }
|
||||
if infos
|
||||
@@ -75,11 +59,4 @@ class User
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# Remove empty values
|
||||
def clean_active_roles
|
||||
self.active_roles.delete('') if self.active_roles
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,3 +1,8 @@
|
||||
class UserRoleModel < UserAttributeModel
|
||||
|
||||
# Get an user_role_model from key
|
||||
def self.get_role_model_from_key(key)
|
||||
self.first(:conditions => {:key => key})
|
||||
end
|
||||
|
||||
end
|
||||
@@ -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>
|
||||
@@ -1,64 +1,48 @@
|
||||
<div id="select_user_roles">
|
||||
<% @user_role_models.each do |ua| %>
|
||||
<%= check_box_tag "user[active_roles][]", ua.key, (@user.active_roles.include?(ua.key) rescue false) %> <%= ua.i18n_variable[locale] %>
|
||||
<% end -%>
|
||||
<%= hidden_field_tag 'user[active_roles][]', '' %>
|
||||
<div id="person">
|
||||
<% if @user.avatar? %>
|
||||
<%= image_tag(@user.avatar.thumb.url) %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png" %>
|
||||
<% end %>
|
||||
<%#= file_field_tag 'file' %>
|
||||
<%#= hidden_field_tag :avatar_cache %>
|
||||
<a id="upload" href="#"> Choose a file... </a>
|
||||
<%= f.text_field :email %>
|
||||
<label>
|
||||
<%= f.check_box :admin %><span>Admin</span>
|
||||
</label>
|
||||
<%= f.select :active_role, @user_role_models.sort_by{|role| role.key }.collect {|role| [ role.key.capitalize, role.key ]}, :selected => (@user.active_role || 'student') %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label><%= t('admin.my_avatar') %></label>
|
||||
<%= image_tag(@user.avatar.thumb.url) if @user.avatar? %>
|
||||
<%= file_field_tag 'file' %>
|
||||
<%= hidden_field_tag :avatar_cache %>
|
||||
<% @user_info_models.each do |ua| %>
|
||||
<div id="basic_block" class="roles_block">
|
||||
<h2><%= ua.key.capitalize %></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" <%= raw(' style="display: none;"') unless ((@user.active_role.eql?(ua.key) rescue nil) || (ua.key.eql?('student') && @user.new_record?)) %>>
|
||||
<h2><%= ua.key.capitalize %></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'} %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
<%= f.label :email %>
|
||||
<%= f.text_field :email %>
|
||||
</p>
|
||||
<p>
|
||||
<%= t('admin.admin') %>
|
||||
<%= f.check_box :admin %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<% if @user_info_models %>
|
||||
<fieldset>
|
||||
<legend><%= t('admin.info') %></legend>
|
||||
<% @user_info_models.each do |ua| %>
|
||||
<fieldset>
|
||||
<%= render :partial => 'user_attribute',
|
||||
:object => (@user.user_infos.detect {|u| u.key == ua.key } || @user.user_infos.build),
|
||||
:locals => {:ua => ua, :type => 'info'} %>
|
||||
</fieldset>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% if @user_role_models %>
|
||||
<fieldset id="roles" <%= raw(' style="display: none;"') unless (@user.active_roles.size > 0 rescue nil) %>>
|
||||
<legend><%= t('admin.roles') %></legend>
|
||||
<% @user_role_models.each do |ua| %>
|
||||
<fieldset id="role_<%= ua.key %>" <%= raw(' style="display: none;"') unless (@user.active_roles.include?(ua.key) rescue nil) %>>
|
||||
<%= render :partial => 'user_attribute',
|
||||
:object => (@user.user_roles.detect {|u| u.key == ua.key } || @user.user_roles.build),
|
||||
:locals => {:ua => ua, :type => 'role'} %>
|
||||
</fieldset>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function(){
|
||||
$('#select_user_roles input').click(function(){
|
||||
$('#role_'+this.value).toggle();
|
||||
if($("#select_user_roles input:checked").length > 0)
|
||||
{ $('#roles').show(); }
|
||||
else
|
||||
{ $('#roles').hide(); }
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$('#user_active_role').change(function(){
|
||||
$('#role_models .roles_block').hide();
|
||||
$('#'+this.value+'_block').toggle();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% end -%>
|
||||
@@ -1,17 +1,27 @@
|
||||
<fieldset>
|
||||
<legend><%= am.i18n_variable[I18n.locale] %></legend>
|
||||
<table>
|
||||
<% am.get_enabled_attribute_models.each do |attr| %>
|
||||
<tr>
|
||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
||||
<td>
|
||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||
<%= show_user_attribute(object, attr.key, I18n.locale) %>
|
||||
<% else %>
|
||||
<%= show_user_attribute(object, attr.key) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</fieldset>
|
||||
<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 style="color:<%= colorize_in_use_locale(locale) %>"><%= 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,42 +1,44 @@
|
||||
<%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %>
|
||||
<legend><%= ua.i18n_variable[I18n.locale] %></legend>
|
||||
<%= f.hidden_field :key, :value => ua.key %>
|
||||
<%= f.hidden_field :id unless user_attribute.new_record? %>
|
||||
|
||||
<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>
|
||||
|
||||
<% 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>
|
||||
<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 %>
|
||||
|
||||
</table>
|
||||
<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>
|
||||
<% 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 %>
|
||||
@@ -1,19 +1,21 @@
|
||||
<% content_for :body_id do %>user_list<% end -%>
|
||||
|
||||
<% content_for :secondary do %>
|
||||
<ul class="list">
|
||||
<li><%= link_to t('admin.new_user'), new_admin_user_path, :class => 'button positive' %></li>
|
||||
</ul>
|
||||
<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 -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<h1><%= t('admin.user_panel') %></h1>
|
||||
|
||||
<%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<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 } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit t(:update) %> <%= link_back %>
|
||||
</p>
|
||||
|
||||
<% end -%>
|
||||
<div class='buttom clear'>
|
||||
<%= f.submit t('update') %> <%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
@@ -1,42 +1,46 @@
|
||||
<% content_for :body_id do %>user_list<% end -%>
|
||||
|
||||
<% content_for :secondary do %>
|
||||
<div id='user_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 -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<div id="add_new" class="clear">
|
||||
<%= link_to t('admin.new_user'), new_admin_user_path %>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="list_head clear">
|
||||
<span class="roles">Roles</span>
|
||||
<span class="name">Name</span>
|
||||
<span class="email">Email</span>
|
||||
<span class="admin">Admin</span>
|
||||
<span class="action">Action</span>
|
||||
</li>
|
||||
<% @users.each do |user| %>
|
||||
|
||||
<div class="main_list">
|
||||
<%= flash_messages %>
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t('admin.new_user'), new_admin_user_path %>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="list_head clear">
|
||||
<span class="roles">Roles</span>
|
||||
<span class="name">Name</span>
|
||||
<span class="email">Email</span>
|
||||
<span class="admin">Admin</span>
|
||||
<span class="action">Action</span>
|
||||
</li>
|
||||
<% @users.each do |user| %>
|
||||
<li class="list_item clear">
|
||||
<span class="roles <%= user.get_roles.downcase %>"><%= user.get_roles %></span>
|
||||
<% active_role = UserRoleModel.get_role_model_from_key(user.active_role) %>
|
||||
<span class="roles <%= active_role.key.downcase rescue nil %>"><%= active_role.i18n_variable[I18n.locale] rescue nil %></span>
|
||||
<span class="name"><%= user.name ? user.name : 'bob' %></span>
|
||||
<span class="email"><%= user.email %></span>
|
||||
<span class="admin"><%= user.admin ? t(:yes_) : t(:no_) %></span>
|
||||
<span class="action">
|
||||
<%= link_to t(:show), admin_user_path(user), :class => 'show' %>
|
||||
<%= link_to t(:edit), edit_admin_user_path(user), :class => 'edit' %>
|
||||
<%= link_to t(:delete), admin_user_path(user), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
|
||||
<%= link_to t(:show), admin_user_path(user), :class => 'show' %>
|
||||
<%= link_to t(:edit), edit_admin_user_path(user), :class => 'edit' %>
|
||||
<%= link_to t(:delete), admin_user_path(user), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="add_new" class="clear">
|
||||
<%= link_to t('admin.new_user'), new_admin_user_path %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="add_new" class="buttom clear">
|
||||
<%= link_to t('admin.new_user'), new_admin_user_path %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,18 +1,26 @@
|
||||
<% content_for :body_id do %>user_list<% end -%>
|
||||
|
||||
<% content_for :secondary do %>
|
||||
<ul class="list">
|
||||
<li><%= link_to t('admin.new_user'), new_admin_user_path, :class => 'button positive' %></li>
|
||||
</ul>
|
||||
<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 -%>
|
||||
|
||||
<h1><%= t('admin.user_panel') %></h1>
|
||||
<div id="porfile">
|
||||
<%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<div id="confirm" class='buttom clear'>
|
||||
<%= f.submit t('create') %> <%= link_back %>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit t(:create) %> <%= link_back %>
|
||||
</p>
|
||||
|
||||
<% end -%>
|
||||
|
||||
@@ -1,29 +1,40 @@
|
||||
<% content_for :body_id do %>user_list<% end -%>
|
||||
|
||||
<% content_for :secondary do %>
|
||||
<ul class="list">
|
||||
<li><%= link_to t('admin.new_user'), new_admin_user_path, :class => 'button positive' %></li>
|
||||
</ul>
|
||||
<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 -%>
|
||||
|
||||
<h1><%= t('admin.user_panel') %></h1>
|
||||
<div id="porfile">
|
||||
|
||||
<div id="person">
|
||||
<% if @user.avatar? %>
|
||||
<%= image_tag(@user.avatar.thumb.url) %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png" %>
|
||||
<% end %>
|
||||
<%= link_to t(:edit), edit_admin_user_path(@user), :id => 'edit' %>
|
||||
</div>
|
||||
|
||||
<% @user_info_models.each do |am| %>
|
||||
<div id="basic_block" class="roles_block">
|
||||
<h2><%= am.i18n_variable[I18n.locale] %></h2>
|
||||
<hr>
|
||||
<%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<%= image_tag(@user.avatar.thumb.url) rescue nil %>
|
||||
<div id="<%= @user.active_role %>_block" class="roles_block">
|
||||
<% active_role = UserRoleModel.get_role_model_from_key(@user.active_role) %>
|
||||
<h2><%= active_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)} %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%= @user.email %>
|
||||
|
||||
<% if @user_info_models %>
|
||||
<fieldset>
|
||||
<legend><%= t('admin.info') %></legend>
|
||||
<% @user_info_models.each do |am| %>
|
||||
<%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% if @user.active_roles.size > 0 %>
|
||||
<fieldset>
|
||||
<legend><%= t('admin.roles') %></legend>
|
||||
<% @user.get_active_role_models.each do |am| %>
|
||||
<%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_role_from_model_key(am.key)} %>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
@@ -12,7 +12,7 @@
|
||||
<%= csrf_meta_tag %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body id="<%= yield :body_id %>">
|
||||
<div id="content">
|
||||
<div id="hmenu">
|
||||
<div id="orbit">
|
||||
@@ -35,8 +35,7 @@
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
<div class="main_list">
|
||||
<%= yield %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||