From db35db43780de482ec260069e5381808d3d4cbf0 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 6 Jun 2017 17:38:10 +0800 Subject: [PATCH 001/110] =?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 @@
@@ -115,9 +115,9 @@
- + + + @@ -135,8 +135,8 @@ '/courses/<%= @course.id %>/has_group_student_list?group_id=<%= @role %>' ); <% end %> - <% elsif @select_tab == 'module'%> - $(".stud-class-set .news .nav p[data-option='module']").click(); + <%# elsif @select_tab == 'module'%> +// $(".stud-class-set .news .nav p[data-option='module']").click(); <% end %> }); diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 937829171..bd9bb29be 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -70,61 +70,75 @@
  • 动态
  • - <% course_modules = @course.create_course_modules.where(:hidden => 0).order("position asc") %> - <% course_board = @course.boards.where("parent_id is NULL").first %> - <% course_modules.each_with_index do |cm, i| %> - <% case cm.module_type %> - <% when "news" %> -
  • - 通知 - <%= @course.news.count %> - <%= link_to( "+", new_course_news_path(@course, :is_new => 1), :class => 'fr mr15 font-18 link-color-grey', :title => "#{l(:label_course_news_new)}") if is_teacher %> -
  • - <% when "boards" %> - <% count = course_board ? course_board.messages.count : 0 %> -
  • - 讨论 - <%= count %> - <%= link_to( "+", course_boards_path(@course, :flag => true, :is_new => 1), :class => 'fr mr15 font-18 link-color-grey', :title => "#{l(:label_message_new)}") if User.current.logged? %> -
  • -
    - <%= render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board} %> -
    - <% when "attachment" %> -
  • - 资源 - <%= course_file_num %> - <% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %> - + - <% end %> -
  • - <% when "homework" %> -
  • - 作业 - <%= homework_num %> - <% if is_teacher %> - + - <% end %> -
  • - <% when "exercises" %> - <% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %> -
  • - 试卷 - <%= count %> - <%= link_to( "+", new_exercise_path(:course_id => @course.id), :class => 'fr mr15 font-18 link-color-grey', :title =>"新建试卷") if is_teacher %> -
  • - <% when "poll" %> -
  • - @course.id) %>" class="fl ml15 ">问卷 - <%= course_poll_count %> - <%= link_to( "+", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'fr mr15 font-18 link-color-grey', :title =>"#{l(:label_new_poll)}") if is_teacher %> -
  • - <% when "statistics" %> -
  • - 统计 -
  • +
  • + 作业 + <%= homework_num %> + <% if is_teacher %> + + <% end %> - <% end %> +
  • +
  • + 资源 + <%= course_file_num %> + <% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %> + + + <% end %> +
  • + <%# course_modules = @course.create_course_modules.where(:hidden => 0).order("position asc") %> + <%# course_board = @course.boards.where("parent_id is NULL").first %> + <%# course_modules.each_with_index do |cm, i| %> + <%# case cm.module_type %> + <%# when "news" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%# end %> + <%# end %> <%= @course.visits %> 次访问 From c6471a44aa75ac55fc380c7bfbf270ac17972ff3 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 7 Jun 2017 17:14:20 +0800 Subject: [PATCH 003/110] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E8=AF=84=E5=88=86=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E5=AD=98=E5=90=8E=E7=99=BE=E5=88=86=E6=AF=94?= =?UTF-8?q?=E7=9A=84=E4=B8=8B=E6=8B=89=E6=9D=A1=E5=BA=94=E8=AF=A5=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homework_common/_show_score_setting.html.erb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/views/homework_common/_show_score_setting.html.erb b/app/views/homework_common/_show_score_setting.html.erb index 1d826e1f5..be39f3ac2 100644 --- a/app/views/homework_common/_show_score_setting.html.erb +++ b/app/views/homework_common/_show_score_setting.html.erb @@ -57,18 +57,14 @@ - +
  • - +
  • <% if @homework.homework_type == 2 %> @@ -76,9 +72,7 @@ - +
  • From 87071cacce045c2088ab3bedd642c92f3a9e4296 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 7 Jun 2017 17:39:24 +0800 Subject: [PATCH 004/110] =?UTF-8?q?=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- app/assets/javascripts/managements.js.coffee | 3 + app/assets/stylesheets/managements.css.scss | 3 + app/controllers/management_controller.rb | 14 +- app/controllers/managements_controller.rb | 37 +++ app/helpers/application_helper.rb | 12 + app/helpers/managements_helper.rb | 15 + app/models/apply_action.rb | 6 + app/models/user.rb | 3 + app/views/admin/_authentication_list.html.erb | 86 +++--- app/views/layouts/base_management.html.erb | 2 +- .../management/_authentication_list.html.erb | 86 +++--- .../_trial_authorization_list.html.erb | 44 +++ .../management/trial_authorization.html.erb | 266 ++++++++---------- .../management/trial_authorization.js.erb | 30 ++ .../managements/_authentication_list.html.erb | 47 ++++ .../_trial_authorization_list.html.erb | 44 +++ .../_trial_authorization_passed_list.html.erb | 34 +++ .../identity_authentication.html.erb | 135 +++++++++ .../identity_authentication.js.erb | 30 ++ .../managements/trial_authorization.html.erb | 136 +++++++++ .../managements/trial_authorization.js.erb | 30 ++ config/routes.rb | 3 +- .../20170607015139_create_apply_actions.rb | 13 + ...70607021803_add_status_to_apply_actions.rb | 5 + public/stylesheets/css/edu-admin.css | 2 +- spec/factories/apply_actions.rb | 10 + spec/models/apply_action_spec.rb | 5 + 28 files changed, 863 insertions(+), 240 deletions(-) create mode 100644 app/assets/javascripts/managements.js.coffee create mode 100644 app/assets/stylesheets/managements.css.scss create mode 100644 app/controllers/managements_controller.rb create mode 100644 app/helpers/managements_helper.rb create mode 100644 app/models/apply_action.rb create mode 100644 app/views/management/_trial_authorization_list.html.erb create mode 100644 app/views/management/trial_authorization.js.erb create mode 100644 app/views/managements/_authentication_list.html.erb create mode 100644 app/views/managements/_trial_authorization_list.html.erb create mode 100644 app/views/managements/_trial_authorization_passed_list.html.erb create mode 100644 app/views/managements/identity_authentication.html.erb create mode 100644 app/views/managements/identity_authentication.js.erb create mode 100644 app/views/managements/trial_authorization.html.erb create mode 100644 app/views/managements/trial_authorization.js.erb create mode 100644 db/migrate/20170607015139_create_apply_actions.rb create mode 100644 db/migrate/20170607021803_add_status_to_apply_actions.rb create mode 100644 spec/factories/apply_actions.rb create mode 100644 spec/models/apply_action_spec.rb diff --git a/Gemfile b/Gemfile index 8033bf210..57e9d17f7 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,7 @@ group :development, :test do gem 'pry-byebug' gem "test-unit", "~>3.0" end - gem 'rspec-rails', '~> 3.0' + # gem 'rspec-rails', '~> 3.0' gem 'factory_girl_rails' end diff --git a/app/assets/javascripts/managements.js.coffee b/app/assets/javascripts/managements.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/managements.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/managements.css.scss b/app/assets/stylesheets/managements.css.scss new file mode 100644 index 000000000..00a467eed --- /dev/null +++ b/app/assets/stylesheets/managements.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the managements 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 index 877e4b823..825a509ea 100644 --- a/app/controllers/management_controller.rb +++ b/app/controllers/management_controller.rb @@ -1,4 +1,4 @@ -class ManagementController < ApplicationController +class ManagementsController < ApplicationController before_filter :require_admin layout 'base_management' @@ -7,9 +7,21 @@ class ManagementController < ApplicationController end def trial_authorization + search = params[:search] + @status = (params[:status].blank? || params[:status] == "0") ? 0 : [1,2] + if search.blank? + @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status).includes(:user) + else + user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'") + @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status, :user_id => user_id).includes(:user) + end + end + + def trial_authorization_operation end + def index end diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb new file mode 100644 index 000000000..9b78e988a --- /dev/null +++ b/app/controllers/managements_controller.rb @@ -0,0 +1,37 @@ +class ManagementsController < ApplicationController + before_filter :require_admin + layout 'base_management' + include ManagementsHelper + + def trial_authorization + search = params[:search] + @status = trial_authorization_status(params[:status]) + @status = (params[:status].blank? || params[:status] == "0") ? 0 : [1,2] + if search.blank? + @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status).includes(:user) + else + user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'") + @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status, :user_id => user_id).includes(:user) + end + end + + def trial_authorization_operation + apply_action = ApplyAction.find(params[:apply_id]) + apply_action.update_attributes(:status => (params[:type] == "1" ? 2 : 1), :reason => params[:reject_reason], :dealer_id => User.current.id) + redirect_to '/managements/trial_authorization.js' + 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/application_helper.rb b/app/helpers/application_helper.rb index 1ddb9931d..cd44ea064 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2806,6 +2806,18 @@ module ApplicationHelper end end + def identity_authentication_status user_id + apply = ApplyUserAuthentication.where(:user_id => user_id).first + case apply.status + when 0 + "等待认证审批" + when 1 + "认证已通过" + when 2 + "认证被拒绝" + end + end + def date_format_local(time) date = time.strftime("%Y年%m月%d日") end diff --git a/app/helpers/managements_helper.rb b/app/helpers/managements_helper.rb new file mode 100644 index 000000000..6c97b5512 --- /dev/null +++ b/app/helpers/managements_helper.rb @@ -0,0 +1,15 @@ +module ManagementsHelper + + def trial_authorization_status status + case status + when "0", nil + 0 + when "1" + 1 + when "2" + 2 + else + [1,2] + end + end +end diff --git a/app/models/apply_action.rb b/app/models/apply_action.rb new file mode 100644 index 000000000..a940ada38 --- /dev/null +++ b/app/models/apply_action.rb @@ -0,0 +1,6 @@ +# status:0 审核中 1 同意 2 拒绝 +class ApplyAction < ActiveRecord::Base + attr_accessible :container_id, :container_type, :dealer_id, :reason, :user_id, :status + + belongs_to :user +end diff --git a/app/models/user.rb b/app/models/user.rb index 8b0361a2a..676e57835 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -200,6 +200,9 @@ class User < Principal ##### has_many :shares ,:dependent => :destroy + ### + has_many :apply_actions, :dependent => :destroy + has_one :user_wechat has_one :sso diff --git a/app/views/admin/_authentication_list.html.erb b/app/views/admin/_authentication_list.html.erb index b8f2621fc..256685e7c 100644 --- a/app/views/admin/_authentication_list.html.erb +++ b/app/views/admin/_authentication_list.html.erb @@ -1,43 +1,47 @@ -<% @unapproved_user.each do |apply_user| %> - <% user = User.find(apply_user.user_id) %> -
    - - <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> - -
    -
      -
    • - <%= user.show_name %> - <%= time_from_now(apply_user.updated_at) %> - 拒绝 - 同意 -
    • -
    • - <% if !user.user_extensions.school_id.blank? && user.user_extensions.school %> - <%= user.user_extensions.school.name %><%= user.user_extensions.department ? ' - '+user.user_extensions.department.name.to_s : '' %> - <% end %> - <% if user.user_extensions && user.user_extensions.identity %> - <%= get_user_roll user %> - <% if user.user_extensions.identity == 1 && user.user_extensions.try(:student_id) %> - <%= user.user_extensions.try(:student_id) %> +<% unless @unapproved_user.blank? %> + <% @unapproved_user.each do |apply_user| %> + <% user = User.find(apply_user.user_id) %> +
      + + <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> + +
      +
        +
      • + <%= user.show_name %> + <%= time_from_now(apply_user.updated_at) %> + 拒绝 + 同意 +
      • +
      • + <% if !user.user_extensions.school_id.blank? && user.user_extensions.school %> + <%= user.user_extensions.school.name %><%= user.user_extensions.department ? ' - '+user.user_extensions.department.name.to_s : '' %> <% end %> - <% end %> -
      • -
      • - <%= image_tag(url_to_auth_img(user.id, 'PRO'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> - <%= image_tag(url_to_auth_img(user.id, 'ID'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> -
      • -
        -
      • - - -
      • -
      • - 确定 - 取消 -
      • + <% if user.user_extensions && user.user_extensions.identity %> + <%= get_user_roll user %> + <% if user.user_extensions.identity == 1 && user.user_extensions.try(:student_id) %> + <%= user.user_extensions.try(:student_id) %> + <% end %> + <% end %> + +
      • + <%= image_tag(url_to_auth_img(user.id, 'PRO'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> + <%= image_tag(url_to_auth_img(user.id, 'ID'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> +
      • +
        +
      • + + +
      • +
      • + 确定 + 取消 +
      • +
        +
      -
    -
    -
    -<% end %> \ No newline at end of file + + <% end %> +<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %> diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index b3f8ba985..a214e40ca 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -9,7 +9,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common', 'css/edu-public', 'css/font-awesome', 'css/edu-popup', 'css/magic-check', "css/edu-admin", "bootstrap/bootstrap-min.css" %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common', 'css/edu-public', 'css/font-awesome', 'css/edu-popup', 'css/magic-check', "css/edu-admin" %> <%= javascript_include_tag "edu/application",'edu/base_edu','baiduTemplate','jquery.datetimepicker.js' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> diff --git a/app/views/management/_authentication_list.html.erb b/app/views/management/_authentication_list.html.erb index ca4f1cc50..ec79c9bd5 100644 --- a/app/views/management/_authentication_list.html.erb +++ b/app/views/management/_authentication_list.html.erb @@ -1,43 +1,47 @@ -<% @unapproved_user.each do |apply_user| %> - <% user = User.find(apply_user.user_id) %> -
    - - <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> - -
    -
      -
    • - <%= user.show_name %> - <%= time_from_now(apply_user.updated_at) %> - 拒绝 - 同意 -
    • -
    • - <% if !user.user_extensions.school_id.blank? && user.user_extensions.school %> - <%= user.user_extensions.school.name %><%= user.user_extensions.department ? ' - '+user.user_extensions.department.name.to_s : '' %> - <% end %> - <% if user.user_extensions && user.user_extensions.identity %> - <%= get_user_roll user %> - <% if user.user_extensions.identity == 1 && user.user_extensions.try(:student_id) %> - <%= user.user_extensions.try(:student_id) %> +<% unless @unapproved_user.blank? %> + <% @unapproved_user.each do |apply_user| %> + <% user = User.find(apply_user.user_id) %> +
      + + <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> + +
      +
        +
      • + <%= user.show_name %> + <%= time_from_now(apply_user.updated_at) %> + 拒绝 + 同意 +
      • +
      • + <% if !user.user_extensions.school_id.blank? && user.user_extensions.school %> + <%= user.user_extensions.school.name %><%= user.user_extensions.department ? ' - '+user.user_extensions.department.name.to_s : '' %> <% end %> - <% end %> -
      • -
      • - <%= image_tag(url_to_auth_img(user.id, 'PRO'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> - <%= image_tag(url_to_auth_img(user.id, 'ID'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> -
      • -
        -
      • - - -
      • -
      • - 确定 - 取消 -
      • + <% if user.user_extensions && user.user_extensions.identity %> + <%= get_user_roll user %> + <% if user.user_extensions.identity == 1 && user.user_extensions.try(:student_id) %> + <%= user.user_extensions.try(:student_id) %> + <% end %> + <% end %> + +
      • + <%= image_tag(url_to_auth_img(user.id, 'PRO'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> + <%= image_tag(url_to_auth_img(user.id, 'ID'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> +
      • +
        +
      • + + +
      • +
      • + 确定 + 取消 +
      • +
        +
      -
    -
    -
    -<% end %> \ No newline at end of file + + <% end %> +<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %> diff --git a/app/views/management/_trial_authorization_list.html.erb b/app/views/management/_trial_authorization_list.html.erb new file mode 100644 index 000000000..d0895a333 --- /dev/null +++ b/app/views/management/_trial_authorization_list.html.erb @@ -0,0 +1,44 @@ +<% unless @authorizations.blank? %> + <% @authorizations.each do |authorization| %> + <% user = authorization.user %> +
    + + <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> + +
    +
      +
    • + <%= user.try(:show_name) %> + <%= time_from_now(authorization.updated_at) %> + 拒绝 + 同意 +
    • +
    • + <% if !user.try(:user_extensions).school_id.blank? && user.try(:user_extensions).try(:school) %> + <%= user.try(:user_extensions).school.name %><%= user.try(:user_extensions).department ? ' - '+user.try(:user_extensions).department.name.to_s : '' %> + <% end %> + <% if user.try(:user_extensions) && user.try(:user_extensions).identity %> + <%= get_user_roll user %> + <% if user.try(:user_extensions).identity == 1 && user.try(:user_extensions).try(:student_id) %> + <%= user.try(:user_extensions).try(:student_id) %> + <% end %> + <% end %> + <%= identity_authentication_status(User.current.id) %> +
    • +
      +
    • + + +
    • +
    • + 确定 + 取消 +
    • +
      +
    +
    +
    + <% end %> +<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %> diff --git a/app/views/management/trial_authorization.html.erb b/app/views/management/trial_authorization.html.erb index 222824104..ebf3df89e 100644 --- a/app/views/management/trial_authorization.html.erb +++ b/app/views/management/trial_authorization.html.erb @@ -1,175 +1,135 @@ -

    胡莎莎 > 审批 > 试用授权

    -
    -

    身份认证

    - 试用授权 -
    -
    -
    -
    +
    +
    +

    身份认证

    +
    +
    +
    • - 待审批 - + <%= link_to "待审批", {:controller => "management", :action => "trial_authorization", :status => 0}, :class => "tab_type", :remote => true %> +
    • -
    • - 已审批 - +
    • + <%= link_to "已审批", {:controller => "management", :action => "trial_authorization", :status => 2}, :class => "tab_type", :remote => true %> +
    -
    -
    -
    - - +
    +
    +
    + +
    -
    -
    - 头像 -
    - -
    -
    -
    - 头像 -
    -
      -
    • - 姓名姓名1小时前 - 拒绝 - 同意 - -
    • -
    • - 国防科学与技术大学 - - - 计算机学院 - 学生 - 等待认证审批 -
    • -
    -
    -
    -
    - 头像 -
    -
      -
    • - 姓名姓名1小时前 - 拒绝 - 同意 - -
    • -
    • - 国防科学与技术大学 - - - 计算机学院 - 学生 - 认证已通过 -
    • -
    -
    -
    -
    - 头像 -
    -
      -
    • - 姓名姓名1小时前 - 拒绝 - 同意 - -
    • -
    • - 国防科学与技术大学 - - - 计算机学院 - 学生 - 认证被拒绝 -
    • -
    -
    -
    +
    + <%= render :partial => "management/trial_authorization_list" %>
    +
    -
    +

    - 全部 - 同意 - 拒绝 + 全部 + 同意 + 拒绝

    -
    - - +
    + +
    -
    -
    - 头像 -
    -
      -
    • - 姓名姓名1小时前 - 已同意 -
    • -
    • - 国防科学与技术大学 - - - 计算机学院 - 学生 - 未提交认证 -
    • -
    -
    -
    -
    - 头像 -
    -
      -
    • - 姓名姓名1小时前 - 已拒绝 -
    • -
    • - 国防科学与技术大学 - - - 计算机学院 - 学生 - 等待认证审批 -
    • -
    • 原因:身份证照上的个人信息显示不够清晰
    • -
    -
    -
    +
    -
    \ No newline at end of file +
    + \ No newline at end of file diff --git a/app/views/management/trial_authorization.js.erb b/app/views/management/trial_authorization.js.erb new file mode 100644 index 000000000..2e45bdee2 --- /dev/null +++ b/app/views/management/trial_authorization.js.erb @@ -0,0 +1,30 @@ +var nTabIcon_1 = $("#edu-tab-con-1"); +var nTabIcon_2 = $("#edu-tab-con-2"); +var nTabNav_1 = $("#edu-tab-nav-1"); +var nTabNav_2 = $("#edu-tab-nav-2"); +var nAudit = $("#audit_all_authentication").parent(); + +<% if @status == 0 %> +$("#authentication_list").html("<%= j( render :partial => "management/trial_authorization_list" ) %>"); +nTabNav_1.addClass("edu-tab-hover"); +nTabNav_2.removeClass("edu-tab-hover"); +nTabIcon_1.show(); +nTabIcon_2.hide(); +<% else %> +$("#audit_authentication_list").html("<%= j( render :partial => "management/trial_authorization_list" ) %>"); +nTabNav_1.removeClass("edu-tab-hover"); +nTabNav_2.addClass("edu-tab-hover"); +nTabIcon_1.hide(); +nTabIcon_2.show(); +/* -------------------------- 未审批(全部、同意、拒绝点击时动态样式) ------------------------------ */ +if(<%= @status == "1" %>){ + nAudit.find(".active").removeClass("active"); + $("#audit_agree_authentication").addClass("active"); +}else if(<%= @status == "2" %>){ + nAudit.find(".active").removeClass("active"); + $("#audit_reject_authentication").addClass("active"); +}else{ + nAudit.find(".active").removeClass("active"); + $("#audit_all_authentication").addClass("active"); +} +<% end %> \ No newline at end of file diff --git a/app/views/managements/_authentication_list.html.erb b/app/views/managements/_authentication_list.html.erb new file mode 100644 index 000000000..ec79c9bd5 --- /dev/null +++ b/app/views/managements/_authentication_list.html.erb @@ -0,0 +1,47 @@ +<% unless @unapproved_user.blank? %> + <% @unapproved_user.each do |apply_user| %> + <% user = User.find(apply_user.user_id) %> +
    + + <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> + +
    +
      +
    • + <%= user.show_name %> + <%= time_from_now(apply_user.updated_at) %> + 拒绝 + 同意 +
    • +
    • + <% if !user.user_extensions.school_id.blank? && user.user_extensions.school %> + <%= user.user_extensions.school.name %><%= user.user_extensions.department ? ' - '+user.user_extensions.department.name.to_s : '' %> + <% end %> + <% if user.user_extensions && user.user_extensions.identity %> + <%= get_user_roll user %> + <% if user.user_extensions.identity == 1 && user.user_extensions.try(:student_id) %> + <%= user.user_extensions.try(:student_id) %> + <% end %> + <% end %> +
    • +
    • + <%= image_tag(url_to_auth_img(user.id, 'PRO'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> + <%= image_tag(url_to_auth_img(user.id, 'ID'), :width => 200, :height => 150, :class => 'edu-renzheng-img fl mr20') %> +
    • +
      +
    • + + +
    • +
    • + 确定 + 取消 +
    • +
      +
    +
    +
    + <% end %> +<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %> diff --git a/app/views/managements/_trial_authorization_list.html.erb b/app/views/managements/_trial_authorization_list.html.erb new file mode 100644 index 000000000..d0895a333 --- /dev/null +++ b/app/views/managements/_trial_authorization_list.html.erb @@ -0,0 +1,44 @@ +<% unless @authorizations.blank? %> + <% @authorizations.each do |authorization| %> + <% user = authorization.user %> +
    + + <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> + +
    +
      +
    • + <%= user.try(:show_name) %> + <%= time_from_now(authorization.updated_at) %> + 拒绝 + 同意 +
    • +
    • + <% if !user.try(:user_extensions).school_id.blank? && user.try(:user_extensions).try(:school) %> + <%= user.try(:user_extensions).school.name %><%= user.try(:user_extensions).department ? ' - '+user.try(:user_extensions).department.name.to_s : '' %> + <% end %> + <% if user.try(:user_extensions) && user.try(:user_extensions).identity %> + <%= get_user_roll user %> + <% if user.try(:user_extensions).identity == 1 && user.try(:user_extensions).try(:student_id) %> + <%= user.try(:user_extensions).try(:student_id) %> + <% end %> + <% end %> + <%= identity_authentication_status(User.current.id) %> +
    • +
      +
    • + + +
    • +
    • + 确定 + 取消 +
    • +
      +
    +
    +
    + <% end %> +<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %> diff --git a/app/views/managements/_trial_authorization_passed_list.html.erb b/app/views/managements/_trial_authorization_passed_list.html.erb new file mode 100644 index 000000000..94c6d76f9 --- /dev/null +++ b/app/views/managements/_trial_authorization_passed_list.html.erb @@ -0,0 +1,34 @@ +<% unless @authorizations.blank? %> + <% @authorizations.each do |authorization| %> + <% user = authorization.user %> +
    + + <%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %> + +
    +
      +
    • + <%= user.try(:show_name) %> + <%= time_from_now(authorization.updated_at) %> + <%= authorization.status == 1 ? "已同意" : "已拒绝" %> +
    • +
    • + <% if !user.try(:user_extensions).school_id.blank? && user.try(:user_extensions).try(:school) %> + <%= user.try(:user_extensions).school.name %><%= user.try(:user_extensions).department ? ' - '+user.try(:user_extensions).department.name.to_s : '' %> + <% end %> + <% if user.try(:user_extensions) && user.try(:user_extensions).identity %> + <%= get_user_roll user %> + <% if user.try(:user_extensions).identity == 1 && user.try(:user_extensions).try(:student_id) %> + <%= user.try(:user_extensions).try(:student_id) %> + <% end %> + <% end %> + <%= identity_authentication_status(User.current.id) %> +
    • +
    • 原因:<%= authorization.reason.blank? ? "空" : authorization.reason %>
    • +
    +
    +
    + <% end %> +<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %> diff --git a/app/views/managements/identity_authentication.html.erb b/app/views/managements/identity_authentication.html.erb new file mode 100644 index 000000000..86fa3852b --- /dev/null +++ b/app/views/managements/identity_authentication.html.erb @@ -0,0 +1,135 @@ +
    +
    +

    身份认证

    +
    +
    +
    +
      +
    • + <%= link_to "待审批", {:controller => "management", :action => "identity_authentication", :type => [0]}, :class => "tab_type", :remote => true %> + +
    • +
    • + <%= link_to "已审批", {:controller => "management", :action => "identity_authentication", :type => [1,2]}, :class => "tab_type", :remote => true %> + +
    • +
    +
    +
    +
    +
    + + +
    +
    +
    + <%= render :partial => "admin/authentication_list" %> +
    +
    +
    + +
    +
    +

    + 全部 + 同意 + 拒绝 +

    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/app/views/managements/identity_authentication.js.erb b/app/views/managements/identity_authentication.js.erb new file mode 100644 index 000000000..a8bd6caf8 --- /dev/null +++ b/app/views/managements/identity_authentication.js.erb @@ -0,0 +1,30 @@ +var nTabIcon_1 = $("#edu-tab-con-1"); +var nTabIcon_2 = $("#edu-tab-con-2"); +var nTabNav_1 = $("#edu-tab-nav-1"); +var nTabNav_2 = $("#edu-tab-nav-2"); +var nAudit = $("#audit_all_authentication").parent(); + +<% if params[:type] == "0" %> +$("#authentication_list").html("<%= j( render :partial => "admin/authentication_list" ) %>"); +nTabNav_1.addClass("edu-tab-hover"); +nTabNav_2.removeClass("edu-tab-hover"); +nTabIcon_1.show(); +nTabIcon_2.hide(); +<% else %> +$("#audit_authentication_list").html("<%= j( render :partial => "admin/audit_authentication_list" ) %>"); +nTabNav_1.removeClass("edu-tab-hover"); +nTabNav_2.addClass("edu-tab-hover"); +nTabIcon_1.hide(); +nTabIcon_2.show(); +/* -------------------------- 未审批(全部、同意、拒绝点击时动态样式) ------------------------------ */ +if(<%= params[:type] == "1" %>){ + nAudit.find(".active").removeClass("active"); + $("#audit_agree_authentication").addClass("active"); +}else if(<%= params[:type] == "2" %>){ + nAudit.find(".active").removeClass("active"); + $("#audit_reject_authentication").addClass("active"); +}else{ + nAudit.find(".active").removeClass("active"); + $("#audit_all_authentication").addClass("active"); +} +<% end %> \ No newline at end of file diff --git a/app/views/managements/trial_authorization.html.erb b/app/views/managements/trial_authorization.html.erb new file mode 100644 index 000000000..c86669ab8 --- /dev/null +++ b/app/views/managements/trial_authorization.html.erb @@ -0,0 +1,136 @@ +
    +
    +

    使用授权

    +
    +
    +
    +
      +
    • + <%= link_to "待审批", {:controller => "managements", :action => "trial_authorization", :status => "0"}, :class => "tab_type", :remote => true %> + +
    • +
    • + <%= link_to "已审批", {:controller => "managements", :action => "trial_authorization", :status => [1,2]}, :class => "tab_type", :remote => true %> + +
    • +
    +
    +
    +
    +
    + + +
    +
    +
    + <%= render :partial => "management/trial_authorization_list" %> +
    +
    +
    + +
    +
    +

    + 全部 + 同意 + 拒绝 +

    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/app/views/managements/trial_authorization.js.erb b/app/views/managements/trial_authorization.js.erb new file mode 100644 index 000000000..e64fe0a14 --- /dev/null +++ b/app/views/managements/trial_authorization.js.erb @@ -0,0 +1,30 @@ +var nTabIcon_1 = $("#edu-tab-con-1"); +var nTabIcon_2 = $("#edu-tab-con-2"); +var nTabNav_1 = $("#edu-tab-nav-1"); +var nTabNav_2 = $("#edu-tab-nav-2"); +var nAudit = $("#audit_all_authentication").parent(); + +<% if @status == 0 %> +$("#authentication_list").html("<%= j( render :partial => "management/trial_authorization_list" ) %>"); +nTabNav_1.addClass("edu-tab-hover"); +nTabNav_2.removeClass("edu-tab-hover"); +nTabIcon_1.show(); +nTabIcon_2.hide(); +<% else %> +$("#audit_authentication_list").html("<%= j( render :partial => "managements/trial_authorization_passed_list" ) %>"); +nTabNav_1.removeClass("edu-tab-hover"); +nTabNav_2.addClass("edu-tab-hover"); +nTabIcon_1.hide(); +nTabIcon_2.show(); +/* -------------------------- 未审批(全部、同意、拒绝点击时动态样式) ------------------------------ */ +if(<%= @status == "1" %>){ + nAudit.find(".active").removeClass("active"); + $("#audit_agree_authentication").addClass("active"); +}else if(<%= @status == "2" %>){ + nAudit.find(".active").removeClass("active"); + $("#audit_reject_authentication").addClass("active"); +}else{ + nAudit.find(".active").removeClass("active"); + $("#audit_all_authentication").addClass("active"); +} +<% end %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3a9cca942..2bf20608c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -94,11 +94,12 @@ RedmineApp::Application.routes.draw do end end - resources :management do + resources :managements do collection do get 'approve' get 'trial_authorization', :as => 'trial_authorization' get 'identity_authentication', :as => 'identity_authentication' + match 'trial_authorization_operation', :as => 'trial_authorization_operation' end end # Enable Grack support diff --git a/db/migrate/20170607015139_create_apply_actions.rb b/db/migrate/20170607015139_create_apply_actions.rb new file mode 100644 index 000000000..bd008aed7 --- /dev/null +++ b/db/migrate/20170607015139_create_apply_actions.rb @@ -0,0 +1,13 @@ +class CreateApplyActions < ActiveRecord::Migration + def change + create_table :apply_actions do |t| + t.integer :user_id + t.string :reason + t.integer :container_id + t.string :container_type + t.integer :dealer_id + + t.timestamps + end + end +end diff --git a/db/migrate/20170607021803_add_status_to_apply_actions.rb b/db/migrate/20170607021803_add_status_to_apply_actions.rb new file mode 100644 index 000000000..11e141409 --- /dev/null +++ b/db/migrate/20170607021803_add_status_to_apply_actions.rb @@ -0,0 +1,5 @@ +class AddStatusToApplyActions < ActiveRecord::Migration + def change + add_column :apply_actions, :status, :integer, :limit => 1, :default => 0 + end +end diff --git a/public/stylesheets/css/edu-admin.css b/public/stylesheets/css/edu-admin.css index ad089c394..fd86cc314 100644 --- a/public/stylesheets/css/edu-admin.css +++ b/public/stylesheets/css/edu-admin.css @@ -74,7 +74,7 @@ table.table-pa5 th,table.table-pa5 td{ padding:0 5px;} .edu-tab{ width: 100%; background:#fff; } #edu-tab-nav{height:47px;background: #fff; } #edu-tab-nav li {float:left; width: 170px; text-align:center;height: 47px;line-height: 47px; position: relative; } -.edu-tab-fa{ position: absolute; top:45px; left:85px; color: #fff;} +.edu-tab-fa{ position: absolute; top:27px; left:85px; color: #fff;} #edu-tab-nav li a{font-size:14px; } .edu-tab-hover {border-bottom:3px solid #5faee3; background: #fff; } .edu-tab-hover .edu-tab-fa{ color: #5faee3;} diff --git a/spec/factories/apply_actions.rb b/spec/factories/apply_actions.rb new file mode 100644 index 000000000..4cc15f20b --- /dev/null +++ b/spec/factories/apply_actions.rb @@ -0,0 +1,10 @@ +FactoryGirl.define do + factory :apply_action do + user_id 1 +reason "MyString" +container_id 1 +container_type "MyString" +dealer_id 1 + end + +end diff --git a/spec/models/apply_action_spec.rb b/spec/models/apply_action_spec.rb new file mode 100644 index 000000000..5bac07af7 --- /dev/null +++ b/spec/models/apply_action_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ApplyAction, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 4342286d6983e18e110c661fdc4ac3e4b2a7ca68 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Jun 2017 09:24:37 +0800 Subject: [PATCH 005/110] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E8=B5=84=E6=96=99?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/_has_authentication.html.erb | 2 +- app/views/my/account.html.erb | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/app/views/account/_has_authentication.html.erb b/app/views/account/_has_authentication.html.erb index 4244df0c5..f42f6ca6b 100644 --- a/app/views/account/_has_authentication.html.erb +++ b/app/views/account/_has_authentication.html.erb @@ -5,7 +5,7 @@ 已认证 <% end %>
    -<% if !@user.authentication && @apply_user_auth && @apply_user_auth.status == 0 %> +<% if false %> <%= render :partial => "welcome/one_btn_mask_pop", :locals => { :tip1 => "更多功能,需要经过管理员的授权审核", diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index cb28f7e1a..4c2aed71b 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -181,14 +181,18 @@ 已认证 <% else %> - - - 未认证 - - - - 认证中 - + <% apply_auth = ApplyUserAuthentication.where(:user_id => @user.id).last %> + <% if apply_auth && apply_auth.status == 0 %> + + + 认证中 + + <% else %> + + + 未认证 + + <% end %> <% end %>

  • @@ -245,9 +249,9 @@ <% title = "" %> <% language = "" %> <% end %> -<% if @force %> +<% if false %> <%= render :partial => "welcome/guidance_mask" %> -<% elsif @auth %> +<% elsif false %> <%= render :partial => 'welcome/two_btn_mask_pop', :locals => { :btn1 => "试用申请", From 400c9e7703c111287114a3303c4270142c939120 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Jun 2017 09:28:00 +0800 Subject: [PATCH 006/110] =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=85=B1=E8=B5=84=E6=BA=90cheekbox=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=97=A0=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_import_resource_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index 71638b672..14d4b785c 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -5,7 +5,7 @@ <% @attachments.each do |attach| %>
    • 留言
    • 审批
        -
      • <%= link_to "身份认证", :controller => "management", :action => "identity_authentication", :remote => true %>
      • -
      • <%= link_to "试用授权", :controller => "management", :action => "trial_authorization", :remote => true %>
      • +
      • <%= link_to "身份认证", :controller => "managements", :action => "identity_authentication" %>
      • +
      • <%= link_to "试用授权", :controller => "managements", :action => "trial_authorization" %>
    • 工程认证+
    • diff --git a/app/views/managements/agree_authentication.js.erb b/app/views/managements/agree_authentication.js.erb new file mode 100644 index 000000000..ab9d4277d --- /dev/null +++ b/app/views/managements/agree_authentication.js.erb @@ -0,0 +1 @@ +$("#authentication_list").html("<%= j( render :partial => "authentication_list" ) %>"); \ No newline at end of file diff --git a/app/views/managements/identity_authentication.html.erb b/app/views/managements/identity_authentication.html.erb index 86fa3852b..e1b8318e4 100644 --- a/app/views/managements/identity_authentication.html.erb +++ b/app/views/managements/identity_authentication.html.erb @@ -6,11 +6,11 @@
      • - <%= link_to "待审批", {:controller => "management", :action => "identity_authentication", :type => [0]}, :class => "tab_type", :remote => true %> + <%= link_to "待审批", {:controller => "managements", :action => "identity_authentication", :type => [0]}, :class => "tab_type", :remote => true %>
      • - <%= link_to "已审批", {:controller => "management", :action => "identity_authentication", :type => [1,2]}, :class => "tab_type", :remote => true %> + <%= link_to "已审批", {:controller => "managements", :action => "identity_authentication", :type => [1,2]}, :class => "tab_type", :remote => true %>
      @@ -19,7 +19,7 @@
      - +
      diff --git a/app/views/managements/trial_authorization.html.erb b/app/views/managements/trial_authorization.html.erb index c86669ab8..8e8607635 100644 --- a/app/views/managements/trial_authorization.html.erb +++ b/app/views/managements/trial_authorization.html.erb @@ -1,6 +1,6 @@
      -

      使用授权

      +

      试用授权

      @@ -37,7 +37,7 @@

      - +
      @@ -120,16 +120,18 @@ var iName = $("#audit_search_name").val(); var id = $("#audit_all_authentication").parent().find(".active").attr("id"); var type = 0; - if(id = "audit_all_authentication"){ + + if(id == "audit_all_authentication"){ type = [1, 2]; - }else if(id="audit_agree_authentication"){ + }else if(id=="audit_agree_authentication"){ type = 1; }else{ type = 2; } + alert(type); $.ajax({ url: "<%= trial_authorization_managements_path %>" +".js", - data: { name: iName, status: type} + data: { search: iName, status: type} }); }); diff --git a/app/views/managements/trial_authorization.js.erb b/app/views/managements/trial_authorization.js.erb index e64fe0a14..d45efab75 100644 --- a/app/views/managements/trial_authorization.js.erb +++ b/app/views/managements/trial_authorization.js.erb @@ -17,10 +17,10 @@ nTabNav_2.addClass("edu-tab-hover"); nTabIcon_1.hide(); nTabIcon_2.show(); /* -------------------------- 未审批(全部、同意、拒绝点击时动态样式) ------------------------------ */ -if(<%= @status == "1" %>){ +if(<%= @status == 1 %>){ nAudit.find(".active").removeClass("active"); $("#audit_agree_authentication").addClass("active"); -}else if(<%= @status == "2" %>){ +}else if(<%= @status == 2 %>){ nAudit.find(".active").removeClass("active"); $("#audit_reject_authentication").addClass("active"); }else{ diff --git a/config/routes.rb b/config/routes.rb index 67ed60488..3c43e53b9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -101,6 +101,8 @@ RedmineApp::Application.routes.draw do get 'trial_authorization', :as => 'trial_authorization' get 'identity_authentication', :as => 'identity_authentication' match 'trial_authorization_operation', :as => 'trial_authorization_operation' + get 'reject_authentication' + get 'agree_authentication' end end # Enable Grack support From d888e3f140bb7b19906baed98c496bb958941374 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Jun 2017 11:17:29 +0800 Subject: [PATCH 009/110] =?UTF-8?q?=E7=83=AD=E8=AF=81=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 6 ++++++ app/views/layouts/base_management.html.erb | 4 ++-- app/views/managements/users.html.erb | 0 app/views/welcome/_no_data.html.erb | 2 +- config/routes.rb | 1 + public/stylesheets/css/edu-class.css | 2 -- public/stylesheets/css/edu-public.css | 4 ++++ 7 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 app/views/managements/users.html.erb diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index eb5a4ff8b..530dd2700 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -3,7 +3,12 @@ class ManagementsController < ApplicationController layout 'base_management' include ManagementsHelper + def users + @menu_type = 6 + end + def trial_authorization + @menu_type = 9 search = params[:search] @status = trial_authorization_status(params[:status]) # @status = (params[:status].blank? || params[:status] == "0") ? 0 : [1,2] @@ -27,6 +32,7 @@ class ManagementsController < ApplicationController # copy from admin def identity_authentication + @menu_type = 9 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") diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index ea7fa3cf9..b4743785a 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -27,7 +27,7 @@
    • 实训+
    • 竞赛+
    • 单位
    • -
    • 用户 +
    • <%= link_to "用户", users_managements_path, :class => "edu-admin-nav-a" %>
      • 用户列表
      • 试用授权列表
      • @@ -35,7 +35,7 @@
      • 消息
      • 留言
      • -
      • 审批 +
      • 审批
        • <%= link_to "身份认证", :controller => "managements", :action => "identity_authentication" %>
        • <%= link_to "试用授权", :controller => "managements", :action => "trial_authorization" %>
        • diff --git a/app/views/managements/users.html.erb b/app/views/managements/users.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/welcome/_no_data.html.erb b/app/views/welcome/_no_data.html.erb index 8f64b878f..a3343f3dd 100644 --- a/app/views/welcome/_no_data.html.erb +++ b/app/views/welcome/_no_data.html.erb @@ -1,4 +1,4 @@ -
          +

          没有数据可以显示!

          \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3c43e53b9..4d36d401c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -103,6 +103,7 @@ RedmineApp::Application.routes.draw do match 'trial_authorization_operation', :as => 'trial_authorization_operation' get 'reject_authentication' get 'agree_authentication' + get 'users' end end # Enable Grack support diff --git a/public/stylesheets/css/edu-class.css b/public/stylesheets/css/edu-class.css index 92230988f..0a918398b 100644 --- a/public/stylesheets/css/edu-class.css +++ b/public/stylesheets/css/edu-class.css @@ -104,8 +104,6 @@ a:hover.edu-class-right-add{ background-color: rgba(0, 0, 0, 0.4);} .resource_btns_bottom a{ height: 28px; line-height: 28px; padding:0px 15px; border:1px solid #d5d5d5; border-radius:3px; color: #666;} .resource_btns_bottom a:hover{background-color: #3498db; color: #fff; } .resource_classlist_title a{margin-top:1px;color:#333; display: block; font-size: 16px; font-weight: normal;margin-bottom: 5px; max-width:780px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} -img.edu-nodata-img{ width:200px; margin:50px auto 20px; display: block;} -.edu-nodata-p{ font-size: 16px; text-align: center; color:#888;} .edu-reference-ma-block{height: 40px; margin: 30px auto; text-align: center; font-size: 16px; color: #9a9a9a;} diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index 3ebfb4179..29139eb5a 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -234,3 +234,7 @@ a.task-index-name{ display: inline-block; max-width:80px;} .upload_img img{max-width: 100%;} .list_style ol li{list-style-type: decimal;margin-left: 40px;} .list_style ul li{list-style-type: disc;margin-left: 40px;} + +/*数据为空公共页面*/ +img.edu-nodata-img{ width:200px; margin:50px auto 20px; display: block;} +.edu-nodata-p{ font-size: 16px; text-align: center; color:#888;} \ No newline at end of file From 0f95f258b5a034f16b527fe1256e7d2c1e3e5d3c Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Jun 2017 11:27:18 +0800 Subject: [PATCH 010/110] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=9C=80=E8=A6=81=E5=88=A0=E9=99=A4=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=97=B6=E9=97=B4=E5=90=8E=E7=9A=84+0800?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_homework_base_info.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index beae21c5e..a157c4e5c 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -4,7 +4,7 @@
          <% if activity.anonymous_comment == 0%>
          - 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start.nil? ? '--' : (activity.homework_detail_manual.evaluation_start.to_s+" 00:00") %> + 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start.nil? ? '--' : (format_time activity.homework_detail_manual.evaluation_start) %>
          <% end %>
    • @@ -15,7 +15,7 @@ 缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
      - 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end.nil? ? '--' : (activity.homework_detail_manual.evaluation_end.to_s+" 00:00") %> + 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end.nil? ? '--' : (format_time activity.homework_detail_manual.evaluation_end) %>
      <% end %>
      From 9e9772b24d6518872c73a9bba1c339a08b33552b Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Jun 2017 15:03:13 +0800 Subject: [PATCH 011/110] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E7=9A=84=E5=89=8D=E5=90=8E=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/edu/base_edu.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/javascripts/edu/base_edu.js b/public/javascripts/edu/base_edu.js index a24bedf65..b7e092e31 100644 --- a/public/javascripts/edu/base_edu.js +++ b/public/javascripts/edu/base_edu.js @@ -649,6 +649,7 @@ function submit_new_syllabus() $("#new_syllabus_name_notice").hide(); } else{ + $("#new_syllabus_name").val($.trim($("#new_syllabus_name").val())); $("#new_syllabus").submit(); } } @@ -679,6 +680,7 @@ function submit_edit_syllabus(id) $("#new_syllabus_name_notice").hide(); } else{ + $("#new_syllabus_name").val($.trim($("#new_syllabus_name").val())); $("#edit_syllabus").submit(); } } From 4bff7c7d68c9da1122fe05ce0b143c1ee3845223 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Jun 2017 16:05:23 +0800 Subject: [PATCH 012/110] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=AF=BC=E8=87=B4=E9=A1=B5=E9=9D=A2=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 117962aca..b6aa682ff 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3554,7 +3554,7 @@ module ApplicationHelper if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1 link_to "提交作品(#{count})","javascript:void(0)", :class => 'c_grey homepagePostSubmit',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品' else - link_to "提交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' + link_to "提交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue homepagePostSubmit' end elsif work.nil? && homework.end_time < Time.now if homework.allow_late From a0cff38470370abf4f67aae976e125d6e70e2e2f Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Jun 2017 16:15:24 +0800 Subject: [PATCH 013/110] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 32 +++++++++ app/helpers/application_helper.rb | 4 +- app/models/shixun.rb | 2 +- app/views/layouts/base_management.html.erb | 6 +- .../_users_authorization_list.html.erb | 37 +++++++++++ .../managements/trial_authorization.html.erb | 2 +- app/views/managements/users.html.erb | 62 ++++++++++++++++++ app/views/managements/users_trial.html.erb | 65 +++++++++++++++++++ app/views/myshixuns/_myshixun_top.html.erb | 2 +- config/routes.rb | 3 + 10 files changed, 208 insertions(+), 7 deletions(-) create mode 100644 app/views/managements/_users_authorization_list.html.erb create mode 100644 app/views/managements/users_trial.html.erb diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 530dd2700..325854741 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -2,9 +2,41 @@ class ManagementsController < ApplicationController before_filter :require_admin layout 'base_management' include ManagementsHelper + include SortHelper + include UsersHelper def users @menu_type = 6 + sort_init 'login', 'asc' + sort_update %w(login firstname lastname mail admin created_on last_login_on) + + case params[:format] + when 'xml', 'json' + @offset, @limit = api_offset_and_limit({:limit => 50}) + else + @limit = 50 #per_page_option + end + + @status = params[:status] || 1 + scope = User.logged.status(@status) + scope = User.like(params[:name]) if params[:name].present? + scope = scope.in_group(params[:group_id]) if params[:group_id].present? + + @user_count = scope.count + @user_pages = Paginator.new @user_count, @limit, params['page'] + @offset ||= @user_pages.offset + @users = scope.order(sort_clause).limit(@limit).offset(@offset).all + respond_to do |format| + format.html { + @groups = Group.all.sort + } + format.api + end + end + + def users_trial + @menu_type = 6 + @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => 0).includes(:user) end def trial_authorization diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a5cf87e77..f09315183 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2808,7 +2808,9 @@ module ApplicationHelper def identity_authentication_status user_id apply = ApplyUserAuthentication.where(:user_id => user_id).first - case apply.status + case apply.try(:status) + when nil + "未认证" when 0 "等待认证审批" when 1 diff --git a/app/models/shixun.rb b/app/models/shixun.rb index ab18f7410..0e99937bf 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -1,5 +1,5 @@ # status 控制实训的状态,0:未开启;1: 已开启(TPM); 2:已认证 -# 繁忙等级参数:80发布实训失败,返回code为-1;81:实训开启的时候fork失败;83:job创建失败;84:jenkins系统异常,post数据不成功 +# 繁忙等级参数:80发布实训失败,返回code为-1;81:实训开启的时候fork失败;83:j ;84:jenkins系统异常,post数据不成功 # 85:challenge创建的时候Jenkins处理异常;86:实训评测失败,jenkins返回错误结果; 87:版本库删除异常;88:点击评测失败,没返回数据;89:重置链接jenkins返回失败 class Shixun < ActiveRecord::Base attr_accessible :description, :is_public, :name, :changeset_num, :status, :user_id, :gpid, :language, :identifier, :authentication, :myshixun_count, :propaedeutics diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index b4743785a..57e16864a 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -27,10 +27,10 @@
    • 实训+
    • 竞赛+
    • 单位
    • -
    • <%= link_to "用户", users_managements_path, :class => "edu-admin-nav-a" %> +
    • 用户
        -
      • 用户列表
      • -
      • 试用授权列表
      • +
      • <%= link_to "用户列表", users_managements_path %>
      • +
      • <%= link_to "试用授权列表", users_trial_managements_path %>
    • 消息
    • diff --git a/app/views/managements/_users_authorization_list.html.erb b/app/views/managements/_users_authorization_list.html.erb new file mode 100644 index 000000000..33db6f123 --- /dev/null +++ b/app/views/managements/_users_authorization_list.html.erb @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + <% @authorizations.each do |authorization| %> + <% user = authorization.user %> + + + + + + + + + + + + <% end %> + + +
       真实姓名职业学号认证单位子单位试用状态授权时间
      + + + + <%= link_to user.try(:show_name), user_path(user), :class => "edu-txt-w100 task-hide2" %> + <%= user.identity %><%= user.try(:user_extensions).try(:student_id).blank? ? "--" : user.try(:user_extensions).try(:student_id) %><%= identity_authentication_status(user.id) %><%= user.try(:user_extensions).try(:school).name.blank? ? "--" : user.try(:user_extensions).try(:school) %><%= user.try(:user_extensions).department ? user.try(:user_extensions).try(:department).try(:name).to_s : '--' %><%= authorization.status == 0 ? "未授权" : (authorization.status == 1 ? "已授权" : "已拒绝") %><%= format_time(authorization.created_at) %>
      \ No newline at end of file diff --git a/app/views/managements/trial_authorization.html.erb b/app/views/managements/trial_authorization.html.erb index 8e8607635..8982c0249 100644 --- a/app/views/managements/trial_authorization.html.erb +++ b/app/views/managements/trial_authorization.html.erb @@ -23,7 +23,7 @@
      - <%= render :partial => "management/trial_authorization_list" %> + <%= render :partial => "management/trial_authorization_list"%>
      diff --git a/app/views/managements/users.html.erb b/app/views/managements/users.html.erb index e69de29bb..fb3252fd6 100644 --- a/app/views/managements/users.html.erb +++ b/app/views/managements/users.html.erb @@ -0,0 +1,62 @@ +
      +
      +

      全部状态

      +
        +
      • 活动的(53888)
      • +
      • 未激活(4800)
      • +
      • 已锁定(200)
      • +
      +
      +
      +

      真实姓名搜索

      +
        +
      • 邮箱地址搜索
      • +
      • 手机号码搜索
      • +
      +
      +
      + + 搜索 + 清除 +
      + 新建用户 +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      ID真实姓名邮件地址手机号码单位创建于最后登录操作
      m12345678欧阳莎莎欧阳莎莎欧阳莎莎欧阳莎莎12345678123456781234567890@test.com12345678901国防科学技术大学国防科学技术大学国防科学技术大学2017-05-01 10:062017-05-01 10:06锁定删除
      m12345678欧阳莎1234567810@test.com12345678901国防科学技术大学国防科学技术大学国防科学技术大学2017-05-01 10:062017-05-01 10:06锁定删除
      +
      \ No newline at end of file diff --git a/app/views/managements/users_trial.html.erb b/app/views/managements/users_trial.html.erb new file mode 100644 index 000000000..9faf20f78 --- /dev/null +++ b/app/views/managements/users_trial.html.erb @@ -0,0 +1,65 @@ +
      +
      +

      认证情况

      +
        +
      • 已认证
      • +
      • 未认证
      • +
      • 处理中
      • +
      • 被拒绝
      • +
      +
      +
      +

      试用授权情况

      +
        +
      • 已授权
      • +
      • 未授权
      • +
      • 处理中
      • +
      • 被拒绝
      • +
      +
      +
      +

      全部单位

      +
        +
      • 全部单位
      • + +
      +
      +
      +

      子单位

      +
        +
      • 子单位
      • +
      +
      +
      +

      真实姓名搜索

      +
        +
      • 邮箱地址搜索
      • +
      • 手机号码搜索
      • +
      +
      +
      + + 搜索 + 清除 +
      +
      +
      + <% if @authorizations.blank? %> + <%= render :partial => "welcome/no_data" %> + <% else %> +
      + + + + + + + + 授权试用 + 取消试用 +
      +
      + <%= render :partial => "users_authorization_list" %> +
      + <% end %> +
      \ No newline at end of file diff --git a/app/views/myshixuns/_myshixun_top.html.erb b/app/views/myshixuns/_myshixun_top.html.erb index e6920ac2a..765492e7e 100644 --- a/app/views/myshixuns/_myshixun_top.html.erb +++ b/app/views/myshixuns/_myshixun_top.html.erb @@ -1,5 +1,5 @@
      -

      <%= @myshixun.name %>

      +

      <%= @myshixun.shixun.try(:name) %>

      第<%= @game_challenge.position %>关
      diff --git a/config/routes.rb b/config/routes.rb index 4d36d401c..42b8396b6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -104,6 +104,9 @@ RedmineApp::Application.routes.draw do get 'reject_authentication' get 'agree_authentication' get 'users' + get 'users_trial' + match 'users_authorization_agree' + match 'users_authorization_cancel' end end # Enable Grack support From 1f04cd128574900e47eec297d9f84ad03fbc4a4d Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Jun 2017 17:39:29 +0800 Subject: [PATCH 014/110] =?UTF-8?q?=E4=BD=9C=E5=93=81=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 5 +- app/views/layouts/base_edu.html.erb | 2 +- .../student_work/_evaluation_work.html.erb | 10 +- app/views/student_work/show.html.erb | 23 ++-- public/javascripts/edu/course.js | 109 +++++++++++++++++- public/stylesheets/css/edu-class.css | 7 ++ 6 files changed, 139 insertions(+), 17 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 070107633..eeccff036 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -875,7 +875,10 @@ class StudentWorkController < ApplicationController @is_last = params[:is_last] == "true" @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? #老师、教辅可以随时评分,学生只能在匿评作业的匿评阶段进行评分 - render_403 and return unless @is_teacher || @homework.homework_detail_manual.comment_status == 2 + unless @is_teacher || @homework.homework_detail_manual.comment_status == 3 + render_403 + return + end @score = student_work_score @work,User.current #@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #@score.score = params[:score] if params[:score] diff --git a/app/views/layouts/base_edu.html.erb b/app/views/layouts/base_edu.html.erb index 32dc69186..95af1a10b 100644 --- a/app/views/layouts/base_edu.html.erb +++ b/app/views/layouts/base_edu.html.erb @@ -10,7 +10,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/structure','css/edu-common', 'css/edu-public','css/taskstyle', 'css/font-awesome', 'css/edu-class', 'css/edu-popup', 'css/ketang', 'css/magic-check', "css/edu-admin", "bootstrap/bootstrap-min.css" %> - <%= javascript_include_tag "edu/application",'edu/base_edu','baiduTemplate','jquery.datetimepicker.js' %> + <%= javascript_include_tag "edu/application",'edu/base_edu','baiduTemplate','jquery.datetimepicker.js','edu/course' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 063de0caf..9ea2d97e3 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -8,19 +8,19 @@ <% end %> <% if is_my_work%> - + <%= index + 1 %> <%= student_work.user.show_name%> - <%= student_work.updated_at %> + <%= format_time student_work.updated_at %> - <%= student_work.student_score.nil? ? '--' : format("%.1f",student_work.student_score) %>((<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)) + <%= student_work.student_score.nil? ? '--' : format("%.1f",student_work.student_score)+"((#{student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count}))" %> <%= link_to '查看', student_work_path(student_work), :class => 'link-color-blue' %> <% else%> - + <%= index + 1 %> 匿名 - <%= student_work.updated_at %> + <%= format_time student_work.updated_at %> <% my_score = student_work_score(student_work,User.current,3) %> <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> diff --git a/app/views/student_work/show.html.erb b/app/views/student_work/show.html.erb index 08b6091c3..ec385e8b1 100644 --- a/app/views/student_work/show.html.erb +++ b/app/views/student_work/show.html.erb @@ -170,7 +170,7 @@
      - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current ) %> + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 3 && @work.user != User.current ) %> <%= form_for('new_form', :remote => true, :method => :post, :url => add_score_student_work_path(@work.id),:id=>'add_score_'+@work.id.to_s) do |f| %>
      全部评阅<%= @student_work_scores.count %>
      @@ -179,26 +179,28 @@
      - +
      • <%= f.text_area 'user_message', :class => 'edu-reply-teat panel-box-sizing fl', :id => 'score_comment_'+@work.id.to_s, :placeholder => "录入你对本作品的评语,最多1000个字符", :maxlength => 1000 %> +
        +
      • <% is_member_work = (@work.homework_common.homework_type == 3 && @work.student_work_projects.empty?) %> <% if @is_teacher && @work.homework_common.homework_type == 3 && !is_member_work %>
      • - + 组员同评(选中,则本次评阅对象指小组全部成员;否则,仅指此成员1人)
      • <% end %>
      • - - + + - - + +
      • @@ -229,14 +231,17 @@ .CodeMirror{border: 1px solid #eee;} \ No newline at end of file diff --git a/app/views/management/identity_authentication.js.erb b/app/views/management/identity_authentication.js.erb deleted file mode 100644 index a8bd6caf8..000000000 --- a/app/views/management/identity_authentication.js.erb +++ /dev/null @@ -1,30 +0,0 @@ -var nTabIcon_1 = $("#edu-tab-con-1"); -var nTabIcon_2 = $("#edu-tab-con-2"); -var nTabNav_1 = $("#edu-tab-nav-1"); -var nTabNav_2 = $("#edu-tab-nav-2"); -var nAudit = $("#audit_all_authentication").parent(); - -<% if params[:type] == "0" %> -$("#authentication_list").html("<%= j( render :partial => "admin/authentication_list" ) %>"); -nTabNav_1.addClass("edu-tab-hover"); -nTabNav_2.removeClass("edu-tab-hover"); -nTabIcon_1.show(); -nTabIcon_2.hide(); -<% else %> -$("#audit_authentication_list").html("<%= j( render :partial => "admin/audit_authentication_list" ) %>"); -nTabNav_1.removeClass("edu-tab-hover"); -nTabNav_2.addClass("edu-tab-hover"); -nTabIcon_1.hide(); -nTabIcon_2.show(); -/* -------------------------- 未审批(全部、同意、拒绝点击时动态样式) ------------------------------ */ -if(<%= params[:type] == "1" %>){ - nAudit.find(".active").removeClass("active"); - $("#audit_agree_authentication").addClass("active"); -}else if(<%= params[:type] == "2" %>){ - nAudit.find(".active").removeClass("active"); - $("#audit_reject_authentication").addClass("active"); -}else{ - nAudit.find(".active").removeClass("active"); - $("#audit_all_authentication").addClass("active"); -} -<% end %> \ No newline at end of file diff --git a/app/views/management/trial_authorization.html.erb b/app/views/management/trial_authorization.html.erb deleted file mode 100644 index ebf3df89e..000000000 --- a/app/views/management/trial_authorization.html.erb +++ /dev/null @@ -1,135 +0,0 @@ -
        -
        -

        身份认证

        -
        -
        -
        -
          -
        • - <%= link_to "待审批", {:controller => "management", :action => "trial_authorization", :status => 0}, :class => "tab_type", :remote => true %> - -
        • -
        • - <%= link_to "已审批", {:controller => "management", :action => "trial_authorization", :status => 2}, :class => "tab_type", :remote => true %> - -
        • -
        -
        -
        -
        -
        - - -
        -
        -
        - <%= render :partial => "management/trial_authorization_list" %> -
        -
        -
        - -
        -
        -

        - 全部 - 同意 - 拒绝 -

        -
        - - -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        - \ No newline at end of file diff --git a/app/views/management/trial_authorization.js.erb b/app/views/management/trial_authorization.js.erb deleted file mode 100644 index 2e45bdee2..000000000 --- a/app/views/management/trial_authorization.js.erb +++ /dev/null @@ -1,30 +0,0 @@ -var nTabIcon_1 = $("#edu-tab-con-1"); -var nTabIcon_2 = $("#edu-tab-con-2"); -var nTabNav_1 = $("#edu-tab-nav-1"); -var nTabNav_2 = $("#edu-tab-nav-2"); -var nAudit = $("#audit_all_authentication").parent(); - -<% if @status == 0 %> -$("#authentication_list").html("<%= j( render :partial => "management/trial_authorization_list" ) %>"); -nTabNav_1.addClass("edu-tab-hover"); -nTabNav_2.removeClass("edu-tab-hover"); -nTabIcon_1.show(); -nTabIcon_2.hide(); -<% else %> -$("#audit_authentication_list").html("<%= j( render :partial => "management/trial_authorization_list" ) %>"); -nTabNav_1.removeClass("edu-tab-hover"); -nTabNav_2.addClass("edu-tab-hover"); -nTabIcon_1.hide(); -nTabIcon_2.show(); -/* -------------------------- 未审批(全部、同意、拒绝点击时动态样式) ------------------------------ */ -if(<%= @status == "1" %>){ - nAudit.find(".active").removeClass("active"); - $("#audit_agree_authentication").addClass("active"); -}else if(<%= @status == "2" %>){ - nAudit.find(".active").removeClass("active"); - $("#audit_reject_authentication").addClass("active"); -}else{ - nAudit.find(".active").removeClass("active"); - $("#audit_all_authentication").addClass("active"); -} -<% end %> \ No newline at end of file diff --git a/app/views/managements/_trial_authorization_list.html.erb b/app/views/managements/_trial_authorization_list.html.erb index d0895a333..c9f2a4f37 100644 --- a/app/views/managements/_trial_authorization_list.html.erb +++ b/app/views/managements/_trial_authorization_list.html.erb @@ -11,7 +11,7 @@ <%= user.try(:show_name) %> <%= time_from_now(authorization.updated_at) %> 拒绝 - 同意 + 同意
      • <% if !user.try(:user_extensions).school_id.blank? && user.try(:user_extensions).try(:school) %> diff --git a/app/views/managements/trial_authorization.html.erb b/app/views/managements/trial_authorization.html.erb index 8982c0249..ddd3e74c6 100644 --- a/app/views/managements/trial_authorization.html.erb +++ b/app/views/managements/trial_authorization.html.erb @@ -23,7 +23,7 @@
      - <%= render :partial => "management/trial_authorization_list"%> + <%= render :partial => "managements/trial_authorization_list"%>
      diff --git a/app/views/managements/trial_authorization.js.erb b/app/views/managements/trial_authorization.js.erb index d45efab75..5de72a691 100644 --- a/app/views/managements/trial_authorization.js.erb +++ b/app/views/managements/trial_authorization.js.erb @@ -5,7 +5,7 @@ var nTabNav_2 = $("#edu-tab-nav-2"); var nAudit = $("#audit_all_authentication").parent(); <% if @status == 0 %> -$("#authentication_list").html("<%= j( render :partial => "management/trial_authorization_list" ) %>"); +$("#authentication_list").html("<%= j( render :partial => "managements/trial_authorization_list" ) %>"); nTabNav_1.addClass("edu-tab-hover"); nTabNav_2.removeClass("edu-tab-hover"); nTabIcon_1.show(); diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index cb28f7e1a..8e59ece8a 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -249,14 +249,11 @@ <%= render :partial => "welcome/guidance_mask" %> <% elsif @auth %> <%= render :partial => 'welcome/two_btn_mask_pop', - :locals => { - :btn1 => "试用申请", - :btn2 => "身份认证", - :tip1 => "更多功能,需要经过管理员的授权审核", - :tip2 => "建议先提交身份认证,再进行试用申请", - :url1 => "javascript:void(0);", - :url2 => "#{authentication_account_path}" - } + :locals => {:btn1 => "试用申请", :btn2 => "身份认证", + :tip1 => "更多功能,需要经过管理员的授权审核", + :tip2 => "建议先提交身份认证,再进行试用申请", + :url1 => "javascript:void(0);", + :url2 => "#{authentication_account_path}"} %> <% end %> \ No newline at end of file diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 8c0c8ba8d..64e8f5235 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,5 +1,5 @@ -<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint" %> -<%= stylesheet_link_tag "/codemirror/lib/codemirror" %> +<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %> +<%= stylesheet_link_tag "/codemirror/lib/codemirror"%> <%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %> <%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js', '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%> diff --git a/app/views/shixuns/autocompletion.html.erb b/app/views/shixuns/autocompletion.html.erb index 80dedc144..8f09a6605 100644 --- a/app/views/shixuns/autocompletion.html.erb +++ b/app/views/shixuns/autocompletion.html.erb @@ -1,5 +1,11 @@ -<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint" %> -<%= stylesheet_link_tag "/codemirror/lib/codemirror", "/codemirror/addon/hint/show-hint", "/codemirror/doc/docs" %> +<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %> +<%= stylesheet_link_tag "/codemirror/lib/codemirror", "/codemirror/addon/hint/show-hint", "/codemirror/doc/docs", "/codemirror/addon/lint/lint" %> +
    - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/homework_common/_show_late_setting.html.erb b/app/views/homework_common/_show_late_setting.html.erb index 0f1bcf206..1ec839248 100644 --- a/app/views/homework_common/_show_late_setting.html.erb +++ b/app/views/homework_common/_show_late_setting.html.erb @@ -37,4 +37,18 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/homework_common/_show_public_setting.html.erb b/app/views/homework_common/_show_public_setting.html.erb index 693714e05..9d944cfe7 100644 --- a/app/views/homework_common/_show_public_setting.html.erb +++ b/app/views/homework_common/_show_public_setting.html.erb @@ -31,4 +31,17 @@ <% end %> - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/homework_common/_show_publish_setting.html.erb b/app/views/homework_common/_show_publish_setting.html.erb index 3d9cecc15..20fa0cf81 100644 --- a/app/views/homework_common/_show_publish_setting.html.erb +++ b/app/views/homework_common/_show_publish_setting.html.erb @@ -37,4 +37,52 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/homework_common/_show_score_setting.html.erb b/app/views/homework_common/_show_score_setting.html.erb index be39f3ac2..65784dd87 100644 --- a/app/views/homework_common/_show_score_setting.html.erb +++ b/app/views/homework_common/_show_score_setting.html.erb @@ -120,4 +120,12 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/homework_common/anon_setting.js.erb b/app/views/homework_common/anon_setting.js.erb index 40c18ca51..4d08101be 100644 --- a/app/views/homework_common/anon_setting.js.erb +++ b/app/views/homework_common/anon_setting.js.erb @@ -1,4 +1,23 @@ $("#show_anon_setting").html("<%= j(render :partial => 'show_anon_setting') %>").show(); $("#show_score_setting").html("<%= j(render :partial => 'show_score_setting') %>"); $("#edit_score_setting").html("<%= j(render :partial => 'edit_score_setting') %>"); -$("#edit_anon_setting").html("<%= j(render :partial => 'edit_anon_setting') %>").hide(); \ No newline at end of file +$("#edit_anon_setting").html("<%= j(render :partial => 'edit_anon_setting') %>").hide(); + +$("input[name='homework_evaluation_start']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false +}); +$("input[name='homework_evaluation_end']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false +}); +$("input[name='homework_appeal_time']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false +}); \ No newline at end of file diff --git a/app/views/homework_common/late_setting.js.erb b/app/views/homework_common/late_setting.js.erb index 54bfbca58..283e88183 100644 --- a/app/views/homework_common/late_setting.js.erb +++ b/app/views/homework_common/late_setting.js.erb @@ -1,2 +1,8 @@ $("#show_late_setting").html("<%= j(render :partial => 'show_late_setting') %>").show(); -$("#edit_late_setting").html("<%= j(render :partial => 'edit_late_setting') %>").hide(); \ No newline at end of file +$("#edit_late_setting").html("<%= j(render :partial => 'edit_late_setting') %>").hide(); +$("input[name='homework_late_time']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false +}); \ No newline at end of file diff --git a/app/views/homework_common/publish_setting.js.erb b/app/views/homework_common/publish_setting.js.erb index d135fa68b..36290611b 100644 --- a/app/views/homework_common/publish_setting.js.erb +++ b/app/views/homework_common/publish_setting.js.erb @@ -5,4 +5,44 @@ $("#homework_late_setting").html('
    <%= j(render :part $("#homework_anon_setting").html('
    <%= j(render :partial => 'show_anon_setting') %>
    <%= j(render :partial => 'edit_anon_setting') %>
    '); $("#homework_score_setting").html('
    <%= j(render :partial => 'show_score_setting') %>
    <%= j(render :partial => 'edit_score_setting') %>
    '); $("#homework_public_setting").html('
    <%= j(render :partial => 'show_public_setting') %>
    <%= j(render :partial => 'edit_public_setting') %>
    '); -<% end %> \ No newline at end of file +<% end %> +$("input[name='homework_publish_time']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false, + onSelectDate:function() { + $("#reset_publish_time").show(); + if($.trim($("input[name='homework_archive_time']").val()) == ""){ + var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/"))); + $("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1)))); + } + }, + onSelectTime:function() { + $("#reset_publish_time").show(); + if($.trim($("input[name='homework_archive_time']").val()) == ""){ + var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/"))); + $("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1)))); + } + } +}); + +$("input[name='homework_end_time']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false, + onSelectDate:function() { + $("#reset_end_time").show(); + }, + onSelectTime:function() { + $("#reset_end_time").show(); + } +}); + +$("input[name='homework_archive_time']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false +}); \ No newline at end of file diff --git a/app/views/homework_common/setting.html.erb b/app/views/homework_common/setting.html.erb index 30343a4ac..fb4d1467b 100644 --- a/app/views/homework_common/setting.html.erb +++ b/app/views/homework_common/setting.html.erb @@ -120,97 +120,4 @@
    <% end %> - - - - \ No newline at end of file + \ No newline at end of file diff --git a/public/javascripts/edu/base_edu.js b/public/javascripts/edu/base_edu.js index b7e092e31..8772554e1 100644 --- a/public/javascripts/edu/base_edu.js +++ b/public/javascripts/edu/base_edu.js @@ -194,7 +194,7 @@ $(function(){ result = false; } } - if($.trim($("input[name='homework_end_time']").val()) != ""){ + if($("input[name='homework_end_time']").prop("disabled")==false && $.trim($("input[name='homework_end_time']").val()) != ""){ if($.trim($("input[name='homework_publish_time']").val()) == ""){ $("#homework_publish_time").val(formate_time(myDate)); } From 607a3ad65c9655f89839d4569eee0bc976bfcf1a Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 13:58:58 +0800 Subject: [PATCH 020/110] =?UTF-8?q?=E4=BD=9C=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=BF=9B=E8=A1=8C=E8=AF=84=E9=98=85=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E8=AF=84=E9=98=85=E4=BA=86=E4=B8=80=E6=9D=A1=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E5=85=A8=E9=83=A8=E8=AF=84=E9=98=85=E5=8D=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA3=E6=9D=A1=EF=BC=8C=E6=95=B0=E7=9B=AE=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index eeccff036..aeefba540 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -713,7 +713,7 @@ class StudentWorkController < ApplicationController @score = student_work_score @work,User.current @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - if @homework.homework_detail_manual.comment_status == 2 && !@is_teacher && @work.user != User.current + if @homework.homework_detail_manual.comment_status == 3 && !@is_teacher && @work.user != User.current @student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") else @student_work_scores = student_work_score_record(@work) @@ -970,8 +970,12 @@ class StudentWorkController < ApplicationController update_org_activity(@homework.class,@homework.id) if @work.save @work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => @work.id).first - @count = @homework.student_works.has_committed.count - @student_work_scores = student_work_score_record @work + if @homework.homework_detail_manual.comment_status == 3 && !@is_teacher && @work.user != User.current + @student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") + else + @student_work_scores = student_work_score_record(@work) + end + @count = @student_work_scores.count respond_to do |format| format.js end From a34bf6bba70603881330fc1abc8c187633a13c2f Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 14:09:59 +0800 Subject: [PATCH 021/110] =?UTF-8?q?=E4=BB=8E=E4=BD=9C=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E7=82=B9=E5=87=BB=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E5=BA=94=E8=AF=A5=E6=98=AF=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=EF=BC=8C=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/show.html.erb b/app/views/student_work/show.html.erb index ec385e8b1..01a78d38f 100644 --- a/app/views/student_work/show.html.erb +++ b/app/views/student_work/show.html.erb @@ -6,7 +6,7 @@ #<%= link_to (get_hw_index(@homework, @is_teacher) + 1), student_work_index_path(:homework => @homework.id) %> > <%= link_to @work.user.try(:show_name), user_path(@work.user) %>

    <%= @work.name %>

    - 返回 + 返回
    <%# work_status :0 未提交 1 已提交 2 迟交 3 分组作品复制的组员作品 %> <%# homework_type: 0:普通作业;1:匿评作业;2:编程作业;3:分组作业; %> From 53c355d0e99efc3fe59f40e9007680a1fb0a0765 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 14:38:04 +0800 Subject: [PATCH 022/110] =?UTF-8?q?=E7=94=B3=E8=AF=89=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E4=B8=8D=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=99=A4=E8=87=AA=E5=B7=B1=E4=B9=8B=E5=A4=96?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=AD=A6=E7=94=9F=E7=9A=84=E5=A7=93=E5=90=8D?= =?UTF-8?q?=E5=92=8C=E5=AD=A6=E5=8F=B7=EF=BC=8C=E5=92=8C=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E6=97=B6=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 4 ++-- app/views/student_work/_evaluation_work.html.erb | 2 +- lib/tasks/homework_evaluation.rake | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index aeefba540..de80537a1 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -363,7 +363,7 @@ class StudentWorkController < ApplicationController @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now).order("created_at desc") @all_homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 3 && !@is_teacher #是不是匿评 + @is_evaluation = @homework.homework_detail_manual && (@homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4) && !@is_teacher #是不是匿评 @show_all = false # 0表示没有分组的学生,-1表示所有分组的学生 @@ -713,7 +713,7 @@ class StudentWorkController < ApplicationController @score = student_work_score @work,User.current @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - if @homework.homework_detail_manual.comment_status == 3 && !@is_teacher && @work.user != User.current + if (@homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4) && !@is_teacher && @work.user != User.current @student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") else @student_work_scores = student_work_score_record(@work) diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 9ea2d97e3..2948f05a2 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -26,7 +26,7 @@ <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> - <%= link_to '评阅', student_work_path(student_work), :class => 'link-color-blue' %> + <%= link_to @homework.homework_detail_manual.comment_status == 3 ? '评阅' : '查看', student_work_path(student_work), :class => 'link-color-blue' %> <% end%> diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake index cb817c61d..15e8cd6d6 100644 --- a/lib/tasks/homework_evaluation.rake +++ b/lib/tasks/homework_evaluation.rake @@ -14,7 +14,11 @@ namespace :homework_evaluation do homework_detail_manuals.each do |homework_detail_manual| homework_common = homework_detail_manual.homework_common if homework_common.anonymous_comment == 0 #新建状态才可开启匿评 - student_works = homework_common.student_works.has_committed + if homework_common.homework_type == 3 + student_works = homework_common.student_works.where(:id => homework_common.student_work_projects.where(:is_leader => 1).map(&:student_work_id)) + else + student_works = homework_common.student_works.has_committed + end if student_works && student_works.size >= 2 if homework_common.homework_type == 3 student_work_projects = homework_common.student_work_projects.where("student_work_id is not null") From a86d2bf7feaa4880514942eb89398a12d35578aa Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 15:21:05 +0800 Subject: [PATCH 023/110] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=99=A4=E4=BA=86=E6=8F=90=E4=BA=A4=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=9A=84=E5=8F=AF=E4=BB=A5=E5=AF=BC=E5=87=BA=E4=BD=9C?= =?UTF-8?q?=E5=93=81=EF=BC=8C=E5=85=B6=E4=BB=96=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=AF=BC=E5=87=BA=E4=BD=9C=E5=93=81=E6=97=A0?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contestant_works/index.html.erb | 2 +- app/views/homework_common/_homework_index_list.html.erb | 8 +++++--- app/views/student_work/_student_work_list.html.erb | 6 +++--- app/views/users/_homework_base_info.html.erb | 2 +- public/javascripts/application.js | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/views/contestant_works/index.html.erb b/app/views/contestant_works/index.html.erb index 375cdca4a..b3ddcb904 100644 --- a/app/views/contestant_works/index.html.erb +++ b/app/views/contestant_works/index.html.erb @@ -86,7 +86,7 @@ <%#= link_to "导出作业附件", "javascript:void(0)", class: "hworkExport resourcesGrey", :onclick => "alert('没有学生提交作业,无法下载附件')" %> <% else%> <%= link_to "导出作业附件", zipdown_assort_path(obj_class: @contestwork.class, obj_id: @contestwork, format: :json), - remote: true, class: "hworkExport resourcesGrey", :id => "download_homework_attachments" %> + remote: true, class: "hworkExport resourcesGrey download_homework_attachments" %> <% end%> diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb index 2bb0e6dd9..3408252cb 100644 --- a/app/views/homework_common/_homework_index_list.html.erb +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -1,7 +1,7 @@ <% if homework_commons.count != 0 %> <% homework_commons.each_with_index do |homework_common, index|%> -
    -
    +
    +
    <% homework_curr_status = homework_curr_time(homework_common) %> <%= link_to homework_common.name.to_s, student_work_index_path(:homework => homework_common.id,:host=> Setting.host_course), :class => "edu-class-inner-list fl"%> <%= homework_curr_status[:status] %> @@ -49,13 +49,15 @@ <%= link_to "设置", setting_homework_common_path(homework_common) %>
  • <%= link_to "导出成绩", student_work_index_path(:homework => homework_common, :format => 'xls'), :id => "export_student_work" %>
  • + <% if homework_common.homework_type == 1 || homework_common.homework_type == 3 %>
  • <% if homework_common.student_works.has_committed.empty?%> 导出作品附件 <% else%> - <%= link_to "导出作品附件", zipdown_assort_path(obj_class: homework_common.class,obj_id: homework_common.id, format: :json), remote: true, :id => "download_homework_attachments" %> + <%= link_to "导出作品附件", zipdown_assort_path(obj_class: homework_common.class,obj_id: homework_common, format: :json), remote: true, :class => "download_homework_attachments" %> <% end%>
  • + <% end %> <% unless homework_common.is_public %>
  • 设为公开 diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index f6fd24476..9e2a286df 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -8,10 +8,10 @@ <%= link_to "导出成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :comment => @comment, :status => @status, :format => 'xls'),:class=>'fl mr5', :id => "export_student_work"%> <% if @homework.homework_type == 1 || @homework.homework_type == 3 %> <% if @stundet_works.empty?%> - <%= link_to "导出作业附件", "javascript:void(0)", class: "fl mr5", :onclick => "notice_box('该检索条件下没有作品,无法下载附件')" %> + <%= link_to "导出作品附件", "javascript:void(0)", class: "fl mr5", :onclick => "notice_box('该检索条件下没有作品,无法下载附件')" %> <% else%> - <%= link_to "导出作业附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), - remote: true, class: "fl mr5", :id => "download_homework_attachments" %> + <%= link_to "导出作品附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), + remote: true, class: "fl mr5 download_homework_attachments" %> <% end%> <% end %>
  • diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index a157c4e5c..f7b6ef7d0 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -102,7 +102,7 @@ <% if activity.student_works.has_committed.empty?%> 导出作品附件 <% else%> - <%= link_to "导出作品附件", zipdown_assort_path(obj_class: activity.class,obj_id: activity.id, format: :json), remote: true, :id => "download_homework_attachments", :class => "wpostOptionLink" %> + <%= link_to "导出作品附件", zipdown_assort_path(obj_class: activity.class,obj_id: activity.id, format: :json), remote: true, :class => "wpostOptionLink download_homework_attachments" %> <% end%> <% unless activity.is_public %> diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 51399237b..320f8626b 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1029,7 +1029,7 @@ $(function(){ } } }); - $('#download_homework_attachments').bind('ajax:complete', function (event, data, status, xhr) { + $('.download_homework_attachments').bind('ajax:complete', function (event, data, status, xhr) { if(status == 'success'){ var res = JSON.parse(data.responseText); From 9d11db6869263fea88ec2186ae26bb517428ba05 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 15:27:35 +0800 Subject: [PATCH 024/110] =?UTF-8?q?=E5=9C=A8=E4=BD=9C=E4=B8=9A=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=88=AA=E6=AD=A2=E5=89=8D=E8=BF=9B=E8=A1=8C=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=EF=BC=8C=E5=8C=BF=E8=AF=84=E6=97=B6=E5=8D=B4=E7=BB=99?= =?UTF-8?q?=E5=87=BA=E4=BD=9C=E4=B8=9A=E5=9C=A8=E5=8C=BF=E8=AF=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=BC=80=E5=90=AF=E5=90=8E=E6=89=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E6=89=80=E4=BB=A5=E4=B8=8D=E8=83=BD=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=EF=BC=8C=E8=AF=B7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_work.html.erb | 2 +- app/views/student_work/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 2948f05a2..83da78e18 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -12,7 +12,7 @@ <%= student_work.user.show_name%> <%= format_time student_work.updated_at %> - <%= student_work.student_score.nil? ? '--' : format("%.1f",student_work.student_score)+"((#{student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count}))" %> + <%= student_work.student_score.nil? ? '--' : format("%.1f",student_work.student_score)+"(#{student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count})" %> <%= link_to '查看', student_work_path(student_work), :class => 'link-color-blue' %> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 63e40c1ff..bf4d43dd6 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -243,7 +243,7 @@ <% my_work = cur_user_works_for_homework @homework %> <% if @homework.homework_detail_manual.comment_status == 3 %> <% unless my_work.nil?%> - <% if my_work.student_works_evaluation_distributions.count == 0 %> + <% if my_work.student_works_evaluation_distributions.count != 0 %> 你在匿评开启之前提交了作品,你的作品正在匿评中 <% else %> 你在匿评开启之后才提交作品,你的作品没有参与匿评 From 6853bdfba1db197e2ee73d59257ce6649794be98 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 15:34:16 +0800 Subject: [PATCH 025/110] =?UTF-8?q?=E3=80=90=E7=BC=BA=E9=99=B7=E3=80=91?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=A4=B4=E9=83=A8=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E5=9B=BE=E7=89=87=EF=BC=8C=E8=AF=B7=E8=B0=83=E6=95=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/syllabuses/show.html.erb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/syllabuses/show.html.erb b/app/views/syllabuses/show.html.erb index 8043d018c..72491492c 100644 --- a/app/views/syllabuses/show.html.erb +++ b/app/views/syllabuses/show.html.erb @@ -20,14 +20,13 @@ <%= @syllabus.eng_name %>
  • + <%= @syllabus.user.user_extensions.school.blank? ? '' : @syllabus.user.user_extensions.school.name %> <% if @syllabus.major_level %> - - <%= @syllabus.syllabus_major_level %> - <%= @syllabus.syllabus_discipline_category %> - <%= @syllabus.syllabus_first_level_discipline %> + <%= @syllabus.syllabus_major_level %> + <%= @syllabus.syllabus_discipline_category %> + <%= @syllabus.syllabus_first_level_discipline %> <% end %> - <%= @syllabus.user.user_extensions.school.blank? ? '' : @syllabus.user.user_extensions.school.name %> - <%= @syllabus.syllabus_type_str %>
  • + <%= @syllabus.syllabus_type_str %>
  • <% if params[:action] == "edit" && @challenge.test_sets.count > 0 %> diff --git a/app/views/games/_file_edit_form.html.erb b/app/views/games/_file_edit_form.html.erb index 57e77a9d0..5fc00dbfe 100644 --- a/app/views/games/_file_edit_form.html.erb +++ b/app/views/games/_file_edit_form.html.erb @@ -1,5 +1,6 @@
    @@ -139,6 +140,8 @@ $(".CodeMirror-code").children('div').eq(12).find(".CodeMirror-gutter-wrapper").append(html); } }*/ + console.log(__Token.string.indexOf("#") > -1); + console.log(__Token); if (!editor.state.completionActive && !ExcludedIntelliSenseTriggerKeys[(event.keyCode || event.which).toString()]) { @@ -157,7 +160,13 @@ } }else if(__Token.string.match(/^[\u4e00-\u9fa5]+$/)){ return; // 输入的是中文,也不启动自动补全功能 + }else if(event.shiftKey && event.keyCode == 51){ + return; + }else if(__Token.string.indexOf("#") > -1){ + return; } + console.log("####################################"); + console.log(event.keyCode); CodeMirror.commands.autocomplete(editor, null, { completeSingle: false }); // 开启自动补全 } }); @@ -178,7 +187,7 @@ editor_CodeMirror.setGutterMarker(12, "breakpoints", info.gutterMarkers ? null : makeMarker()); function makeMarker() { var marker = document.createElement("div"); - marker.style.color = "#822"; + marker.style.color = "#fff"; marker.innerHTML = ""; return marker; } diff --git a/db/migrate/20170609061623_add_code_line_to_challenges.rb b/db/migrate/20170609061623_add_code_line_to_challenges.rb new file mode 100644 index 000000000..cbb28c553 --- /dev/null +++ b/db/migrate/20170609061623_add_code_line_to_challenges.rb @@ -0,0 +1,5 @@ +class AddCodeLineToChallenges < ActiveRecord::Migration + def change + add_column :challenges, :code_line, :integer + end +end diff --git a/public/stylesheets/css/edu-user.css b/public/stylesheets/css/edu-user.css index c97628bb4..69c82ff19 100644 --- a/public/stylesheets/css/edu-user.css +++ b/public/stylesheets/css/edu-user.css @@ -134,7 +134,7 @@ transition:all .5s ease-in .1s; } /*-------------------侧边提示区域--------------------------*/ -.-task-sidebar{position:fixed;width:35px;height:20%;right:5%;bottom:5%;z-index: 10;} +.-task-sidebar{position:fixed;width:35px;height:20%;right:0;bottom:1%;z-index: 10;} .-task-sidebar div{width:35px;height:28px;margin-bottom:3px;background:cornflowerblue;color:#fff;font-size:20px;text-align:center;padding-top:7px;} .-task-sidebar div:hover {background:#ccc;} .-task-desc{background:#494949;width:90px;line-height: 35px;text-align: center; diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 6012ffec7..31a7fb28a 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -93,6 +93,7 @@ a.task-header-name{ max-width:200px;} .panel-form input,.panel-form textarea{ border:1px solid #e2e2e2;color:#666;line-height: 1.9;} .panel-box-sizing{-moz-box-sizing: border-box; /*Firefox3.5+*/-webkit-box-sizing: border-box; /*Safari3.2+*/-o-box-sizing: border-box; /*Opera9.6*/-ms-box-sizing: border-box; /*IE8*/box-sizing: border-box; } input.panel-form-width-690{ padding:5px;width:90%; height:40px; min-width:700px;} +input.panel-form-width-200{ padding:5px; height:40px; width:200px;} input.panel-form-width-100{ padding:5px;width:100%; height:40px; min-width:700px;} textarea.panel-form-width-100{ padding:5px;width:100%; height:150px; min-width:700px;} textarea.panel-form-width-40{ padding:5px;width:100%; height: 40px; min-width:700px;} From 809a580cca79fc1d15c2295a89203b9641faa3df Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 16:17:31 +0800 Subject: [PATCH 027/110] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- app/controllers/users_controller.rb | 22 ++++-- app/views/users/shixuns.html.erb | 88 +++++++++++++++++++++++ app/views/users/user_shixuns.html.erb | 5 -- config/routes.rb | 2 +- public/stylesheets/css/edu-class.css | 20 ++++++ 6 files changed, 128 insertions(+), 11 deletions(-) create mode 100644 app/views/users/shixuns.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7df2cd1de..0ee869c4d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -65,7 +65,7 @@ class ApplicationController < ActionController::Base return true # if User.current.logged? # uthentication = AuthenticationsUsers.where(:user_id => User.current.id).first - # user_account = User.current.user_extensions.try(:occupation) + # user_account = User.current.try(:user_extensions).try(:occupation) # if uthentication.blank? || user_account.blank? # redirect_to my_account_path # return diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 54dd8c081..3b9ac6c69 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -43,7 +43,7 @@ class UsersController < ApplicationController :user_courses4show,:user_projects4show,:user_contests4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction, :user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list, :sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community, :contest_community, - :user_shixuns] + :shixuns] before_filter :auth_user_extension, only: :show before_filter :show_system_message, :only => [:show] #before_filter :rest_user_score, only: :show @@ -654,10 +654,24 @@ class UsersController < ApplicationController end # 我发布的实训 - def shixuns_zone - @shixuns = Shixun.where(:user_id => User.current) + def shixuns + type = params[:type] + # 我发布的 + @shixuns = Shixun.where(:user_id => @user.id) + @shixuns_count = @shixuns.count + @limit = 10 + @shixun_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1 + @offset ||= @shixun_pages.offset + @shixuns = paginateHelper @shixuns, @limit + + # 我参入的 + @join_shixuns = Shixun.find_by_sql("select * from shixuns where id in (select id from shixun_members where role =2 and user_id = #{@user.id})") + # @join_shixuns_count = @join_shixuns.count + # @join_shixuns_pages = Paginator.new @join_shixuns_count, @limit, params['page'] || 1 + # @join_shixuns_offset ||= @join_shixuns_pages.offset + # @join_shixuns = paginateHelper @join_shixuns, @limit respond_to do |format| - format.html{render :layout=>'base_users_new'} + format.html{render :layout=> 'base_edu'} end end diff --git a/app/views/users/shixuns.html.erb b/app/views/users/shixuns.html.erb new file mode 100644 index 000000000..19d1ed6eb --- /dev/null +++ b/app/views/users/shixuns.html.erb @@ -0,0 +1,88 @@ +
    +

    <%= @user.show_name %> > + 项目实训 > 我的实训

    +
    +
    +
    + +
    +
    +
    + <% if @shixuns.blank? %> + <%= render :partial => "welcome/no_data" %> + <% else %> + <% @shixuns.each do |shixun| %> +
    +
    + <%= shixun.name %> +
    +

    + <%= shixun.language %> + <%= shixun.authentication == 1 ? "已审核" : "未审核" %> + <%= shixun.challenges.count %> 任务 + <%= shixun.myshixuns.count %>人挑战 + <%= format_time(shixun.updated_at) %> 更新 +

    +
    + 查看详情 +
    + <% end %> + <% end %> +
    +
    +
    +
      + <%= pagination_links_full @shixun_pages, @shixuns_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %> +
    +
    +
    +
    +
    +
    +
    +
    + <% if @join_shixuns.blank? %> + <%= render :partial => "welcome/no_data" %> + <% else %> + <% @join_shixuns.each do |shixun| %> +
    +
    + <%= shixun.name %> +
    +

    + <%= shixun.language %> + <%= had_passed_changllenge_count shixun %> / <%= shixun.challenges.count %> 任务完成 + + <%= format_time(shixun.updated_at) %> 开启 +

    +
    + 查看详情 +
    + <% end %> + + <% end %> +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/app/views/users/user_shixuns.html.erb b/app/views/users/user_shixuns.html.erb index 70b0e5db1..e69de29bb 100644 --- a/app/views/users/user_shixuns.html.erb +++ b/app/views/users/user_shixuns.html.erb @@ -1,5 +0,0 @@ -
      - <% @shixuns.each do |shixun| %> -
    • <%= shixun.name %>
    • - <% end %> -
    \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 42b8396b6..dc479cba5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -808,7 +808,7 @@ RedmineApp::Application.routes.draw do end member do - get 'user_shixuns', :to => 'users#user_shixuns' + get 'shixuns', :to => 'users#shixuns' get 'user_myshixuns', :to => 'users#user_myshixuns' match 'user_projects_index', :to => 'users#user_projects_index', :via => :get match 'user_projects', :to => 'users#user_projects', :via => :get diff --git a/public/stylesheets/css/edu-class.css b/public/stylesheets/css/edu-class.css index 0a918398b..1b906989a 100644 --- a/public/stylesheets/css/edu-class.css +++ b/public/stylesheets/css/edu-class.css @@ -329,3 +329,23 @@ a:hover.edu-class-inner-list{color:#3498db;} .edu-bg-blue{ background:#f7f9fd} .padding10{ padding:10px;} .padding15{ padding:15px;} + +/* 我的实训我的课堂 20170608byLB */ +.edu-class-inner-max a.edu-class-inner-list{ max-width:84%;} +.edu-class-list-inner a.edu-class-inner-list{max-width:80%;} +.edu-class-inner-max .task-form-90{ width: 92%;} +.edu-class-list-inner .task-form-90{width: 91%;} +/* new tab */ +#edu-tab-nav li {width: 150px; } +.edu-tab{ width: 100%; background:#fff; } +#edu-tab-nav{height:47px;background: #fff; border-bottom:2px solid #5faee3;} +#edu-tab-nav li.new-tab-nav {float:left; width: 150px; text-align:center;height:48px;line-height:48px; } +#edu-tab-nav li a{font-size:14px; } +.edu-new-tab-hover { background:#5faee3; } +.edu-new-tab-hover a{color:#fff!important;} +.edu-class-con-list:hover{ background:#fbfbfb;} +.edu-bg-shadow{ box-shadow: 0px 0px 5px rgba(146, 153, 169, 0.2);} +a.task-btn-line{display: inline-block;font-weight: bold;padding: 0 12px;color: #666;background: #fff;letter-spacing: 1px;text-align: center;font-size: 14px;height: 30px;line-height: 30px;border-radius: 3px; border:1px solid #ccc;} +a:hover.task-btn-line{ border:1px solid #3498db;background:#3498db;color: #fff;} + + From b1d859405ffadad1d98c8932c3c400be89055e66 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 16:37:18 +0800 Subject: [PATCH 028/110] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 2 +- app/views/users/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 09e8ddaac..39c888d67 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -37,7 +37,7 @@
  • <%= link_to '我的主页', user_path(User.current) %>
  • <%= link_to '我的课程', syllabuses_path() %>
  • -
  • <%= link_to '我的实训', shixuns_path %>
  • +
  • <%= link_to '我的实训', shixuns_user_path(User.current) %>
  • <%= link_to '我的留言', feedback_path(User.current, :host=> Setting.host_user) %>
  • <%= link_to '修改资料', my_account_path %>
  • diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 82c81b3ae..f58a167d8 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -227,7 +227,7 @@

    <% end %> <% if @shixuns_count > 8 %> - 点击查看全部 + 点击查看全部 <% end %>
  • From 650d8016a0ea6094af624d6da54f49871aad179e Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 16:51:32 +0800 Subject: [PATCH 029/110] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E6=97=B6=E9=80=89=E6=8B=A9=E8=BA=AB=E4=BB=BD=E4=B8=BA=E6=95=99?= =?UTF-8?q?=E5=B8=88=E6=88=96=E5=8A=A9=E6=95=99=EF=BC=8C=E6=95=99=E5=B8=88?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=B2=A1=E6=9C=89=E7=9B=B8=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=EF=BC=88=E6=96=B0=E5=BB=BA=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 12 +----------- app/controllers/users_controller.rb | 5 +---- app/views/courses/settings/_members.html.erb | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 50a7f4486..d01774024 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -851,17 +851,7 @@ class CoursesController < ApplicationController @teacher_count = @teachers.count @student_count = studentCount(@course) @no_group_count = @course.members.where(:course_group_id => 0).select{|m| m.roles.to_s.include?("Student")}.count - - @roles = Role.givable.all[3..5] - @members = @course.member_principals.includes(:roles, :principal).all.sort - - course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{@course.id}").map(&:organization_id) - if course_org_ids.empty? - @orgs_not_in_course = User.current.organizations - else - course_org_ids = "(" + course_org_ids.join(',') + ")" - @orgs_not_in_course = User.current.organizations.where("organizations.id not in #{course_org_ids}") - end + @apply_users = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0) course_module = @course.course_modules if course_module.blank? diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d24cc8af5..770c1c76f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -721,11 +721,8 @@ class UsersController < ApplicationController c = Course.find(@msg.course_id) cs.send_wechat_join_class_notice apply_user,c,7,1 end - - end - respond_to do |format| - format.js end + redirect_to settings_course_path(@msg.course_id, :tab => 'member') end # 处理资源引用请求 diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index ec20a7243..2dcdff721 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -41,6 +41,21 @@ <% end %> + <% @apply_users.each_with_index do |apply, index| %> + <% user = User.find(apply.course_message_id) %> + + <%= @teacher_count + index + 1 %> + + <%= link_to user.show_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %> + + <%= user.try(:login) %> + <%= apply.content && apply.content.include?('9') ? "教师" : "助教" %> + + <%= link_to '同意', dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>apply.id), :class=>'color-red mr5'%> + <%= link_to '拒绝', dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>apply.id), :class=>'color-red'%> + + + <% end %>
    From 180f131e2daf33e1068beae6f54453abaa72ef18 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 16:53:24 +0800 Subject: [PATCH 030/110] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dadmin=E4=B8=AD?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=93=BE=E6=8E=A5=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 25 ++++++++++------------- app/views/admin/shixuns.html.erb | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0ee869c4d..dcddaf20e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -62,20 +62,17 @@ class ApplicationController < ActionController::Base # 判断用户是否认证 def check_authentication - return true - # if User.current.logged? - # uthentication = AuthenticationsUsers.where(:user_id => User.current.id).first - # user_account = User.current.try(:user_extensions).try(:occupation) - # if uthentication.blank? || user_account.blank? - # redirect_to my_account_path - # return - # elsif User.current.authentications == 0 - # redirect_to authentication_account_path - # return - # end - # else - # redirect_to signin_path - # end + # return true + uthentication = AuthenticationsUsers.where(:user_id => User.current.id).first + user_account = User.current.try(:user_extensions).try(:occupation) + if uthentication.blank? || user_account.blank? + redirect_to my_account_path + return + elsif User.current.authentications == 0 + redirect_to authentication_account_path + return + end + end def session_expiration diff --git a/app/views/admin/shixuns.html.erb b/app/views/admin/shixuns.html.erb index 3bd5a84ee..513f2c705 100644 --- a/app/views/admin/shixuns.html.erb +++ b/app/views/admin/shixuns.html.erb @@ -32,7 +32,7 @@ - <%= link_to(shixun.name, shixun_path(shixun.id)) %> + <%= link_to(shixun.name, shixun_path(shixun)) %> From e3d61feb38c531e9503b7dc02ae8d9d01c6bb65d Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 16:58:36 +0800 Subject: [PATCH 031/110] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index dcddaf20e..e7b475671 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -62,17 +62,16 @@ class ApplicationController < ActionController::Base # 判断用户是否认证 def check_authentication - # return true - uthentication = AuthenticationsUsers.where(:user_id => User.current.id).first - user_account = User.current.try(:user_extensions).try(:occupation) - if uthentication.blank? || user_account.blank? - redirect_to my_account_path - return - elsif User.current.authentications == 0 - redirect_to authentication_account_path - return - end - + return true + # uthentication = AuthenticationsUsers.where(:user_id => User.current.id).first + # user_account = User.current.try(:user_extensions).try(:occupation) + # if uthentication.blank? || user_account.blank? + # redirect_to my_account_path + # return + # elsif User.current.authentications == 0 + # redirect_to authentication_account_path + # return + # end end def session_expiration From cf73698051f54f93b22959b06f3f274d279127e7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Jun 2017 17:24:49 +0800 Subject: [PATCH 032/110] =?UTF-8?q?=E5=AE=9E=E8=AE=ADTPI=E5=8F=82=E8=80=83?= =?UTF-8?q?=E7=AD=94=E6=A1=88=E4=B8=8E=E8=BF=87=E5=85=B3=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=9B=E8=A1=8C=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_file_edit_form.html.erb | 6 ++++-- app/views/games/_game_show.html.erb | 4 ++-- public/stylesheets/css/taskstyle.css | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/games/_file_edit_form.html.erb b/app/views/games/_file_edit_form.html.erb index 5fc00dbfe..d0b982356 100644 --- a/app/views/games/_file_edit_form.html.erb +++ b/app/views/games/_file_edit_form.html.erb @@ -164,6 +164,8 @@ return; }else if(__Token.string.indexOf("#") > -1){ return; + }else if(event.ctrlKey){ + return; } console.log("####################################"); console.log(event.keyCode); @@ -182,7 +184,7 @@ // 由于codemirror加载过慢,放在ready中的refresh失效,所以该在页面加载完成之后触发refresh函数 $(window).load(function() { editor_CodeMirror.refresh(); - editor_CodeMirror.setCursor(12, 0); +/* editor_CodeMirror.setCursor(12, 0); var info = editor_CodeMirror.lineInfo(12); editor_CodeMirror.setGutterMarker(12, "breakpoints", info.gutterMarkers ? null : makeMarker()); function makeMarker() { @@ -190,6 +192,6 @@ marker.style.color = "#fff"; marker.innerHTML = ""; return marker; - } + }*/ }); \ No newline at end of file diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index 720bad0cd..bf3c22ad7 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -28,7 +28,7 @@
    -
    +
    @@ -37,7 +37,7 @@
    -
    +
    diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 31a7fb28a..d64b70136 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -284,4 +284,6 @@ a.shixun-task-btn { display: inline-block; /* 合作者 20170516byLB */ .task-partner-list{ padding:15px; border-bottom:1px solid #eee;} -.task-width33{ width:33.3%;} \ No newline at end of file +.task-width33{ width:33.3%;} + +.read_only{ -moz-user-select: none; -webkit-user-select: none; } \ No newline at end of file From a2ef4c11796f5e235c02ee67553886dfaffd4ec6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Jun 2017 17:30:25 +0800 Subject: [PATCH 033/110] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=A1=B6=E9=83=A8=E5=B8=AE=E5=8A=A9=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=9C=80=E8=A6=81=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/bigdate.iml | 6 ------ app/views/layouts/_logined_header.html.erb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.idea/bigdate.iml b/.idea/bigdate.iml index d42b3ba90..c89710e36 100644 --- a/.idea/bigdate.iml +++ b/.idea/bigdate.iml @@ -198,7 +198,6 @@ - @@ -259,11 +258,6 @@ - - - - - diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 39c888d67..3ad3d5775 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -21,7 +21,7 @@
  • <%= link_to "智能课堂", courses_path, :class => "new-nav-a", :target => "_blank" %>
  • <%= link_to "项目实训", shixuns_path, :class => "new-nav-a", :target => "_blank" %>
  • -
  • <%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "new-nav-a", :target=>"_blank" %>
  • +
    From 6d9d66d2d55a11d41782f6a64c0c79ab3669f254 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 18:09:31 +0800 Subject: [PATCH 034/110] =?UTF-8?q?=E5=9C=A8=E4=BD=9C=E4=B8=9A=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E4=B8=AD=E5=A4=9A=E5=B1=82=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E7=82=B9=E8=B5=9E=E5=9B=9E=E5=A4=8D=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=BA=94=E8=AF=A5=E9=9A=90=E8=97=8F=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=8A=A8=E4=B8=8A=E5=8E=BB?= =?UTF-8?q?=E6=97=B6=E6=89=8D=E5=87=BA=E7=8E=B0=EF=BC=8C=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E8=A7=81=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_homework_reply_detail.html.erb | 53 +++++++++++-------- .../_student_work_replies.html.erb | 2 +- public/stylesheets/css/edu-common.css | 1 + 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/app/views/student_work/_homework_reply_detail.html.erb b/app/views/student_work/_homework_reply_detail.html.erb index 54ca4c8f1..e0126ab41 100644 --- a/app/views/student_work/_homework_reply_detail.html.erb +++ b/app/views/student_work/_homework_reply_detail.html.erb @@ -7,29 +7,36 @@ autoUrl('reply_content_<%= comment.id %>'); }); -
    - <%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username hide fl" %> - <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> -
    - <%= comment.content_detail.html_safe %> +
    +
    + <%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username hide fl" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
    + <%= comment.content_detail.html_safe %> +
    + +
    +
    +
    +
    + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + + <%= link_to('回复'.html_safe, + {:controller => 'users', + :action => 'reply_to_comment', + :reply_id => comment.id, + :type => type, + :user_activity_id => user_activity_id, + :parent_id => parent_id}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> +
    +
    +
    +
    +

    -
    -

    - - <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - - <%= link_to('回复'.html_safe, - {:controller => 'users', - :action => 'reply_to_comment', - :reply_id => comment.id, - :type => type, - :user_activity_id => user_activity_id, - :parent_id => parent_id}, - :remote => true, - :method => 'get', - :title => l(:button_reply)) %> -

    -
    -

    \ No newline at end of file diff --git a/app/views/student_work/_student_work_replies.html.erb b/app/views/student_work/_student_work_replies.html.erb index cfb21818a..37c439ecb 100644 --- a/app/views/student_work/_student_work_replies.html.erb +++ b/app/views/student_work/_student_work_replies.html.erb @@ -64,7 +64,7 @@ <% end %>
    <% end %> -
    +
    <%= comment.content_detail.html_safe %>

    diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index bc7e7131e..6fe1ca742 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -77,6 +77,7 @@ a:hover.link-color-grey03{color:#3498db!important;} .pl5{ padding-left:5px;}.pl10{ padding-left:10px;}.pl15{ padding-left:15px;}.pl20{ padding-left:20px;} .pr5{ padding-right:5px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px;} .padding15{ padding:15px;} +.h24{ height: 24px;} /*块*/ From 519fdc3aff442ab38c11abe4693e33bede443d64 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Jun 2017 18:32:24 +0800 Subject: [PATCH 035/110] =?UTF-8?q?=E5=8F=AA=E8=83=BD=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=92=8C=E9=A1=B9=E7=9B=AE=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E6=94=BE=E5=A4=A7=E9=95=9C=E2=80=9C?= =?UTF-8?q?=C3=97=E2=80=9D=E6=8C=89=E9=92=AE=E5=BA=94=E8=AF=A5=E6=9C=89?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BE=93=E5=85=A5=E6=90=9C=E7=B4=A2=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/index.html.erb | 3 ++- app/views/shixuns/index.html.erb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index 4bf2f307c..f75e6088d 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -21,7 +21,7 @@ - +

    @@ -104,6 +104,7 @@ container.find('.search-input').val(''); // clear and hide result container when we press close container.find('.result-container').fadeOut(100, function(){$(this).empty();}); + $("#search_syllabuses_name").submit(); } } function submitFn(obj, evt){ diff --git a/app/views/shixuns/index.html.erb b/app/views/shixuns/index.html.erb index 4363f728f..fd4649c42 100644 --- a/app/views/shixuns/index.html.erb +++ b/app/views/shixuns/index.html.erb @@ -78,6 +78,7 @@ container.find('.search-input').val(''); // clear and hide result container when we press close container.find('.result-container').fadeOut(100, function(){$(this).empty();}); + $("#add_collaborators_form").submit(); } } From 2e666223eca5a426a1c152ef4543032e596b63fe Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Jun 2017 18:52:07 +0800 Subject: [PATCH 036/110] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=80=E8=AE=BE=E7=BD=AE=EF=BC=8C=E9=9D=9E?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=E7=9A=84checkbox=E4=BC=BC?= =?UTF-8?q?=E4=B9=8E=E5=8F=98=E5=B0=8F=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homework_common/_show_anon_setting.html.erb | 2 +- .../homework_common/_show_public_setting.html.erb | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/views/homework_common/_show_anon_setting.html.erb b/app/views/homework_common/_show_anon_setting.html.erb index 7a3085af4..45ee57f59 100644 --- a/app/views/homework_common/_show_anon_setting.html.erb +++ b/app/views/homework_common/_show_anon_setting.html.erb @@ -9,7 +9,7 @@
    • - > + >
    • - > + > (选中则在作业结束时间之后对班级学生公开所有作品,否则作品不公开)
    • <% end %>
    • - > + > (选中则在作业结束时间之后对班级学生公开作品成绩,否则成绩不公开)
    • <% if @homework.homework_type != 4 %>
    • - > + > (选中则在作业结束时间之后对班级学生公开作业答案,否则答案不公开)
    • From 4ebc4ce5aa50572ded45efcf513cab60d90e277b Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Jun 2017 19:03:23 +0800 Subject: [PATCH 037/110] =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA=E6=A5=BC?= =?UTF-8?q?=E5=B1=82=E4=B8=AD=E6=9C=89=E5=A5=BD=E5=87=A0=E4=B8=AA=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=EF=BC=8C=E7=82=B9=E5=87=BB=E8=AF=A5=E6=A5=BC=E5=B1=82?= =?UTF-8?q?=E4=B8=AD=E6=AF=8F=E4=B8=AA=E8=AF=84=E8=AE=BA=E4=B8=8B=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E9=83=BD=E5=BA=94=E8=AF=A5=E5=8F=AA=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E5=9B=9E=E5=A4=8D=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blog_comments/_blog_comment_show_replies.html.erb | 2 +- app/views/blog_comments/quote.js.erb | 7 ++++--- app/views/comments/quote.js.erb | 7 ++++--- app/views/courses/syllabus.html.erb | 2 +- app/views/memos/_memo_all_replies.html.erb | 2 +- app/views/memos/quote.js.erb | 7 ++++--- app/views/messages/_contest_show_replies.html.erb | 2 +- app/views/messages/_course_show_replies.html.erb | 2 +- app/views/messages/_org_show_replies.html.erb | 2 +- app/views/messages/_project_show_replies.html.erb | 2 +- app/views/messages/quote.js.erb | 11 ++++++----- app/views/news/_news_replies_detail.html.erb | 2 +- .../student_work/_homework_reply_detail.html.erb | 2 +- app/views/student_work/_student_work_replies.html.erb | 2 +- app/views/users/_comment_reply_detail.html.erb | 2 +- app/views/users/_message_replies.html.erb | 2 +- app/views/users/_news_replies.html.erb | 2 +- app/views/users/_reply_to.html.erb | 2 +- app/views/users/reply_to.js.erb | 9 +++++---- app/views/users/reply_to_comment.js.erb | 9 +++++---- 20 files changed, 42 insertions(+), 36 deletions(-) diff --git a/app/views/blog_comments/_blog_comment_show_replies.html.erb b/app/views/blog_comments/_blog_comment_show_replies.html.erb index 23cabb67d..1b2cc07b8 100644 --- a/app/views/blog_comments/_blog_comment_show_replies.html.erb +++ b/app/views/blog_comments/_blog_comment_show_replies.html.erb @@ -46,7 +46,7 @@
    -

    +
    <% end %>
    diff --git a/app/views/blog_comments/quote.js.erb b/app/views/blog_comments/quote.js.erb index 6d3264a22..958c32124 100644 --- a/app/views/blog_comments/quote.js.erb +++ b/app/views/blog_comments/quote.js.erb @@ -1,8 +1,9 @@ -if($("#reply_message_<%= @blogComment.id%>").length > 0) { +if($("#reply_message_<%= @blogComment.id%>").html() == "") { + $(".reply_to_message").html(""); $("#reply_message_<%= @blogComment.id%>").replaceWith("<%= escape_javascript(render :partial => 'blog_comments/simple_ke_reply_form', :locals => {:reply => @blogComment,:temp =>@temp,:course_id=>@course_id}) %>"); $(function(){ sd_create_editor_from_data(<%= @blogComment.id%>,null,"100%", "<%=@blogComment.class.to_s%>"); }); -}else if($("#reply_to_message_<%= @blogComment.id%>").length >0) { - $("#reply_to_message_<%= @blogComment.id%>").replaceWith("

    "); +}else { + $("#reply_message_<%= @reply.id%>").html(""); } \ No newline at end of file diff --git a/app/views/comments/quote.js.erb b/app/views/comments/quote.js.erb index cc5bc98ac..db1ab7935 100644 --- a/app/views/comments/quote.js.erb +++ b/app/views/comments/quote.js.erb @@ -1,8 +1,9 @@ -if($("#reply_message_<%= @comment.id%>").length > 0) { +if($("#reply_message_<%= @comment.id%>").html() == "") { + $(".reply_to_message").html(""); $("#reply_message_<%= @comment.id%>").replaceWith("<%= escape_javascript(render :partial => 'comments/simple_ke_reply_form', :locals => {:reply => @comment}) %>"); $(function(){ sd_create_editor_from_data(<%= @comment.id%>,null,"100%", "<%=@comment.class.to_s%>"); }); -}else if($("#reply_to_message_<%= @comment.id %>").length >0) { - $("#reply_to_message_<%= @comment.id%>").replaceWith("

    "); +}else { + $("#reply_message_<%= @message.id%>").html(""); } \ No newline at end of file diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb index ec81b0d18..06e790527 100644 --- a/app/views/courses/syllabus.html.erb +++ b/app/views/courses/syllabus.html.erb @@ -145,7 +145,7 @@ ) if reply.author.id == User.current.id %>
    -

    +
    diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb index 9d6726ef1..0d2934dc5 100644 --- a/app/views/memos/_memo_all_replies.html.erb +++ b/app/views/memos/_memo_all_replies.html.erb @@ -61,7 +61,7 @@
    -

    +
    diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index bd1d2f047..563973bed 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,5 +1,6 @@ -if($("#reply_message_<%= @memo.id%>").length > 0) { +if($("#reply_message_<%= @memo.id%>").html() == "") { + $(".reply_to_message").html(""); $("#reply_message_<%= @memo.id%>").replaceWith("<%= escape_javascript(render :partial => 'memos/reply_message', :locals => {:reply => @memo}) %>"); -}else if($("#reply_to_message_<%= @memo.id%>").length >0) { - $("#reply_to_message_<%= @memo.id%>").replaceWith("

    "); +}else { + $("#reply_message_<%= @memo.id%>").html(""); } \ No newline at end of file diff --git a/app/views/messages/_contest_show_replies.html.erb b/app/views/messages/_contest_show_replies.html.erb index b9c179ff2..3a841a2f8 100644 --- a/app/views/messages/_contest_show_replies.html.erb +++ b/app/views/messages/_contest_show_replies.html.erb @@ -44,7 +44,7 @@
    -

    +
    diff --git a/app/views/messages/_course_show_replies.html.erb b/app/views/messages/_course_show_replies.html.erb index 3ea86596f..2f662fd02 100644 --- a/app/views/messages/_course_show_replies.html.erb +++ b/app/views/messages/_course_show_replies.html.erb @@ -44,7 +44,7 @@
    -

    +
    diff --git a/app/views/messages/_org_show_replies.html.erb b/app/views/messages/_org_show_replies.html.erb index 9b63c80ed..15a84934f 100644 --- a/app/views/messages/_org_show_replies.html.erb +++ b/app/views/messages/_org_show_replies.html.erb @@ -43,7 +43,7 @@
    -

    +
    diff --git a/app/views/messages/_project_show_replies.html.erb b/app/views/messages/_project_show_replies.html.erb index 637fade8a..ebca39ace 100644 --- a/app/views/messages/_project_show_replies.html.erb +++ b/app/views/messages/_project_show_replies.html.erb @@ -44,7 +44,7 @@
    -

    +
    diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb index aa429201d..47bd77351 100644 --- a/app/views/messages/quote.js.erb +++ b/app/views/messages/quote.js.erb @@ -1,8 +1,9 @@ -if($("#reply_message_<%= @message.id%>").length > 0) { +if($("#reply_message_<%= @message.id%>").html() == "") { + $(".reply_to_message").html(""); <% if params[:is_project] %> - $("#reply_message_<%= @message.id%>").replaceWith("<%= escape_javascript(render :partial => 'messages/project_rereply_message', :locals => {:reply => @message}) %>"); + $("#reply_message_<%= @message.id%>").html("<%= escape_javascript(render :partial => 'messages/project_rereply_message', :locals => {:reply => @message}) %>"); <% else %> - $("#reply_message_<%= @message.id%>").replaceWith("<%= escape_javascript(render :partial => 'reply_message', :locals => {:reply => @message}) %>"); + $("#reply_message_<%= @message.id%>").html("<%= escape_javascript(render :partial => 'reply_message', :locals => {:reply => @message}) %>"); <% end %> $(function(){ @@ -10,6 +11,6 @@ if($("#reply_message_<%= @message.id%>").length > 0) { $('#quote_quote').val("<%#= raw escape_javascript(@temp.content.html_safe) %>");*/ sd_create_editor_from_data(<%= @message.id%>,null,"100%", "<%=@message.class.to_s%>"); }); -}else if($("#reply_to_message_<%= @message.id%>").length >0) { - $("#reply_to_message_<%= @message.id%>").replaceWith("

    "); +}else { + $("#reply_message_<%= @message.id%>").html(""); } \ No newline at end of file diff --git a/app/views/news/_news_replies_detail.html.erb b/app/views/news/_news_replies_detail.html.erb index fbac8c96a..6e056949f 100644 --- a/app/views/news/_news_replies_detail.html.erb +++ b/app/views/news/_news_replies_detail.html.erb @@ -46,7 +46,7 @@
    -

    +
    <% end %>
    diff --git a/app/views/student_work/_homework_reply_detail.html.erb b/app/views/student_work/_homework_reply_detail.html.erb index e0126ab41..5c742ffdc 100644 --- a/app/views/student_work/_homework_reply_detail.html.erb +++ b/app/views/student_work/_homework_reply_detail.html.erb @@ -37,6 +37,6 @@
    -

    +
    \ No newline at end of file diff --git a/app/views/student_work/_student_work_replies.html.erb b/app/views/student_work/_student_work_replies.html.erb index 37c439ecb..d4870708c 100644 --- a/app/views/student_work/_student_work_replies.html.erb +++ b/app/views/student_work/_student_work_replies.html.erb @@ -82,7 +82,7 @@ :title => l(:button_reply)) %>

    -

    +
    diff --git a/app/views/users/_comment_reply_detail.html.erb b/app/views/users/_comment_reply_detail.html.erb index e7cd7e0b0..4d8e1747f 100644 --- a/app/views/users/_comment_reply_detail.html.erb +++ b/app/views/users/_comment_reply_detail.html.erb @@ -64,6 +64,6 @@
    -

    +
    \ No newline at end of file diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 9f810a052..78f05a40e 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -109,7 +109,7 @@
    -

    +
    <% end %>
    diff --git a/app/views/users/_news_replies.html.erb b/app/views/users/_news_replies.html.erb index 5b5aac94d..870490386 100644 --- a/app/views/users/_news_replies.html.erb +++ b/app/views/users/_news_replies.html.erb @@ -99,7 +99,7 @@
    -

    +
    <% end %>
    diff --git a/app/views/users/_reply_to.html.erb b/app/views/users/_reply_to.html.erb index db2024011..1ce89cfd6 100644 --- a/app/views/users/_reply_to.html.erb +++ b/app/views/users/_reply_to.html.erb @@ -1,4 +1,4 @@ -
    +
    <% if User.current.logged? %>
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
    diff --git a/app/views/users/reply_to.js.erb b/app/views/users/reply_to.js.erb index 60e851c71..00bceece4 100644 --- a/app/views/users/reply_to.js.erb +++ b/app/views/users/reply_to.js.erb @@ -1,14 +1,15 @@ -if($("#reply_message_<%= @reply.id%>").length > 0) { +if($("#reply_message_<%= @reply.id%>").html() == "") { + $(".reply_to_message").html(""); <% if params[:is_project] %> $("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/reply_to', :locals => {:reply => @reply}) %>"); <% else %> - $("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>"); + $("#reply_message_<%= @reply.id%>").html("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>"); <% end %> $("#reply_iconup_<%=@reply.id %>").show(); $(function(){ sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%=@reply.class.to_s%>"); }); -}else if($("#reply_to_message_<%= @reply.id%>").length >0) { - $("#reply_to_message_<%= @reply.id%>").replaceWith("

    "); +}else { + $("#reply_message_<%= @reply.id%>").html(""); $("#reply_iconup_<%=@reply.id %>").hide(); } \ No newline at end of file diff --git a/app/views/users/reply_to_comment.js.erb b/app/views/users/reply_to_comment.js.erb index 49a624e28..d38c5eb54 100644 --- a/app/views/users/reply_to_comment.js.erb +++ b/app/views/users/reply_to_comment.js.erb @@ -1,10 +1,11 @@ -if($("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id %>").length > 0) { - $("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/reply_to_comment', :locals => {:reply => @reply}) %>"); +if($("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id %>").html() == "") { + $(".reply_to_message").html(""); + $("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id %>").html("<%= escape_javascript(render :partial => 'users/reply_to_comment', :locals => {:reply => @reply}) %>"); $("#comment_reply_<%=@parent_id %> #reply_iconup_<%=@reply.id %>").show(); $(function(){ sd_create_editor_from_data(<%= @reply.id %>,null,"100%", "<%= @reply.class.to_s %>"); }); -}else if($("#comment_reply_<%= @parent_id %> #reply_to_message_<%= @reply.id %>").length >0) { - $("#comment_reply_<%= @parent_id %> #reply_to_message_<%= @reply.id %>").replaceWith("

    "); +}else{ + $("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id %>").html(""); $("#comment_reply_<%= @parent_id %> #reply_iconup_<%= @reply.id %>").hide(); } \ No newline at end of file From 08192b3e7ba35ce3691979f0958edd1f6949297a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Jun 2017 20:32:40 +0800 Subject: [PATCH 038/110] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=A0=8F=E7=9A=84?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=AE=9E=E8=AE=AD=E8=8F=9C=E5=8D=95=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_force_header.html.erb | 2 +- app/views/layouts/_public_left_info.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_logined_force_header.html.erb b/app/views/layouts/_logined_force_header.html.erb index ef565db0b..f955846e7 100644 --- a/app/views/layouts/_logined_force_header.html.erb +++ b/app/views/layouts/_logined_force_header.html.erb @@ -37,7 +37,7 @@
  • 我的主页
  • 我的课程
  • -
  • 我的实训
  • +
  • 我的实训
  • 我的留言
  • 修改资料
  • diff --git a/app/views/layouts/_public_left_info.html.erb b/app/views/layouts/_public_left_info.html.erb index 7717156ae..3cd67d0f4 100644 --- a/app/views/layouts/_public_left_info.html.erb +++ b/app/views/layouts/_public_left_info.html.erb @@ -29,7 +29,7 @@
    实训
      -
    • <%= link_to "我的实训", shixuns_path, :target => "_blank" %>
    • +
    • <%= link_to "我的实训", shixuns_user_path(User.current), :target => "_blank" %>
    • <%= link_to "新建实训", new_shixun_path, :target => "_blank" %>
    From b3bac60f3fbad03b63ef784b46900a7624dfd89c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 20:35:58 +0800 Subject: [PATCH 039/110] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 10 +++++ app/controllers/application_controller.rb | 20 +++++----- app/controllers/my_controller.rb | 39 ++++++++++++++------ app/views/account/apply_trail.js.erb | 1 + app/views/layouts/base_edu_account.html.erb | 6 +-- app/views/managements/index.html.erb | 1 + app/views/my/account.html.erb | 26 +++++++------ app/views/welcome/_two_btn_mask_pop.html.erb | 22 +++++++---- config/routes.rb | 1 + 9 files changed, 81 insertions(+), 45 deletions(-) create mode 100644 app/views/account/apply_trail.js.erb create mode 100644 app/views/managements/index.html.erb diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index f6d76e728..fb5639739 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -452,6 +452,16 @@ class AccountController < ApplicationController render :layout => 'base_edu_account' end + def apply_trail + apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization").first + if apply_action.blank? + ApplyAction.create(:user_id => User.current.id, :status => 0, :container_type => "TrialAuthorization") + end + respond_to do |format| + format.js + end + end + def user_auth @user = User.current diskfile1 = disk_auth_filename('UserAuthentication', @user.id, 'ID') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e7b475671..27127016a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -62,16 +62,16 @@ class ApplicationController < ActionController::Base # 判断用户是否认证 def check_authentication - return true - # uthentication = AuthenticationsUsers.where(:user_id => User.current.id).first - # user_account = User.current.try(:user_extensions).try(:occupation) - # if uthentication.blank? || user_account.blank? - # redirect_to my_account_path - # return - # elsif User.current.authentications == 0 - # redirect_to authentication_account_path - # return - # end + # return true + if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 + return true + end + authentication = ApplyAction.where(:user_id => User.current.id).first + user_identity = User.current.try(:user_extensions).try(:identity) + if user_identity.blank? || authentication.blank? + redirect_to my_account_path + return + end end def session_expiration diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index fe71494ad..b07fca70f 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -147,21 +147,35 @@ class MyController < ApplicationController end @user = User.current - # 基本资料不完善 @force为false, 完善 @force为true - @force = false - if params[:tip] - @force = true + # 认证 + ue = @user.user_extensions + @trail_authentication = ApplyAction.where(:user_id => User.current.id).first + @authentication = @user.authentication + if ue.identity.nil? + @require_auth = true else - user = UserExtensions.where(:user_id => User.current.id).first - if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil? - @force = true - elsif user.identity == 3 && user.school_id.nil? - @force = true + if @trail_authentication.blank? + @require_trail_auth = true end end - - # 用户认证 - @auth = @user.authentication ? false : true + # @require_auth = true + # + # # 基本资料不完善 @force为false, 完善 @force为true + # @force = false + # # @authentication = @user.authentication + # @trail_authentication = AuthenticationsUsers.where(:user_id => User.current.id).first + # if params[:tip] + # @force = true + # else + # user = UserExtensions.where(:user_id => User.current.id).first + # if user.identity.nil? || user.school_id.nil? || User.current.lastname.nil? + # @force = false + # else + # @force = @trail_authentication.blank? ? false : true + # end + # end + # # 用户认证 + # @auth = @user.authentication ? false : true @s_message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddSchools').first @d_message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddDepartment').first @@ -217,6 +231,7 @@ class MyController < ApplicationController @se.brief_introduction = params[:brief_introduction] if @user.save && @se.save + reward_grade(@user, @user.id, 'Account', 500) # 修改邮箱的时候同步修改到gitlab # if changed_mail || changed_login diff --git a/app/views/account/apply_trail.js.erb b/app/views/account/apply_trail.js.erb new file mode 100644 index 000000000..eb6213a58 --- /dev/null +++ b/app/views/account/apply_trail.js.erb @@ -0,0 +1 @@ +notice_box("申请成功,我们将在一个工作日内完成审核") \ No newline at end of file diff --git a/app/views/layouts/base_edu_account.html.erb b/app/views/layouts/base_edu_account.html.erb index 7b674dd13..da3c91700 100644 --- a/app/views/layouts/base_edu_account.html.erb +++ b/app/views/layouts/base_edu_account.html.erb @@ -30,11 +30,7 @@
    <% if User.current.logged? %> - <% if @force %> - <%= render :partial => 'layouts/logined_force_header' %> - <% else %> - <%= render :partial => 'layouts/logined_header' %> - <% end %> + <%= render :partial => 'layouts/logined_header' %> <% else%> <%= render :partial => 'layouts/unlogin_header' %> <% end%> diff --git a/app/views/managements/index.html.erb b/app/views/managements/index.html.erb new file mode 100644 index 000000000..65b6c4e30 --- /dev/null +++ b/app/views/managements/index.html.erb @@ -0,0 +1 @@ +<%= render :partial => "welcome/no_data" %> \ No newline at end of file diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 0e9e42e27..483792042 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -1,3 +1,17 @@ +<% if @require_auth %> + <%= render :partial => "welcome/guidance_mask" %> +<% else %> + <% if @require_trail_auth %> + <%= render :partial => 'welcome/two_btn_mask_pop', + :locals => {:btn1 => "试用申请", :btn2 => "身份认证", + :tip1 => "更多功能,需要经过管理员的授权审核", + :tip2 => "建议先提交身份认证,再进行试用申请", + :url1 => "#{apply_trail_account_path}", + :url2 => "#{authentication_account_path}" + } + %> + <% end %> +<% end %>
    @@ -249,17 +263,7 @@ <% title = "" %> <% language = "" %> <% end %> -<% if false %> - <%= render :partial => "welcome/guidance_mask" %> -<% elsif false %> - <%= render :partial => 'welcome/two_btn_mask_pop', - :locals => {:btn1 => "试用申请", :btn2 => "身份认证", - :tip1 => "更多功能,需要经过管理员的授权审核", - :tip2 => "建议先提交身份认证,再进行试用申请", - :url1 => "javascript:void(0);", - :url2 => "#{authentication_account_path}"} - %> -<% end %> + \ No newline at end of file diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 918507aae..ad2ae360c 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,6 +1,6 @@
    -

    让高校教学与实训更简单

    +

    让互联网教学与实训更简单

    创新实践人才的自主化和规模化培养

    From ea583751ea4f0c326208f132911d2e1dfbdf435a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Jun 2017 21:15:58 +0800 Subject: [PATCH 046/110] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/apply_trail.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/account/apply_trail.js.erb b/app/views/account/apply_trail.js.erb index eb6213a58..0b921b7c3 100644 --- a/app/views/account/apply_trail.js.erb +++ b/app/views/account/apply_trail.js.erb @@ -1 +1 @@ -notice_box("申请成功,我们将在一个工作日内完成审核") \ No newline at end of file +$("body").append('<%= j( render :partial => 'welcome/one_btn_mask_pop', :locals => {:btn => "确定", :tip1 => "申请成功,我们将在一个工作日内完成审核", :url => "javascript:void(0);"}) %>'); \ No newline at end of file From bc7673d66845a63604b4f90f2ed69d332c101448 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 21:21:32 +0800 Subject: [PATCH 047/110] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=9C=AA=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E4=B9=8B=E5=89=8D=E4=B8=8D=E8=83=BD=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 27127016a..468f3f8f4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -66,7 +66,7 @@ class ApplicationController < ActionController::Base if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 return true end - authentication = ApplyAction.where(:user_id => User.current.id).first + authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first user_identity = User.current.try(:user_extensions).try(:identity) if user_identity.blank? || authentication.blank? redirect_to my_account_path From 6da0249f5191f8bbac4640a986b98353fa89ef82 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 21:30:46 +0800 Subject: [PATCH 048/110] =?UTF-8?q?=E5=90=88=E4=BD=9C=E8=80=85=E4=B9=9F?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=8F=91=E5=B8=83=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_shixun_top.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb index 2ce091dfe..f0cbde564 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -6,8 +6,8 @@ /

    <%= @shixun.name %>

    <% if allow_shixun_exec(@shixun) %> - <% if User.current.id == @shixun.user_id %> - <% if @shixun.status == 1 %> + <% if @shixun %> + <% if User.current.manager_of_shixun?(@shixun) %> <%= link_to "重新发布", publish_shixun_path(@shixun, :type => "retry"), :class => "fr shixun-task-btn task-btn-orange mr15", :id => "challenge_begin", :remote => true %> <% else %> <%= link_to "发布实训", publish_shixun_path(@shixun), :class => "fr shixun-task-btn task-btn-orange mr15", :id => "challenge_begin", :remote => true %> From 14549426d9050ca15553ab2fb31dc1d521dd9c42 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Jun 2017 21:44:44 +0800 Subject: [PATCH 049/110] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 367e7b4ce..f2a395960 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -665,6 +665,9 @@ class UsersController < ApplicationController @shixuns = paginateHelper @shixuns, @limit # 我参入的 + ids = Shixun.find_by_sql("select id from shixun_members where role=2 and user_id=#{@user.id}") + ids2 = Shixun.find_by_sql("select id from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})") + @join_shixuns = Shixun.find_by_sql("select * from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})") # @join_shixuns_count = @join_shixuns.count # @join_shixuns_pages = Paginator.new @join_shixuns_count, @limit, params['page'] || 1 From b05bd236cdf9f9ff7217172cee95a02edf022eec Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 21:59:24 +0800 Subject: [PATCH 050/110] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f2a395960..33487ddde 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -665,10 +665,14 @@ class UsersController < ApplicationController @shixuns = paginateHelper @shixuns, @limit # 我参入的 + id = [] ids = Shixun.find_by_sql("select id from shixun_members where role=2 and user_id=#{@user.id}") ids2 = Shixun.find_by_sql("select id from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})") - - @join_shixuns = Shixun.find_by_sql("select * from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})") + ids = ids.map{|shixun| shixun.id} unless ids.blank? + ids2 = ids2.map{|shixun| shixun.id} unless ids2.blank? + id = ids + ids2 + id = id.uniq + @join_shixuns = Shixun.where(:shixun_id => id) # @join_shixuns_count = @join_shixuns.count # @join_shixuns_pages = Paginator.new @join_shixuns_count, @limit, params['page'] || 1 # @join_shixuns_offset ||= @join_shixuns_pages.offset From d259706a19d78e251dc12fac6e612646469f4305 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 22:08:10 +0800 Subject: [PATCH 051/110] =?UTF-8?q?=E6=88=91=E5=8F=82=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 33487ddde..5bb03ce39 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -665,14 +665,13 @@ class UsersController < ApplicationController @shixuns = paginateHelper @shixuns, @limit # 我参入的 - id = [] ids = Shixun.find_by_sql("select id from shixun_members where role=2 and user_id=#{@user.id}") ids2 = Shixun.find_by_sql("select id from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})") ids = ids.map{|shixun| shixun.id} unless ids.blank? ids2 = ids2.map{|shixun| shixun.id} unless ids2.blank? id = ids + ids2 id = id.uniq - @join_shixuns = Shixun.where(:shixun_id => id) + @join_shixuns = Shixun.where(:id => id) # @join_shixuns_count = @join_shixuns.count # @join_shixuns_pages = Paginator.new @join_shixuns_count, @limit, params['page'] || 1 # @join_shixuns_offset ||= @join_shixuns_pages.offset From 6e9b478f74c61365cf29b11987097a6332061f96 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Jun 2017 22:23:47 +0800 Subject: [PATCH 052/110] =?UTF-8?q?=E5=90=88=E4=BD=9C=E8=80=85=E8=83=BD?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_shixun_top.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb index f0cbde564..01f23f459 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -6,8 +6,8 @@ /

    <%= @shixun.name %>

    <% if allow_shixun_exec(@shixun) %> - <% if @shixun %> - <% if User.current.manager_of_shixun?(@shixun) %> + <% if User.current.manager_of_shixun?(@shixun) %> + <% if @shixun.status == 1 %> <%= link_to "重新发布", publish_shixun_path(@shixun, :type => "retry"), :class => "fr shixun-task-btn task-btn-orange mr15", :id => "challenge_begin", :remote => true %> <% else %> <%= link_to "发布实训", publish_shixun_path(@shixun), :class => "fr shixun-task-btn task-btn-orange mr15", :id => "challenge_begin", :remote => true %> From 67d4430bed7ab7854c59c7ab3f8d9da60a655efe Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 10 Jun 2017 10:01:32 +0800 Subject: [PATCH 053/110] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/dataSources.xml | 12 ++++++------ app/controllers/application_controller.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index e9ec192f0..934f79cf7 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -28,25 +28,25 @@ mysql com.mysql.jdbc.Driver - jdbc:mysql://127.0.0.1/trustie2 + jdbc:mysql://127.0.0.1/0604new root - df9bdf98df99df9edf9fdf9c + df9bdf98df99df9e mysql com.mysql.jdbc.Driver - jdbc:mysql://127.0.0.1/trustie2 + jdbc:mysql://127.0.0.1/20161227data root - df9bdf98df99df9edf9fdf9c + df9bdf98df99df9e mysql com.mysql.jdbc.Driver - jdbc:mysql://127.0.0.1/trustie2 + jdbc:mysql://127.0.0.1/0623newblank root - df9bdf98df99df9edf9fdf9c + df9bdf98df99df9e diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 468f3f8f4..ab9eac745 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -63,7 +63,7 @@ class ApplicationController < ActionController::Base # 判断用户是否认证 def check_authentication # return true - if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 + if params[:action] == "on_search" || params[:action] == "apply_trail" || params[:action] == "training_task_status" # 之所以这样处理是为了避开account页面ajax加载 return true end authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first From 8f40d7022abea944543a8bc512aa847dc4cebc0a Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 11 Jun 2017 15:45:54 +0800 Subject: [PATCH 054/110] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=AD=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 28 +++++++++++------------ app/controllers/courses_controller.rb | 1 + app/controllers/forums_controller.rb | 3 ++- app/controllers/myshixuns_controller.rb | 1 + app/controllers/shixuns_controller.rb | 1 + app/controllers/syllabuses_controller.rb | 1 + app/helpers/application_helper.rb | 15 ++++++++++++ 7 files changed, 35 insertions(+), 15 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ab9eac745..e0cbc2524 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -45,8 +45,8 @@ class ApplicationController < ActionController::Base before_filter :find_first_page before_filter :find_web_footer - before_filter :session_expiration, :user_setup, :check_if_login_required, :set_localization, :check_authentication - before_filter :user_agent + before_filter :session_expiration, :user_setup, :check_if_login_required, :set_localization + before_filter :user_agent rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token rescue_from ::Unauthorized, :with => :deny_access @@ -61,18 +61,18 @@ class ApplicationController < ActionController::Base end # 判断用户是否认证 - def check_authentication - # return true - if params[:action] == "on_search" || params[:action] == "apply_trail" || params[:action] == "training_task_status" # 之所以这样处理是为了避开account页面ajax加载 - return true - end - authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first - user_identity = User.current.try(:user_extensions).try(:identity) - if user_identity.blank? || authentication.blank? - redirect_to my_account_path - return - end - end + # def check_authentication + # # return true + # if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 + # return true + # end + # authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first + # user_identity = User.current.try(:user_extensions).try(:identity) + # if user_identity.blank? || authentication.blank? + # redirect_to my_account_path + # return + # end + # end def session_expiration if session[:user_id] diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index d01774024..222138049 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -14,6 +14,7 @@ class CoursesController < ApplicationController before_filter :auth_login1, :only => [:show, :course_activity, :feedback] skip_before_filter :verify_authenticity_token, :only => [:update_position] + before_filter :check_authentication, :except => [:update_position] menu_item :overview menu_item :feedback, :only => :feedback menu_item :homework, :only => :homework diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 24223c25d..bc26d5bb6 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -8,7 +8,8 @@ class ForumsController < ApplicationController before_filter :authenticate_user_edit, :only => [:edit, :update] before_filter :authenticate_user_destroy, :only => [:destroy] before_filter :require_login, :only => [:new, :create,:destroy,:update,:edit] - + before_filter :check_authentication + helper :sort include SortHelper diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index d76494716..42d0416c1 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -3,6 +3,7 @@ class MyshixunsController < ApplicationController layout 'base_myshixun' skip_before_filter :verify_authenticity_token, :only => [:training_task_status] before_filter :require_login, :except => [:training_task_status] + before_filter :check_authentication, :except => [:training_task_status] before_filter :find_myshixun, :only => [:show, :myshixun_reset] include ApplicationHelper diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 505e73699..8fc561502 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -3,6 +3,7 @@ class ShixunsController < ApplicationController layout 'base_shixun' before_filter :require_login + before_filter :check_authentication before_filter :find_shixun, :except => [ :index, :new, :create, :index, :search ] before_filter :shixun_view_allow, :only => [:show] before_filter :require_manager, :only => [ :settings, :add_script, :publish, :collaborators_delete, :shixun_members_added, :add_collaborators] diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb index 7451a893c..23ad61f92 100644 --- a/app/controllers/syllabuses_controller.rb +++ b/app/controllers/syllabuses_controller.rb @@ -7,6 +7,7 @@ class SyllabusesController < ApplicationController include SyllabusesHelper include UsersHelper before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus, :syllabus_resources, :syllabus_homeworks] + before_filter :check_authentication before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des, :members, :update_des, :edit_ref, :update_ref, :add_sy_member_alert, :search_not_sy_member, :syllabus_resources, :syllabus_homeworks, :send_homeworks_to_course, :choose_user_course, :send_resources_to_course, :send_r_and_h_to_course] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 02ed45619..e270da1a3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -33,6 +33,21 @@ module ApplicationHelper extend Forwardable def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter + # 判断用户是否认证 + def check_authentication + # return true + if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 + return true + end + authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first + user_identity = User.current.try(:user_extensions).try(:identity) + if user_identity.blank? || authentication.blank? + redirect_to my_account_path + return + end + end + + # 积分表中建立记录行为,有过奖励则不重复奖励 def reward_grade(user, container_id, container_type, score) grade = Grade.where(:user_id => user.id, :container_id => container_id, :container_type => container_type).first From f0823e7eb709024c3603a3972aa20d930f68e87e Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 11 Jun 2017 15:53:04 +0800 Subject: [PATCH 055/110] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 2 +- app/controllers/users_controller.rb | 2 ++ app/helpers/application_helper.rb | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index bc26d5bb6..ed646354c 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -9,7 +9,7 @@ class ForumsController < ApplicationController before_filter :authenticate_user_destroy, :only => [:destroy] before_filter :require_login, :only => [:new, :create,:destroy,:update,:edit] before_filter :check_authentication - + helper :sort include SortHelper diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5bb03ce39..a62b5f620 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -35,6 +35,8 @@ class UsersController < ApplicationController # before_filter :can_show_course, :only => [:user_courses,:user_homeworks] + before_filter :check_authentication + before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :unfinished_homework_list, :user_manage_homeworks, :unfinished_poll_list, :user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :update_message_viewed, :anonymous_evaluation_list,:unfinished_test_list, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :user_receive_homeworks, diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e270da1a3..4b1f10bb9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -36,9 +36,9 @@ module ApplicationHelper # 判断用户是否认证 def check_authentication # return true - if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 - return true - end + # if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 + # return true + # end authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first user_identity = User.current.try(:user_extensions).try(:identity) if user_identity.blank? || authentication.blank? From e63508a3374d4cc1ae27e00a218495b2b062b215 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 11 Jun 2017 16:00:12 +0800 Subject: [PATCH 056/110] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- app/views/welcome/_one_btn_mask_pop.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a62b5f620..d7e4af7ab 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -36,7 +36,7 @@ class UsersController < ApplicationController # before_filter :can_show_course, :only => [:user_courses,:user_homeworks] before_filter :check_authentication - + before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :unfinished_homework_list, :user_manage_homeworks, :unfinished_poll_list, :user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :update_message_viewed, :anonymous_evaluation_list,:unfinished_test_list, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :user_receive_homeworks, diff --git a/app/views/welcome/_one_btn_mask_pop.html.erb b/app/views/welcome/_one_btn_mask_pop.html.erb index 7532e416f..af9ccf6a6 100644 --- a/app/views/welcome/_one_btn_mask_pop.html.erb +++ b/app/views/welcome/_one_btn_mask_pop.html.erb @@ -21,7 +21,7 @@ <%#= tip2 %>

    -->
    From 24364118af26842c85b09afc9a4376fc7d667240 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 12 Jun 2017 11:04:12 +0800 Subject: [PATCH 057/110] =?UTF-8?q?tab=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css/edu-admin.css | 2 +- public/stylesheets/css/edu-class.css | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/public/stylesheets/css/edu-admin.css b/public/stylesheets/css/edu-admin.css index fd86cc314..5e60d4d45 100644 --- a/public/stylesheets/css/edu-admin.css +++ b/public/stylesheets/css/edu-admin.css @@ -74,7 +74,7 @@ table.table-pa5 th,table.table-pa5 td{ padding:0 5px;} .edu-tab{ width: 100%; background:#fff; } #edu-tab-nav{height:47px;background: #fff; } #edu-tab-nav li {float:left; width: 170px; text-align:center;height: 47px;line-height: 47px; position: relative; } -.edu-tab-fa{ position: absolute; top:27px; left:85px; color: #fff;} +.edu-tab-fa{ position: absolute; top:27px; left:81px; color: #fff;} #edu-tab-nav li a{font-size:14px; } .edu-tab-hover {border-bottom:3px solid #5faee3; background: #fff; } .edu-tab-hover .edu-tab-fa{ color: #5faee3;} diff --git a/public/stylesheets/css/edu-class.css b/public/stylesheets/css/edu-class.css index 4c25f85d3..8333f3793 100644 --- a/public/stylesheets/css/edu-class.css +++ b/public/stylesheets/css/edu-class.css @@ -73,11 +73,11 @@ table.table-pa5 th,table.table-pa5 td{ padding:0 5px;} .edu-class-top-info{ color:#333;} .edu-class-top-img{ width:260px; height: 140px;} /* tab */ -.edu-tab{ width: 100%; background:#fff; } +.edu-tab{ width: 100%; background:#fff;} #edu-tab-nav{height:47px;background: #fff; } #edu-tab-nav li {float:left; width: 170px; text-align:center;height: 47px;line-height: 47px; position: relative; } -.edu-tab-fa{ position: absolute; top:28px!important; left:85px!important; color: #fff;} -#edu-tab-nav li a{font-size:14px; } +.edu-tab-fa{ position: absolute; top:28px!important; left:81px!important; color: #fff;} +#edu-tab-nav li a{font-size:14px;} .edu-tab-hover {border-bottom:3px solid #5faee3; background: #fff; } .edu-tab-hover .edu-tab-fa{ color: #5faee3;} .edu-tab-hover a{ color:#5faee3; font-weight:bold;} @@ -343,9 +343,8 @@ a:hover.edu-class-inner-list{color:#3498db;} .edu-class-inner-max .task-form-90{ width: 92%;} .edu-class-list-inner .task-form-90{width: 91%;} /* new tab */ -#edu-tab-nav li {width: 150px; } -.edu-tab{ width: 100%; background:#fff; } -#edu-tab-nav{height:47px;background: #fff; border-bottom:2px solid #5faee3;} +.edu-tab{ width: 100%; background:#fff;} +#edu-tab-nav{height:47px;background: #fff;} #edu-tab-nav li.new-tab-nav {float:left; width: 150px; text-align:center;height:48px;line-height:48px; } #edu-tab-nav li a{font-size:14px; } .edu-new-tab-hover { background:#5faee3; } From a57b533be8d62354bb8539dd80c198cc650f6b29 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 12 Jun 2017 14:29:36 +0800 Subject: [PATCH 058/110] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2=EF=BC=8Ccheekbox=E5=92=8C=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=90=8D=E7=A7=B0=E6=B2=A1=E6=9C=89=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_import_resource_info.html.erb | 1 + app/views/users/_user_import_resource_list.html.erb | 9 +++++---- public/stylesheets/css/popup.css | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/users/_import_resource_info.html.erb b/app/views/users/_import_resource_info.html.erb index 42ced5657..7139e1e7b 100644 --- a/app/views/users/_import_resource_info.html.erb +++ b/app/views/users/_import_resource_info.html.erb @@ -40,6 +40,7 @@
      +
    • 类别
    • 大小
    • diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index 14d4b785c..7906be7f5 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -4,11 +4,12 @@ :method => 'post', :id => 'resource_import_container_form') do %> <% @attachments.each do |attach| %>
        +
      • + + +
      • <%= get_resource_type(attach.container_type)%>
      • diff --git a/public/stylesheets/css/popup.css b/public/stylesheets/css/popup.css index d79fc5df9..71e5d9a60 100644 --- a/public/stylesheets/css/popup.css +++ b/public/stylesheets/css/popup.css @@ -263,7 +263,8 @@ a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.chooseActive {background-color:#3b94d6; color:#ffffff;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner li {height:40px; line-height:40px; vertical-align:middle;} -.subjectName {width:270px; padding-left:10px; padding-right:10px;} +.subjectCheck {width:20px;} +.subjectName {width:220px; padding-left:10px; padding-right:10px;} .subjectPublisher {width:80px; text-align:center;} .subjectDate {width:80px; text-align:center;} .subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} From 527348c63aa21eb765d808213ff5b328ca5677a3 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 12 Jun 2017 14:47:37 +0800 Subject: [PATCH 059/110] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=90=8E=E7=82=B9=E5=87=BB=E4=BF=9D=E5=AD=98=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/_edit_publish_setting.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/homework_common/_edit_publish_setting.html.erb b/app/views/homework_common/_edit_publish_setting.html.erb index a337df9e0..9ee845e21 100644 --- a/app/views/homework_common/_edit_publish_setting.html.erb +++ b/app/views/homework_common/_edit_publish_setting.html.erb @@ -24,7 +24,7 @@
      • - class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.end_time <= Time.now ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 10:00"/> + class="fl task-form-15 task-height-40 panel-box-sizing <%= !@homework.end_time.nil? && @homework.end_time <= Time.now ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 10:00"/> <% if @homework.homework_detail_manual.try(:comment_status) == 0 %> 清除 <% end %> From 0f825ee493ac115ae0a0ba0bd84b92b26eb5282d Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 12 Jun 2017 14:55:48 +0800 Subject: [PATCH 060/110] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=85=B3=E5=8D=A1=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/myshixuns/_myshixun_top.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/myshixuns/_myshixun_top.html.erb b/app/views/myshixuns/_myshixun_top.html.erb index 765492e7e..641a3d603 100644 --- a/app/views/myshixuns/_myshixun_top.html.erb +++ b/app/views/myshixuns/_myshixun_top.html.erb @@ -1,7 +1,7 @@

        <%= @myshixun.shixun.try(:name) %>

        - - 第<%= @game_challenge.position %>关 +      + 第<%= @game_challenge.position %>关:<%= @game_challenge.subject %>
        From 9c9740edce0dd9cf3b0a5722599f7b79c259476b Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 12 Jun 2017 15:01:19 +0800 Subject: [PATCH 061/110] =?UTF-8?q?=E6=99=BA=E8=83=BD=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=9F=A5=E8=AF=A2=E4=B8=8B=E6=8B=89=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E4=B8=8E=E6=90=9C=E7=B4=A2=E6=A1=86=E7=9A=84=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E4=B8=80=E8=B5=B7=E6=89=A7=E8=A1=8C=E6=97=B6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=87=BA=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/index.html.erb | 3 ++- app/views/courses/index.js.erb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index f75e6088d..2a69244cf 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -21,9 +21,10 @@
      - +
      +
      diff --git a/app/views/courses/index.js.erb b/app/views/courses/index.js.erb index 915f15b27..43375cf34 100644 --- a/app/views/courses/index.js.erb +++ b/app/views/courses/index.js.erb @@ -1,4 +1,5 @@ $("#intelligence_course_list").html("<%= j(render :partial => "courses/courseList") %>"); $("#courses_index_syllabuses_1").attr('href','<%= courses_path(:select => "all", :search => @search) %>'); $("#courses_index_syllabuses_2").attr('href','<%= courses_path(:select => "create", :search => @search) %>'); -$("#courses_index_syllabuses_3").attr('href','<%= courses_path(:select => "join", :search => @search) %>'); \ No newline at end of file +$("#courses_index_syllabuses_3").attr('href','<%= courses_path(:select => "join", :search => @search) %>'); +$("#input_select_val").val('<%= @select %>'); \ No newline at end of file From 7a0384885966e77ad2c66adb53c214ab387d0925 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 12 Jun 2017 15:41:21 +0800 Subject: [PATCH 062/110] =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=94=B9=E6=88=90=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_content_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/challenges/_content_list.html.erb b/app/views/challenges/_content_list.html.erb index 6d3fb5f56..bfbf1c82a 100644 --- a/app/views/challenges/_content_list.html.erb +++ b/app/views/challenges/_content_list.html.erb @@ -24,7 +24,7 @@ <% end %> <% if User.current.manager_of_shixun?(@shixun) %> -

      +

      <% unless challenge.position < 2 %> <% end %> From da87db878b74c78f5809c89e3e95c54aae2d38e1 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 12 Jun 2017 16:02:07 +0800 Subject: [PATCH 063/110] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/user_join.html.erb | 8 ++++---- public/javascripts/edu/application.js | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/account/user_join.html.erb b/app/views/account/user_join.html.erb index 9f4dc8e44..8ee3c2c98 100644 --- a/app/views/account/user_join.html.erb +++ b/app/views/account/user_join.html.erb @@ -76,7 +76,7 @@

      • - +
      • <% end %> diff --git a/app/views/repositories/_shixun_dir_list_content.html.erb b/app/views/repositories/_shixun_dir_list_content.html.erb index ab6493cfa..e0a1758ee 100644 --- a/app/views/repositories/_shixun_dir_list_content.html.erb +++ b/app/views/repositories/_shixun_dir_list_content.html.erb @@ -8,17 +8,7 @@ - <% if entry.is_dir? %> - <%# 展开文件目录 %> -   - <% end %> + <%= link_to h(ent_name), {:action => (entry.is_dir? ? 'shixun_show' : 'shixun_entry'), :id => @shixun, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev}, :class => (entry.is_dir? ? 'old-icon old-icon-folder' : "old-icon old-icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%> diff --git a/app/views/shixuns/edit.html.erb b/app/views/shixuns/edit.html.erb new file mode 100644 index 000000000..e69de29bb From 18c03066a68b634aae476ce28ce9e25c944a342e Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 12 Jun 2017 17:14:57 +0800 Subject: [PATCH 065/110] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=A4=8D=E6=9B=B4=E6=96=B0=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/words/leave_homework_message.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/words/leave_homework_message.js.erb b/app/views/words/leave_homework_message.js.erb index 393dd3e9e..4a1a36008 100644 --- a/app/views/words/leave_homework_message.js.erb +++ b/app/views/words/leave_homework_message.js.erb @@ -2,6 +2,6 @@ $("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework, :user_activity_id => @user_activity_id, :is_teacher => @is_teacher}) %>"); sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> -$("#student_work_replies_box").replaceWith("<%= escape_javascript(render :partial => 'student_work/student_work_replies') %>"); +$("#student_work_replies_box").html("<%= escape_javascript(render :partial => 'student_work/student_work_replies') %>"); sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> \ No newline at end of file From 3d9c98ef09479263bc36b4d71c1b34b7fbd250f3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 12 Jun 2017 17:15:31 +0800 Subject: [PATCH 066/110] =?UTF-8?q?=E7=94=A8=E7=A7=AF=E5=88=86=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E4=BA=86=E5=8F=82=E8=80=83=E7=AD=94=E6=A1=88=EF=BC=8C?= =?UTF-8?q?=E8=AF=84=E6=B5=8B=E9=80=9A=E8=BF=87=E5=90=8E=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=B8=AD=E7=9A=84=E7=BB=8F=E9=AA=8C=E5=80=BC?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=98=BE=E7=A4=BA=E4=B8=BA+0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/index.html.erb | 2 +- app/views/challenges/show.html.erb | 5 ++-- app/views/games/_file_edit_form.html.erb | 4 ++-- app/views/games/_game_results.html.erb | 2 +- app/views/games/minus_score.js.erb | 1 + app/views/shixuns/autocompletion.html.erb | 28 ++++++++++++++++------- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/app/views/challenges/index.html.erb b/app/views/challenges/index.html.erb index 66aac37e8..2591ec020 100644 --- a/app/views/challenges/index.html.erb +++ b/app/views/challenges/index.html.erb @@ -1,4 +1,4 @@ -<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min' %> +<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %> <%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js', '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%>