From 64d37bd7b7468dd8cce4526aea6f2d20f7bcbd18 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 17 Jul 2019 18:49:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 9 +++ app/views/layouts/base_management.html.erb | 1 + .../managements/_user_agent_list.html.erb | 66 +++++++++++++++++++ app/views/managements/user_agents.html.erb | 19 ++++++ config/routes.rb | 1 + 5 files changed, 96 insertions(+) create mode 100644 app/views/managements/_user_agent_list.html.erb create mode 100644 app/views/managements/user_agents.html.erb diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 3a66aff4..51e13713 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -28,6 +28,15 @@ class ManagementsController < ApplicationController render :json => {status: 1} end + def user_agents + @user_agents = UserAgent.where("user_agents.key is not null") + @agents_count = @user_agents.count + limit = 20 + @agents_pages = Paginator.new @agents_count, limit, params['page'] || 1 + @offset ||= @agents_pages.offset + @user_agents = paginateHelper @user_agents, limit + end + # 实训课程等级体系 def subject_level_system @levels = SubjectLevelSystem.all diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index f0fefec5..3392f099 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -145,6 +145,7 @@
  • <%= link_to "升级通知", update_notice_managements_path %>
  • <%= link_to "门户banner设置", setting_banner_managements_path %>
  • <%= link_to "培训会", training_2018_managements_path %>
  • +
  • <%= link_to "引流情况", user_agents_managements_path %>
  • diff --git a/app/views/managements/_user_agent_list.html.erb b/app/views/managements/_user_agent_list.html.erb new file mode 100644 index 00000000..43886c8d --- /dev/null +++ b/app/views/managements/_user_agent_list.html.erb @@ -0,0 +1,66 @@ + + + + + + + + + + + + + <% @user_agents.each do |ua| %> + <% user = User.find_by_login(ua.key) %> + <% user_extension = user.extensions %> + <% school = user_extension.school %> + + + + + + + + + + <% end %> + +
    ID代理人登录名代理人姓名学校竞赛报名状态ipip负责人
    <%= ua.id %><%= link_to ua.key, user_path(ua.key), :target => "_blank" %><%= link_to user.try(:show_real_name), user_path(user), target:'_blank' %><%= school.name %><%= "--" %><%= ua.ip %><%= "理由" %>
    +
    +
    +
    +
      + <%= pagination_links_full @agents_pages, @agents_count, :per_page_links => false, :flag => true, :is_new => true %> +
    +
    +
    +
    + \ No newline at end of file diff --git a/app/views/managements/user_agents.html.erb b/app/views/managements/user_agents.html.erb new file mode 100644 index 00000000..d29e7bec --- /dev/null +++ b/app/views/managements/user_agents.html.erb @@ -0,0 +1,19 @@ +<%= form_tag(url_for(departments_part_managements_path),:id=>"department_part_search",:method => "post",:remote=>true) do %> +
    + + 搜索 + 清除 + <%= link_to "关联代理人",add_departments_part_managements_path(),:class => "task-btn task-btn-green fr mt6 mr30" %> + +
    +<% end %> +
    + <%= render :partial => "managements/user_agent_list" %> +
    + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index a92555c1..427b4744 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -537,6 +537,7 @@ RedmineApp::Application.routes.draw do ## oauth相关 resources :managements do collection do + get 'user_agents' get 'evaluate_simple' get 'hidden_course' match 'training_2018',:via=>[:get,:post] From 2b9bd22f254ced70aab32d13e74ad2e544bdcaab Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 17 Jul 2019 19:10:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=97=E5=8C=85=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/project_packages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/project_packages_controller.rb b/app/controllers/project_packages_controller.rb index fe2c1c13..6721c1c4 100644 --- a/app/controllers/project_packages_controller.rb +++ b/app/controllers/project_packages_controller.rb @@ -1,7 +1,7 @@ # encoding=utf-8 # For react class ProjectPackagesController < ApplicationController - before_filter :require_login, :except => [:index] + before_filter :require_login, :except => [:index, :show] include ApplicationHelper