diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index b4de6576..156ae951 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/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 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 @@
ID | +代理人登录名 | +代理人姓名 | +学校 | +竞赛报名状态 | +ip | +ip | +负责人 | + + + <% @user_agents.each do |ua| %> + <% user = User.find_by_login(ua.key) %> + <% user_extension = user.extensions %> + <% school = user_extension.school %> +
---|---|---|---|---|---|---|
<%= 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 %> | +<%= "理由" %> | +