Merge 'standardization' and 'role structure modification'

This commit is contained in:
chris2tof 2011-12-10 18:21:59 +08:00
parent b7ac5478b4
commit d23cf152da
29 changed files with 1687 additions and 800 deletions

278
admin_back_end.css.erb Normal file
View File

@ -0,0 +1,278 @@
html, body{
height: 100%;
margin: 0;
padding: 0;
}
html{
background: url(<%= asset_path "body.jpg" %>) no-repeat scroll 0 0 transparent;
background-size: cover;
}
body{
color: #000000;
font-family: Helvetica, '微軟正黑體';
}
#panel_banner_link{
background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0;
height: 50px;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 5;
}
.hmenu{
height: 40px;
position: absolute;
right: 0;
top: 1px;
width: 250px;
}
#orbit{
background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent;
cursor:pointer;
height: 43px;
left: 10px;
position: relative;
width: 41px;
}
#orbit:hover{
background-position:0 -43px;
box-shadow: 0 3px 3px #000000;
}
#orbit:hover #orblist{
display:block;
}
#orblist{
background: none repeat scroll 0 0 #FFFFFF;
border-radius: 0 3px 3px 3px;
box-shadow: 0 3px 3px #000000;
display: none;
margin: 0;
padding: 10px;
position: absolute;
top: 43px;
width: 130px;
}
#orblist li{
border-bottom:1px solid #aaa;
list-style:none;
}
.orblink{
color: #333333;
display: block;
font: 12px/100% arial,sans-serif;
padding: 5px;
text-decoration: none;
}
.orblink:hover{
background:#eee;
color:#333;
}
#log_out a{
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent;
border: medium none !important;
display: block !important;
height: 40px !important;
line-height: normal !important;
padding: 0 !important;
position: absolute;
right: 0px;
text-indent: -10000px;
top: 0px;
width: 43px !important;
}
#log_out a:hover{
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important;
}
.lang{
color: #FFFFFF;
font-size: 15px;
line-height: 40px;
position: absolute;
right: 55px;
top: 0;
}
.lang a{
color:#fff;
text-decoration:none;
}
.lang a:hover{
text-decoration:underline;
}
#content{
height: 100%;
}
#sidebar {
background: url(<%= asset_path "75.png" %>) repeat scroll left top transparent;
box-shadow: 3px 0 4px #472A12;
border-right: 1px solid #121212;
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 220px;
}
#search {
background: url(<%= asset_path "search_block_bg.jpg" %>) repeat-x scroll left top transparent;
height: 20px;
margin-top: 43px;
padding: 15px 12px;
}
#search input {
background: url(<%= asset_path "search_bg.png" %>) no-repeat scroll left top transparent;
border: medium none;
font-family: Helvetica;
height: 20px;
padding: 0 20px;
width: 154px;
}
h1 {
background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent;
border-bottom: 1px solid #1B1B1B;
border-top: 1px solid #424344;
color: #FFFFFF;
font-size: 12px;
font-weight: normal;
height: 21px;
line-height: 21px;
margin: 0;
padding-left: 10px;
text-shadow: 0 -1px 0 #000000;
}
.member_setup .list {
color:#fff;
font-size:12px;
background:url(<%= asset_path "line.png" %>) repeat-x left bottom;
}
.member_setup .list li {
background:url(<%= asset_path "sidebar_li.jpg" %>) repeat-x left top;
border-top:1px solid #424344;
border-bottom:1px solid #000000;
}
.member_setup .list li:hover {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
.member_setup .list li a {
display: block;
padding: 7px 0 6px 12px;
color:#c4c4c4;
}
.member_setup .list li a span {
background:url(<%= asset_path "add_mamber.png" %>) left top no-repeat;
text-shadow: 0px 1px 0px #000;
line-height: 18px;
padding: 2px 0 1px 35px;
}
.member_setup .list li a:hover span {
background-position:left bottom;
color:#eeeeee;
}
.users .list .set_1 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
.users .list .set_1 a span {
background-position:left bottom;
color:#eeeeee;
}
.user_role_models .list .set_2 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
.user_role_models .list .set_2 a span {
background-position:left bottom;
color:#eeeeee;
}
.user_info_models .list .set_3 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
.user_info_models .list .set_3 a span {
background-position:left bottom;
color:#eeeeee;
}
.main {
height: 100%;
margin-left: 260px;
padding-right: 40px;
position: relative;
}
.main_list {
padding-top: 70px;
}
.main_list ul {
clear:both;
}
#porfile {
padding-top: 100px;
}
/*add_buttom*/
.button_bar {
float: right;
-moz-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
-webkit-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4f4f4f), color-stop(1, #000000) );
background:-moz-linear-gradient( center top, #4f4f4f 5%, #000000 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f', endColorstr='#000000');
background-color:#4f4f4f;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
display:inline-block;
padding:0;
margin:10px 0;
}
.button_bar a {
text-decoration:none;
text-shadow:0px -1px 0px #000000;
font-size:12px;
color:#EDEDED;
border-right:1px solid #555;
-moz-box-shadow:1px 0px 0px black;
-webkit-box-shadow:1px 0px 0px black;
box-shadow:1px 0px 0px black;
padding: 6px 10px 4px;
display: inline-block;
float: left;
}
.button_bar a:active {
padding: 7px 10px 3px;
text-shadow:0px 1px 0px #000000;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #4f4f4f) );
background:-moz-linear-gradient( center top, #000000 5%, #4f4f4f 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#4f4f4f');
}
.button_bar a:last-child {
border-right:none;
-moz-box-shadow:none;
-webkit-box-shadow:none;
box-shadow:none;
-moz-border-radius:0px 5px 5px 0px;
-webkit-border-radius:0px 5px 5px 0px;
border-radius:0px 5px 5px 0px;
}
.button_bar a:first-child {
-moz-border-radius:5px 0px 0px 5px;
-webkit-border-radius:5px 0px 0px 5px;
border-radius:5px 0px 0px 5px;
}
.button_bar a.new {
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
}
.button_bar a:hover {
color:#FFFFFF;
}

View File

@ -30,4 +30,4 @@ $('.select_type select').live('change', function(){
{ {
$(this).next().hide(); $(this).next().hide();
} }
}); });

View File

@ -0,0 +1,57 @@
<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>&nbsp;</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 -%>

View File

