Integration of Ray' modifications

This commit is contained in:
chris2tof 2011-11-17 20:02:58 +08:00
parent c4810274ec
commit 861237d65b
39 changed files with 804 additions and 175 deletions

BIN
app/assets/images/Jobs.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
app/assets/images/Thumbs.db Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
app/assets/images/h1_bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
app/assets/images/h1_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
app/assets/images/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
app/assets/images/line.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 KiB

View File

@ -297,7 +297,7 @@ p{
background: none repeat scroll 0 0 #FFFFFF; background: none repeat scroll 0 0 #FFFFFF;
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
box-shadow: 0 0 5px #000000; box-shadow: 0 0 5px #000000;
height: 289px; /* height: 289px;*/
margin: 0 0 20px; margin: 0 0 20px;
overflow: hidden; overflow: hidden;
width: 600px; width: 600px;

View File

@ -0,0 +1,244 @@
/*
*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
*the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*/
a, a:hover {
text-decoration: none;
outline:none;
}
html,body {
height:100%;
margin:0;
font-family: Helvetica, '微軟正黑體';
}
ul {
list-style:none;
list-style-image:none;
margin:0;
padding:0;
}
.clear:after {
content:".";
clear:both;
height:0;
display:block;
visibility:hidden;
}
#content{
height:100%;
}
#sidebar {
position:fixed;
top:0;
left:0;
height: 100%;
width:220px;
/*background-color:rgba(245,245,245,1);*/
background-color:rgba(0,0,0,0.75);
-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 + */
}
#search {
background:url(<%= asset_path 'search_block_bg.jpg' %>) repeat-x left top;
margin-top:43px;
padding:15px 12px;
height:20px;
}
#search input {
background:url(<%= asset_path 'search_bg.png' %>) no-repeat left top;
border:none;
width:174px;
height:20px;
padding-left:20px;
}
h1 {
background:url(<%= asset_path 'h1_bg.png' %>) repeat-x left top;
margin:0;
line-height:21px;
height:21px;
font-size:12px;
padding-left:10px;
font-weight:normal;
text-shadow:0px -1px 0px #000;
color:#FFF;
border-top:1px solid #424344;
border-bottom:1px solid #1b1b1b;
}
#user_list .member_setup ul li.set_1 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
#roles_list .member_setup ul li.set_2 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
#user_list .member_setup ul li.set_1 a span {
background-position:left bottom;
color:#eeeeee;
}
#roles_list .member_setup ul li.set_2 a span {
background-position:left bottom;
color:#eeeeee;
}
.member_setup ul {
color:#fff;
font-size:12px;
background:url(<%= asset_path 'line.png' %>) repeat-x left bottom;
}
.member_setup ul li {
background:url(<%= asset_path 'sidebar_li.jpg' %>) repeat-x left top;
/* line-height:31px;*/
border-top:1px solid #424344;
border-bottom:1px solid #000000;
}
.member_setup ul li:hover {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
.member_setup ul li a {
display: block;
padding: 7px 0 6px 12px;
color:#c4c4c4;
}
.member_setup ul 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 ul li a:hover span {
background-position:left bottom;
color:#eeeeee;
}
#main{
position: relative;
margin-left: 260px;
padding-right: 40px;
height:100%;
}
.main_list {
padding-top:70px;
}
.main_list li {
background-color:rgba(0,0,0,0.75);
margin-bottom:20px;
}
.main_list li span {
display:inline-block;
float:left;
padding-left:20px;
color:#fff;
font-size:14px;
line-height:40px;
width:18%;
}
.main_list li.list_head {
background-color:inherit;
margin-bottom:10px;
}
.main_list li.list_head span {
font-size:16px;
line-height:inherit;
text-shadow: 0px 1px 1px #3e2914;
}
.main_list li.list_item {
position:relative;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-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_list li.list_item:hover {
border:1px solid #3699dd;
}
.main_list li.list_item:hover span {
line-height:38px;
}
.main_list li .roles {
}
.main_list li .name {
}
.main_list li .email {
}
.main_list li .admin{
}
.main_list li .action{
float: right;
width:10%;
}
.main_list li .action a{
background-image:url(<%= asset_path 'icon.png' %>);
text-indent:-9999px;
display:inline-block;
width:19px;
height:19px;
margin-top:8px;
margin-right:10px;
}
.main_list li .action a.show{
background-position:left top;
}
.main_list li .action a.edit{
background-position:-19px top;
}
.main_list li .action a.delete{
background-position:-38px top;
}
.main_list li .action a.show:hover{
background-position:left bottom;
}
.main_list li .action a.edit:hover{
background-position:-19px bottom;
}
.main_list li .action a.delete:hover{
background-position:-38px bottom;
}
.main_list li.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;
}
.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;
background-repeat:no-repeat;
font-size:12px;
color:#FFF;
float:right;
display:inline-block;
padding:0 10px 0 25px;
background-color: rgba(0, 0, 0, 0.75);
line-height:24px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 3px 0px 4px #180902; /* Firefox */
-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;
color:#000;
font-weight:bold;
background-color: rgba(255, 255, 255, 1);
}

