diff --git a/.gitignore b/.gitignore index bb4b68554..1b56839ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,39 @@ -*.swp -/.project -/.idea -/.bundle -*.swp -/config/database.yml -/config/configuration.yml -/config/additional_environment.rb -/config/oneapm.yml -/config/environments/production.rb - - -/files/* -/log/* -/public/tmp/* -/tmp/* -/public/cache/* -/config/newrelic.yml -/public/images/avatars/* -/db/schema.rb -/Gemfile.lock -/lib/plugins/acts_as_versioned/test/debug.log -.rbenv-gemsets -.DS_Store -public/api_doc/ -/.metadata -vendor/cache -/files -/public/images/avatars -/public/files -/tags -/config/initializers/gitlab_config.rb -1234567 -public/javascripts/wechat/node_modules/ -.ruby-version -.access_token -tmux*.log -config/wechat.yml -config/oneapm.yml +*.swp +/.project +/.idea/* +/.bundle +*.swp +/config/database.yml +/config/configuration.yml +/config/additional_environment.rb +/config/oneapm.yml +/config/environments/production.rb + + +/files/* +/log/* +/public/tmp/* +/tmp/* +/public/cache/* +/config/newrelic.yml +/public/images/avatars/* +/db/schema.rb +/Gemfile.lock +/lib/plugins/acts_as_versioned/test/debug.log +.rbenv-gemsets +.DS_Store +public/api_doc/ +/.metadata +vendor/cache +/files +/public/images/avatars +/public/files +/tags +/config/initializers/gitlab_config.rb +1234567 +public/javascripts/wechat/node_modules/ +.ruby-version +.access_token +tmux*.log +config/wechat.yml +config/oneapm.yml diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index a04216052..afcf13d41 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -18,6 +18,21 @@ class ManagementsController < ApplicationController end def unit + end + def classroom + + end + def classroom_classment + + end + def class_shixuns + + end + def class_publish_shixuns + + end + def class_shixun_authorization + end # 0 全部;1 活动的; 2 已注册; 3 锁定 def users @@ -51,7 +66,7 @@ class ManagementsController < ApplicationController end def shixuns - @menu_type = 3 + @menu_type = 3 sx_status = params[:status].blank? ? [0, 1, 2, 3] : params[:status].to_i # 搜索实训的状态 keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/实训名搜索 search = params[:search] # 搜索的字 @@ -83,73 +98,73 @@ class ManagementsController < ApplicationController end end - # 已发布的实训 - def publish_shixuns - @menu_type = 3 - @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] # 排序 - search = params[:search] # 搜索字 - keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/实训名搜索 - close = params[:close] # 关闭实训,参数是实训的Id - unless close.blank? - Shixun.find(close).update_attribute(:status, 3) - end - if "u_name" == keyword - # 如果用户搜索为空,不用遍历user表,直接查找所有实训, 有搜索时才查找user - if search.blank? - @shixuns = Shixun.where(:status => 2).order("created_at #{@sx_order}") - else - user_id = User.where("concat(lastname, firstname) like '%#{search}%'") - @shixuns = Shixun.where(:user_id => user_id, :status => 2).order("created_at #{@sx_order}") - end - else - @shixuns = Shixun.where("name like '%#{search}%'").where(:status => 2).order("created_at #{@sx_order}") - end - @shixuns_count = @shixuns.count - limit = 20 - @shixuns_pages = Paginator.new @shixuns_count, limit, params['page'] || 1 - @offset ||= @shixuns_pages.offset - @shixuns = paginateHelper @shixuns, limit - - respond_to do |format| - format.js - format.html - end - end - - # 已关闭的实训 - def close_shixuns - @menu_type = 3 - @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] # 排序 - search = params[:search] # 搜索字 - keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/实训名搜索 - reopen = params[:reopen] # 从新开启实训,参数是实训的Id - - unless reopen.blank? - Shixun.find(reopen).update_attribute(:status, 2) - end - if "u_name" == keyword - # 如果用户搜索为空,不用遍历user表,直接查找所有实训, 有搜索时才查找user - if search.blank? - @shixuns = Shixun.where(:status => 3).order("updated_at #{@sx_order}") - else - user_id = User.where("concat(lastname, firstname) like '%#{search}%'") - @shixuns = Shixun.where(:user_id => user_id, :status => 3).order("updated_at #{@sx_order}") - end - else - @shixuns = Shixun.where("name like '%#{search}%'").where(:status => 3).order("updated_at #{@sx_order}") - end - @shixuns_count = @shixuns.count - limit = 20 - @shixuns_pages = Paginator.new @shixuns_count, limit, params['page'] || 1 - @offset ||= @shixuns_pages.offset - @shixuns = paginateHelper @shixuns, limit - - respond_to do |format| - format.js - format.html - end - end - + # 已发布的实训 + def publish_shixuns + @menu_type = 3 + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] # 排序 + search = params[:search] # 搜索字 + keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/实训名搜索 + close = params[:close] # 关闭实训,参数是实训的Id + unless close.blank? + Shixun.find(close).update_attribute(:status, 3) + end + if "u_name" == keyword + # 如果用户搜索为空,不用遍历user表,直接查找所有实训, 有搜索时才查找user + if search.blank? + @shixuns = Shixun.where(:status => 2).order("created_at #{@sx_order}") + else + user_id = User.where("concat(lastname, firstname) like '%#{search}%'") + @shixuns = Shixun.where(:user_id => user_id, :status => 2).order("created_at #{@sx_order}") + end + else + @shixuns = Shixun.where("name like '%#{search}%'").where(:status => 2).order("created_at #{@sx_order}") + end + @shixuns_count = @shixuns.count + limit = 20 + @shixuns_pages = Paginator.new @shixuns_count, limit, params['page'] || 1 + @offset ||= @shixuns_pages.offset + @shixuns = paginateHelper @shixuns, limit + + respond_to do |format| + format.js + format.html + end + end + + # 已关闭的实训 + def close_shixuns + @menu_type = 3 + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] # 排序 + search = params[:search] # 搜索字 + keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/实训名搜索 + reopen = params[:reopen] # 从新开启实训,参数是实训的Id + + unless reopen.blank? + Shixun.find(reopen).update_attribute(:status, 2) + end + if "u_name" == keyword + # 如果用户搜索为空,不用遍历user表,直接查找所有实训, 有搜索时才查找user + if search.blank? + @shixuns = Shixun.where(:status => 3).order("updated_at #{@sx_order}") + else + user_id = User.where("concat(lastname, firstname) like '%#{search}%'") + @shixuns = Shixun.where(:user_id => user_id, :status => 3).order("updated_at #{@sx_order}") + end + else + @shixuns = Shixun.where("name like '%#{search}%'").where(:status => 3).order("updated_at #{@sx_order}") + end + @shixuns_count = @shixuns.count + limit = 20 + @shixuns_pages = Paginator.new @shixuns_count, limit, params['page'] || 1 + @offset ||= @shixuns_pages.offset + @shixuns = paginateHelper @shixuns, limit + + respond_to do |format| + format.js + format.html + end + end + def users_trial @menu_type = 6 @users = User.where(:status => 1).order("created_on desc").all diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index ffdf4ef1e..a4f42abc7 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -21,22 +21,37 @@
+

+ 胡莎莎 > 班级列表 +

+ - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - +
序号部门名称单位名称创建于序号部门名称单位名称创建于
1计算机学院中国科学近代物理研究所2018-02-02 10:02 修改
1计算机学院中国科学近代物理研究所2018-02-02 10:02 修改
1计算机学院中国科学近代物理研究所2018-02-02 10:02批准   删除   修改
1计算机学院中国科学近代物理研究所2018-02-02 10:02批准   删除   修改
1计算机学院中国科学近代物理研究所2018-02-02 10:02批准   删除   修改
1计算机学院中国科学近代物理研究所2018-02-02 10:02批准   删除   修改
1计算机学院中国科学近代物理研究所2018-02-02 10:02 修改
\ No newline at end of file diff --git a/app/views/managements/unit.html.erb b/app/views/managements/unit.html.erb index 7c13594d3..589f9cd0b 100644 --- a/app/views/managements/unit.html.erb +++ b/app/views/managements/unit.html.erb @@ -34,51 +34,47 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号单位名称地区详细地址申请者创建于
1山西省云城市临猗县白沙空间省会花园小区178号山西省运城市山西省云城市临猗县白沙空间省会花园小区178号胡莎莎2018-02-02 10:02 修改
1山西省云城市临猗县白沙空间省会花园小区178号山西省运城市山西省云城市临猗县白沙空间省会花园小区178号胡莎莎2018-02-02 10:02 修改
1山西省云城市临猗县白的空间省会花园小区178号山西省运城市山西省云城市临猗县的空间省会花园小区178号胡莎莎2018-02-02 10:02 修改
1山西省云城市临猗县白沙空间省会花园小区178号山西省运城市山西省云城市临猗县的空间省会花园小区178号胡莎莎2018-02-02 10:02 修改序号单位名称地区详细地址申请者创建于
1山西省云城市临猗县白沙空间省会花园小区178号山西省运城市山西省云城市临猗县的空间省会花园小区178号胡莎莎2018-02-02 10:02批准   删除   修改
1山西省云城市临猗县白沙空间省会花园小区178号山西省运城市山西省云城市临猗县的空间省会花园小区178号胡莎莎2018-02-02 10:02批准   删除   修改
1山西省云城市临猗县白沙空间省会花园小区178号山西省运城市山西省云城市临猗县的空间省会花园小区178号胡莎莎2018-02-02 10:02批准   删除   修改