@ -1,8 +1,9 @@
/* /*
*This is a manifest file that'll automatically include all the stylesheets available in this directory *This is a manifest file that'll automatically include all the stylesheets available in this directory
*and any sub-directories. You're free to add application-wide styles to this file and they'll appear at *and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
*the top of the compiled file, but it's generally better to create a new file per style scope. *the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self *= require reset
*= require message *= require_self
*= require admin_back_end *= require message
*= require admin_back_end
*/ */

View File

@ -1,354 +1,490 @@
html, body{ html, body{
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
html{ html{
background: url(<%= asset_path "body.jpg" %>) no-repeat scroll 0 0 transparent; background: url(<%= asset_path "body.jpg" %>) no-repeat scroll 0 0 transparent;
background-size: cover; background-size: cover;
} }
body{ body{
color: #000000; color: #000000;
font-family: helvetica,arial,sans-serif; font-family: Helvetica, '微軟正黑體';
margin: 0; }
padding: 0;
} #panel_banner_link{
background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0;
#panel_banner_link{ height: 50px;
background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0; left: 0;
height: 52px; position: fixed;
left: 0; top: 0;
position: absolute; width: 100%;
top: 0; z-index: 5;
width: 100%; }
} .hmenu{
.hmenu{ height: 40px;
height: 40px; position: absolute;
position: absolute; right: 0;
right: 0; top: 1px;
top: 1px; width: 250px;
width: 250px; }
} #orbit{
background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent;
cursor:pointer;
#orbit{ height: 43px;
background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent; left: 10px;
cursor:pointer; position: relative;
height: 43px; width: 41px;
left: 10px; }
position: relative; #orbit:hover{
width: 41px; background-position:0 -43px;
} box-shadow: 0 3px 3px #000000;
}
#orbit:hover{ #orbit:hover #orblist{
background-position:0 -43px; display:block;
box-shadow: 0 3px 3px #000000; }
} #orblist{
#orbit:hover #orblist{ background: none repeat scroll 0 0 #FFFFFF;
display:block; border-radius: 0 3px 3px 3px;
} box-shadow: 0 3px 3px #000000;
#orblist{ display: none;
background: none repeat scroll 0 0 #FFFFFF; margin: 0;
border-radius: 0 3px 3px 3px; padding: 10px;
box-shadow: 0 3px 3px #000000; position: absolute;
display: none; top: 43px;
margin: 0; width: 130px;
padding: 10px; }
position: absolute; #orblist li{
top: 43px; border-bottom:1px solid #aaa;
width: 130px; list-style:none;
} }
#orblist li{ .orblink{
border-bottom:1px solid #aaa; color: #333333;
list-style:none; display: block;
} font: 12px/100% arial,sans-serif;
.orblink{ padding: 5px;
color: #333333; text-decoration: none;
display: block; }
font: 12px/100% arial,sans-serif; .orblink:hover{
padding: 5px; background:#eee;
text-decoration: none; color:#333;
} }
.orblink:hover{
background:#eee; #log_out a{
color:#333; background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent;
} border: medium none !important;
display: block !important;
#log_out a{ height: 40px !important;
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent; line-height: normal !important;
border: medium none !important; padding: 0 !important;
display: block !important; position: absolute;
height: 40px !important; right: 0px;
line-height: normal !important; text-indent: -10000px;
padding: 0 !important; top: 0px;
position: absolute; width: 43px !important;
right: 0px; }
text-indent: -10000px; #log_out a:hover{
top: 0px; background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important;
width: 43px !important; }
} .lang{
#log_out a:hover{ color: #FFFFFF;
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important; font-size: 15px;
} line-height: 40px;
.lang{ position: absolute;
color: #FFFFFF; right: 55px;
font-size: 15px; top: 0;
line-height: 40px; }
position: absolute; .lang a{
right: 55px; color:#fff;
top: 0; text-decoration:none;
} }
.lang a:hover{
.lang a{ text-decoration:underline;
color:#fff; }
text-decoration:none; #content{
} height: 100%;
}
.lang a:hover{ #panel_footer{
text-decoration:underline; background-color: #101010;
} bottom: 0;
color: #FFFFFF;
#panel_container{ font-size: 11px;
height: 100%; padding: 10px;
} position: fixed;
width: 100%;
#panel_container h1{ left: 0;
color: #FFFFFF; box-shadow: 0 -3px 4px #000;
font: 32px/100% helvetica,arial,sans-serif; }
margin: 0 0 20px; #sidebar {
padding: 0; background: url(<%= asset_path "75.png" %>) repeat scroll left top transparent;
text-shadow: 0 0 5px #000000; box-shadow: 3px 0 4px #472A12;
} border-right: 1px solid #121212;
height: 100%;
#panel_header{ left: 0;
background: none repeat scroll 0 0 #F1F1F1; position: fixed;
border-bottom: 1px solid #818181; top: 0;
padding: 10px; width: 220px;
} }
#panel_header :after { #search {
content: "."; background: url(<%= asset_path "search_block_bg.jpg" %>) repeat-x scroll left top transparent;
display: block; height: 20px;
height: 0; margin-top: 43px;
clear: both; padding: 15px 12px;
visibility: hidden; }
} #search input {
#panel_header #nav{ background: url(<%= asset_path "search_bg.png" %>) no-repeat scroll left top transparent;
margin:0; border: medium none;
padding:0; font-family: Helvetica;
width:100%; height: 20px;
} padding: 0 20px;
width: 154px;
#panel_header #nav li{ }
float: left; h1 {
list-style: none outside none; background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent;
} border-bottom: 1px solid #1B1B1B;
border-top: 1px solid #424344;
#panel_header #nav li a{ color: #FFFFFF;
background: none repeat scroll 0 0 #fff; font-size: 12px;
border-radius: 13px 13px 13px 13px; font-weight: normal;
border: 1px solid #D6D6D6; height: 21px;
color: #000000; line-height: 21px;
float: left; margin: 0;
font-size:15px; padding-left: 10px;
margin: 0 20px 0 0; text-shadow: 0 -1px 0 #000000;
padding: 5px 10px; }
text-decoration: none; .member_setup .list {
} color:#fff;
font-size:12px;
#panel_header #nav li a:hover{ background:url(<%= asset_path "line.png" %>) repeat-x left bottom;
background: none repeat scroll 0 0 #818181; }
border-radius: 13px 13px 13px 13px; .member_setup .list li {
color: #fff; background:url(<%= asset_path "sidebar_li.jpg" %>) repeat-x left top;
} border-top:1px solid #424344;
border-bottom:1px solid #000000;
#panel_content{ }
height: 100%; .member_setup .list li:hover {
} background-position:left bottom;
border-top:1px solid #406cc3;
.main{ border-bottom:1px solid #242628;
float: left; }
height: 100%; .member_setup .list li a {
padding: 0 1%; display: block;
width: 81%; padding: 7px 0 6px 12px;
} color:#c4c4c4;
.main2{ }
padding: 62px 0 0; .member_setup .list li a span {
} background:url(<%= asset_path "add_mamber.png" %>) left top no-repeat;
.main table{ text-shadow: 0px 1px 0px #000;
border-collapse: collapse; line-height: 18px;
width:100%; padding: 2px 0 1px 35px;
} }
.main table th{ .member_setup .list li a:hover span {
border-bottom: 1px solid #222222; background-position:left bottom;
color: #FFFFFF; color:#eeeeee;
font: 20px/100% helvetica,arial,sans-serif; }
letter-spacing: 0.05em; #sidebar .users .list .set_1 {
padding: 10px; background-position:left bottom;
text-shadow: 0 0 3px #000000; border-top:1px solid #406cc3;
} border-bottom:1px solid #242628;
.main table td{ }
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5); #sidebar .users .list .set_1 a span {
border-bottom: 1px solid #222222; background-position:left bottom;
color: #FFFFFF; color:#eeeeee;
padding: 10px; }
text-align: center; #sidebar .roles .list .set_2 {
} background-position:left bottom;
border-top:1px solid #406cc3;
.main table td a{ border-bottom:1px solid #242628;
background: none repeat scroll 0 0 #FFFFFF; }
border-radius: 5px 5px 5px 5px; #sidebar .roles .list .set_2 a span {
color: #000000; background-position:left bottom;
padding: 5px; color:#eeeeee;
text-decoration: none; }
} #sidebar .infos .list .set_3 {
background-position:left bottom;
.main table td a:hover{ border-top:1px solid #406cc3;
background: none repeat scroll 0 0 #eee; border-bottom:1px solid #242628;
border-radius: 5px 5px 5px 5px; }
color: #333; #sidebar .infos .list .set_3 a span {
} background-position:left bottom;
.secondary{ color:#eeeeee;
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.75); }
box-shadow: 3px 0 3px #000000; .main {
float: left; height: 100%;
height: 100%; margin-left: 260px;
padding: 0 1%; padding-right: 40px;
width: 14%; position: relative;
} }
.secondary2{ .main_list {
padding: 62px 0 0; padding-top: 70px;
} }
.secondary ul{ .main_list ul {
margin: 0; clear:both;
padding: 0; }
} #porfile {
.secondary ul li{ padding-top: 100px;
list-style:none; }
} /*add_buttom*/
.secondary ul li a{ .button_bar {
border-bottom: 1px solid #333; float: right;
color: #AAAAAA; -moz-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
display: block; -webkit-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
padding: 14px 0; box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
text-align: left; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4f4f4f), color-stop(1, #000000) );
text-decoration: none; background:-moz-linear-gradient( center top, #4f4f4f 5%, #000000 100% );
} filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f', endColorstr='#000000');
.seclink1{ background-color:#4f4f4f;
background: url(<%= asset_path "icon1.png" %>) no-repeat scroll 20px 8px transparent; -moz-border-radius:5px;
border-bottom: 1px solid #333; -webkit-border-radius:5px;
color: #AAAAAA; border-radius:5px;
display: block; display:inline-block;
padding: 14px 0 14px 60px !important; padding:0;
text-align: left; margin:10px 0 60px;
text-decoration: none; }
} .button_bar a {
.seclink2{ text-decoration:none;
background: url(<%= asset_path "icon2.png" %>) no-repeat scroll 20px 14px transparent; text-shadow:0px -1px 0px #000000;
border-bottom: 1px solid #333; font-size:12px;
color: #AAAAAA; color:#EDEDED;
display: block; border-right:1px solid #555;
padding: 14px 0 14px 60px !important; -moz-box-shadow:1px 0px 0px black;
text-align: left; -webkit-box-shadow:1px 0px 0px black;
text-decoration: none; box-shadow:1px 0px 0px black;
} padding: 6px 10px 4px;
.secondary ul li a:hover{ display: inline-block;
color: #fff; float: left;
} }
.button_bar a:active {
#panel_footer{ padding: 7px 10px 3px !important;
background: none repeat scroll 0 0 #FFFFFF; text-shadow:0px 1px 0px #000000;
display:none; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #4f4f4f) );
clear: both; background:-moz-linear-gradient( center top, #000000 5%, #4f4f4f 100% );
padding: 10px; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#4f4f4f');
} }
#panel_footer p{ .button_bar a:last-child {
margin:0; border-right:none;
} -moz-box-shadow:none;
label{ -webkit-box-shadow:none;
color: #FFFFFF; box-shadow:none;
display: block; -moz-border-radius:0px 5px 5px 0px;
text-shadow: 0 0 5px #000000; -webkit-border-radius:0px 5px 5px 0px;
width: 130px; border-radius:0px 5px 5px 0px;
} }
p{ .button_bar a:first-child {
margin:0 0 10px; -moz-border-radius:5px 0px 0px 5px;
} -webkit-border-radius:5px 0px 0px 5px;
#panel_main p label{ border-radius:5px 0px 0px 5px;
float: left; }
padding: 3px; .button_bar a.new {
width: 100px; padding: 5px 10px;
} -moz-border-radius:5px;
#panel_main .translation_missing{ -webkit-border-radius:5px;
float: left; border-radius:5px;
padding: 3px; }
width: 100px; .button_bar a:hover {
color:#FFFFFF;
} }
.text{ .up {
border: 1px solid #818181; margin:10px 0;
border-radius: 3px 3px 3px 3px; }
font: 12px/100% helvetica,arial,sans-serif; #person {
padding: 3px; left: 245px;
width: 205px; position: fixed;
} text-align: center;
top: 75px;
#site_info{ width: 140px;
background: none repeat scroll 0 0 #FFFFFF; background-color:#FFF;
border-radius: 5px 5px 5px 5px; padding:15px;
box-shadow: 0 0 5px #000000; border-radius: 5px;
/* height: 289px;*/ -moz-border-radius: 5px;
margin: 0 0 20px; -webkit-border-radius: 5px;
overflow: hidden; -moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
width: 600px; -webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
} box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
#siteinfo_title{ }
background: none repeat scroll 0 0 #333333; #file {
color: #FFFFFF; display:none;
font: 24px/50px arial,sans-serif; }
height: 50px; #person img {
margin: 0; }
padding: 0 0 0 20px; .user_mail {
text-shadow: 0 1px 0 #000000; border: medium none;
} border:1px solid #DDDDDD;
#siteinfo_tb{ color: #666666;
background: none repeat scroll 0 0 #FFFFFF; font-size: 12px;
} width: 140px;
#siteinfo_tb td{ }
background: none repeat scroll 0 0 transparent; #person label {
border-bottom: 1px solid #333333; display: block;
color: #333333; margin: 15px 0 0;
} }
#person label input {
.buy_btn{ }
float:left; #person label #user_admin {
margin: 0 10px 0 0; float:right;
} margin: 0;
.main table td .buy_btn a{ }
background: url("/assets/buy_btn.png") no-repeat scroll 0 0 transparent; #person label span {
color: #000000; text-align:left;
display: block; font-size:11px;
font-size: 22px; color:#888;
height: 37px; display:block;
line-height: 37px; }
text-align: center; #person select {
text-decoration: none; border: 1px solid #DDDDDD;
text-shadow: 0 1px 0 #FFFFFF; padding: 0;
width: 170px; width: 140px;
padding: 0px; }
} #porfile .users{
.buy_btn a:hover{ margin-left: 180px;
background-position:0 bottom; }
} .roles_block {
.bought_btn{ background: url(<%= asset_path "75.png" %>) repeat left top;
background: url("/assets/bought_btn.png") no-repeat scroll 0 0 transparent; min-width:710px;
color: #FFFFFF; margin-bottom:50px;
float:left; position:relative;
font-size: 22px; padding-bottom: 20px;
height: 37px; border-radius: 5px;
line-height: 37px; -moz-border-radius: 5px;
margin: 0 10px 0 0; -webkit-border-radius: 5px;
text-align: center; -moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
text-shadow: 0 1px 0 #C06408; -webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
width: 170px; box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
}
.roles_block h2 {
color: #FFFFFF;
font-weight: normal;
margin: 0;
padding: 0;
position: absolute;
text-shadow: 0 3px 2px #000000;
top: -30px;
}
.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;
}
.main table {
width:100%;
}
.main td {
padding-left:20px;
color:#fff;
font-size:14px;
line-height:40px;
}
.main thead td {
line-height:40px;
font-size:16px;
text-shadow: 0px 1px 1px #3e2914;
}
.main thead td.action {
width:15%
}
.main tbody td.roles {
background-image: url(<%= asset_path "roles_type.jpg" %>);
background-repeat: repeat-x;
}
.main tbody td.teacher {
background-position: 0 -54px;
}
.main tbody td.student {
background-position: 0 -5px;
}
.main tbody td.action a {
background-image: url(<%= asset_path "icon.png" %>);
display: inline-block;
height: 19px;
margin-right: 10px;
top: 8px;
text-indent: -9999px;
width: 19px;
position: relative;
}
.main tbody td.action a.show {
background-position: left top;
}
.main tbody td.action a.show:hover {
background-position: left -19px;
}
.main tbody td.action a.edit {
background-position: -19px top;
}
.main tbody td.action a.edit:hover {
background-position: -19px -19px;
}
.main tbody td.action a.delete {
background-position: -38px top;
}
.main tbody td.action a.delete:hover {
background-position: -38px -19px;
}
.main tbody td.action a.switch {
background: url(<%= asset_path "switch.png" %>) no-repeat left 3px;
width: 40px;
}
.main tbody tr.disable td.action a.switch {
background-position:left bottom;
}
.main tbody td.action a.delete:hover {
background-position: -38px -19px;
}
.main tbody tr.have {
background: url(<%= asset_path "75.png" %>) repeat left top;
-moz-box-shadow: 0px 0px 6px #291508; /* Firefox */
-webkit-box-shadow: 0px 0px 6px #291508;/* Safari 和 Chrome */
box-shadow: 0px 0px 6px #291508; /* Opera 10.5 + */
}
.main tbody tr.disable {
opacity: 0.7;
}
.main tbody tr {
background:none;
height:15px;
} }