View File

@ -0,0 +1,305 @@
body{
background:url(<%= asset_path 'wood_floor.jpg' %>) fixed center 0;
/*background:url(images/jobs.jpg) fixed center bottom;*/
-moz-background-size:cover;
background-size:cover;
color: #000000;
margin: 0;
padding: 0;
}
#hmenu{
background:url(<%= asset_path 'orbitbar.png' %>) repeat-x 0 0;
height: 50px;
position:fixed;
top:0;
left:0;
width:100%;
z-index: 5;
}
#orbit_icon {
margin-left: 10px;
}
#orbit_icon a {
background:url(<%= asset_path 'bar_orbit.png' %>) no-repeat scroll left top transparent;
height: 43px;
width: 41px;
display:block;
text-indent:-9999px;
}
#orbit_icon a:hover {
background:url(<%= asset_path 'bar_orbit.png' %>) no-repeat scroll left 50% transparent;
}
#hmenu #left{
left: 51px;
position: absolute;
top: 1px;
}
#hmenu #left a{
border-left: 1px solid #000000;
border-right: 1px solid #7F8488;
color: #FFFFFF;
display: block;
font-size: 17px;
height: 40px;
line-height: 40px;
padding: 0 10px;
text-align: center;
text-decoration: none;
}
#hmenu #left a:hover{
background:#000;
color: #FFFFFF;
}
#hmenu #right{
position: absolute;
right: 10px;
top: 1px;
width: 393px;
}
#hmenu #right a{
border-left: 1px solid #7F8488;
border-right: 1px solid #7F8488;
color: #FFFFFF;
display: block;
font-size: 17px;
height: 40px;
line-height: 40px;
padding: 0 10px;
text-align: center;
text-decoration: none;
width: 65px;
}
#hmenu #right a:hover{
background:#000;
color: #FFFFFF;
}
#hmenu form{
left: 27px;
position: absolute;
top: 8px;
}
#login_id{
background:url(<%= asset_path 'bar_id.png' %>) no-repeat scroll 0 0 transparent;
border: medium none;
color: #818181;
font-family: arial,sans-serif;
height: 26px;
left: 70px;
position: absolute;
top: 0;
width: 119px;
}
#login_id input {
background: none repeat scroll 0 0 transparent;
border: medium none;
font-family: arial,sans-serif;
height: 15px;
left: 21px;
position: absolute;
top: 4px;
width: 92px;
}
#login_pw {
background:url(<%= asset_path 'bar_pw.png' %>) no-repeat scroll 0 0 transparent;
border: medium none;
color: #818181;
font-family: arial,sans-serif;
height: 26px;
left: 193px;
position: absolute;
top: 0;
width: 119px;
}
#login_pw input {
background: none repeat scroll 0 0 transparent;
border: medium none;
font-family: arial,sans-serif;
height: 15px;
left: 21px;
position: absolute;
top: 4px;
width: 92px;
}
#login_btn input {
background:url(<%= asset_path 'bar_btn.png' %>) no-repeat scroll 0 0 transparent;
border: medium none;
color: #FFFFFF;
cursor: pointer;
font-family: arial,sans-serif;
height: 26px;
left: 316px;
margin: 0;
padding: 0 0 2px;
position: absolute;
top: 0;
width: 50px;
}
#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: -9px;*/
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;
}
#hmenu #right select{
font-family: helvetica,arial,sans-serif;
left: 97px;
position: absolute;
top: 10px;
width: 120px;
}
.content{
padding: 10px;
}
#user_info{
background: none repeat scroll 0 0 #FEFEFE;
border: 1px solid #818181;
border-radius: 5px 5px 5px 5px;
margin: 0 0 20px;
padding: 10px;
width: 250px;
}
#user_info table{
border-collapse: collapse;
width: 100%;
}
#user_info table td{
padding: 3px;
}
#sites_info{
background: -webkit-gradient(linear, left top, left bottom, from(white), to(#F8F8F8));
border: 1px solid #818181;
border-radius: 5px 5px 5px 5px;
float: left;
margin: 0 20px 20px 0;
width: 30%;
min-width: 320px;
}
#sites_info h3{
background: none repeat scroll 0 0 #EEEEEE;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
font: 24px/100% helvetica,arial,sans-serif;
margin: 2% 2% 0;
padding: 1%;
}
#sites_info table{
background: none repeat scroll 0 0 #fff;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
margin: 2%;
width: 96%;
}
#sites_info table td{
padding: 10px 5px;
}
#sites_info table th{
border-right: 1px solid #DDDDDD;
color: #808080;
font-size: 18px;
font-weight: normal;
padding: 10px 5px;
text-align: right;
width: 20%;
}
#purchases{
background: -webkit-gradient(linear, left top, left bottom, from(white), to(#F8F8F8));
border: 1px solid #818181;
border-radius: 5px 5px 5px 5px;
float: left;
width: 30%;
min-width: 320px;
}
#purchases h3{
background: none repeat scroll 0 0 #EEEEEE;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
font: 24px/100% helvetica,arial,sans-serif;
margin: 2% 2% 0;
padding: 1%;
}
#purchases table{
background: none repeat scroll 0 0 #fff;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
margin: 2%;
width: 96%;
}
#purchases table th{
border-right: 1px solid #DDDDDD;
color: #808080;
font-size: 18px;
font-weight: normal;
padding: 10px 5px;
text-align: right;
width: 20%;
}
#purchases table td{
padding: 10px 5px;
}
.design_page{
}
.style_list{
background:url(<%= asset_path 'preview.png' %>) no-repeat 0 0;
height:246px;
margin: 20px 0;
padding: 0 0 0 236px;
}
.style_list ul{
margin:0;
padding:0;
}
.style_list li{
color: #EDA330;
font-size: 20px;
list-style: none outside none;
margin: 0 0 20px;
}
.list_title{
color: #818181;
display: block;
font: 24px/100% ·L³n¥¿¶ÂÅé,sans-serif;
}
.buy_btn a{
background:url(<%= asset_path "buy_btn.png" %>) no-repeat scroll 0 0 transparent;
color: #000000;
display: block;
font-size: 22px;
height: 37px;
line-height: 37px;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 0 #FFFFFF;
width: 170px;
}
.buy_btn a:hover{
background-position:0 bottom;
}
.bought_btn{
background:url(<%= asset_path "bought_btn.png" %>) no-repeat scroll 0 0 transparent;
color: #FFFFFF;
font-size: 22px;
height: 37px;
line-height: 37px;
text-align: center;
text-shadow: 0 1px 0 #C06408;
width: 170px;
}

