diff --git a/app/assets/images/Thumbs.db b/app/assets/images/Thumbs.db index 964d8da8..f9d32b5f 100644 Binary files a/app/assets/images/Thumbs.db and b/app/assets/images/Thumbs.db differ diff --git a/app/assets/images/icon.png b/app/assets/images/icon.png index 597e8dbe..a3fc685b 100644 Binary files a/app/assets/images/icon.png and b/app/assets/images/icon.png differ diff --git a/app/assets/images/orbitbar.png b/app/assets/images/orbitbar.png index 6cb3d6bb..4f27a0a2 100644 Binary files a/app/assets/images/orbitbar.png and b/app/assets/images/orbitbar.png differ diff --git a/app/assets/images/switch.png b/app/assets/images/switch.png new file mode 100644 index 00000000..e4b1930a Binary files /dev/null and b/app/assets/images/switch.png differ diff --git a/app/assets/stylesheets/member.css.erb b/app/assets/stylesheets/member.css.erb index d55f31ea..05b66b0f 100644 --- a/app/assets/stylesheets/member.css.erb +++ b/app/assets/stylesheets/member.css.erb @@ -21,7 +21,7 @@ ul { margin:0; padding:0; } -input{ +.info_input input{ border:none; padding:5px; border-radius: 5px; @@ -91,6 +91,11 @@ h1 { border-top:1px solid #406cc3; border-bottom:1px solid #242628; } +#infos_list .member_setup ul li.set_3 { + 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; @@ -139,6 +144,9 @@ h1 { .main_list { padding-top:70px; } +.main_list ul { + clear:both; +} .main_list li { background:url(<%= asset_path '75.png' %>) repeat left top; margin-bottom:20px; @@ -173,6 +181,9 @@ h1 { .main_list li.list_item:hover { border:1px solid #3699dd; } +.main_list li.disable { + opacity:0.6; +} .main_list li.list_item:hover span { line-height:38px; } @@ -206,6 +217,13 @@ h1 { #main .action a.delete{ background-position:-38px top; } +#main a.switch{ + background:url(<%= asset_path 'switch.png' %>) no-repeat left 3px; + width:40px; +} +#main .disable a.switch{ + background:url(<%= asset_path 'switch.png' %>) no-repeat left bottom; +} #main .action a.show:hover{ background-position:left -19px; } @@ -238,19 +256,37 @@ h1 { #add_new a:hover { background-position: -54px 3px; } +.buttom { + float:right; +} #confirm a{ background-position:4px -70px; } #confirm a:hover{ background-position: 4px -51px; } +#create a{ + background-image: none; + padding: 0 10px; +} +#update a{ + background-position:4px -112px; +} +#update a:hover{ + background-position:4px -89px; +} +#back a{ + background-position:4px -156px; +} +#back a:hover{ + background-position:4px -133px; +} .buttom a { - margin-bottom: 20px; + margin:0 0 20px 10px; background-image:url(<%= asset_path 'icon.png' %>); 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); @@ -279,6 +315,21 @@ h1 { position:absolute; top:-30px; } +#porfile .user_mail { + text-align: center; + background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top; + border:none; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + padding:3px 10px 1px; + margin-top:10px; + width:110px; + height: 21px; + font-size: 12px; + color:#666666; + text-shadow: 0 1px 0 #FFFFFF; +} #porfile label { display:block; text-shadow: 0 1px 0 #FFFFFF; @@ -326,6 +377,7 @@ h1 { margin-left:180px; } #person { + text-align:center; left: 265px; position: fixed; top: 75px; @@ -340,7 +392,16 @@ h1 { -webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */ box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */ } +#person .mail { + color: #FFFFFF; + font-size: 12px; + text-shadow:0px 1px 0px #333; + font-weight:bold; + background:url(<%= asset_path 'line.png' %>) repeat-x left top; + padding-top:10px; +} #upload, #edit{ + margin: 0 auto; display:block; text-shadow: 0 1px 0 #FFFFFF; background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top; diff --git a/app/models/user/user.rb b/app/models/user/user.rb index f582dc04..31e182ac 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -52,7 +52,7 @@ class User 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 + last_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('family_name') }[I18n.locale.to_s] rescue nil return "#{first_name} #{last_name}" else return nil diff --git a/app/models/user/user_attribute_model.rb b/app/models/user/user_attribute_model.rb index a70c9f85..c8aea4b2 100644 --- a/app/models/user/user_attribute_model.rb +++ b/app/models/user/user_attribute_model.rb @@ -53,7 +53,7 @@ class UserAttributeModel end def is_disabled? - self.disabled + self.disabled.blank? ? false : self.disabled end def get_enabled_attribute_models diff --git a/app/views/admin/user_attribute_models/_attribute_model.html.erb b/app/views/admin/user_attribute_models/_attribute_model.html.erb index 10dac715..819f584b 100644 --- a/app/views/admin/user_attribute_models/_attribute_model.html.erb +++ b/app/views/admin/user_attribute_models/_attribute_model.html.erb @@ -20,17 +20,13 @@ <% if attribute_model.new_record? %> <%= t(:delete) %> <% else %> - - <% if attribute_model.is_built_in? %> - - <%= t(:disable) %> - <%= t(:enable) %> - - <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][disabled]", attribute_model.is_disabled? , :class => 'built_in_state' %> - <% else %> - <%= t(:delete) %> - <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %> - <% end %> + <% if attribute_model.is_built_in? %> + + <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][disabled]", attribute_model.is_disabled? , :class => 'built_in_state' %> + <% else %> + <%= t(:delete) %> + <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %> + <% end %> <%= f.hidden_field :id %> <%= f.hidden_field :key %> <% end %> diff --git a/app/views/admin/user_attribute_models/_form.html.erb b/app/views/admin/user_attribute_models/_form.html.erb index f7325ec2..beb9c5df 100644 --- a/app/views/admin/user_attribute_models/_form.html.erb +++ b/app/views/admin/user_attribute_models/_form.html.erb @@ -1,5 +1,5 @@
-

User Role

+

<%= t("admin.user_#{@attribute}") %>

@@ -68,7 +68,7 @@ }); $('#attributes_block a.change_built_in').click(function(){ - $(this).children().toggle(); + $(this).parent().toggleClass('disable'); var $am = $(this).next('.built_in_state') $am.attr('value', ($am.attr('value') == "false") ? "true" : "false"); }); diff --git a/app/views/admin/user_attribute_models/edit.html.erb b/app/views/admin/user_attribute_models/edit.html.erb index f3dedbec..810da772 100644 --- a/app/views/admin/user_attribute_models/edit.html.erb +++ b/app/views/admin/user_attribute_models/edit.html.erb @@ -1,21 +1,14 @@ -<% content_for :body_id do %>roles_list<% end -%> - -<% content_for :secondary do %> -
-

Member Setup

-
    -
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • -
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • -
-
-<% end -%> +<% content_for :body_id do %><%= "#{@attribute}s_list" %><% end -%>
<%= form_for @user_attribute_model, :url => eval("admin_user_#{@attribute}_model_path(@user_role_model)") do |f| %> <%= f.error_messages %> <%= render :partial => "admin/user_attribute_models/form", :locals => { :f => f, :is_new => false } %> -
- <%= f.submit t('update') %> <%= link_back %> +
+ <%= link_to t('update'), "#", :onclick=>"$('#edit_user_role_model_#{@user_attribute_model.id}').submit()" %> +
+
+ <%= link_back %>
<% end -%>
\ No newline at end of file diff --git a/app/views/admin/user_attribute_models/index.html.erb b/app/views/admin/user_attribute_models/index.html.erb index f50885a9..58ab9bc7 100644 --- a/app/views/admin/user_attribute_models/index.html.erb +++ b/app/views/admin/user_attribute_models/index.html.erb @@ -1,60 +1,32 @@ -<% content_for :body_id do %>roles_list<% end -%> - -<% content_for :secondary do %> -
-

Member Setup

-
    -
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • -
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • -
-
-<% end -%> - - +<% content_for :body_id do %><%= "#{@attribute}s_list" %><% end -%>
- <%= link_to t('admin.new_user_role'), new_admin_user_role_model_path %> + <%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %>
  • - Roles + <%= t("admin.#{@attribute}") %> Action
  • <% @user_attribute_models.each do |user_attribute_model| %> -
  • - <%= user_attribute_model.i18n_variable[I18n.locale] %> +
  • clear"> + <%= user_attribute_model.i18n_variable[I18n.locale] %> + <%= 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? %> + <% 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 %> +
  • <% end %>
- <%= link_to t('admin.new_user_role'), new_admin_user_role_model_path %> + <%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %>
diff --git a/app/views/admin/user_attribute_models/new.html.erb b/app/views/admin/user_attribute_models/new.html.erb index 1bd58d00..aaa6a032 100644 --- a/app/views/admin/user_attribute_models/new.html.erb +++ b/app/views/admin/user_attribute_models/new.html.erb @@ -1,21 +1,14 @@ -<% content_for :body_id do %>roles_list<% end -%> - -<% content_for :secondary do %> -
-

Member Setup

-
    -
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • -
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • -
-
-<% end -%> +<% content_for :body_id do %><%= "#{@attribute}s_list" %><% end -%>
<%= form_for @user_attribute_model, :url => eval("admin_user_#{@attribute}_models_path") do |f| %> <%= f.error_messages %> <%= render :partial => "admin/user_attribute_models/form", :locals => { :f => f, :is_new => true } %> -
- <%= f.submit t('create') %> <%= link_back %> +
+ <%= link_to t('create'), "#", :onclick=>"$('#new_user_attribute_model').submit()" %> +
+
+ <%= link_back %>
<% end -%>
diff --git a/app/views/admin/user_attribute_models/toggle_enable.js.erb b/app/views/admin/user_attribute_models/toggle_enable.js.erb index a78a00db..153c24a8 100644 --- a/app/views/admin/user_attribute_models/toggle_enable.js.erb +++ b/app/views/admin/user_attribute_models/toggle_enable.js.erb @@ -1,2 +1,3 @@ $("#enable_<%= @user_attribute_model.id %>").toggle(); -$("#disable_<%= @user_attribute_model.id %>").toggle(); \ No newline at end of file +$("#disable_<%= @user_attribute_model.id %>").toggle(); +$("#attribute_<%= @user_attribute_model.id %>").toggleClass('disable'); \ No newline at end of file diff --git a/app/views/admin/users/_form.html.erb b/app/views/admin/users/_form.html.erb index ff222438..68431349 100644 --- a/app/views/admin/users/_form.html.erb +++ b/app/views/admin/users/_form.html.erb @@ -7,7 +7,7 @@ <%#= file_field_tag 'file' %> <%#= hidden_field_tag :avatar_cache %> Choose a file... - <%= f.text_field :email %> + <%= f.text_field :email, :onfocus => "this.value='';", :onblur => "if(this.value==''){this.value='E-Mail';}", :value => "E-Mail", :class => 'user_mail' %> diff --git a/app/views/admin/users/edit.html.erb b/app/views/admin/users/edit.html.erb index 43053c4f..2e114f21 100644 --- a/app/views/admin/users/edit.html.erb +++ b/app/views/admin/users/edit.html.erb @@ -1,21 +1,14 @@ <% content_for :body_id do %>user_list<% end -%> -<% content_for :secondary do %> -
-

Member Setup

-
    -
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • -
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • -
-
-<% end -%> -
<%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %> <%= f.error_messages %> <%= render :partial => 'form', :locals => { :f => f } %> -
- <%= f.submit t('update') %> <%= link_back %> +
+ <%= link_to t('update'), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %> +
+
+ <%= link_back %>
<% end -%>
\ No newline at end of file diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index 72c8179d..7ac2ddf7 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -1,17 +1,5 @@ <% content_for :body_id do %>user_list<% end -%> -<% content_for :secondary do %> -
-

Member Setup

-
    -
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • -
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • -
-
-<% end -%> - - -
<%= flash_messages %>
diff --git a/app/views/admin/users/new.html.erb b/app/views/admin/users/new.html.erb index 9a3a866f..a3864046 100644 --- a/app/views/admin/users/new.html.erb +++ b/app/views/admin/users/new.html.erb @@ -1,21 +1,14 @@ <% content_for :body_id do %>user_list<% end -%> -<% content_for :secondary do %> -
-

Member Setup

-
    -
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • -
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • -
-
-<% end -%> -
<%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %> <%= f.error_messages %> <%= render :partial => 'form', :locals => { :f => f } %> -
- <%= f.submit t('create') %> <%= link_back %> +
+ <%= link_to t('create'), "#", :onclick=>"$('#new_user').submit()" %> +
+
+ <%= link_back %>
<% end -%>
diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb index 7e4b5ab6..cc6fafff 100644 --- a/app/views/admin/users/show.html.erb +++ b/app/views/admin/users/show.html.erb @@ -1,15 +1,5 @@ <% content_for :body_id do %>user_list<% end -%> -<% content_for :secondary do %> -
-

Member Setup

-
    -
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • -
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • -
-
-<% end -%> -
diff --git a/app/views/layouts/member.html.erb b/app/views/layouts/member.html.erb index 5cffe7b4..91615d71 100644 --- a/app/views/layouts/member.html.erb +++ b/app/views/layouts/member.html.erb @@ -31,7 +31,14 @@ - <%= yield :secondary %> +
+

Member Setup

+
    +
  • <%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %>
  • +
  • <%= link_to content_tag(:span, t('admin.list_user_roles')), admin_user_role_models_path %>
  • +
  • <%= link_to content_tag(:span, t('admin.list_user_infos')), admin_user_info_models_path %>
  • +
+