View File

@ -0,0 +1,44 @@
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
a {
text-decoration:none;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/*自定*/
input:focus, select:focus, textarea:focus {
outline:none;
-moz-outline-radius: 0;
}
.clear:after {
content:".";
clear:both;
display:block;
height:0;
visibility:hidden;
}

View File

@ -0,0 +1,44 @@
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
a {
text-decoration:none;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/*自定*/
input:focus, select:focus, textarea:focus {
outline:none;
-moz-outline-radius: 0;
}
.clear:after {
content:".";
clear:both;
display:block;
height:0;
visibility:hidden;
}

View File

@ -0,0 +1,59 @@
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

View File

@ -0,0 +1,60 @@
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

View File

@ -1,84 +1,89 @@
class Admin::UsersController < ApplicationController class Admin::UsersController < ApplicationController
layout "admin" layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :set_attribute, :only => [:index, :show, :new, :edit]
def index
@users = User.all.entries def index
end @users = User.all.entries
end
def show
@user = User.find(params[:id]) def show
get_info_role_models @user = User.find(params[:id])
end get_info_role_models
end
def new
@user = User.new def new
get_info_role_models @user = User.new
end get_info_role_models
end
def create
@user = User.new(params[:user]) def create
if @user.save @user = User.new(params[:user])
@user.user_infos.each do |info| if @user.save
info.save @user.user_infos.each do |info|
info.attribute_values.each(&:save) info.save
end info.attribute_values.each(&:save)
@user.roles.each do |role| end
role.save @user.roles.each do |role|
role.attribute_values.each(&:save) role.save
end role.attribute_values.each(&:save)
flash[:notice] = t('admin.create_success_user') end
redirect_to :action => :index flash[:notice] = t('admin.create_success_user')
else redirect_to :action => :index
render :action => :new else
end render :action => :new
end end
end
def edit
@user = User.find(params[:id]) def edit
get_info_role_models @user = User.find(params[:id])
end get_info_role_models
end
def update
@user = User.find(params[:id]) def update
@user = User.find(params[:id])
# Update changes to the avatar
@user.remove_avatar! if params[:file] # Update changes to the avatar
@user.avatar = params[:file] if params[:file] @user.remove_avatar! if params[:file]
@user.avatar = params[:file] if params[:file]
if @user.id.to_s.eql?(session['warden.user.user.key'][1].to_s) && @user.admin != params[:user][:admin].to_i.to_b
flash.now[:error] = t('admin.cant_revoke_self_admin') if @user.id.to_s.eql?(session['warden.user.user.key'][1].to_s) && @user.admin != params[:user][:admin].to_i.to_b
end flash.now[:error] = t('admin.cant_revoke_self_admin')
if !flash[:error] && @user.update_attributes(params[:user]) end
flash[:notice] = t('admin.update_success_user') if !flash[:error] && @user.update_attributes(params[:user])
redirect_to :action => :index flash[:notice] = t('admin.update_success_user')
else redirect_to :action => :index
get_info_role_models else
render :action => :edit get_info_role_models
end render :action => :edit
end end
end
def destroy
if params[:id].eql?(session['warden.user.user.key'][1].to_s) def destroy
flash[:error] = t('admin.cant_delete_self') if params[:id].eql?(session['warden.user.user.key'][1].to_s)
else flash[:error] = t('admin.cant_delete_self')
@user = User.find(params[:id]) else
@user.destroy @user = User.find(params[:id])
@user.user_attributes.each do |ua| @user.destroy
ua.attribute_values.each(&:destroy) @user.user_attributes.each do |ua|
ua.destroy ua.attribute_values.each(&:destroy)
end ua.destroy
end end
end
redirect_to :action => :index
end redirect_to :action => :index
end
protected
protected
def get_info_role_models
@roles = Info.excludes('disabled' => true) def get_info_role_models
@infos = Role.excludes('disabled' => true) @roles = Info.excludes('disabled' => true)
end @infos = Role.excludes('disabled' => true)
end
end
def set_attribute
@class = 'users'
end
end

View File

@ -1,57 +1,57 @@
<div id="UserRole_block" class="roles_block"> <div id="UserRole_block" class="roles_block <%= @class %>">
<h2><%= t("admin.user_#{@attribute}") %></h2> <h2><%= t("admin.user_#{@attribute}") %></h2>
<div class="info_input"> <div class="info_input">
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
<thead class="list_head"> <thead class="list_head">
<tr> <tr>
<td><%= t('admin.key') %></td> <td><%= t('admin.key') %></td>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td style="color:<%= colorize_in_use_locale(locale) %>"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td> <td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
<% end %> <% end %>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="list_item"> <tr class="list_item">
<td><%= is_new ? (f.text_field :key, {:style => "width:150px"}) : @user_attribute_model.key %></td> <td><%= is_new ? (f.text_field :key, {:style => "width:150px"}) : @user_attribute_model.key %></td>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td> <td>
<%= text_field_tag "user_#{@attribute}_model[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:150px" %> <%= text_field_tag "user_#{@attribute}_model[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:150px" %>
</td> </td>
<% end %> <% end %>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div id="attributes_block" class="roles_block"> <div id="attributes_block" class="roles_block <%= @class %>">
<h2>Attributes</h2> <h2>Attributes</h2>
<div class="info_input"> <div class="info_input">
<table id='attributes' border="0" cellspacing="0" cellpadding="0"> <table id='attributes' border="0" cellspacing="0" cellpadding="0">
<thead class="list_head"> <thead class="list_head">
<tr> <tr>
<td><%= t('admin.key') %></td> <td><%= t('admin.key') %></td>
<td><%= t('admin.multilingual') %></td> <td><%= t('admin.multilingual') %></td>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td style="color:<%= colorize_in_use_locale(locale) %>"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td> <td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
<% end %> <% end %>
<td><%= t('admin.type')%></td> <td><%= t('admin.type')%></td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
</thead> </thead>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="5"><a href="#" class="add"><%= t(:add) %></a></td> <td colspan="5"><a href="#" class="add"><%= t(:add) %></a></td>
</tr> </tr>
</tfoot> </tfoot>
<tbody> <tbody>
<%= render :partial => 'admin/user_attribute_models/attribute_model', :collection => @user_attribute_model.attribute_models %> <%= render :partial => 'admin/user_attribute_models/attribute_model', :collection => @user_attribute_model.attribute_models %>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "user_attribute_model_form" %> <%= javascript_include_tag "user_attribute_model_form" %>
<% end -%> <% end -%>

View File

@ -0,0 +1,31 @@
<!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>

View File

@ -1,12 +1,14 @@
<div id="porfile"> <% content_for :secondary do %>
<%= form_for @user_attribute_model, :url => eval("admin_user_#{@attribute}_model_path(@user_role_model)") do |f| %> <%= render 'side_bar' %>
<%= f.error_messages %> <% end %>
<%= render :partial => "admin/user_attribute_models/form", :locals => { :f => f, :is_new => false } %>
<div id="update" class='buttom clear'> <div id="porfile">
<%= link_to t('update'), "#", :onclick=>"$('#edit_user_role_model_#{@user_attribute_model.id}').submit()" %> <%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %>
</div> <%= f.error_messages %>
<div id="back" class='buttom clear'> <%= render :partial => 'form', :locals => { :f => f } %>
<%= link_back %> <div class="button_bar">
</div> <%= link_back %>
<% end -%> <%= link_to t('update'), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
</div>
<% end -%>
</div> </div>

View File

@ -1,30 +1,41 @@
<div class="main_list"> <% content_for :secondary do %>
<div id="add_new" class="buttom clear"> <%= render 'admin/users/side_bar' %>
<%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %> <% end %>
</div>
<ul> <div class="main_list">
<li class="list_head clear"> <div class="button_bar up">
<span class="<%= @attribute %>s"><%= t("admin.#{@attribute}") %></span> <%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path"), :class => 'new' %>
<span class="action"><%= t('admin.action') %></span> </div>
</li> <table>
<% @user_attribute_models.each do |user_attribute_model| %> <thead>
<li id="attribute_<%= user_attribute_model.id %>" class="list_item <%= "#{user_attribute_model.is_disabled? ? 'disable' : ''}" %> clear"> <tr>
<span class="<%= @attribute %>s <%= user_attribute_model.i18n_variable[:key].downcase %>"><%= user_attribute_model.i18n_variable[I18n.locale] %></span> <td class="<%= @attribute %>s"><%= t("admin.#{@attribute}") %></td>
<span class="action"> <td class="action"><%= t('admin.action') %></td>
</tr>
<%= link_to t(:edit), eval("edit_admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'edit' %> </thead>
<% if user_attribute_model.is_built_in? %> <tbody>
<%= 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' %> <% @user_attribute_models.each do |user_attribute_model| %>
<%= 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' %> <tr id="attribute_<%= user_attribute_model.id %>" class="have <%= "#{user_attribute_model.is_disabled? ? 'disable' : ''}" %>">
<% else %> <td class="<%= @attribute %>s <%= user_attribute_model.i18n_variable[:key].downcase %>"><%= user_attribute_model.i18n_variable[I18n.locale] %></td>
<%= link_to t(:delete), eval("admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %> <td class="action">
<% end %> <%= link_to t(:edit), eval("edit_admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'edit' %>
<% if user_attribute_model.is_built_in? %>
</span> <%= 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' %>
</li> <%= 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' %>
<% end %> <% else %>
</ul> <%= 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' %>
<div id="add_new" class="buttom clear"> <%= 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("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %> <%= link_to t(:delete), eval("admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
</div> <% end %>
</div> </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>

View File

@ -1,16 +1,18 @@
<div id="porfile"> <% content_for :secondary do %>
<%= form_for @user_attribute_model, :url => eval("admin_user_#{@attribute}_models_path") do |f| %> <%= render 'admin/users/side_bar' %>
<%= f.error_messages %> <% end %>
<%= render :partial => "admin/user_attribute_models/form", :locals => { :f => f, :is_new => true } %>
<div id="create" class='buttom clear'> <div id="porfile">
<%= link_to t('create'), "#", :onclick=>"$('#new_user_attribute_model').submit()" %> <%= form_for @user_attribute_model, :url => eval("admin_user_#{@attribute}_models_path") do |f| %>
</div> <%= f.error_messages %>
<div id="back" class='buttom clear'> <%= render :partial => "admin/user_attribute_models/form", :locals => { :f => f, :is_new => true } %>
<%= link_back %> <div class="button_bar">
</div> <%= link_back %>
<% end -%> <%= link_to t('create'), "#", :onclick=>"$('#new_user_attribute_model').submit()" %>
</div> </div>
<% end -%>
</div>

View File

@ -0,0 +1,34 @@
<% content_for :secondary do %>
<%= render 'admin/users/side_bar' %>
<% end %>
<div class="main_list">
<div id="add_new" class="buttom clear">
<%= link_to t("admin.new_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>

View File

@ -0,0 +1,16 @@
<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 -%>

View File

@ -1,40 +1,47 @@
<div id="person"> <div id="person" class="clear">
<% if @user.avatar? %> <% if @user.avatar? %>
<%= image_tag(@user.avatar.thumb.url) %> <%= image_tag(@user.avatar.thumb.url) %>
<% else %> <% else %>
<%= image_tag "person.png" %> <%= image_tag "person.png" %>
<% end %> <% end %>
<%= file_field_tag 'file' %> <%= file_field_tag 'file' %>
<%= hidden_field_tag :avatar_cache %> <%= hidden_field_tag :avatar_cache %>
<%= f.text_field :email, :onfocus => "this.value='';", :onblur => "if(this.value==''){this.value=#{t('admin.email')};}", :value => (@user.email.blank? ? t('admin.email') : @user.email), :class => 'user_mail' %> <label>
<label> <span><%= t('admin.email') %></span>
<%= f.check_box :admin %><span><%= t('admin.admin') %></span> <%= f.text_field :email, :onfocus => "this.value='';", :onblur => "if(this.value==''){this.value=#{t('admin.email')};}", :value => (@user.email.blank? ? t('admin.email') : @user.email), :class => 'user_mail' %>
</label> </label>
<%= 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') %> <label>
</div> <%= f.check_box :admin %>
<span><%= t('admin.admin') %></span>
<% @user_info_models.each do |ua| %> </label>
<div id="basic_block" class="roles_block"> <label>
<h2><%= ua.i18n_variable[I18n.locale] %></h2> <span><%= t('admin.role') %></span>
<hr> <%= 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') %>
<%= render :partial => 'user_attribute', </label>
:object => (@user.user_infos.detect {|u| u.key == ua.key } || @user.user_infos.build), </div>
:locals => {:ua => ua, :type => 'info'} %>
</div> <% @user_info_models.each do |ua| %>
<% end -%> <div id="basic_block" class="roles_block <%= @class %>">
<h2><%= ua.i18n_variable[I18n.locale] %></h2>
<div id='role_models'> <hr>
<% @user_role_models.each do |ua| %> <%= render :partial => 'user_attribute',
<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?)) %>> :object => (@user.user_infos.detect {|u| u.key == ua.key } || @user.user_infos.build),
<h2><%= ua.i18n_variable[I18n.locale] %></h2> :locals => {:ua => ua, :type => 'info'} %>
<hr> </div>
<%= render :partial => 'user_attribute', <% end -%>
:object => (@user.user_roles.detect {|u| u.key == ua.key } || @user.user_roles.build),
:locals => {:ua => ua, :type => 'role'} %> <div id='role_models'>
</div> <% @user_role_models.each do |ua| %>
<% end -%> <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> <h2><%= ua.i18n_variable[I18n.locale] %></h2>
<hr>
<% content_for :page_specific_javascript do %> <%= render :partial => 'user_attribute',
<%= javascript_include_tag "user_form" %> :object => (@user.user_roles.detect {|u| u.key == ua.key } || @user.user_roles.build),
<% end -%> :locals => {:ua => ua, :type => 'role'} %>
</div>
<% end -%>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "user_form" %>
<% end -%>

View File

@ -1,27 +1,27 @@
<div class="info_input"> <div class="info_input">
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
<thead class="list_head"> <thead class="list_head">
<td><%= t("admin.key") %></td> <td><%= t("admin.key") %></td>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td style="color:<%= colorize_in_use_locale(locale) %>"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td> <td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
<% end %> <% end %>
</thead> </thead>
<tbody> <tbody>
<% am.get_enabled_attribute_models.each do |attr| %> <% am.get_enabled_attribute_models.each do |attr| %>
<tr class="list_item"> <tr class="list_item">
<td><%= attr.i18n_variable[I18n.locale] %></td> <td><%= attr.i18n_variable[I18n.locale] %></td>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td> <td>
<% if attr["locale"] && attr["markup"] == 'text_field' %> <% if attr["locale"] && attr["markup"] == 'text_field' %>
<%= show_user_attribute(object, attr.key, locale) %> <%= show_user_attribute(object, attr.key, locale) %>
<% else %> <% else %>
<%= show_user_attribute(object, attr.key) %> <%= show_user_attribute(object, attr.key) %>
<% end %> <% end %>
</td> </td>
<% end %> <% end %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -1,11 +1,11 @@
<div id="search"> <div id="search">
<input id="user_search" name="user[username]" size="30" type="text" /> <input id="user_search" name="user[username]" size="30" type="text" />
</div> </div>
<div class="member_setup"> <div class="member_setup <%= @class %>">
<h1><%= t('admin.setup_member') %></h1> <h1><%= t('admin.setup_member') %></h1>
<ul class="list"> <ul class="list">
<li class="set_1"><%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %></li> <li class="set_1"><%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %></li>
<li class="set_2"><%= link_to content_tag(:span, t('admin.list_roles')), admin_roles_path %></li> <li class="set_2"><%= link_to content_tag(:span, t('admin.list_roles')), admin_roles_path %></li>
<li class="set_3"><%= link_to content_tag(:span, t('admin.list_infos')), admin_infos_path %></li> <li class="set_3"><%= link_to content_tag(:span, t('admin.list_infos')), admin_infos_path %></li>
</ul> </ul>
</div> </div>

View File

@ -1,44 +1,44 @@
<%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %> <%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %>
<%= f.hidden_field :key, :value => ua.key %> <%= f.hidden_field :key, :value => ua.key %>
<%= f.hidden_field :id unless user_attribute.new_record? %> <%= f.hidden_field :id unless user_attribute.new_record? %>
<div class="info_input"> <div class="info_input">
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
<thead class="list_head"> <thead class="list_head">
<tr> <tr>
<td><%= t("admin.key") %></td> <td><%= t("admin.key") %></td>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td style="color:<%= colorize_in_use_locale(locale) %>"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td> <td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
<% end %> <% end %>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% ua.get_enabled_attribute_models.each do |attr| %> <% ua.get_enabled_attribute_models.each do |attr| %>
<% value = user_attribute.attribute_values.detect{|v| v.key == attr.key } %> <% 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][][id]", value.id rescue nil %>
<%= hidden_field_tag "user[user_#{type}s][][attribute_values][][key]", attr.key %> <%= hidden_field_tag "user[user_#{type}s][][attribute_values][][key]", attr.key %>
<tr class="list_item"> <tr class="list_item">
<td><%= attr.i18n_variable[I18n.locale] %></td> <td><%= attr.i18n_variable[I18n.locale] %></td>
<% if attr["locale"] && attr["markup"] == 'text_field' %> <% if attr["locale"] && attr["markup"] == 'text_field' %>
<%= hidden_field_tag "user[user_#{type}s][][attribute_values][][non_locale]", nil %> <%= hidden_field_tag "user[user_#{type}s][][attribute_values][][non_locale]", nil %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td> <td>
<%= text_field_tag "user[user_#{type}s][][attribute_values][][#{locale}]", (value[locale] rescue nil) %> <%= text_field_tag "user[user_#{type}s][][attribute_values][][#{locale}]", (value[locale] rescue nil) %>
</td> </td>
<% end -%> <% end -%>
<% else %> <% else %>
<td colspan=<%= @site_valid_locales.size %>> <td colspan=<%= @site_valid_locales.size %>>
<% if attr["markup"] == "text_field" %> <% 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[user_#{type}s][][attribute_values][][non_locale]", (value['non_locale'] rescue nil) %>
<% elsif attr["markup"] == "select" %> <% 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[user_#{type}s][][attribute_values][][non_locale]", options_for_select(attr["options"], value['non_locale']) %>
<% end -%> <% end -%>
</td> </td>
<% end -%> <% end -%>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
</div> </div>
<% end %> <% end %>

View File

@ -1,12 +1,14 @@
<div id="porfile"> <% content_for :secondary do %>
<%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %> <%= render 'side_bar' %>
<%= f.error_messages %> <% end %>
<%= render :partial => 'form', :locals => { :f => f } %>
<div id="update" class='buttom clear'> <div id="porfile">
<%= link_to t('update'), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %> <%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %>
</div> <%= f.error_messages %>
<div id="back" class='buttom clear'> <%= render :partial => 'form', :locals => { :f => f } %>
<%= link_back %> <div class="button_bar">
</div> <%= link_back %>
<% end -%> <%= link_to t('update'), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
</div>
<% end -%>
</div> </div>

View File

@ -1,32 +1,43 @@
<div class="main_list"> <% content_for :secondary do %>
<%= flash_messages %> <%= render 'side_bar' %>
<div id="add_new" class="buttom clear"> <% end %>
<%= link_to t('admin.new_user'), new_admin_user_path %>
</div> <div class="main_list">
<ul> <%= flash_messages %>
<li class="list_head clear"> <div class="button_bar up">
<span class="roles"><%= t('admin.role') %></span> <%= link_to t('admin.new_user'), new_admin_user_path, :class => 'new' %>
<span class="name"><%= t('admin.name') %></span> </div>
<span class="email"><%= t('admin.email') %></span> <table>
<span class="admin"><%= t('admin.admin') %></span> <thead>
<span class="action"><%= t('admin.action') %></span> <tr>
</li> <td class="roles"><%= t('admin.role') %></td>
<% @users.each do |user| %> <td class="name"><%= t('admin.name') %></td>
<li class="list_item clear"> <td class="email"><%= t('admin.email') %></td>
<% active_role = UserRoleModel.get_role_model_from_key(user.active_role) %> <td class="admin"><%= t('admin.admin') %></td>
<span class="roles <%= active_role.key.downcase rescue nil %>"><%= active_role.i18n_variable[I18n.locale] rescue nil %></span> <td class="action"><%= t('admin.action') %></td>
<span class="name"><%= user.name ? user.name : 'bob' %></span> </tr>
<span class="email"><%= user.email %></span> </thead>
<span class="admin"><%= user.admin ? t(:yes_) : t(:no_) %></span> <tbody>
<span class="action"> <% @users.each do |user| %>
<%= link_to t(:show), admin_user_path(user), :class => 'show' %> <% active_role = UserRoleModel.get_role_model_from_key(user.active_role) %>
<%= link_to t(:edit), edit_admin_user_path(user), :class => 'edit' %> <tr class="have">
<%= link_to t(:delete), admin_user_path(user), :class => 'delete', :confirm => t('sure?'), :method => :delete %> <td class="roles <%= active_role.key.downcase rescue nil %>"><%= active_role.i18n_variable[I18n.locale] rescue nil %></td>
</span> <td class="name"><%= user.name ? user.name : 'bob' %></td>
</li> <td class="email"><%= user.email %></td>
<% end %> <td class="admin"><%= user.admin ? t(:yes_) : t(:no_) %></td>
</ul> <td class="action">
<div id="add_new" class="buttom clear"> <%= link_to t(:show), admin_user_path(user), :class => 'show' %>
<%= link_to t('admin.new_user'), new_admin_user_path %> <%= link_to t(:edit), edit_admin_user_path(user), :class => 'edit' %>
</div> <%= link_to t(:delete), admin_user_path(user), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
</div> </td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<% end %>
</tbody>
</table>
<div class="button_bar">
<%= link_to t('admin.new_user'), new_admin_user_path, :class => 'new' %>
</div>
</div>

View File

@ -1,17 +1,19 @@
<div id="porfile"> <% content_for :secondary do %>
<%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %> <%= render 'side_bar' %>
<%= f.error_messages %> <% end %>
<%= render :partial => 'form', :locals => { :f => f } %>
<div id="create" class='buttom clear'> <div id="porfile">
<%= link_to t('create'), "#", :onclick=>"$('#new_user').submit()" %> <%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %>
</div> <%= f.error_messages %>
<div id="back" class='buttom clear'> <%= render :partial => 'form', :locals => { :f => f } %>
<%= link_back %> <div class="button_bar">
</div> <%= link_back %>
<% end -%> <%= link_to t('create'), "#", :onclick=>"$('#new_user').submit()" %>
</div> </div>
<% end -%>
</div>

View File

@ -1,28 +1,34 @@
<div id="porfile"> <% content_for :secondary do %>
<%= render 'side_bar' %>
<div id="person"> <% end %>
<% if @user.avatar? %>
<%= image_tag(@user.avatar.thumb.url) %> <div id="porfile">
<% else %>
<%= image_tag "person.png" %> <div id="person">
<% end %> <% if @user.avatar? %>
<%= link_to t(:edit), edit_admin_user_path(@user), :id => 'edit' %> <%= image_tag(@user.avatar.thumb.url) %>
</div> <% else %>
<%= image_tag "person.png" %>
<% @user_info_models.each do |am| %> <% end %>
<div id="basic_block" class="roles_block"> </div>
<h2><%= am.i18n_variable[I18n.locale] %></h2>
<hr> <% @user_info_models.each do |am| %>
<%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %> <div id="basic_block" class="roles_block <%= @class %>">
</div> <h2><%= am.i18n_variable[I18n.locale] %></h2>
<% end -%> <hr>
<%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %>
<div id="<%= @user.active_role %>_block" class="roles_block"> </div>
<% active_role = UserRoleModel.get_role_model_from_key(@user.active_role) %> <% end -%>
<h2><%= active_role.i18n_variable[I18n.locale] %></h2>
<hr> <div id="<%= @user.active_role %>_block" class="roles_block <%= @class %>">
<%= render :partial => 'show_user_attribute', :locals => {:am => active_role, :object => @user.get_role_from_model_key(active_role.key)} %> <% active_role = UserRoleModel.get_role_model_from_key(@user.active_role) %>
</div> <h2><%= active_role.i18n_variable[I18n.locale] %></h2>
<hr>
</div> <%= render :partial => 'show_user_attribute', :locals => {:am => active_role, :object => @user.get_role_from_model_key(active_role.key)} %>
</div>
<div class="button_bar">
<%= link_to t(:edit), edit_admin_user_path(@user) %>
<%= link_back %>
</div>
</div>

View File

@ -1,36 +1,31 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%= @title || APP_CONFIG['orbit'] %></title> <title><%= @title || APP_CONFIG['orbit'] %></title>
<link rel="shortcut icon" href="/favicon.ico"> <link rel="shortcut icon" href="/favicon.ico">
<%= stylesheet_link_tag "admin" %> <%= stylesheet_link_tag "admin" %>
<%= javascript_include_tag "admin" %> <%= javascript_include_tag "admin" %>
<%= yield :page_specific_css %> <%= yield :page_specific_css %>
<%= yield :page_specific_javascript %> <%= yield :page_specific_javascript %>
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body> <body>
<div id="panel_banner_link" >
<div id="panel_banner_link" > <div id="orbit"><%= render 'layouts/drop_down_menu' %></div>
<div id="orbit"><%= render 'layouts/drop_down_menu' %></div> <div class="hmenu">
<div class="hmenu"> <div class="lang"><%= render 'layouts/lang_menu' %></div>
<div class="lang"><%= render 'layouts/lang_menu' %></div> <%= render 'devise/menu/login_items' %>
<%= render 'devise/menu/login_items' %> </div>
</div> </div>
</div>
<div id="content">
<div id="panel_container"> <div id="sidebar"><%= yield :secondary %></div>
<div id="panel_content"> <div class="main">
<div class="secondary"> <%= yield %>
<div class="secondary2"><%= yield :secondary %></div> </div>
</div> <div class="tertiary"><%= yield :tertiary %></div>
<div class="main"> <div id="panel_footer"><p><%= APP_CONFIG['ruling_digital'] %></p></div>
<div class="main2"><%= yield %></div> </div>
</div> </body>
<div class="tertiary"><%= yield :tertiary %></div> </html>
</div>
<div id="panel_footer"><p><%= APP_CONFIG['ruling_digital'] %></p></div>
</div>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!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>

14
edit.html.erb Normal file
View File

@ -0,0 +1,14 @@
<% 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_to t('update'), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
<%= link_back %>
</div>
<% end -%>
</div>

34
index.html.erb Normal file
View File

@ -0,0 +1,34 @@
<% content_for :secondary do %>
<%= render 'admin/users/side_bar' %>
<% end %>
<div class="main_list">
<div id="add_new" class="buttom clear">
<%= link_to t("admin.new_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>