View File

@ -1,6 +1,6 @@
class Admin::UserAttributesController < ApplicationController class Admin::UserAttributesController < ApplicationController
layout "admin" layout "member"
before_filter :authenticate_user! before_filter :authenticate_user!
def index def index

View File

@ -1,6 +1,6 @@
class Admin::UserInfoModelsController < ApplicationController class Admin::UserInfoModelsController < ApplicationController
layout "admin" layout "member"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?
before_filter :set_attribute, :only => [:index, :show, :new, :edit] before_filter :set_attribute, :only => [:index, :show, :new, :edit]

View File

@ -1,6 +1,6 @@
class Admin::UserRoleModelsController < ApplicationController class Admin::UserRoleModelsController < ApplicationController
layout "admin" layout "member"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?
before_filter :set_attribute, :only => [:index, :show, :new, :edit] before_filter :set_attribute, :only => [:index, :show, :new, :edit]

View File

@ -1,6 +1,6 @@
class Panel::UsersController < ApplicationController class Admin::UsersController < ApplicationController
layout "panel" layout "member"
before_filter :authenticate_user! before_filter :authenticate_user!
def index def index
@ -28,7 +28,7 @@ class Panel::UsersController < ApplicationController
user_role.save user_role.save
user_role.attribute_values.each(&:save) user_role.attribute_values.each(&:save)
end end
flash[:notice] = t('panel.create_success_user') flash[:notice] = t('admin.create_success_user')
redirect_to :action => :index redirect_to :action => :index
else else
render :action => :new render :action => :new
@ -48,10 +48,10 @@ class Panel::UsersController < ApplicationController
@user.avatar = params[:file] 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 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('panel.cant_revoke_self_admin') flash.now[:error] = t('admin.cant_revoke_self_admin')
end end
if !flash[:error] && @user.update_attributes(params[:user]) if !flash[:error] && @user.update_attributes(params[:user])
flash[:notice] = t('panel.update_success_user') flash[:notice] = t('admin.update_success_user')
redirect_to :action => :index redirect_to :action => :index
else else
get_info_role_models get_info_role_models
@ -61,7 +61,7 @@ class Panel::UsersController < ApplicationController
def destroy def destroy
if params[:id].eql?(session['warden.user.user.key'][1].to_s) if params[:id].eql?(session['warden.user.user.key'][1].to_s)
flash[:error] = t('panel.cant_delete_self') flash[:error] = t('admin.cant_delete_self')
else else
@user = User.find(params[:id]) @user = User.find(params[:id])
@user.destroy @user.destroy

