diff --git a/app/assets/images/Jobs.jpg b/app/assets/images/Jobs.jpg new file mode 100644 index 00000000..6d6627e4 Binary files /dev/null and b/app/assets/images/Jobs.jpg differ diff --git a/app/assets/images/Thumbs.db b/app/assets/images/Thumbs.db new file mode 100644 index 00000000..a91692c5 Binary files /dev/null and b/app/assets/images/Thumbs.db differ diff --git a/app/assets/images/add_mamber.png b/app/assets/images/add_mamber.png new file mode 100644 index 00000000..1af41590 Binary files /dev/null and b/app/assets/images/add_mamber.png differ diff --git a/app/assets/images/h1_bg.jpg b/app/assets/images/h1_bg.jpg new file mode 100644 index 00000000..edf2a0a3 Binary files /dev/null and b/app/assets/images/h1_bg.jpg differ diff --git a/app/assets/images/h1_bg.png b/app/assets/images/h1_bg.png new file mode 100644 index 00000000..d6e90160 Binary files /dev/null and b/app/assets/images/h1_bg.png differ diff --git a/app/assets/images/icon.png b/app/assets/images/icon.png new file mode 100644 index 00000000..fc8a40ce Binary files /dev/null and b/app/assets/images/icon.png differ diff --git a/app/assets/images/line.png b/app/assets/images/line.png new file mode 100644 index 00000000..6b16a949 Binary files /dev/null and b/app/assets/images/line.png differ diff --git a/app/assets/images/preview.png b/app/assets/images/preview.png new file mode 100644 index 00000000..0bab69db Binary files /dev/null and b/app/assets/images/preview.png differ diff --git a/app/assets/images/roles_type.jpg b/app/assets/images/roles_type.jpg new file mode 100644 index 00000000..97791f3b Binary files /dev/null and b/app/assets/images/roles_type.jpg differ diff --git a/app/assets/images/search_bg.png b/app/assets/images/search_bg.png new file mode 100644 index 00000000..c00c431b Binary files /dev/null and b/app/assets/images/search_bg.png differ diff --git a/app/assets/images/search_block_bg.jpg b/app/assets/images/search_block_bg.jpg new file mode 100644 index 00000000..19e8e30e Binary files /dev/null and b/app/assets/images/search_block_bg.jpg differ diff --git a/app/assets/images/sidebar_li.jpg b/app/assets/images/sidebar_li.jpg new file mode 100644 index 00000000..a3aaeb98 Binary files /dev/null and b/app/assets/images/sidebar_li.jpg differ diff --git a/app/assets/images/wood_floor.jpg b/app/assets/images/wood_floor.jpg new file mode 100644 index 00000000..5d1c2362 Binary files /dev/null and b/app/assets/images/wood_floor.jpg differ diff --git a/app/assets/stylesheets/admin.css.erb b/app/assets/stylesheets/admin.css.erb index 6b89d771..9e318b68 100644 --- a/app/assets/stylesheets/admin.css.erb +++ b/app/assets/stylesheets/admin.css.erb @@ -297,7 +297,7 @@ p{ background: none repeat scroll 0 0 #FFFFFF; border-radius: 5px 5px 5px 5px; box-shadow: 0 0 5px #000000; - height: 289px; +/* height: 289px;*/ margin: 0 0 20px; overflow: hidden; width: 600px; diff --git a/app/assets/stylesheets/member.css.erb b/app/assets/stylesheets/member.css.erb new file mode 100644 index 00000000..669e571f --- /dev/null +++ b/app/assets/stylesheets/member.css.erb @@ -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); +} \ No newline at end of file diff --git a/app/assets/stylesheets/messy.css.erb b/app/assets/stylesheets/messy.css.erb new file mode 100644 index 00000000..6646b7ca --- /dev/null +++ b/app/assets/stylesheets/messy.css.erb @@ -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; +} \ No newline at end of file diff --git a/app/controllers/admin/user_attributes_controller.rb b/app/controllers/admin/user_attributes_controller.rb index c7021c74..127f4c7f 100644 --- a/app/controllers/admin/user_attributes_controller.rb +++ b/app/controllers/admin/user_attributes_controller.rb @@ -1,6 +1,6 @@ class Admin::UserAttributesController < ApplicationController - layout "admin" + layout "member" before_filter :authenticate_user! def index diff --git a/app/controllers/admin/user_info_models_controller.rb b/app/controllers/admin/user_info_models_controller.rb index 7660d699..29a26dba 100644 --- a/app/controllers/admin/user_info_models_controller.rb +++ b/app/controllers/admin/user_info_models_controller.rb @@ -1,6 +1,6 @@ class Admin::UserInfoModelsController < ApplicationController - layout "admin" + layout "member" before_filter :authenticate_user! before_filter :is_admin? before_filter :set_attribute, :only => [:index, :show, :new, :edit] diff --git a/app/controllers/admin/user_role_models_controller.rb b/app/controllers/admin/user_role_models_controller.rb index b4145a8f..ecb8b5a2 100644 --- a/app/controllers/admin/user_role_models_controller.rb +++ b/app/controllers/admin/user_role_models_controller.rb @@ -1,6 +1,6 @@ class Admin::UserRoleModelsController < ApplicationController - layout "admin" + layout "member" before_filter :authenticate_user! before_filter :is_admin? before_filter :set_attribute, :only => [:index, :show, :new, :edit] diff --git a/app/controllers/panel/users_controller.rb b/app/controllers/admin/users_controller.rb similarity index 85% rename from app/controllers/panel/users_controller.rb rename to app/controllers/admin/users_controller.rb index 7abf6e1f..46d7ed96 100644 --- a/app/controllers/panel/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,6 +1,6 @@ -class Panel::UsersController < ApplicationController +class Admin::UsersController < ApplicationController - layout "panel" + layout "member" before_filter :authenticate_user! def index @@ -28,7 +28,7 @@ class Panel::UsersController < ApplicationController user_role.save user_role.attribute_values.each(&:save) end - flash[:notice] = t('panel.create_success_user') + flash[:notice] = t('admin.create_success_user') redirect_to :action => :index else render :action => :new @@ -48,10 +48,10 @@ class Panel::UsersController < ApplicationController @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('panel.cant_revoke_self_admin') + flash.now[:error] = t('admin.cant_revoke_self_admin') end 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 else get_info_role_models @@ -61,7 +61,7 @@ class Panel::UsersController < ApplicationController def destroy 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 @user = User.find(params[:id]) @user.destroy diff --git a/app/helpers/panel/user_helper.rb b/app/helpers/admin/user_helper.rb similarity index 93% rename from app/helpers/panel/user_helper.rb rename to app/helpers/admin/user_helper.rb index b536f959..6ebd056f 100644 --- a/app/helpers/panel/user_helper.rb +++ b/app/helpers/admin/user_helper.rb @@ -1,4 +1,4 @@ -module Panel::UserHelper +module Admin::UserHelper def show_user_attribute(object, key, locale = '') attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) } rescue nil diff --git a/app/models/user/user.rb b/app/models/user/user.rb index f7171723..7eec8145 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -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(' / ') 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 # Remove empty values diff --git a/app/views/admin/sites/index.html.erb b/app/views/admin/sites/index.html.erb index 7f5c6a7c..6739cbe5 100644 --- a/app/views/admin/sites/index.html.erb +++ b/app/views/admin/sites/index.html.erb @@ -7,7 +7,7 @@