dev_aliyun
jingquan huang 5 years ago
commit a07033c880

@ -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

@ -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

@ -145,6 +145,7 @@
<li style="width: 120px"><%= link_to "升级通知", update_notice_managements_path %></li>
<li style="width: 120px"><%= link_to "门户banner设置", setting_banner_managements_path %></li>
<li style="width: 120px"><%= link_to "培训会", training_2018_managements_path %></li>
<li style="width: 120px"><%= link_to "引流情况", user_agents_managements_path %></li>
</ul>
</li>
</ul>

@ -0,0 +1,66 @@
<table class="edu-pop-table edu-txt-center" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
<thead>
<th width="10%">ID</th>
<th width="10%">代理人登录名</th>
<th width="10%">代理人姓名</th>
<th width="20%">学校</th>
<th width="10%">竞赛报名状态</th>
<th width="10%">ip</th>
<th width="10%">ip</th>
<th width="20%">负责人</th>
</thead>
<tbody>
<% @user_agents.each do |ua| %>
<% user = User.find_by_login(ua.key) %>
<% user_extension = user.extensions %>
<% school = user_extension.school %>
<tr>
<td><%= ua.id %></td>
<td class="edu-txt-left"><span><%= link_to ua.key, user_path(ua.key), :target => "_blank" %></span></td>
<td><%= link_to user.try(:show_real_name), user_path(user), target:'_blank' %></td>
<td><%= school.name %></td>
<td><%= "--" %></td>
<td><%= ua.ip %></td>
<td><%= "理由" %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="cl"></div>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @agents_pages, @agents_count, :per_page_links => false, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<script>
$(".eud-pointer").on("click", function(ev){
var nArrow = $(this).find("i");
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
$.ajax({
url:"<%= shixuns_managements_path %>",
data: {sx_order:sx_order},
dateType: "script"
});
});
$(".shixun_webssh").on("click", 'input', function(ev){
var id = $(ev.target).parent().find("div").html();
var status = $(ev.target).parent().find("input").is(':checked');
$.ajax({
url:"<%= update_webssh_managements_path %>",
dataType: "script",
data:{shixun_id: id, status: status}
});
});
$(".shixun_hidden").on("click", 'input', function(ev){
var id = $(ev.target).parent().find("div").html();
$.ajax({
url:"<%= update_shixun_hidden_managements_path %>",
dataType: "script",
data:{shixun_id: id}
});
});
</script>

@ -0,0 +1,19 @@
<%= form_tag(url_for(departments_part_managements_path),:id=>"department_part_search",:method => "post",:remote=>true) do %>
<div class="edu-con-top clearfix mb20 xmt10 bor-grey-e mt10">
<input class="fl task-form-20 task-height-30 ml25" id="shixun_Look_name" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" >
<a href="javascript:void(0);" class="fl task-btn task-btn-orange ml5 mt2" onclick="$('#department_part_search').submit();">搜索</a>
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2" id="clear_contents">清除</a>
<%= link_to "关联代理人",add_departments_part_managements_path(),:class => "task-btn task-btn-green fr mt6 mr30" %>
<input name="sx_order" type="hidden">
</div>
<% end %>
<div class="edu-con-bg01 mt15" id="managements_department_part_list">
<%= render :partial => "managements/user_agent_list" %>
</div>
<script>
function clearSearchCondition() {
$("#shixun_Look_name").val("");
$.get('<%= departments_part_managements_path() %>')
}
</script>

@ -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]

Loading…
Cancel
Save