View File

@ -1,4 +1,4 @@
module Panel::UserHelper module Admin::UserHelper
def show_user_attribute(object, key, locale = '') def show_user_attribute(object, key, locale = '')
attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) } rescue nil attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) } rescue nil

View File

@ -64,6 +64,17 @@ class User
(self.active_roles.nil? || self.active_roles.empty?) ? '-' : self.active_roles.map{|role| I18nVariable.first(:conditions => {:key => role})[I18n.locale] rescue role}.join(' / ') (self.active_roles.nil? || self.active_roles.empty?) ? '-' : self.active_roles.map{|role| I18nVariable.first(:conditions => {:key => role})[I18n.locale] rescue role}.join(' / ')
end end
def name
infos = self.user_infos.detect {|info| info.key.to_s.eql?('profile') }
if infos
first_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
last_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
return "#{first_name} #{last_name}"
else
return nil
end
end
protected protected
# Remove empty values # Remove empty values

View File

@ -7,7 +7,7 @@
</tr> </tr>
<tr> <tr>
<td>Department</td> <td>Department</td>
<td>Design Deptartment</td> <td>Computer Science</td>
</tr> </tr>
<tr> <tr>
<td>Version</td> <td>Version</td>
@ -19,14 +19,15 @@
</tr> </tr>
<tr> <tr>
<td>Visitor Counter</td> <td>Visitor Counter</td>
<td>1112201</td> <td>2,201</td>
</tr> </tr>
<tr> <tr>
<td>Site Status</td> <td>Registration Status</td>
<td>Available</td> <td><%= render 'registration' %></td>
</tr>
<tr>
<td>Updates</td>
<td><%= render 'update' %></td>
</tr> </tr>
</table> </table>
</div> </div>
<%= render 'registration' %>
<%= render 'update' %>

View File

@ -1,12 +1,16 @@
<% content_for :secondary do %> <% content_for :secondary do %>
<div id='roles_list'>
<div class="member_setup">
<h1>Member Setup</h1>
<ul class="list"> <ul class="list">
<li><%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path"), :class => 'button positive' %></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_user_roles')), admin_user_role_models_path %></li>
</ul> </ul>
</div>
</div>
<% end -%> <% end -%>
<h1><%= t("admin.list_user_#{@attribute}s") %></h1> <!-- <table>
<table>
<tr> <tr>
<th><%= t("admin.#{@attribute}") %></th> <th><%= t("admin.#{@attribute}") %></th>
<th><%= t('admin.key') %></th> <th><%= t('admin.key') %></th>
@ -29,4 +33,26 @@
</td> </td>
</tr> </tr>
<% end %> <% end %>
</table> </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| %>
<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="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 %>
</div>

View File

