From db35db43780de482ec260069e5381808d3d4cbf0 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 6 Jun 2017 17:38:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/management.js.coffee | 3 + app/assets/stylesheets/management.css.scss | 3 + app/controllers/management_controller.rb | 26 +++ app/helpers/management_helper.rb | 2 + app/views/layouts/_logined_header.html.erb | 2 +- app/views/layouts/base_management.html.erb | 61 ++++++ .../management/_authentication_list.html.erb | 43 +++++ app/views/management/approve.html.erb | 105 +++++++++++ .../identity_authentication.html.erb | 135 ++++++++++++++ .../management/identity_authentication.js.erb | 30 +++ .../management/trial_authorization.html.erb | 175 ++++++++++++++++++ config/routes.rb | 8 + public/stylesheets/css/edu-admin.css | 18 ++ public/stylesheets/css/edu-common.css | 3 +- .../controllers/management_controller_spec.rb | 5 + 15 files changed, 617 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/management.js.coffee create mode 100644 app/assets/stylesheets/management.css.scss create mode 100644 app/controllers/management_controller.rb create mode 100644 app/helpers/management_helper.rb create mode 100644 app/views/layouts/base_management.html.erb create mode 100644 app/views/management/_authentication_list.html.erb create mode 100644 app/views/management/approve.html.erb create mode 100644 app/views/management/identity_authentication.html.erb create mode 100644 app/views/management/identity_authentication.js.erb create mode 100644 app/views/management/trial_authorization.html.erb create mode 100644 spec/controllers/management_controller_spec.rb diff --git a/app/assets/javascripts/management.js.coffee b/app/assets/javascripts/management.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/management.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/management.css.scss b/app/assets/stylesheets/management.css.scss new file mode 100644 index 000000000..6d4f81abc --- /dev/null +++ b/app/assets/stylesheets/management.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the management controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/management_controller.rb b/app/controllers/management_controller.rb new file mode 100644 index 000000000..877e4b823 --- /dev/null +++ b/app/controllers/management_controller.rb @@ -0,0 +1,26 @@ +class ManagementController < ApplicationController + before_filter :require_admin + layout 'base_management' + + def approve + + end + + def trial_authorization + + end + + def index + + end + + def identity_authentication + type = params[:type] || 0 # 存在type 就用type 没有就为 0 + user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{params[:name]}%'") + @unapproved_user = ApplyUserAuthentication.where(:status => type, :user_id => user_id).order("updated_at desc") + respond_to do |format| + format.html + format.js + end + end +end diff --git a/app/helpers/management_helper.rb b/app/helpers/management_helper.rb new file mode 100644 index 000000000..d07e930fe --- /dev/null +++ b/app/helpers/management_helper.rb @@ -0,0 +1,2 @@ +module ManagementHelper +end diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 34dd02306..09e8ddaac 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -33,7 +33,7 @@