From a067bcd30474acf237e538d5b8bdf6db402455a0 Mon Sep 17 00:00:00 2001 From: Spen Date: Wed, 18 Sep 2013 17:31:53 +0800 Subject: [PATCH] Add Brief intro. for all personal plugins Add Share Setting for Personal Plugins ( if have old data must be add default value "field: is_hidden => false " ) Apply New UI to Member Plugin Edit Page Personal Plugin Summary fix Academic Info. list fix --- app/assets/javascripts/lib/list-check.js | 105 ++++ app/assets/stylesheets/lib/list-check.css | 28 + app/assets/stylesheets/lib/member.css | 11 +- app/assets/stylesheets/lib/wrap-nav.css | 3 + .../personal_plugin_intros_controller.rb | 83 +++ .../admin/users_new_interface_controller.rb | 4 +- app/models/user/personal_plugin_intro.rb | 28 + app/models/user/user.rb | 3 + .../personal_plugin_intros/index.html.erb | 117 ++++ .../_plugin_summary.html.erb | 90 +-- .../admin/users_new_interface/index.html.erb | 7 +- .../index_summary.html.erb | 8 +- .../index_thumbnail.html.erb | 8 +- .../admin/users_new_interface/show.html.erb | 6 +- app/views/layouts/member.html.erb | 4 +- config/locales/en.yml | 6 + config/locales/zh_tw.yml | 6 + config/mongoid.yml | 2 +- lib/orbit_app/plugin/registration.rb | 17 + .../member_lists/_show_roles.html.erb | 38 +- .../front_end/member_lists/show.html.erb | 63 +- .../personal_book_intros_controller.rb | 10 + .../back_end/writing_books_controller.rb | 111 ++-- .../app/models/personal_book_intro.rb | 4 + .../back_end/writing_books/_form.html.erb | 562 ++++++++++------- .../writing_books/_form_file.html.erb | 95 ++- .../writing_books/_writing_book.html.erb | 5 - .../back_end/writing_books/edit.html.erb | 10 +- .../back_end/writing_books/index.html.erb | 16 +- .../back_end/writing_books/new.html.erb | 18 +- .../writing_book_setting.html.erb | 4 +- .../personal_book/front_end/_profile.html.erb | 68 +- .../personal_book/plugin/_profile.html.erb | 48 +- .../personal_book/config/routes.rb | 9 +- vendor/built_in_modules/personal_book/init.rb | 2 +- .../personal_conference_intros_controller.rb | 10 + .../writing_conferences_controller.rb | 107 ++-- .../app/models/personal_conference_intro.rb | 4 + .../writing_conferences/_form.html.erb | 555 ++++++++++------- .../writing_conferences/_form_file.html.erb | 95 ++- .../_writing_conference.html.erb | 5 - .../writing_conferences/edit.html.erb | 10 +- .../writing_conferences/index.html.erb | 15 +- .../back_end/writing_conferences/new.html.erb | 16 +- .../writing_conference_setting.html.erb | 4 +- .../front_end/_profile.html.erb | 68 +- .../plugin/_profile.html.erb | 49 +- .../personal_conference/config/locales/en.yml | 2 +- .../personal_conference/config/routes.rb | 2 + .../personal_conference/init.rb | 2 +- .../back_end/diplomas_controller.rb | 73 ++- .../personal_diploma_intros_controller.rb | 10 + .../app/models/personal_diploma_intro.rb | 4 + .../back_end/diplomas/_diploma.html.erb | 5 - .../back_end/diplomas/_form.html.erb | 326 ++++++---- .../back_end/diplomas/edit.html.erb | 13 +- .../back_end/diplomas/index.html.erb | 15 +- .../back_end/diplomas/new.html.erb | 17 +- .../front_end/_profile.html.erb | 68 +- .../personal_diploma/plugin/_profile.html.erb | 46 +- .../personal_diploma/config/routes.rb | 2 + .../built_in_modules/personal_diploma/init.rb | 2 +- .../back_end/experiences_controller.rb | 79 +-- .../personal_experience_intros_controller.rb | 10 + .../app/models/personal_experience_intro.rb | 4 + .../back_end/experiences/_experience.html.erb | 5 - .../back_end/experiences/_form.html.erb | 321 ++++++---- .../back_end/experiences/edit.html.erb | 10 +- .../experiences/experience_setting.html.erb | 2 +- .../back_end/experiences/index.html.erb | 19 +- .../back_end/experiences/new.html.erb | 14 +- .../front_end/_profile.html.erb | 68 +- .../plugin/_profile.html.erb | 47 +- .../personal_experience/config/routes.rb | 4 +- .../personal_experience/init.rb | 2 +- .../back_end/honors_controller.rb | 78 +-- .../personal_honor_intros_controller.rb | 10 + .../app/models/personal_honor_intro.rb | 4 + .../back_end/honors/_form.html.erb | 238 ++++--- .../back_end/honors/_honor.html.erb | 5 - .../back_end/honors/edit.html.erb | 10 +- .../back_end/honors/honor_setting.html.erb | 2 +- .../back_end/honors/index.html.erb | 18 +- .../back_end/honors/new.html.erb | 16 +- .../front_end/_profile.html.erb | 71 ++- .../personal_honor/plugin/_profile.html.erb | 47 +- .../personal_honor/config/routes.rb | 4 +- .../built_in_modules/personal_honor/init.rb | 2 +- .../personal_journal_intros_controller.rb | 10 + .../back_end/writing_journals_controller.rb | 140 +++-- .../app/models/personal_journal_intro.rb | 4 + .../back_end/writing_journals/_form.html.erb | 586 ++++++++++-------- .../writing_journals/_form_file.html.erb | 95 ++- .../_writing_journal.html.erb | 8 +- .../back_end/writing_journals/edit.html.erb | 10 +- .../back_end/writing_journals/index.html.erb | 15 +- .../back_end/writing_journals/new.html.erb | 16 +- .../writing_journal_setting.html.erb | 6 +- .../front_end/_profile.html.erb | 73 ++- .../personal_journal/plugin/_profile.html.erb | 46 +- .../personal_journal/config/locales/en.yml | 2 +- .../personal_journal/config/routes.rb | 2 + .../built_in_modules/personal_journal/init.rb | 2 +- .../personal_lab/back_end/labs_controller.rb | 73 +-- .../personal_lab_intros_controller.rb | 10 + .../app/models/personal_lab_intro.rb | 4 + .../personal_lab/back_end/labs/_form.html.erb | 470 ++++++++------ .../back_end/labs/_form_file.html.erb | 95 ++- .../personal_lab/back_end/labs/_lab.html.erb | 5 - .../personal_lab/back_end/labs/edit.html.erb | 10 +- .../personal_lab/back_end/labs/index.html.erb | 19 +- .../personal_lab/back_end/labs/new.html.erb | 16 +- .../personal_lab/front_end/_profile.html.erb | 74 ++- .../personal_lab/plugin/_profile.html.erb | 47 +- .../personal_lab/config/routes.rb | 2 + vendor/built_in_modules/personal_lab/init.rb | 2 +- .../personal_patent_intros_controller.rb | 10 + .../back_end/writing_patents_controller.rb | 133 ++-- .../app/models/personal_patent_intro.rb | 4 + .../back_end/writing_patents/_form.html.erb | 449 ++++++++------ .../writing_patents/_form_file.html.erb | 95 ++- .../writing_patents/_writing_patent.html.erb | 6 - .../back_end/writing_patents/edit.html.erb | 10 +- .../back_end/writing_patents/index.html.erb | 18 +- .../back_end/writing_patents/new.html.erb | 16 +- .../writing_patent_setting.html.erb | 2 +- .../front_end/_profile.html.erb | 68 +- .../personal_patent/plugin/_profile.html.erb | 46 +- .../personal_patent/config/routes.rb | 5 +- .../built_in_modules/personal_patent/init.rb | 2 +- .../personal_project_intros_controller.rb | 10 + .../back_end/projects_controller.rb | 138 +++-- .../app/models/personal_project_intro.rb | 4 + .../back_end/projects/_form.html.erb | 487 +++++++++------ .../back_end/projects/_form_file.html.erb | 95 ++- .../back_end/projects/_project.html.erb | 5 - .../back_end/projects/edit.html.erb | 10 +- .../back_end/projects/index.html.erb | 18 +- .../back_end/projects/new.html.erb | 16 +- .../projects/project_setting.html.erb | 2 +- .../front_end/_profile.html.erb | 68 +- .../personal_project/plugin/_profile.html.erb | 47 +- .../personal_project/config/routes.rb | 5 +- .../built_in_modules/personal_project/init.rb | 2 +- .../personal_research_intros_controller.rb | 10 + .../back_end/researchs_controller.rb | 70 ++- .../app/models/personal_research_intro.rb | 4 + .../back_end/researchs/_form.html.erb | 427 +++++++------ .../back_end/researchs/_form_file.html.erb | 95 ++- .../back_end/researchs/_research.html.erb | 5 - .../back_end/researchs/edit.html.erb | 10 +- .../back_end/researchs/index.html.erb | 13 +- .../back_end/researchs/new.html.erb | 16 +- .../front_end/_profile.html.erb | 68 +- .../plugin/_profile.html.erb | 46 +- .../personal_research/config/locales/en.yml | 2 +- .../personal_research/config/routes.rb | 2 + .../personal_research/init.rb | 2 +- .../back_end/web_links/_form.html.erb | 1 + 159 files changed, 5145 insertions(+), 3453 deletions(-) create mode 100644 app/assets/javascripts/lib/list-check.js create mode 100644 app/assets/stylesheets/lib/list-check.css create mode 100644 app/controllers/admin/personal_plugin_intros_controller.rb create mode 100644 app/models/user/personal_plugin_intro.rb create mode 100644 app/views/admin/personal_plugin_intros/index.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/personal_book_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_book/app/models/personal_book_intro.rb create mode 100644 vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/back_end/personal_conference_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_conference/app/models/personal_conference_intro.rb create mode 100644 vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/personal_diploma_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_diploma/app/models/personal_diploma_intro.rb create mode 100644 vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/personal_experience_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_experience/app/models/personal_experience_intro.rb create mode 100644 vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/personal_honor_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_honor/app/models/personal_honor_intro.rb create mode 100644 vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/personal_journal_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_journal/app/models/personal_journal_intro.rb create mode 100644 vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/personal_lab_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_lab/app/models/personal_lab_intro.rb create mode 100644 vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/personal_patent_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_patent/app/models/personal_patent_intro.rb create mode 100644 vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/personal_project_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_project/app/models/personal_project_intro.rb create mode 100644 vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/back_end/personal_research_intros_controller.rb create mode 100644 vendor/built_in_modules/personal_research/app/models/personal_research_intro.rb diff --git a/app/assets/javascripts/lib/list-check.js b/app/assets/javascripts/lib/list-check.js new file mode 100644 index 00000000..c21899fd --- /dev/null +++ b/app/assets/javascripts/lib/list-check.js @@ -0,0 +1,105 @@ +var ListCheck = function(element) { + this.element = $(element); + this.element.data('exists', true); + if(this.element.context.parentNode.tagName == "TD") { + this.elementWrap = $(this.element.context.parentNode); + this.elementWrap.addClass('listCheck'); + } else if(this.element.context.parentNode.tagName == "TH") { + this.elementWrap = $(this.element.context.parentNode); + this.elementWrap.addClass('listCheckHead'); + } + this.element.before(''); +}; + +$.fn.listCheck = function (callback) { + this.each(function (i) { + if(!$(this).data('exists')) { + new ListCheck(this); + }; + }); + this.on(clickEvent, function(e) { + if($(this).prop('checked')) { + $(this).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit'); + } else { + $(this).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit'); + }; + if ($(this).closest('.listCheckHead').length) { + $('.listCheck .list-check').prop('checked', $(this).prop('checked')); + if($(this).prop('checked')) { + $('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit'); + } else { + $('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit'); + } + }; + + var _isCheck = $('tbody .list-check').filter(':checked').length, + _defaultLength = $('tbody .list-check').length; + + if(_isCheck > 0 && _isCheck < _defaultLength) { + $('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus'); + } else if(!_isCheck) { + $('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty'); + } else { + $('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check'); + } + _isCheck ? $('.list-active-btn').removeClass('disabled').data('actionable', true) : $('.list-active-btn').addClass('disabled').data('actionable', false); + }); +}; +function clearCheck() { + $('.list-check').each(function() { + $(this).prop('checked', false); + }) +} +function actionSuccess(e) { + $("tbody .list-check").each(function() { + switch(e) { + case 'list-be-hide': + $(this).filter(':checked').closest('tr').addClass('checkHide'); + break; + case 'list-be-show': + $(this).filter(':checked').closest('tr').removeClass('checkHide'); + break; + case 'list-be-remove': + $(this).filter(':checked').closest('tr').fadeOut(300, function() { + $(this).remove(); + }); + break; + }; + $('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit'); + }); + clearCheck(); +} +$(function() { + var $t = null, + _data = null; + clearCheck(); + $('.list-check').listCheck(); + $('.list-active-btn').data('actionable', false).on(clickEvent, function(e) { + $t = $(this) + _data = $(this).data() + _data.actionable ? $('#dialog').modal('show') : ""; + e.preventDefault(); + }); + + $("#dialog").on('show', function (e) { + $(this).find('.delete-item').on(clickEvent, function() { + var _v = []; + $("tbody .list-check").each(function() { + this.checked && _v.push("ids[]="+this.value) + }); + var _t = $t.attr("rel"); + if(_t.indexOf("?") > -1) { + $.ajax(_t + "&" + _v.join("&")).done(function() { + actionSuccess(_data.checkAction) + }); + } else { + $.ajax(_t + "?" + _v.join("&")).done(function() { + actionSuccess(_data.checkAction) + }); + } + $('#dialog').modal('hide'); + $('.list-active-btn').addClass('disabled').data('actionable', false); + e.preventDefault(); + }) + }); +}); \ No newline at end of file diff --git a/app/assets/stylesheets/lib/list-check.css b/app/assets/stylesheets/lib/list-check.css new file mode 100644 index 00000000..5e5e05b5 --- /dev/null +++ b/app/assets/stylesheets/lib/list-check.css @@ -0,0 +1,28 @@ +.table .listCheckHead, +.table .listCheck { + width: 30px; + vertical-align: middle; + padding: 0 0 0 10px!important; +} +.listCheckHead .list-check, +.listCheck .list-check { + position: absolute; + margin: -12px 0 0 -1px; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; +} +.listCheckHead i, +.listCheck i { + display: block; +} +.checkHide td { + background-color: #E6E6E6 !important; + color: #B9B9B9; +} +.checkHide a { + color: #B9B9B9; +} +.checkHit td { + background-color: #FFFEDB !important; +} \ No newline at end of file diff --git a/app/assets/stylesheets/lib/member.css b/app/assets/stylesheets/lib/member.css index a2bf3195..5a9c6cf2 100644 --- a/app/assets/stylesheets/lib/member.css +++ b/app/assets/stylesheets/lib/member.css @@ -3,9 +3,9 @@ color: #000; text-decoration: none; display: block; - overflow: hidden; width: 100%; text-overflow: ellipsis; + overflow: hidden; white-space: nowrap; } @@ -364,6 +364,9 @@ #profile #module-navbar { margin-left: 10px; } +#profile #module-navbar .navbar { + margin-bottom: 15px; +} #profile #member-module { margin-left: 360px; } @@ -372,9 +375,13 @@ } #profile #member-module #module-content .content { right: 10px; + padding-bottom: 10px; outline: none; } - +#profile #member-module #module-content .list-active { + padding-bottom: 8px; + /*border-bottom: 1px solid #DDD;*/ +} /* Responsive */ @media (max-width: 979px) { diff --git a/app/assets/stylesheets/lib/wrap-nav.css b/app/assets/stylesheets/lib/wrap-nav.css index a1bb13f7..80622262 100644 --- a/app/assets/stylesheets/lib/wrap-nav.css +++ b/app/assets/stylesheets/lib/wrap-nav.css @@ -26,6 +26,9 @@ margin-top: 4px; margin-left: 10px; } +.topnav .btn-group { + margin-left: 0; +} /* Bottom Nav */ .bottomnav { diff --git a/app/controllers/admin/personal_plugin_intros_controller.rb b/app/controllers/admin/personal_plugin_intros_controller.rb new file mode 100644 index 00000000..2d726f55 --- /dev/null +++ b/app/controllers/admin/personal_plugin_intros_controller.rb @@ -0,0 +1,83 @@ +class Admin::PersonalPluginIntrosController < OrbitMemberController + + include OrbitControllerLib::DivisionForDisable + + before_filter :authenticate_user! + before_filter :is_admin? + + + def index + + get_types + @plugin_intro = @types.where(:user_id => params[:user_id]).first + + if @plugin_intro.blank? + + @set_type = @types.new() + @url = eval("panel_#{@app_type_name}_back_end_#{@app_type}s_path(:user_id=>params[:user_id])") + @verb = :post + + else + + @set_type = @types.find(@plugin_intro.id) + @url = polymorphic_path(["panel_#{@app_type_name}_back_end", @plugin_intro]) + @verb = :put + + end + + end + + + def show + + end + + + def new + end + + + def edit + end + + def create + + get_types + + @plugin_intro = @types.new(params[:plugin_intro]) + + respond_to do |format| + if @plugin_intro.save + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:plugin_intro][:user_id],:show_plugin_profile=>@reback_name)) } + end + end + + end + + + def update + + get_types + + @plugin_intro = @types.find(params[:id]) + + respond_to do |format| + + if @plugin_intro.update_attributes(params[:plugin_intro]) + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:plugin_intro][:user_id],:show_plugin_profile=>@reback_name)) } + end + end + + end + + + def destroy + end + + protected + + def get_types + @types = @app_type.classify.constantize + end + +end diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index 4f4e352f..f7a1bdf4 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -98,9 +98,11 @@ class Admin::UsersNewInterfaceController < OrbitMemberController if(!params[:show_plugin_profile].nil?) - @right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary' + @right_partial = OrbitApp::Plugin::Registration.find_by_app_name(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary' + @plugin_app_name = OrbitApp::Plugin::Registration.find_by_app_name(params[:show_plugin_profile]).name rescue nil else @right_partial = "plugin_summary" + @plugin_app_name = '' end # @user.attribute_values.each{|att_val| diff --git a/app/models/user/personal_plugin_intro.rb b/app/models/user/personal_plugin_intro.rb new file mode 100644 index 00000000..8dec3b27 --- /dev/null +++ b/app/models/user/personal_plugin_intro.rb @@ -0,0 +1,28 @@ +class PersonalPluginIntro + + include Mongoid::Document + include Mongoid::Timestamps + # include OrbitCoreLib::ObjectAuthable + # include OrbitCoreLib::ObjectDisable + + # has_and_belongs_to_many :users + belongs_to :user + + field :text, localize: true + field :brief_intro, :type => Boolean, :default => false + field :complete_list, :type => Boolean, :default => true + + + def pp_object + brief_intro + end + + def self.from_id(id) + PersonalPluginIntro.find(id) rescue nil + end + + def self.is_localized?(field_name) + self.fields[field_name.to_s].localized? + end + +end \ No newline at end of file diff --git a/app/models/user/user.rb b/app/models/user/user.rb index c8a682c8..b726c0f3 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -38,12 +38,15 @@ class User has_and_belongs_to_many :sub_role_tags has_many :user_actions, :dependent => :destroy + + has_many :personal_plugin_intro # has_and_belongs_to_many :statuses has_and_belongs_to_many :roles has_and_belongs_to_many :sub_roles has_and_belongs_to_many :role_statuses has_and_belongs_to_many :role_categorys + accepts_nested_attributes_for :attribute_values, :allow_destroy => true before_create :initialize_desktop diff --git a/app/views/admin/personal_plugin_intros/index.html.erb b/app/views/admin/personal_plugin_intros/index.html.erb new file mode 100644 index 00000000..3c399fd5 --- /dev/null +++ b/app/views/admin/personal_plugin_intros/index.html.erb @@ -0,0 +1,117 @@ +<% # encoding: utf-8 %> + +<% content_for :side_bar do %> + <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> +<% end %> + +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/bootstrap-fileupload" %> + <%= javascript_include_tag "lib/file-type" %> +<% end %> + +<%= form_for(:plugin_intro, :url => @url, :method => @verb, html: {class: "form-horizontal main-forms previewable"} ) do |f| %> + +<%= f.error_messages %> + +
+ + +
+ + + + + + +
+ + +
+ + <% if !params[:user_id].blank? %> + +
+ +
+ <%= User.from_id(params[:user_id]).name rescue ''%> +
+
+ + <% end %> + + +
+ +
+ <%= f.check_box :brief_intro, :checked => @set_type.brief_intro %> <%= t("personal_plugins.brief_intro") %> + <%= f.check_box :complete_list, :checked => @set_type.complete_list %> <%= t("personal_plugins.complete_list") %> +
+
+ +
+ +
+ + + + + + +
+ + <% @site_valid_locales.each_with_index do |locale, i| %> + +
"> + + +
+ +
+
+ <%= f.fields_for :text_translations do |f| %> + <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@set_type.text_translations[locale] rescue nil) %> + <% end %> +
+
+
+ + +
+ + <% end %> + + + +
+ + + +
+ + +
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> + <%= f.submit t('submit'), class: 'btn btn-primary' %> + <%= link_to t('cancel'), get_go_back, :class=>"btn" %> +
+ + +
+ +<% end %> \ No newline at end of file diff --git a/app/views/admin/users_new_interface/_plugin_summary.html.erb b/app/views/admin/users_new_interface/_plugin_summary.html.erb index 1c1c0589..3b3ef767 100644 --- a/app/views/admin/users_new_interface/_plugin_summary.html.erb +++ b/app/views/admin/users_new_interface/_plugin_summary.html.erb @@ -1,46 +1,46 @@ -
-