@ -6,7 +6,7 @@
</div> </div>
<div> <div>
<label><%= t('panel.my_avatar') %></label> <label><%= t('admin.my_avatar') %></label>
<%= image_tag(@user.avatar.thumb.url) if @user.avatar? %> <%= image_tag(@user.avatar.thumb.url) if @user.avatar? %>
<%= file_field_tag 'file' %> <%= file_field_tag 'file' %>
<%= hidden_field_tag :avatar_cache %> <%= hidden_field_tag :avatar_cache %>
@ -18,14 +18,14 @@
<%= f.text_field :email %> <%= f.text_field :email %>
</p> </p>
<p> <p>
<%= t('panel.admin') %> <%= t('admin.admin') %>
<%= f.check_box :admin %> <%= f.check_box :admin %>
</p> </p>
</div> </div>
<% if @user_info_models %> <% if @user_info_models %>
<fieldset> <fieldset>
<legend><%= t('panel.infos') %></legend> <legend><%= t('admin.info') %></legend>
<% @user_info_models.each do |ua| %> <% @user_info_models.each do |ua| %>
<fieldset> <fieldset>
<%= render :partial => 'user_attribute', <%= render :partial => 'user_attribute',
@ -38,7 +38,7 @@
<% if @user_role_models %> <% if @user_role_models %>
<fieldset id="roles" <%= raw(' style="display: none;"') unless (@user.active_roles.size > 0 rescue nil) %>> <fieldset id="roles" <%= raw(' style="display: none;"') unless (@user.active_roles.size > 0 rescue nil) %>>
<legend><%= t('panel.roles') %></legend> <legend><%= t('admin.roles') %></legend>
<% @user_role_models.each do |ua| %> <% @user_role_models.each do |ua| %>
<fieldset id="role_<%= ua.key %>" <%= raw(' style="display: none;"') unless (@user.active_roles.include?(ua.key) rescue nil) %>> <fieldset id="role_<%= ua.key %>" <%= raw(' style="display: none;"') unless (@user.active_roles.include?(ua.key) rescue nil) %>>
<%= render :partial => 'user_attribute', <%= render :partial => 'user_attribute',

View File

@ -1,14 +1,14 @@
<% content_for :secondary do %> <% content_for :secondary do %>
<ul class="list"> <ul class="list">
<li><%= link_to t(:new_user, :scope => :panel), new_panel_user_path, :class => 'button positive' %></li> <li><%= link_to t('admin.new_user'), new_admin_user_path, :class => 'button positive' %></li>
</ul> </ul>
<% end -%> <% end -%>
<%= flash_messages %> <%= flash_messages %>
<h1><%= t('panel.user_panel') %></h1> <h1><%= t('admin.user_panel') %></h1>
<%= form_for @user, :url => panel_user_path(@user), :html => { :multipart => true } do |f| %> <%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %>
<%= f.error_messages %> <%= f.error_messages %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>

View File

@ -0,0 +1,42 @@
<% 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>
<% 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| %>
<li class="list_item clear">
<span class="roles <%= user.get_roles.downcase %>"><%= user.get_roles %></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 %>
</span>
</li>
<% end %>
</ul>
<div id="add_new" class="clear">
<%= link_to t('admin.new_user'), new_admin_user_path %>
</div>

View File

@ -1,12 +1,12 @@
<% content_for :secondary do %> <% content_for :secondary do %>
<ul class="list"> <ul class="list">
<li><%= link_to t(:new_user, :scope => :panel), new_panel_user_path, :class => 'button positive' %></li> <li><%= link_to t('admin.new_user'), new_admin_user_path, :class => 'button positive' %></li>
</ul> </ul>
<% end -%> <% end -%>
<h1><%= t('panel.user_panel') %></h1> <h1><%= t('admin.user_panel') %></h1>
<%= form_for @user, :url => panel_users_path, :html => { :multipart => true } do |f| %> <%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %>
<%= f.error_messages %> <%= f.error_messages %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>

View File

@ -1,10 +1,10 @@
<% content_for :secondary do %> <% content_for :secondary do %>
<ul class="list"> <ul class="list">
<li><%= link_to t(:new_user, :scope => :panel), new_panel_user_path, :class => 'button positive' %></li> <li><%= link_to t('admin.new_user'), new_admin_user_path, :class => 'button positive' %></li>
</ul> </ul>
<% end -%> <% end -%>
<h1><%= t('panel.user_panel') %></h1> <h1><%= t('admin.user_panel') %></h1>
<%= image_tag(@user.avatar.thumb.url) rescue nil %> <%= image_tag(@user.avatar.thumb.url) rescue nil %>
@ -12,7 +12,7 @@
<% if @user_info_models %> <% if @user_info_models %>
<fieldset> <fieldset>
<legend><%= t('panel.infos') %></legend> <legend><%= t('admin.info') %></legend>
<% @user_info_models.each do |am| %> <% @user_info_models.each do |am| %>
<%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %> <%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %>
<% end -%> <% end -%>
@ -21,7 +21,7 @@
<% if @user.active_roles.size > 0 %> <% if @user.active_roles.size > 0 %>
<fieldset> <fieldset>
<legend><%= t('panel.roles') %></legend> <legend><%= t('admin.roles') %></legend>
<% @user.get_active_role_models.each do |am| %> <% @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)} %> <%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_role_from_model_key(am.key)} %>
<% end -%> <% end -%>

