diff --git a/app/assets/images/person.png b/app/assets/images/person.png index f0493974c..db1d7d246 100644 Binary files a/app/assets/images/person.png and b/app/assets/images/person.png differ diff --git a/app/assets/images/thumb_person.png b/app/assets/images/thumb_person.png new file mode 100644 index 000000000..f0493974c Binary files /dev/null and b/app/assets/images/thumb_person.png differ diff --git a/app/controllers/admin/plugins_controller.rb b/app/controllers/admin/plugins_controller.rb index 1111f6539..2c90d1317 100644 --- a/app/controllers/admin/plugins_controller.rb +++ b/app/controllers/admin/plugins_controller.rb @@ -4,19 +4,19 @@ class Admin::PluginsController < ApplicationController def index - @plugins = OrbitApp::Plugin::Registration.all + @plugins = OrbitApp::Plugin::Registration.all if(!params[:show_plugin_profile].nil?) - @right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).admin_partial_path + @right_partial = OrbitApp::Plugin::Registration.find_by_app_name(params[:show_plugin_profile]).admin_partial_path - if !@right_partial.blank? - respond_to do |format| - format.html { redirect_to( @right_partial ) } - end - else - @right_partial = "" - end + if !@right_partial.blank? + respond_to do |format| + format.html { redirect_to( @right_partial ) } + end + else + @right_partial = "" + end else @right_partial = "" diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index f05f2ae5f..ba98ec688 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -83,9 +83,18 @@ class Admin::UsersNewInterfaceController < OrbitMemberController end def show + @user = User.find(params[:id]) + @plugins = OrbitApp::Plugin::Registration.all + @ppname = Array.new + @plugins.each do |aa| + @ppname << [aa.sort_number.to_i, [aa.name, aa.app_name, aa.intro_app_name, aa.front_partial_path]] + end + @plugin_shows = @ppname.sort.collect {|v| {"name"=>v[1][0],"app_name"=>v[1][1],"intro_app_name"=>v[1][2],"front_partial_path"=>v[1][3]} } + + @profile_data = [] @teacher_data = [] @student_data = [] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 425a85f9d..2963e6eb1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -271,11 +271,7 @@ module ApplicationHelper end def show_avatar(user) - if (user.avatar? rescue false) - image_tag(user.avatar.thumb.url) - else - image_tag "person.png" - end + image_tag(user.avatar.thumb.url) end # NTU link diff --git a/app/uploaders/avatar_uploader.rb b/app/uploaders/avatar_uploader.rb index 2d55e6759..c2aa3d7be 100644 --- a/app/uploaders/avatar_uploader.rb +++ b/app/uploaders/avatar_uploader.rb @@ -21,6 +21,9 @@ class AvatarUploader < CarrierWave::Uploader::Base # def default_url # "/images/fallback/" + [version_name, "default.png"].compact.join('_') # end + def default_url + [version_name, (Site.first.default_image.file.url rescue "person.png")].compact.join('_') + end # Process files as they are uploaded: # process :scale => [200, 300] diff --git a/app/views/admin/plugins/_plugin_list.html.erb b/app/views/admin/plugins/_plugin_list.html.erb index f583f92ee..2a6255e3f 100644 --- a/app/views/admin/plugins/_plugin_list.html.erb +++ b/app/views/admin/plugins/_plugin_list.html.erb @@ -7,8 +7,8 @@ <%= link_to t(:all_plugin_summary)%> <% end -%> <% @plugins.each do |plugin| %> - <%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.name ? "active" : nil) do %> - <%= link_to plugin.name, admin_plugins_path(:show_plugin_profile => plugin.name) %> + <%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.app_name ? "active" : nil) do %> + <%= link_to plugin.name, admin_plugins_path(:show_plugin_profile => plugin.app_name) %> <% end -%> <% end -%> diff --git a/app/views/admin/users_new_interface/_user_for_summary.html.erb b/app/views/admin/users_new_interface/_user_for_summary.html.erb index 6ed3506d6..de5a88796 100644 --- a/app/views/admin/users_new_interface/_user_for_summary.html.erb +++ b/app/views/admin/users_new_interface/_user_for_summary.html.erb @@ -15,7 +15,7 @@ <%= link_to(content_tag(:i, nil, :class => 'icon-key'),'#',:class=>"key" ) if is_admin?%> <%= link_to(content_tag(:i, nil, :class => 'icon-trash'), admin_users_new_interface_path(user_for_summary, :at=>params[:at]), :confirm => t(:sure?), :method => :delete, :class=>"trash", :remote => true) if is_admin? %> - <%= show_avatar(user_for_summary) %> + <%= image_tag(user_for_summary.avatar) %>

<%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%>

diff --git a/app/views/admin/users_new_interface/_user_for_thumbnail.html.erb b/app/views/admin/users_new_interface/_user_for_thumbnail.html.erb index 71cb2e8c2..e35571104 100644 --- a/app/views/admin/users_new_interface/_user_for_thumbnail.html.erb +++ b/app/views/admin/users_new_interface/_user_for_thumbnail.html.erb @@ -16,7 +16,7 @@ <%= link_to(content_tag(:i, nil, :class => 'icon-trash'), admin_users_new_interface_path(user_for_thumbnail, :at=>params[:at]), :confirm => t(:sure?), :method => :delete, :class=>"trash", :remote => true) if is_admin? %>
- <%= show_avatar(user_for_thumbnail) %> + <%= image_tag(user_for_thumbnail.avatar) %>

<%= link_to user_for_thumbnail.name,admin_users_new_interface_path(user_for_thumbnail)%>

\ No newline at end of file diff --git a/app/views/admin/users_new_interface/show.html.erb b/app/views/admin/users_new_interface/show.html.erb index 07be2bf1a..216177e27 100644 --- a/app/views/admin/users_new_interface/show.html.erb +++ b/app/views/admin/users_new_interface/show.html.erb @@ -50,9 +50,9 @@ Module List