Module Name

-
- - - - - - - -
模組數量
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - -
University2,304
Master783
Doctor45
Staff62
-
-
-
+
+

Module Name

+
+ + + + + + + +
<%= t(:module) %><%= t(:quantity) %>
+
+
+
+
+
-
\ No newline at end of file +
+
+
+
+ + + + <% + @plugins.each do |plugin| + + if is_admin? + @data = plugin.app_name.classify.constantize.where(:create_user_id=>@user.id).count + else + @data = plugin.app_name.classify.constantize.where(:is_hidden=>false , :create_user_id=>@user.id).count + end + %> + + + + + <% end -%> + + +
<%= plugin.name %><%= @data %>
+
+
+
+
+
\ No newline at end of file diff --git a/app/views/admin/users_new_interface/index.html.erb b/app/views/admin/users_new_interface/index.html.erb index d639725e..b72e62d4 100644 --- a/app/views/admin/users_new_interface/index.html.erb +++ b/app/views/admin/users_new_interface/index.html.erb @@ -5,7 +5,8 @@ <%= render :partial => "js_and_css"%> -
+<% content_for :right_nav do %> +
<%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %> @@ -34,8 +35,8 @@
-
- + +<% end %>
diff --git a/app/views/admin/users_new_interface/index_summary.html.erb b/app/views/admin/users_new_interface/index_summary.html.erb index aaa34db5..0bd2e430 100644 --- a/app/views/admin/users_new_interface/index_summary.html.erb +++ b/app/views/admin/users_new_interface/index_summary.html.erb @@ -5,8 +5,9 @@ <%= render :partial => "js_and_css"%> -
-
+<% content_for :right_nav do %> + +
<%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %> @@ -35,7 +36,8 @@
-
+ +<% end %>
    diff --git a/app/views/admin/users_new_interface/index_thumbnail.html.erb b/app/views/admin/users_new_interface/index_thumbnail.html.erb index 6b303c27..df37ddf5 100644 --- a/app/views/admin/users_new_interface/index_thumbnail.html.erb +++ b/app/views/admin/users_new_interface/index_thumbnail.html.erb @@ -5,8 +5,9 @@ <%= render :partial => "js_and_css"%> -
    -
    +<% content_for :right_nav do %> + +
    <%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %> @@ -35,7 +36,8 @@
    -
    + +<% end %>
      diff --git a/app/views/admin/users_new_interface/show.html.erb b/app/views/admin/users_new_interface/show.html.erb index 07a59cfd..bcdc4be1 100644 --- a/app/views/admin/users_new_interface/show.html.erb +++ b/app/views/admin/users_new_interface/show.html.erb @@ -43,7 +43,7 @@