View File

@ -0,0 +1,10 @@
<ul id="orblist">
<li><%= link_to t('homepage'), root_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.item'), admin_items_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.design'), admin_designs_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.purchase'), admin_purchases_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.asset'), admin_assets_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.member'), admin_users_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.translation'), admin_translations_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.site'), admin_sites_path, :class => 'orblink' %></li>
</ul>

View File

@ -16,17 +16,7 @@
<div id="panel_banner_link" > <div id="panel_banner_link" >
<div id="orbit"> <div id="orbit">
<ul id="orblist"> <%= render 'layouts/drop_down_menu' %>
<li><%= link_to t('homepage'), root_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.item'), admin_items_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.design'), admin_designs_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.purchase'), admin_purchases_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.asset'), admin_assets_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.user_info'), admin_user_info_models_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.user_role'), admin_user_role_models_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.translation'), admin_translations_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.site'), admin_sites_path, :class => 'orblink' %></li>
</ul>
</div> </div>
<div class="hmenu"> <div class="hmenu">
@ -38,7 +28,7 @@
</div> </div>
</div> </div>
<div id="panel_container"> <div id="panel_container">
@ -61,7 +51,7 @@
<div id="panel_footer"> <div id="panel_footer">
<p>Rulingcom</p> <p>Rulingcom</p>
</div> </div>
</div> </div>
<%= yield :page_specific_javascript %> <%= yield :page_specific_javascript %>
</body> </body>
</html> </html>

View File

@ -24,17 +24,7 @@
<div id="panel_banner_link" > <div id="panel_banner_link" >
<div id="orbit"> <div id="orbit">
<ul id="orblist"> <%= render 'layouts/drop_down_menu' %>
<li><%= link_to t('homepage'), root_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.item'), admin_items_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.design'), admin_designs_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.purchase'), admin_purchases_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.asset'), admin_assets_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.user_info'), admin_user_info_models_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.user_role'), admin_user_role_models_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.translation'), admin_translations_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.site'), admin_sites_path, :class => 'orblink' %></li>
</ul>
</div> </div>
<div class="hmenu"> <div class="hmenu">

View File

@ -0,0 +1,46 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>R4</title>
<link rel="shortcut icon" href="/favicon.ico">
<%= yield :page_specific_link %>
<%= stylesheet_link_tag 'admin', "member", 'messy', :media => "screen, projection" %>
<%#= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= yield :page_specific_css %>
<%= csrf_meta_tag %>
</head>
<body>
<div id="content">
<div id="hmenu">
<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="sidebar">
<div id="search">
<input id="user_search" name="user[username]" size="30" type="text" />
</div>
<%= yield :secondary %>
</div>
<div id="main">
<div class="main_list">
<%= yield %>
</div>
</div>
<%= yield :page_specific_javascript %>
</body>
</html>

View File

@ -1,33 +0,0 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('panel.new_user'), new_panel_user_path, :class => 'button positive' %></li>
</ul>
<% end -%>
<%= flash_messages %>
<h1><%= t('panel.list_users') %></h1>
<table>
<tr>
<th><%= t('panel.roles') %></th>
<th><%= t('panel.name') %></th>
<th><%= t('panel.email') %></th>
<th><%= t('panel.admin') %></th>
<th><%= t('panel.action') %></th>
</tr>
<% @users.each do |user| %>
<tr>
<td><%= user.get_roles %></td>
<td><%= user[:name] %></td>
<td><%= user.email %></td>
<td><%= user.admin ? t(:yes_) : t(:no_) %></td>
<td>
<%= link_to t(:show), panel_user_path(user) %> |
<%= link_to t(:edit), edit_panel_user_path(user) %> |
<%= link_to t(:delete), panel_user_path(user), :confirm => t('sure?'), :method => :delete %>
</td>
</tr>
<% end %>
</table>

View File

@ -24,13 +24,17 @@ en:
yes_: "Yes" yes_: "Yes"
admin: admin:
action: Action
add_language: Add language add_language: Add language
admin: Admin admin: Admin
action: Action action: Action
announcement: Announcement announcement: Announcement
asset: Asset asset: Asset
attributes: Attributes attributes: Attributes
cant_delete_self: You can not delete yourself.
cant_revoke_self_admin: You can not revoke your admin role yourself.
class: Class class: Class
content: Content
create_error_link: Error when creating link. create_error_link: Error when creating link.
create_error_page: Error when creating page. create_error_page: Error when creating page.
create_success_home: Homepage was successfully created. create_success_home: Homepage was successfully created.
@ -38,7 +42,7 @@ en:
create_success_link: Link was successfully created. create_success_link: Link was successfully created.
create_success_page: Page was successfully created. create_success_page: Page was successfully created.
create_success_snippet: Snippet was successfully created. create_success_snippet: Snippet was successfully created.
content: Content create_success_user: User was successfully created.
data: Data data: Data
delete_language: Delete language delete_language: Delete language
description: Description description: Description
@ -51,11 +55,14 @@ en:
editing_snippet: Editing snippet editing_snippet: Editing snippet
editing_user_info: Editing user information editing_user_info: Editing user information
editing_user_role: Editing user role editing_user_role: Editing user role
email: Email
enable_language: Enable language enable_language: Enable language
file_name: Filename file_name: Filename
file_size: File size file_size: File size
format: Format format: Format
home: Home
id: ID id: ID
info: Information
is_published: Is published is_published: Is published
item: Item item: Item
key: Key key: Key
@ -67,11 +74,14 @@ en:
list_items: Items list list_items: Items list
list_puchases: Purchases list list_puchases: Purchases list
list_snippets: Snippets list list_snippets: Snippets list
list_users: Users list
list_user_infos: User information list list_user_infos: User information list
list_user_roles: User roles list list_user_roles: User roles list
member: Member
move_down: Move down move_down: Move down
move_up: Move up move_up: Move up
multilingual: Multilingual multilingual: Multilingual
my_avatar: My Avatar
no_home_page: You don't have a homepage no_home_page: You don't have a homepage
no_layout: You don't have a layout no_layout: You don't have a layout
name: Name name: Name
@ -82,6 +92,7 @@ en:
new_link: New link new_link: New link
new_page: New page new_page: New page
new_snippet: New snippet new_snippet: New snippet
new_user: New user
new_user_info: New user information new_user_info: New user information
new_user_role: New user role new_user_role: New user role
non_multilingual: Non multilingual non_multilingual: Non multilingual
@ -90,13 +101,13 @@ en:
position: Position position: Position
published?: Published? published?: Published?
purchase: Purchase purchase: Purchase
info: Information
registered: Registered registered: Registered
role: Role role: Role
roles: Roles
title: Title title: Title
translation: Translation translation: Translation
type: Type type: Type
up_to_date: Up-do-date up_to_date: Up-to-date
update_error_link: Error when updating link. update_error_link: Error when updating link.
update_error_page: Error when updating page. update_error_page: Error when updating page.
update_success_content: Content was successfully updated. update_success_content: Content was successfully updated.
@ -105,24 +116,11 @@ en:
update_success_link: Link was successfully updated. update_success_link: Link was successfully updated.
update_success_page: Page was successfully updated. update_success_page: Page was successfully updated.
update_success_snippet: Snippet was successfully updated. update_success_snippet: Snippet was successfully updated.
update_success_user: User was successfully updated.
url: URL url: URL
user: User
user_info: User information user_info: User information
user_panel: User panel
user_role: User role user_role: User role
panel: panel:
action: Action
admin: Admin
cant_delete_self: You can not delete yourself.
cant_revoke_self_admin: You can not revoke your admin role yourself.
create_success_user: User was successfully created.
email: Email
home: Home
list_users: Users list
my_avatar: My Avatar
name: Name
new_user: New user
infos: Information
roles: Roles
update_success_user: User was successfully updated.
user: User
user_panel: User panel

View File

@ -19,12 +19,15 @@ zh_tw:
yes_: "Yes" yes_: "Yes"
admin: admin:
action: 行動
add_language: 新增語言 add_language: 新增語言
admin: 管理 admin: 管理
action: 行動 action: 行動
announcement: 公告 announcement: 公告
asset: 資產 asset: 資產
attributes: 屬性 attributes: 屬性
cant_delete_self: 您不可以刪除自己。
cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
class: 階級 class: 階級
content: 內容 content: 內容
create_error_link: 創建連接時出錯。 create_error_link: 創建連接時出錯。
@ -33,7 +36,8 @@ zh_tw:
create_success_layout: 樣板已成功創建。 create_success_layout: 樣板已成功創建。
create_success_link: 連結已成功創建。 create_success_link: 連結已成功創建。
create_success_page: 頁面已成功創建。 create_success_page: 頁面已成功創建。
create_success_snippet: 片段已成功創建。 create_success_snippet: 片段已成功創建
create_success_user: 用戶已成功創建。。
data: 數據 data: 數據
delete_language: 刪除語言 delete_language: 刪除語言
description: 描述 description: 描述
@ -45,11 +49,14 @@ zh_tw:
editing_snippet: 編輯片段 editing_snippet: 編輯片段
editing_user_info: 編輯用戶資料 editing_user_info: 編輯用戶資料
editing_user_role: 編輯用戶角色 editing_user_role: 編輯用戶角色
email: Email
enable_language: 啟用語言 enable_language: 啟用語言
file_name: 檔名 file_name: 檔名
file_size: 檔案大小 file_size: 檔案大小
format: 格式 format: 格式
home: 首頁
id: ID id: ID
info: 資料
is_published: 被出版 is_published: 被出版
item: 項目 item: 項目
key: 關鍵 key: 關鍵
@ -60,11 +67,14 @@ zh_tw:
list_items: 項目清單 list_items: 項目清單
list_layouts: 佈局清單 list_layouts: 佈局清單
list_snippets: 斷片清單 list_snippets: 斷片清單
list_users: 使用清單
list_user_infos: 用戶資料清單 list_user_infos: 用戶資料清單
list_user_roles: 用戶角色清單 list_user_roles: 用戶角色清單
member: 會員
move_down: 往下移 move_down: 往下移
move_up: 往上移 move_up: 往上移
multilingual: 多種語言 multilingual: 多種語言
my_avatar: 我的頭像
no_home_page: 您沒有首頁 no_home_page: 您沒有首頁
no_layout: 您沒有佈局 no_layout: 您沒有佈局
name: 名稱 name: 名稱
@ -75,6 +85,7 @@ zh_tw:
new_link: 新增連結 new_link: 新增連結
new_page: 新增頁面 new_page: 新增頁面
new_snippet: 新增片段 new_snippet: 新增片段
new_user: 新增使用
new_user_info: 新增用戶資料 new_user_info: 新增用戶資料
new_user_role: 新增用戶角色 new_user_role: 新增用戶角色
non_multilingual: 非多種語言 non_multilingual: 非多種語言
@ -82,8 +93,8 @@ zh_tw:
orig_upload_file: 原上傳檔名 orig_upload_file: 原上傳檔名
position: 位置 position: 位置
published?: 發布? published?: 發布?
info: 資料
role: 角色 role: 角色
roles: 角色。
title: 標題 title: 標題
translation: 翻譯 translation: 翻譯
type: 類型 type: 類型
@ -95,27 +106,14 @@ zh_tw:
update_success_link: 連結已成功更新。 update_success_link: 連結已成功更新。
update_success_page: 頁面已成功更新。 update_success_page: 頁面已成功更新。
update_success_snippet: 片段已成功更新。 update_success_snippet: 片段已成功更新。
update_success_user: 用戶已成功更新
url: URL url: URL
user: 用戶
user_info: 用戶資料 user_info: 用戶資料
user_panel: 用戶面板
user_role: 用戶角色 user_role: 用戶角色
panel: panel:
action: 行動
admin: 管理
cant_delete_self: 您不可以刪除自己。
cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
create_success_user: 用戶已成功創建。
email: Email
home: 首頁
list_users: 使用清單
my_avatar: 我的頭像
name: 名稱
new_user: 新增使用
infos: 資料
roles: 角色
update_success_user: 用戶已成功更新。
user: 用戶
user_panel: 用戶面板

View File

@ -46,6 +46,7 @@ PrototypeR4::Application.routes.draw do
resources :sites resources :sites
resources :snippets resources :snippets
resources :translations resources :translations
resources :users
resources :user_info_models resources :user_info_models
resources :user_role_models resources :user_role_models
end end