From 65bd77f0ff25298ce5039a4b547c47346e47f099 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Sun, 18 Sep 2016 10:50:40 +0800 Subject: [PATCH 01/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E8=BF=87=E6=9C=9F=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 3 ++- app/models/project.rb | 3 ++- .../20160918024056_add_qrcode_expiretime_to_courses.rb | 5 +++++ .../20160918024214_add_qrcode_expiretime_to_projects.rb | 5 +++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160918024056_add_qrcode_expiretime_to_courses.rb create mode 100644 db/migrate/20160918024214_add_qrcode_expiretime_to_projects.rb diff --git a/app/models/course.rb b/app/models/course.rb index 659f9fcec..cc80a1b4b 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -495,10 +495,11 @@ class Course < ActiveRecord::Base def generate_qrcode ticket = self.qrcode - if !ticket || ticket.size < 10 + if !ticket || ticket.size < 10 || (Time.now.to_i > self.qrcode_expiretime) response = Wechat.api.qrcode_create_scene(invite_code, 2592000) logger.debug "response = #{response}" self.qrcode = response['ticket'] + self.qrcode_expiretime = Time.now.to_i+response['expire_seconds'] save! && reload ticket = qrcode end diff --git a/app/models/project.rb b/app/models/project.rb index 0d297bb3c..e80306036 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -930,10 +930,11 @@ class Project < ActiveRecord::Base def generate_qrcode ticket = self.qrcode - if !ticket || ticket.size < 10 + if !ticket || ticket.size < 10 || (Time.now.to_i > self.qrcode_expiretime) response = Wechat.api.qrcode_create_scene(invite_code, 2592000) logger.debug "response = #{response}" self.qrcode = response['ticket'] + self.qrcode_expiretime = Time.now.to_i+response['expire_seconds'] save! ticket = qrcode end diff --git a/db/migrate/20160918024056_add_qrcode_expiretime_to_courses.rb b/db/migrate/20160918024056_add_qrcode_expiretime_to_courses.rb new file mode 100644 index 000000000..17d8548cc --- /dev/null +++ b/db/migrate/20160918024056_add_qrcode_expiretime_to_courses.rb @@ -0,0 +1,5 @@ +class AddQrcodeExpiretimeToCourses < ActiveRecord::Migration + def change + add_column :courses, :qrcode_expiretime, :integer, :default => 0 + end +end diff --git a/db/migrate/20160918024214_add_qrcode_expiretime_to_projects.rb b/db/migrate/20160918024214_add_qrcode_expiretime_to_projects.rb new file mode 100644 index 000000000..870917443 --- /dev/null +++ b/db/migrate/20160918024214_add_qrcode_expiretime_to_projects.rb @@ -0,0 +1,5 @@ +class AddQrcodeExpiretimeToProjects < ActiveRecord::Migration + def change + add_column :projects, :qrcode_expiretime, :integer, :default => 0 + end +end From 6c093f68cf9460310b00a1bc9cf6ec2371c843cf Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 11:18:02 +0800 Subject: [PATCH 02/40] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=86=85=E7=9A=84?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=8F=AF=E4=BB=A5=E5=B0=86=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E3=80=81=E9=80=9A=E7=9F=A5=E3=80=81=E8=B5=84=E6=BA=90=E7=AD=89?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=88=B0=E8=AF=A5=E7=8F=AD=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2a91b75ae..7e9add5e2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2156,11 +2156,9 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) else - @course = @user.courses - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted end @search = params[:search] @type = params[:type] @@ -2178,7 +2176,7 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) + @projects = @user.projects.visible.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) else @projects = @user.projects.visible end From b783ec5b44823771de8f0d0cfe78ea554b764705 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Sun, 18 Sep 2016 13:19:37 +0800 Subject: [PATCH 03/40] . --- app/api/mobile/apis/courses.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index cbf8f4986..57feff084 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -123,6 +123,12 @@ module Mobile else cs = CoursesService.new status = cs.join_course_roles({role: roles_ids, openid: params[:openid], invite_code: params[:invite_code]}, current_user) + if params[:student_flag] && status[:state] == 0 + #查询分班信息 + + + end + { status: status[:state], message:CoursesService::JoinCourseError.message(status[:state]) From 53bdeed1e4b0cb2fad9e3847fb93b1b38c413e82 Mon Sep 17 00:00:00 2001 From: liguangye Date: Sun, 18 Sep 2016 14:20:08 +0800 Subject: [PATCH 04/40] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=93=83=E9=93=9B404?= =?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/views/users/_project_issue.html.erb | 2 -- db/migrate/20160918033136_update_issue_author.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160918033136_update_issue_author.rb diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 0ca706b68..e1c9038d5 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,4 +1,3 @@ -<% unless activity.author.nil? %>
@@ -104,4 +103,3 @@ user_card_show_hide(); }); -<% end %> \ No newline at end of file diff --git a/db/migrate/20160918033136_update_issue_author.rb b/db/migrate/20160918033136_update_issue_author.rb new file mode 100644 index 000000000..8cbc99d6d --- /dev/null +++ b/db/migrate/20160918033136_update_issue_author.rb @@ -0,0 +1,13 @@ +class UpdateIssueAuthor < ActiveRecord::Migration + def up + begin + issue = Issue.find(9377) + issue.update_column(:author_id, 15341) + rescue Exception => e + puts e + end + end + + def down + end +end From 3f7935bf85088fbcd5aaee3c8a3d2605f9fab0ef Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 14:39:03 +0800 Subject: [PATCH 05/40] =?UTF-8?q?=E7=8F=AD=E7=BA=A7/=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E9=94=81=E5=AE=9A=E5=9B=9E=E5=A4=8D=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=B7=B2=E6=9C=89=E5=9B=9E=E5=A4=8D=E7=9A=84=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=9B=9E=E5=A4=8D=E6=8C=89=E9=92=AE=E6=9C=AA=E5=B1=8F?= =?UTF-8?q?=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_message_replies.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 669aea26c..ce1e70887 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -24,6 +24,8 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% if type == 'Message' %> + <% topic = comment.root %> + <% if !topic.locked? && authorize_for('messages', 'reply') %> <%= link_to( l(:button_reply), @@ -33,6 +35,7 @@ :title => l(:button_reply)) %> + <% end %> <% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %> <%= link_to( l(:button_delete), From 2c7eddbae601c0454f239327b8bf9c604fea216d Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 14:49:01 +0800 Subject: [PATCH 06/40] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?= =?UTF-8?q?=E7=9A=84at=E5=9B=9E=E5=A4=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/at_message.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/at_message.rb b/app/models/at_message.rb index 5a175fe76..2212ef07e 100644 --- a/app/models/at_message.rb +++ b/app/models/at_message.rb @@ -89,7 +89,7 @@ class AtMessage < ActiveRecord::Base status = -1 end when 'JournalsForMessage' - if at_message.jour && at_message.jour.course + if at_message.jour && defined? at_message.jour.course #作业回复 shield_type = "Course" container_id = at_message.jour.course.id @@ -99,7 +99,7 @@ class AtMessage < ActiveRecord::Base else type = "journal_for_message" detail_id = topic.id - detail_title = at_message.subject + detail_title = at_message.notes end else status = -1 From f50663158ae1b75bdff395dfb03b75eb58d6662e Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 15:07:22 +0800 Subject: [PATCH 07/40] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=8F=90=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 4c4374a29..f754c4540 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -17,12 +17,13 @@
  • - +
  • 正确示例:计算机系2016秋季A班
  • 错误示例:软件工程 - 计算机系2016秋季A班
  • +
  • 班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。
  • From 014b43cccd754f9b125bfb0c70ed86ad029e1bea Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 15:09:43 +0800 Subject: [PATCH 08/40] =?UTF-8?q?oneapm=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8a40f3ca7..a1f5f7e76 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /config/database.yml /config/configuration.yml /config/additional_environment.rb +/config/oneapm.yml /files/* From 5b938aa11bf95f826be923d6ceb1006aa2d27a2c Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 18 Sep 2016 15:44:27 +0800 Subject: [PATCH 09/40] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E9=9D=9E=E6=88=90=E5=91=98=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E8=B5=84=E6=BA=90=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 8 ++- .../lib/acts_as_attachable.rb | 70 +++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 3e41e2c91..37383712f 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -92,7 +92,13 @@ class MessagesController < ApplicationController @message.board = @board @message.safe_attributes = params[:message] if request.post? - @message.save_attachments(params[:attachments]) + if @project + is_public = @project.is_public + elsif @course + is_public = @course.is_public + end + # 公开项目/课程上传的资源是公开的,私有项目上传的是私有的 + @message.save_attachments_containers(params[:attachments], User.current, is_public) if @message.save # 更新kindeditor上传的图片资源所有者 if params[:asset_id] diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index f5b48544d..20bc0a7ad 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -172,6 +172,76 @@ module Redmine {:files => saved_attachments, :unsaved => unsaved_attachments} end + # 扩展方法,因为类型太多,为了不影响其它的 + # 最终需要形成一个方法 + def save_attachments_containers(attachments, author, is_public) + # 清除临时文件 + if attachments + tempAttach = attachments[:dummy] + if tempAttach && tempAttach[:file] + attachments.delete(:dummy) + end + end + + if attachments.is_a?(Hash) + attachments = attachments.stringify_keys + attachments = attachments.to_a.sort {|a, b| + if a.first.to_i > 0 && b.first.to_i > 0 + a.first.to_i <=> b.first.to_i + elsif a.first.to_i > 0 + 1 + elsif b.first.to_i > 0 + -1 + else + a.first <=> b.first + end + } + attachments = attachments.map(&:last) + end + if attachments.is_a?(Array) + attachments.each do |attachment| + if attachment.is_a?(Hash) + a = nil + file = attachment['file'] + token = attachment['token'] + t = file && file.size > 0 + if file && file.size > 0 + a = Attachment.create(:file => file, :author => author) + elsif token + # 通过token值找到对应的attachment + a = Attachment.find_by_token_only(token) + if a + a.filename = attachment['filename'] unless attachment['filename'].blank? + a.content_type = attachment['content_type'] + end + end + end + + if a && !attachment['is_public_checkbox'] + # 考虑到更新操作,所以全部设置为公开,私有项目、课程是不能访问的 + if is_public + a.is_public = true + else + a.is_public = false + end + elsif a && attachment['is_public_checkbox'] + a.is_public = true + end + set_attachment_public(a) if a + next unless a + a.description = attachment['description'].to_s.strip + a.attachtype = @curattachment_type + if a.new_record? + unsaved_attachments << a + else + saved_attachments << a + end + end + end + {:files => saved_attachments, :unsaved => unsaved_attachments} + end + + def attach_saved_attachments saved_attachments.each do |attachment| self.attachments << attachment From a3467a569796d15b433c77fc034ea86418011cbe Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 18 Sep 2016 15:53:32 +0800 Subject: [PATCH 10/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E8=B5=84=E6=BA=90=E5=85=AC=E5=BC=80?= =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160918074635_update_attach_public_for_message.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 db/migrate/20160918074635_update_attach_public_for_message.rb diff --git a/db/migrate/20160918074635_update_attach_public_for_message.rb b/db/migrate/20160918074635_update_attach_public_for_message.rb new file mode 100644 index 000000000..5f9b51c5a --- /dev/null +++ b/db/migrate/20160918074635_update_attach_public_for_message.rb @@ -0,0 +1,13 @@ +class UpdateAttachPublicForMessage < ActiveRecord::Migration + def up + begin + attachments = Attachment.where(:container_type => "Message", :is_public => 0) + attachments.update_all(:is_public => 1) + rescue Exception => e + puts e + end + end + + def down + end +end From 924db06cbf73066b5a21d47d7bc8f3e88afd3d16 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 18 Sep 2016 15:55:22 +0800 Subject: [PATCH 11/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E9=9A=90=E8=97=8F=E4=BB=A3=E7=A0=81=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 42 +++++++++++++------------- app/views/projects/show.html.erb | 11 ------- 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8d4c09ded..df40eb378 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -325,27 +325,27 @@ class ProjectsController < ApplicationController end # 版本库统计图 - unless @project.gpid.nil? || @project.project_score.changeset_num == 0 - # rep_statics_commit = @project.rep_statics.order("commits_num desc") - rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") - rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") - # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse - @a_uname = rep_statics_commit.map {|s| s.uname } - @a_uname_code = rep_statics_code.map {|s| s.uname } - @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } - @a_commits_add = rep_statics_code.map {|s| s.add.to_i } - @a_commits_del = rep_statics_code.map {|s| s.del.to_i } - @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } - g = Gitlab.client - begin - gid = @project.gpid - g_project = g.project(gid) - g_branch = g_project.default_branch.to_s - rescue =>e - logger.error("get default branch failed: " + e) - end - @rev = g_branch.nil? ? "master" : g_branch - end + # unless @project.gpid.nil? || @project.project_score.changeset_num == 0 + # # rep_statics_commit = @project.rep_statics.order("commits_num desc") + # rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") + # rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") + # # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse + # @a_uname = rep_statics_commit.map {|s| s.uname } + # @a_uname_code = rep_statics_code.map {|s| s.uname } + # @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } + # @a_commits_add = rep_statics_code.map {|s| s.add.to_i } + # @a_commits_del = rep_statics_code.map {|s| s.del.to_i } + # @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } + # g = Gitlab.client + # begin + # gid = @project.gpid + # g_project = g.project(gid) + # g_branch = g_project.default_branch.to_s + # rescue =>e + # logger.error("get default branch failed: " + e) + # end + # @rev = g_branch.nil? ? "master" : g_branch + # end # 根据对应的请求,返回对应的数据 respond_to do |format| format.html diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 39d8a9847..6c4e2b802 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -29,17 +29,6 @@
  • - <%# 时间紧,权限待优化 %> - <% unless @project.hidden_repo && !User.current.member_of?(@project) && !User.current.admin? %> - <% unless @project.gpid.nil? || @project.project_score.changeset_num == 0 || @project.rep_statics.blank? %> -
    -
    - <%= render :partial => "rep_static" %> -
    -
    -
    - <% end %> - <% end %> <%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
    \ No newline at end of file From 728e1333fc988fec0311bdb3fbccc60a961f513f Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 18 Sep 2016 15:58:55 +0800 Subject: [PATCH 12/40] =?UTF-8?q?issue=20author=E4=B8=BA=E7=A9=BA=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 191 ++++++++++++------------ 1 file changed, 97 insertions(+), 94 deletions(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index e1c9038d5..5a0065f86 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,105 +1,108 @@ -
    -
    -
    - <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> - <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> -
    -
    -
    - <% if activity.try(:author).try(:realname) == ' ' %> - <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% end %> TO - <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> -
    - <% if User.current.logged? %> -
    -
      -
    • -
        -
      • - <%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> -
      • -
      • - <% if !defined?(project_id) && !defined?(user_id) %> - <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% elsif defined?(project_id) %> - <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% elsif defined?(user_id) %> - <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% end %> -
      • -
      • - <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> +<% unless activity.author.nil? %> +
        +
        +
        + <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> + <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> +
        +
        +
        + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> +
        + <% if User.current.logged? %> +
        +
          +
        • +
            +
          • + <%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> +
          • +
          • + <% if !defined?(project_id) && !defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(project_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% end %> +
          • +
          • + <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> +
          • +
        -
      • -
      -
    - <% end %> -
    - <% case activity.tracker_id %> - <% when 1%> - 【缺陷】 - <% when 2%> - 【功能】 - <% when 3%> - 【支持】 - <% when 4%> - 【任务】 - <% when 5%> - 【周报】 - <% end %> - <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> - +
    + <% end %> +
    + <% case activity.tracker_id %> + <% when 1%> + 【缺陷】 + <% when 2%> + 【功能】 + <% when 3%> + 【支持】 + <% when 4%> + 【任务】 + <% when 5%> + 【周报】 + <% end %> + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> + <%= get_issue_priority(activity.priority_id)[1] %> -
    -
    -
    指派给   - <% unless activity.assigned_to_id.nil? %> - <% if activity.try(:assigned_to).try(:realname) == ' ' %> - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> +
    +
    +
    指派给   + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname) == ' ' %> + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% end %> + <% end %> +
    +
    + 发布时间: + <%=format_time(activity.created_on) %> +
    +
    + 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> +
    +
    +
    + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> + + +
    + <%# 局部刷新:修改xissue属性 %> + <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> + <% unless params[:action] == "index" %> +
    + <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> +
    <% end %> <% end %> -
    -
    - 发布时间: - <%=format_time(activity.created_on) %> -
    -
    - 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> +
    +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
    - <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> - - -
    - <%# 局部刷新:修改xissue属性 %> - <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> - <% unless params[:action] == "index" %> -
    - <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> -
    - <% end %> - <% end %> -
    -
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
    + <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
    -
    -
    -
    - <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> -
    -
    - + +<% end %> + From 04a2effceec5c8b07b230a51fd90cc5bb5bc2cc3 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Sun, 18 Sep 2016 16:12:38 +0800 Subject: [PATCH 13/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/courses.rb | 30 ++++++++++---- app/services/courses_service.rb | 8 +++- public/assets/wechat/join_class.html | 2 + public/assets/wechat/join_classgroup.html | 32 +++++++++++++++ .../wechat/controllers/join_class.js | 8 +++- .../wechat/controllers/join_classgroup.js | 39 +++++++++++++++++++ public/javascripts/wechat/others/routes.js | 1 + 7 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 public/assets/wechat/join_classgroup.html create mode 100644 public/javascripts/wechat/controllers/join_classgroup.js diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 57feff084..f0e4c867d 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -118,20 +118,18 @@ module Mobile roles_ids << "10" end + go_course_group = 0 + if roles_ids.length <= 0 {status:-1,message:"请至少选择一个角色"} else cs = CoursesService.new status = cs.join_course_roles({role: roles_ids, openid: params[:openid], invite_code: params[:invite_code]}, current_user) - if params[:student_flag] && status[:state] == 0 - #查询分班信息 - - - end - { status: status[:state], - message:CoursesService::JoinCourseError.message(status[:state]) + message:CoursesService::JoinCourseError.message(status[:state]), + go_coursegroup_flag:status[:go_coursegroup_flag], + course_id:status[:course_id] } end end @@ -756,6 +754,24 @@ module Mobile end out.merge(message: message) end + + desc '获取分班列表' + params do + requires :token, type:String + end + get ':course_id/course_groups' do + begin + authenticate! + course = Course.find(params[:course_id]) + groups = [] + groups = course.course_groups if course.course_groups + present :data,groups + present :status,0 + rescue + present :status,-1 + end + end + end end end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 5add9979d..182d1150f 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -565,6 +565,8 @@ class CoursesService #多个角色加入课程 def join_course_roles params,current_user course = Course.find_by_invite_code(params[:invite_code]) if params[:invite_code] + go_coursegroup_flag = 0 + course_id = 0 @state = 10 if course @@ -621,6 +623,8 @@ class CoursesService course.members << members StudentsForCourse.create(:student_id => current_user.id, :course_id => course.id) @state = 0 + go_coursegroup_flag = 1 if course.course_groups + course_id = course.id send_wechat_join_class_notice current_user,course,10,0 else is_stu = false @@ -630,6 +634,8 @@ class CoursesService course.members << members StudentsForCourse.create(:student_id => current_user.id, :course_id =>course.id) is_stu = true + go_coursegroup_flag = 1 if course.course_groups + course_id = course.id send_wechat_join_class_notice current_user,course,10,0 end #如果已经发送过消息了,那么就要给个提示 @@ -674,7 +680,7 @@ class CoursesService else @state = 4 end - {:state => @state,:course => course} + {:state => @state,:course => course,:go_coursegroup_flag => go_coursegroup_flag,:course_id=>course_id} end diff --git a/public/assets/wechat/join_class.html b/public/assets/wechat/join_class.html index ad43db3a7..4c81ff2e4 100644 --- a/public/assets/wechat/join_class.html +++ b/public/assets/wechat/join_class.html @@ -25,5 +25,7 @@
    +
    {{tip_1}}
    + diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html new file mode 100644 index 000000000..6da2f1503 --- /dev/null +++ b/public/assets/wechat/join_classgroup.html @@ -0,0 +1,32 @@ +
    +
    +
    +
    欢迎加入班级
    +
    {{current_course.name}}
    +
    选择分班
    +
      +
    • + +
      +
    • + +
      +
    + +
    + 提示 +
      +
    • 该班级存在分班信息,请选择属于您的小班
    • +
    • 老师可以在班级的成员管理页,对所有成员进行修改
    • +
    • 学生可以在班级的我的同学页,对自己进行修改
    • +
    +
    + +
    + 取消 + 确定 +
    +
    + + +
    \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/join_class.js b/public/javascripts/wechat/controllers/join_class.js index 006fa0b59..8f7647b12 100644 --- a/public/javascripts/wechat/controllers/join_class.js +++ b/public/javascripts/wechat/controllers/join_class.js @@ -55,10 +55,16 @@ app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'ale assistant_flag:vm.assistant, student_flag:vm.student }).then(function(response){ + console.log(response); if(response.data.status == 0){ vm.alertService.showMessage('提示', response.data.message,function(){ rms.save('syllabuses',[]); - $location.path("/class_list"); + if(response.data.go_coursegroup_flag == 0){ + $location.path("/class_list"); + } + else{ + $location.path("/join_classgroup").search({id: response.data.course_id}); + } }); } else { vm.alertService.showMessage('提示', response.data.message); diff --git a/public/javascripts/wechat/controllers/join_classgroup.js b/public/javascripts/wechat/controllers/join_classgroup.js new file mode 100644 index 000000000..504643817 --- /dev/null +++ b/public/javascripts/wechat/controllers/join_classgroup.js @@ -0,0 +1,39 @@ + + +app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx,common){ + var vm = $scope; + + var course_id = $routeParams.id; + vm.alertService = alertService.create(); + + $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then( + function(response) { + console.log(response.data); + if (response.data.status == 0){ + vm.current_course = response.data.data; + console.log("courses"); + console.log(response.data.data); + } + else{ + vm.alertService.showMessage('提示', response.data.message); + } + if(!vm.current_course){ + vm.tip_1 = "该班级不存在或已被删除"; + } + } + ); + + if(vm.current_course){ + $http.get(config.apiUrl + 'courses/course_groups?token='+auth.token()+'&course_id='+course_id).then( + function(response) { + if(response.data.status == 0) { + vm.groups = response.data.groups; + } + else{ + vm.groups = []; + } + }); + } + + +}] ); \ No newline at end of file diff --git a/public/javascripts/wechat/others/routes.js b/public/javascripts/wechat/others/routes.js index e5c87d1ab..845995ec6 100644 --- a/public/javascripts/wechat/others/routes.js +++ b/public/javascripts/wechat/others/routes.js @@ -39,6 +39,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func .when('/invite_code', {templateUrl: rootPath + 'invite_code.html', controller: 'InviteCodeController'}) .when('/send_class_list', makeRoute('send_class_list.html', 'SendClassListController')) .when('/join_class', makeRoute('join_class.html', 'JoinClassController')) + .when('/join_classgroup', makeRoute('join_classgroup.html', 'JoinClassGroupController')) .when('/review_class_member', makeRoute('review_class_member.html', 'ReviewClassMemberController')) .when('/class_publishnotice', makeRoute('class_publishnotice.html', 'ClassPublishNoticeController')) .when('/class_publishissue', makeRoute('class_publishissue.html', 'ClassPublishIssueController')) From dd825a6426e89526273484c801361d447571b11e Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 16:26:47 +0800 Subject: [PATCH 14/40] =?UTF-8?q?config/environments/production.rb=20=20?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E6=96=87=E4=BB=B6=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a1f5f7e76..9d33b264c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /config/configuration.yml /config/additional_environment.rb /config/oneapm.yml +/config/environments/production.rb /files/* From 97394a6cbe529cff023cae4966f5bc686aaa0355 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 18 Sep 2016 16:47:13 +0800 Subject: [PATCH 15/40] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=8E=E7=8F=AD=E7=BA=A7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 16 ++++++++-------- public/assets/wechat/class.html | 2 +- public/assets/wechat/class_publishissue.html | 2 +- public/assets/wechat/class_publishnotice.html | 2 +- public/assets/wechat/course_discussion.html | 2 +- public/assets/wechat/course_notice.html | 2 +- public/assets/wechat/homework_detail.html | 2 +- public/assets/wechat/invite_code.html | 2 +- public/assets/wechat/myresource.html | 4 ++-- public/assets/wechat/review_class_member.html | 4 ++-- public/stylesheets/weui/weixin.css | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 2d45f4d17..09490b766 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -40,7 +40,7 @@
    - +
    {{act.praise_count}}
    @@ -75,7 +75,7 @@
    - +
    {{act.praise_count}}
    @@ -111,7 +111,7 @@
    - +
    {{act.praise_count}}
    @@ -147,7 +147,7 @@
    - + @@ -405,7 +405,7 @@
    - +
    {{act.praise_count}}
    @@ -440,7 +440,7 @@
    - +
    {{act.praise_count}}
    @@ -476,7 +476,7 @@
    - +
    {{act.praise_count}}
    @@ -512,7 +512,7 @@
    - + diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 836575b90..303b73057 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -1,6 +1,6 @@
    -
    邀请码
    +
    邀请码
    diff --git a/public/assets/wechat/class_publishissue.html b/public/assets/wechat/class_publishissue.html index f4dd40552..5a65beabf 100644 --- a/public/assets/wechat/class_publishissue.html +++ b/public/assets/wechat/class_publishissue.html @@ -1,7 +1,7 @@
    -
    {{current_course.name}}
    +
    标题
    diff --git a/public/assets/wechat/class_publishnotice.html b/public/assets/wechat/class_publishnotice.html index d27e378d3..e56c762a6 100644 --- a/public/assets/wechat/class_publishnotice.html +++ b/public/assets/wechat/class_publishnotice.html @@ -1,7 +1,7 @@
    -
    {{current_course.name}}
    +
    标题
    diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 91aa58fcf..8dc08c788 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -24,7 +24,7 @@
    {{discussion.subject}}
    -
    {{discussion.course_project_name}} - 班级讨论区{{discussion.created_on}}
    +
    {{discussion.syllabus_title}}·{{discussion.course_project_name}} - 班级讨论区{{discussion.created_on}}
    diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 247cd1fd0..3358da343 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -23,7 +23,7 @@
    {{news.title}}
    -
    {{news.course_name}} - 课程通知{{news.created_on}}
    +
    {{discussion.syllabus_title}}·{{news.course_name}} - 课程通知{{news.created_on}}
    diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index e5f73faa9..3898bee14 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -23,7 +23,7 @@
    {{homework.name}}
    -
    {{homework.course_name}} - 普通作业编程作业分组作业{{homework.publish_time}}
    +
    {{discussion.syllabus_title}}·{{homework.course_name}} - 普通作业编程作业分组作业{{homework.publish_time}}
    迟交扣分:{{homework.late_penalty}}分 匿评开启时间:{{homework.evaluation_start}}
    diff --git a/public/assets/wechat/invite_code.html b/public/assets/wechat/invite_code.html index 3aaa00bbe..c6d3b425f 100644 --- a/public/assets/wechat/invite_code.html +++ b/public/assets/wechat/invite_code.html @@ -1,7 +1,7 @@
    - +
    邀请码:{{course.invite_code}}
    diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 1848dad60..df04a184f 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -13,7 +13,7 @@
    {{r.filename}}发送
    - 大小:{{r.attafile_size}}
    + 大小:{{r.attafile_size}}
    更多
    @@ -24,7 +24,7 @@
    {{r.homework_name}}发送
    -
    +
    更多
    diff --git a/public/assets/wechat/review_class_member.html b/public/assets/wechat/review_class_member.html index e066c48f0..b1f0dacc5 100644 --- a/public/assets/wechat/review_class_member.html +++ b/public/assets/wechat/review_class_member.html @@ -2,7 +2,7 @@
    -
    {{current_course.name}}
    +
    {{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}
    角色
      @@ -29,7 +29,7 @@
    -
    {{current_course.name}}
    +
    {{tip_2}}
    diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index cf44a3814..8e0b3933e 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -147,7 +147,7 @@ a.underline {text-decoration:underline;} .post-dynamic-author {width:50%; height:30px; line-height:30px; font-size:14px; color:#5b5b5b; vertical-align:middle;} .post-dynamic-time {height:30px; line-height:30px; vertical-align:middle;} .post-dynamic-title {font-size:15px;} -.post-dynamic-from {width:50%; font-size:13px;} +.post-dynamic-from {width:55%; font-size:13px;} .post-box-shadow {box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} .post-reply-author {width:50%; height:20px; line-height:20px; font-size:12px; color:#5d5d5d; vertical-align:middle;} .post-reply-time {height:20px; line-height:20px; vertical-align:middle;} From fe431902d70cce85acee1fb1df9a9f2305d46e17 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Sun, 18 Sep 2016 16:48:20 +0800 Subject: [PATCH 16/40] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=99=E8=A8=80?= =?UTF-8?q?=E7=9A=84at=E5=BE=AE=E4=BF=A1=E7=9B=B8=E5=85=B3BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/at_message.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/at_message.rb b/app/models/at_message.rb index 2212ef07e..10afe3e79 100644 --- a/app/models/at_message.rb +++ b/app/models/at_message.rb @@ -99,7 +99,7 @@ class AtMessage < ActiveRecord::Base else type = "journal_for_message" detail_id = topic.id - detail_title = at_message.notes + detail_title = topic.notes.nil? ? "" : topic.notes end else status = -1 From 030056fd0d0a17792446f9d89375abbef0be88db Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 18 Sep 2016 16:51:52 +0800 Subject: [PATCH 17/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E9=99=84=E4=BB=B6=E4=B8=8B=E8=BD=BD=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index 20bc0a7ad..acfc28c41 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -219,11 +219,7 @@ module Redmine if a && !attachment['is_public_checkbox'] # 考虑到更新操作,所以全部设置为公开,私有项目、课程是不能访问的 - if is_public - a.is_public = true - else - a.is_public = false - end + a.is_public = true elsif a && attachment['is_public_checkbox'] a.is_public = true end From fa82860813408a4498308edcc680b5087ddc1693 Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 17:01:08 +0800 Subject: [PATCH 18/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E5=8A=A8=E6=80=81=E7=9A=84=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7e9add5e2..bdbaf1738 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1683,7 +1683,7 @@ class UsersController < ApplicationController container_type = 'Project' act_type = 'Issue' when "project_message" - container_type = 'Course' + container_type = 'Project' act_type = 'Message' when "user_journals" container_type = 'Principal' From 7a5f21456d75dcf3cf4c7ec21d3bd9641cea4a21 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 19 Sep 2016 11:24:44 +0800 Subject: [PATCH 19/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/edit_userinfo.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/assets/wechat/edit_userinfo.html b/public/assets/wechat/edit_userinfo.html index f4178fee4..3e4bf51f2 100644 --- a/public/assets/wechat/edit_userinfo.html +++ b/public/assets/wechat/edit_userinfo.html @@ -12,6 +12,7 @@
    姓名
    +
    姓名不能为空
    性别 @@ -28,10 +29,10 @@
    邮箱 -
    - 电子邮箱地址不能为空 - 电子邮箱地址不合法 -
    +
    +
    + 电子邮箱地址不能为空 + 电子邮箱地址不合法
    提示 From 3624d9d4ca95863bdb2774ee84572370aa4b07d4 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 19 Sep 2016 13:22:29 +0800 Subject: [PATCH 20/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/courses.rb | 27 +++++++- app/api/mobile/entities/course.rb | 3 + app/api/mobile/entities/user.rb | 4 ++ app/services/courses_service.rb | 2 +- public/assets/wechat/class.html | 3 +- public/assets/wechat/join_classgroup.html | 10 +-- .../assets/wechat/select_my_coursegroup.html | 25 +++++++ .../javascripts/wechat/controllers/class.js | 8 ++- .../wechat/controllers/join_class.js | 6 +- .../wechat/controllers/join_classgroup.js | 63 ++++++++++++++---- .../controllers/select_my_coursegroup.js | 66 +++++++++++++++++++ public/javascripts/wechat/others/routes.js | 1 + 12 files changed, 195 insertions(+), 23 deletions(-) create mode 100644 public/assets/wechat/select_my_coursegroup.html create mode 100644 public/javascripts/wechat/controllers/select_my_coursegroup.js diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index f0e4c867d..dd5525fae 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -757,12 +757,13 @@ module Mobile desc '获取分班列表' params do + requires :id, type: Integer requires :token, type:String end - get ':course_id/course_groups' do + get 'course_groups/:id' do begin authenticate! - course = Course.find(params[:course_id]) + course = Course.find(params[:id]) groups = [] groups = course.course_groups if course.course_groups present :data,groups @@ -772,6 +773,28 @@ module Mobile end end + desc "加入分班" + params do + requires :id, type: Integer + requires :token, type: String + requires :course_group_id, type: Integer + end + post 'join_coursegroup' do + begin + authenticate! + member = Member.where(:course_id => params[:id], :user_id => current_user.id).first + + raise "你还不是该班级的学生!" unless member + + member.course_group_id = params[:course_group_id].to_i + member.save + present :status,0 + rescue Exception=>e + present :message,e.message + present :status,-1 + end + end + end end end diff --git a/app/api/mobile/entities/course.rb b/app/api/mobile/entities/course.rb index 30a5a6cc9..9bf1cc1f6 100644 --- a/app/api/mobile/entities/course.rb +++ b/app/api/mobile/entities/course.rb @@ -19,6 +19,8 @@ module Mobile (format_time(c[field]) if (c.is_a?(Hash) && c.key?(field))) || (format_time(c.send(field)) if c.respond_to?(field)) elsif field == :member_count ::Course===c ? c.members.count : 0 + elsif field == :syllabus_title + c.syllabus.nil? ? "":c.syllabus.title else (c[field] if (c.is_a?(Hash) && c.key?(field))) || (c.send(field) if c.respond_to?(field)) end @@ -38,6 +40,7 @@ module Mobile course_expose :lft course_expose :location course_expose :name + course_expose :syllabus_title course_expose :open_student # course_expose :password course_expose :rgt diff --git a/app/api/mobile/entities/user.rb b/app/api/mobile/entities/user.rb index 30a2a7edd..09ef6a599 100644 --- a/app/api/mobile/entities/user.rb +++ b/app/api/mobile/entities/user.rb @@ -36,6 +36,8 @@ module Mobile u.lastname when :mail u.mail + when :is_me + defined? u.is_me ? u.is_me : 0 end end end @@ -77,6 +79,8 @@ module Mobile user_expose :name + user_expose :is_me + end end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 182d1150f..2c0506d1e 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -115,7 +115,7 @@ class CoursesService role_name: m.roles.first.name, name: m.user.show_name, roles_id: role_ids.include?(7) ? 7 : (role_ids.include?(9) ? 9 : 10 ), - :brief_introduction => m.user.user_extensions.brief_introduction,:realname=>m.user.realname} + :brief_introduction => m.user.user_extensions.brief_introduction,:realname=>m.user.realname,:is_me => current_user.id == m.user.id ? 1:0 } # end end diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 836575b90..30c9120c3 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -25,7 +25,7 @@
    -
    +
    diff --git a/public/assets/wechat/select_my_coursegroup.html b/public/assets/wechat/select_my_coursegroup.html new file mode 100644 index 000000000..c16b276e4 --- /dev/null +++ b/public/assets/wechat/select_my_coursegroup.html @@ -0,0 +1,25 @@ +
    +
    +
    +
    我的信息
    +
    {{current_edit_member.user.show_name}}
    +
    角色
    +
    学生
    +
    选择分班
    +
      +
    • +
    • +
    • +
    + +
    + 取消 + 确定 +
    +
    + +
    {{tip_1}}
    +
    {{tip_2}}
    + + +
    diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index ea394a1ff..ca4ad6d76 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -247,7 +247,6 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location resetMenu(vm.course.current_user_is_teacher,vm.currentTab); } - vm.onSetting = function(user){ rms.save('current_edit_member', user); rms.save("course",vm.course); @@ -255,6 +254,13 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location $location.path("/edit_class_member").search({id: courseid,user_id: user.id}); }; + vm.onSetting_1 = function(user){ + rms.save('current_edit_member', user); + rms.save("course",vm.course); + rms.save("tab_num",vm.currentTab); + $location.path("/select_my_coursegroup").search({id: courseid}); + }; + vm.review = function(user){ rms.save('current_review_member', user); rms.save('current_course', vm.course); diff --git a/public/javascripts/wechat/controllers/join_class.js b/public/javascripts/wechat/controllers/join_class.js index 8f7647b12..709072562 100644 --- a/public/javascripts/wechat/controllers/join_class.js +++ b/public/javascripts/wechat/controllers/join_class.js @@ -67,7 +67,11 @@ app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'ale } }); } else { - vm.alertService.showMessage('提示', response.data.message); + vm.alertService.showMessage('提示', response.data.message,function(){ + if(response.data.go_coursegroup_flag == 1) { + $location.path("/join_classgroup").search({id: response.data.course_id}); + } + }); } }); }; diff --git a/public/javascripts/wechat/controllers/join_classgroup.js b/public/javascripts/wechat/controllers/join_classgroup.js index 504643817..a661ba6fc 100644 --- a/public/javascripts/wechat/controllers/join_classgroup.js +++ b/public/javascripts/wechat/controllers/join_classgroup.js @@ -5,14 +5,28 @@ app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config', var course_id = $routeParams.id; vm.alertService = alertService.create(); + vm.selectid = 0; $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then( function(response) { console.log(response.data); if (response.data.status == 0){ vm.current_course = response.data.data; - console.log("courses"); + console.log("courses="); console.log(response.data.data); + if(vm.current_course){ + $http.get(config.apiUrl + 'courses/course_groups/'+course_id+'?token='+auth.token()).then( + function(response) { + console.log("groups="); + console.log(response); + if(response.data.status == 0) { + vm.groups = response.data.data; + } + else{ + vm.groups = []; + } + }); + } } else{ vm.alertService.showMessage('提示', response.data.message); @@ -23,17 +37,42 @@ app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config', } ); - if(vm.current_course){ - $http.get(config.apiUrl + 'courses/course_groups?token='+auth.token()+'&course_id='+course_id).then( - function(response) { - if(response.data.status == 0) { - vm.groups = response.data.groups; - } - else{ - vm.groups = []; - } - }); - } + vm.selectGroup = function(id){ + vm.selectid = id; + }; + + + vm.cancel = function(){ + }; + + vm.confirm = function(){ + if(vm.selectid == 0){ + rms.save('syllabuses',[]); + $location.path("/class_list"); + return; + } + + //加入分班 + $http.post(config.apiUrl+'courses/join_coursegroup', { + token: auth.token(), + id: course_id, + course_group_id:vm.selectid + }).then(function(response){ + console.log(response); + if(response.data.status == 0){ + vm.alertService.showMessage('提示', "加入分班成功!",function(){ + rms.save('syllabuses',[]); + $location.path("/class_list"); + + }); + } else { + vm.alertService.showMessage('提示', response.data.message,function(){ + rms.save('syllabuses',[]); + $location.path("/class_list"); + }); + } + }); + }; }] ); \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/select_my_coursegroup.js b/public/javascripts/wechat/controllers/select_my_coursegroup.js new file mode 100644 index 000000000..2c338d33f --- /dev/null +++ b/public/javascripts/wechat/controllers/select_my_coursegroup.js @@ -0,0 +1,66 @@ + + +app.controller('SelectMyCourseGroupController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){ +// common.checkLogin(); + + var vm = $scope; + + vm.current_review_member = rms.get('current_review_member'); + + vm.alertService = alertService.create(); + + vm.tip_1 = ""; + vm.tip_2 = ""; + + var course_id = $routeParams.id; + if(!vm.current_course){ + $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then( + function(response) { + console.log(response.data); + if (response.data.status == 0){ + vm.current_course = response.data.data; + console.log("courses"); + console.log(response.data.data); + } + else{ + vm.alertService.showMessage('提示', response.data.message); + } + if(!vm.current_course){ + vm.tip_1 = "该班级不存在或已被删除"; + } + + } + ); + } + + if(!vm.current_edit_member){ + $http.post(config.apiUrl+'courses/get_member_info', { + token: auth.token(), + id: course_id, + user_id:user_id + }).then(function(response){ + if(response.data.status!=0){ + vm.alertService.showMessage('提示', response.data.message,function(){ + $location.path("/class").search({id: course_id,tag:1}); + }); + } else { + console.log(response); + course_id = response.data.course_id; + vm.current_edit_member = response.data.member_info; + vm.current_roles_id = vm.current_edit_member.roles_id; + + for(var i in vm.current_roles_id){ + if(vm.current_roles_id[i] == 10){ + vm.student = true; + return; + } + } + + if(!vm.student){ + vm.tip_2 = "您不是该班级的学生!"; + } + } + }); + } + +}] ); \ No newline at end of file diff --git a/public/javascripts/wechat/others/routes.js b/public/javascripts/wechat/others/routes.js index 845995ec6..7b5434ddd 100644 --- a/public/javascripts/wechat/others/routes.js +++ b/public/javascripts/wechat/others/routes.js @@ -41,6 +41,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func .when('/join_class', makeRoute('join_class.html', 'JoinClassController')) .when('/join_classgroup', makeRoute('join_classgroup.html', 'JoinClassGroupController')) .when('/review_class_member', makeRoute('review_class_member.html', 'ReviewClassMemberController')) + .when('/select_my_coursegroup', makeRoute('select_my_coursegroup.html', 'SelectMyCourseGroupController')) .when('/class_publishnotice', makeRoute('class_publishnotice.html', 'ClassPublishNoticeController')) .when('/class_publishissue', makeRoute('class_publishissue.html', 'ClassPublishIssueController')) .when('/project_list', makeRoute('project_list.html', 'ProjectListController')) From 5b613964103a1742137c41221f9d81db41a1011b Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 19 Sep 2016 13:53:15 +0800 Subject: [PATCH 21/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/attachment.rb | 3 +++ app/api/mobile/entities/course.rb | 3 --- app/api/mobile/entities/exercise.rb | 3 +++ app/api/mobile/entities/homework.rb | 4 ++++ app/api/mobile/entities/message.rb | 5 +++++ app/api/mobile/entities/news.rb | 6 ++++++ app/api/mobile/entities/whomework.rb | 3 +++ 7 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/api/mobile/entities/attachment.rb b/app/api/mobile/entities/attachment.rb index 8200c04b2..0eda2d1c0 100644 --- a/app/api/mobile/entities/attachment.rb +++ b/app/api/mobile/entities/attachment.rb @@ -23,6 +23,8 @@ module Mobile (number_to_human_size(f.filesize)).gsub("ytes", "").to_s when :coursename f.course.nil? ? "" : f.course.name + when :syllabus_title + f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title when :course_id f.course.nil? ? 0 : f.course.id @@ -40,6 +42,7 @@ module Mobile attachment_expose :file_dir attachment_expose :attafile_size attachment_expose :coursename #所属班级名 + attachment_expose :syllabus_title #所属班级名 attachment_expose :course_id #所属班级名 expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options| current_user = options[:user] diff --git a/app/api/mobile/entities/course.rb b/app/api/mobile/entities/course.rb index 9bf1cc1f6..30a5a6cc9 100644 --- a/app/api/mobile/entities/course.rb +++ b/app/api/mobile/entities/course.rb @@ -19,8 +19,6 @@ module Mobile (format_time(c[field]) if (c.is_a?(Hash) && c.key?(field))) || (format_time(c.send(field)) if c.respond_to?(field)) elsif field == :member_count ::Course===c ? c.members.count : 0 - elsif field == :syllabus_title - c.syllabus.nil? ? "":c.syllabus.title else (c[field] if (c.is_a?(Hash) && c.key?(field))) || (c.send(field) if c.respond_to?(field)) end @@ -40,7 +38,6 @@ module Mobile course_expose :lft course_expose :location course_expose :name - course_expose :syllabus_title course_expose :open_student # course_expose :password course_expose :rgt diff --git a/app/api/mobile/entities/exercise.rb b/app/api/mobile/entities/exercise.rb index ce6a2fb39..821380b47 100644 --- a/app/api/mobile/entities/exercise.rb +++ b/app/api/mobile/entities/exercise.rb @@ -19,6 +19,8 @@ module Mobile case field when :coursename f.course.nil? ? "" : f.course.name + when :syllabus_title + f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title end end end @@ -27,6 +29,7 @@ module Mobile expose :exercise_name expose :exercise_description exercise_expose :coursename #所属班级名 + exercise_expose :syllabus_title expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options| current_user = options[:user] diff --git a/app/api/mobile/entities/homework.rb b/app/api/mobile/entities/homework.rb index a5b981c6d..d149681e4 100644 --- a/app/api/mobile/entities/homework.rb +++ b/app/api/mobile/entities/homework.rb @@ -39,6 +39,8 @@ module Mobile val when :coursename f.course.nil? ? "" : f.course.name + when :syllabus_title + f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title end end end @@ -49,6 +51,8 @@ module Mobile #课程名称 homework_expose :course_name + homework_expose :syllabus_title + homework_expose :course_id #作业发布者 expose :author,using: Mobile::Entities::User do |f, opt| diff --git a/app/api/mobile/entities/message.rb b/app/api/mobile/entities/message.rb index 07c560a1f..189b52851 100644 --- a/app/api/mobile/entities/message.rb +++ b/app/api/mobile/entities/message.rb @@ -22,6 +22,10 @@ module Mobile else u.project.name end + when :syllabus_title + if u.board.project_id == -1 + u.course.syllabus.nil? ? "" : u.course.syllabus.title + end when :lasted_comment time_from_now u.created_on when :praise_count @@ -50,6 +54,7 @@ module Mobile message_expose :act_type message_expose :act_id message_expose :course_project_name + message_expose :syllabus_title message_expose :board_id message_expose :subject message_expose :title diff --git a/app/api/mobile/entities/news.rb b/app/api/mobile/entities/news.rb index d8c4dcab3..4515791cd 100644 --- a/app/api/mobile/entities/news.rb +++ b/app/api/mobile/entities/news.rb @@ -26,6 +26,11 @@ module Mobile f.id when :comment_count f.comments.count + when :syllabus_title + unless f.course_id == nil + course = get_course(f.course_id) + course.syllabus.nil? ? "" : course.syllabus.title + end end end elsif f.is_a?(::Comment) @@ -89,6 +94,7 @@ module Mobile news_expose :praise_count #课程名字 news_expose :course_name + news_expose :syllabus_title news_expose :lasted_comment #评论 diff --git a/app/api/mobile/entities/whomework.rb b/app/api/mobile/entities/whomework.rb index 9d141552a..b19d34f05 100644 --- a/app/api/mobile/entities/whomework.rb +++ b/app/api/mobile/entities/whomework.rb @@ -30,6 +30,8 @@ module Mobile wh.journals_for_messages.count when :course_name wh.course.name + when :syllabus_title + wh.course.syllabus.nil? ? "" : wh.course.syllabus.title when :act_type 'HomeworkCommon' when :act_id @@ -65,6 +67,7 @@ module Mobile whomework_expose :act_type whomework_expose :act_id whomework_expose :course_name + whomework_expose :syllabus_title whomework_expose :created_at whomework_expose :absence_penalty whomework_expose :evaluation_start From 126c18f8333f4afd3fbb60cd53140f6c24927283 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 19 Sep 2016 14:00:52 +0800 Subject: [PATCH 22/40] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9D=A5=E6=BA=90=E5=AE=BD=E5=BA=A6=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=9B=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/course_notice.html | 2 +- public/assets/wechat/homework_detail.html | 2 +- public/stylesheets/weui/weixin.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 3358da343..a0c242d72 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -23,7 +23,7 @@
    {{news.title}}
    -
    {{discussion.syllabus_title}}·{{news.course_name}} - 课程通知{{news.created_on}}
    +
    {{news.syllabus_title}}·{{news.course_name}} - 课程通知{{news.created_on}}
    diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 3898bee14..908cff977 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -23,7 +23,7 @@
    {{homework.name}}
    -
    {{discussion.syllabus_title}}·{{homework.course_name}} - 普通作业编程作业分组作业{{homework.publish_time}}
    +
    {{homework.syllabus_title}}·{{homework.course_name}} - 普通作业编程作业分组作业{{homework.publish_time}}
    迟交扣分:{{homework.late_penalty}}分 匿评开启时间:{{homework.evaluation_start}}
    diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 8e0b3933e..d2d92a361 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -203,7 +203,7 @@ a.underline {text-decoration:underline;} .img-circle {border-radius:50% !important;} .member-banner {height:24px; line-height:24px; text-align:center; vertical-align:middle; background-color:#dfdfdf;} .resource-width {width:76%;} -.courseware-from-width {max-width:57%;} +.courseware-from-width {max-width:50%;} .other-from-width {max-width:80%;} .course-name-width {width:68%;} From 9c214ef57b9756683a1e2f8f8daec86d5414e669 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 19 Sep 2016 14:07:32 +0800 Subject: [PATCH 23/40] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E8=B5=84=E6=96=99?= =?UTF-8?q?=E6=96=87=E5=AD=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/edit_userinfo.html | 6 +++--- public/stylesheets/weui/weixin.css | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/assets/wechat/edit_userinfo.html b/public/assets/wechat/edit_userinfo.html index 3e4bf51f2..b0a00bba2 100644 --- a/public/assets/wechat/edit_userinfo.html +++ b/public/assets/wechat/edit_userinfo.html @@ -12,7 +12,7 @@
    姓名
    -
    姓名不能为空
    +
    姓名不能为空
    性别 @@ -31,8 +31,8 @@
    - 电子邮箱地址不能为空 - 电子邮箱地址不合法 + 电子邮箱地址不能为空 + 电子邮箱地址不合法
    提示 diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index d2d92a361..aa4cff972 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -43,6 +43,7 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin: 5px 0.4em 5px 1.4e .mr25 {margin-right:25px;} .ml55 {margin-left:55px;} .mr55 {margin-right:55px;} +.ml65 {margin-left:65px;} .c-red {color:#e81a1a;} .c-blue {color:#269ac9;} .c-grey {color:#9a9a9a !important;} From 2856cd06d5c3511486b1ff661d021b7c5212e973 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 20 Sep 2016 14:42:36 +0800 Subject: [PATCH 24/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=82=B9=E5=87=BB=E5=8F=AF=E6=94=BE=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/app.html | 1 + public/assets/wechat/blog_detail.html | 2 +- public/assets/wechat/course_discussion.html | 2 +- public/assets/wechat/course_notice.html | 2 +- public/assets/wechat/homework_detail.html | 2 +- public/assets/wechat/issue_detail.html | 2 +- public/assets/wechat/jour_message_detail.html | 2 +- public/assets/wechat/project_discussion.html | 2 +- .../wechat/directives/img_preview.js | 22 +++++++++++++++++++ 9 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 public/javascripts/wechat/directives/img_preview.js diff --git a/public/assets/wechat/app.html b/public/assets/wechat/app.html index 099384593..232f07494 100644 --- a/public/assets/wechat/app.html +++ b/public/assets/wechat/app.html @@ -41,6 +41,7 @@ + diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index 7aa629bb7..91a5fff59 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -25,7 +25,7 @@
    {{blog.title}}
    博客{{blog.created_at}}
    -
    +
    diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 8dc08c788..7a818bb79 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -25,7 +25,7 @@
    {{discussion.subject}}
    {{discussion.syllabus_title}}·{{discussion.course_project_name}} - 班级讨论区{{discussion.created_on}}
    -
    +
    diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index a0c242d72..c13a7b532 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -24,7 +24,7 @@
    {{news.title}}
    {{news.syllabus_title}}·{{news.course_name}} - 课程通知{{news.created_on}}
    -
    +
    diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 908cff977..161c3be94 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -24,7 +24,7 @@
    {{homework.name}}
    {{homework.syllabus_title}}·{{homework.course_name}} - 普通作业编程作业分组作业{{homework.publish_time}}
    -
    +
    迟交扣分:{{homework.late_penalty}}分 匿评开启时间:{{homework.evaluation_start}}
    缺评扣分:{{homework.absence_penalty}}分/作品 diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index f4eed4bd9..278b545a5 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -26,7 +26,7 @@
    {{issue.subject}}
    {{issue.project_name}} - 项目问题{{issue.created_on}}
    -
    +
    状   态:{{issue.issue_status}} 优先级:{{issue.issue_priority}}
    指派给:{{issue.issue_assigned_to}} diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index a1db224a6..736ad419b 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -24,7 +24,7 @@
    留言{{message.created_on}}
    -
    +
    diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index dcb5a68a6..7fca33657 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -25,7 +25,7 @@
    {{discussion.subject}}
    {{discussion.course_project_name}} - 项目讨论区{{discussion.created_on}}
    -
    +
    diff --git a/public/javascripts/wechat/directives/img_preview.js b/public/javascripts/wechat/directives/img_preview.js new file mode 100644 index 000000000..08f33d381 --- /dev/null +++ b/public/javascripts/wechat/directives/img_preview.js @@ -0,0 +1,22 @@ +/** + * Created by ttang on 2016/9/20. + */ +app.directive('imgPreview',["$timeout",'wx',function(timer,wx){ + return{ + restrict: 'A', + scope: {}, + link: function(scope, element){ + timer(function(){ + var srcList = []; + $.each($(".post-all-content img"),function(i,item){ + if(item.src){ + srcList.push(item.src); + $(item).click(function(e){ + wx.previewImage(this.src,srcList); + }); + } + }); + }) + } + } +}]); \ No newline at end of file From 8b771a183c6dc6fb99ad02e0f0effbd1f60fcea6 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 20 Sep 2016 14:58:37 +0800 Subject: [PATCH 25/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=88=86=E7=8F=AD?= =?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/api/mobile/apis/courses.rb | 124 +++++++++++++++- app/api/mobile/entities/course.rb | 1 + app/api/mobile/entities/course_group.rb | 19 +++ app/services/courses_service.rb | 4 +- .../_programing_work_show.html.erb | 2 +- public/assets/wechat/class.html | 4 +- public/assets/wechat/class_group.html | 20 +++ public/assets/wechat/edit_class_group.html | 14 ++ public/assets/wechat/edit_class_member.html | 16 ++- public/assets/wechat/edit_userinfo.html | 1 + public/assets/wechat/join_class.html | 2 - public/assets/wechat/join_classgroup.html | 10 +- .../assets/wechat/select_my_coursegroup.html | 17 ++- .../javascripts/wechat/controllers/class.js | 21 ++- .../wechat/controllers/class_group.js | 48 +++++++ .../wechat/controllers/edit_class.js | 2 +- .../wechat/controllers/edit_class_group.js | 136 ++++++++++++++++++ .../wechat/controllers/edit_class_member.js | 87 ++++++++++- .../wechat/controllers/join_classgroup.js | 17 +-- .../controllers/select_my_coursegroup.js | 53 ++++++- public/javascripts/wechat/others/routes.js | 2 + 21 files changed, 564 insertions(+), 36 deletions(-) create mode 100644 app/api/mobile/entities/course_group.rb create mode 100644 public/assets/wechat/class_group.html create mode 100644 public/assets/wechat/edit_class_group.html create mode 100644 public/javascripts/wechat/controllers/class_group.js create mode 100644 public/javascripts/wechat/controllers/edit_class_group.js diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index dd5525fae..c4b445af9 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -541,6 +541,7 @@ module Mobile present :course_id,params[:id] present :user_id,params[:user_id] present :member_info,my_member, with: Mobile::Entities::ProjectMember + present :course_group_id,my_member.course_group_id present :status, 0 else present :status, -1 @@ -779,7 +780,7 @@ module Mobile requires :token, type: String requires :course_group_id, type: Integer end - post 'join_coursegroup' do + post 'user_join_coursegroup' do begin authenticate! member = Member.where(:course_id => params[:id], :user_id => current_user.id).first @@ -795,6 +796,127 @@ module Mobile end end + desc "修改分班" + params do + requires :id, type: Integer + requires :token, type: String + requires :course_group_id, type: Integer + requires :user_id, type: Integer + end + post 'user_edit_coursegroup' do + begin + authenticate! + member = Member.where(:course_id => params[:id], :user_id => params[:user_id]).first + + raise "不是该班级的学生!" unless member + + member.course_group_id = params[:course_group_id].to_i + member.save + present :status,0 + rescue Exception=>e + present :message,e.message + present :status,-1 + end + end + + desc '获取分班列表带上学生' + params do + requires :id, type: Integer + requires :token, type:String + end + get 'course_groups_withstudent/:id' do + begin + authenticate! + course = Course.find(params[:id]) + groups = [] + groups = course.course_groups if course.course_groups + present :data,groups, with: Mobile::Entities::CourseGroup + present :status,0 + rescue + present :status,-1 + end + end + + desc "删除分班" + params do + requires :id, type: Integer + requires :token, type: String + requires :course_group_id, type: Integer + end + post 'delete_coursegroup' do + begin + authenticate! + c = Course.find("#{params[:id]}") + my_member = c.member_principals.where("users.id=#{current_user.id}").first + + roles_ids = [] + my_member.roles.each do |role| + roles_ids << role.id + end + + if my_member && (roles_ids.include?(3) || roles_ids.include?(7) || roles_ids.include?(9) ) + else + raise "您没有该权限!" + end + CourseGroup.delete(params[:course_group_id]) + present :status,0 + rescue Exception=>e + present :message,e.message + present :status,-1 + end + end + + + desc "编辑分班" + params do + requires :id, type: Integer + requires :token, type: String + end + post 'edit_coursegroup' do + begin + authenticate! + c = Course.find("#{params[:id]}") + my_member = c.member_principals.where("users.id=#{current_user.id}").first + + roles_ids = [] + my_member.roles.each do |role| + roles_ids << role.id + end + + if my_member && (roles_ids.include?(3) || roles_ids.include?(7) || roles_ids.include?(9) ) + else + raise "您没有该权限!" + end + + #增加分班和修改分班名 + modify_groups = params[:modify_groups] + modify_groups.each do |g| + group = CourseGroup.find(g.id) + group.name = g.id.to_s + Time.now.to_i.to_s #只能先另取个名了不然原有的两个互换的话修改不了 + group.save + end + + modify_groups.each do |g| + group = CourseGroup.find(g.id) + group.name = g.name + group.save + end + + #增加分班和修改分班名 + add_groups = params[:add_groups] + add_groups.each do |name| + group = CourseGroup.new + group.name = name + group.course_id = params[:id] + group.save + end + present :status,0 + rescue Exception=>e + present :message,e.message + present :status,-1 + end + end + end end end diff --git a/app/api/mobile/entities/course.rb b/app/api/mobile/entities/course.rb index 30a5a6cc9..1b696e40c 100644 --- a/app/api/mobile/entities/course.rb +++ b/app/api/mobile/entities/course.rb @@ -54,6 +54,7 @@ module Mobile course_expose :updated_at course_expose :course_student_num course_expose :member_count + course_expose :groupnum expose :can_setting, if: lambda { |instance, options| options[:user] } do |instance, options| current_user = options[:user] can_setting = false diff --git a/app/api/mobile/entities/course_group.rb b/app/api/mobile/entities/course_group.rb new file mode 100644 index 000000000..f5d05d44c --- /dev/null +++ b/app/api/mobile/entities/course_group.rb @@ -0,0 +1,19 @@ +module Mobile + module Entities + class CourseGroup < Grape::Entity + include Redmine::I18n + include ApplicationHelper + include ApiHelper + def self.course_group_expose(f) + expose f do |u,opt| + if u.is_a?(Hash) && u.key?(f) + u[f] + end + end + end + expose :id + expose :name + expose :users, using: Mobile::Entities::User + end + end +end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 2c0506d1e..5d2957d4c 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -332,7 +332,9 @@ class CoursesService # unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?) # raise '403' # end - {:course => course,:syllabus_title => course.syllabus.nil? ? "":course.syllabus.title ,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0} + groupnum = 0 + groupnum = course.course_groups.length if course.course_groups + {:course => course,:syllabus_title => course.syllabus.nil? ? "":course.syllabus.title ,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0,:groupnum => groupnum} end #创建课程 diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index c4df9e715..bf4cf9e76 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -43,7 +43,7 @@ 第<%= work.student_work_tests.count - index%>次测试

    - <%= test.created_at.to_s(:db) %> + <%= format_time(test.created_at).to_s %>
    diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 30c9120c3..f8947b029 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -256,13 +256,15 @@
    {{student.name}} - +
    +
    diff --git a/public/assets/wechat/class_group.html b/public/assets/wechat/class_group.html new file mode 100644 index 000000000..04cdf8025 --- /dev/null +++ b/public/assets/wechat/class_group.html @@ -0,0 +1,20 @@ +
    +
    +
    + +
    +
    {{group.name+"("+group.users.length+")"}}
    +
    + {{user.realname == "" ? user.name : user.realname}} +
    +
    +
    + +
    + 编辑 +
    + +
    {{tip_1}}
    + + +
    \ No newline at end of file diff --git a/public/assets/wechat/edit_class_group.html b/public/assets/wechat/edit_class_group.html new file mode 100644 index 000000000..3dda96d53 --- /dev/null +++ b/public/assets/wechat/edit_class_group.html @@ -0,0 +1,14 @@ +
    +
    + +
    分班管理
    +
    {{course.name}}
    + +
    分班名称删除
    + + 完成 + + + + +
    \ No newline at end of file diff --git a/public/assets/wechat/edit_class_member.html b/public/assets/wechat/edit_class_member.html index d06eba89b..1eb53c7bf 100644 --- a/public/assets/wechat/edit_class_member.html +++ b/public/assets/wechat/edit_class_member.html @@ -4,15 +4,25 @@
    成员管理
    {{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}
    角色变更
    -
      +
      -
      删除成员
      -
        +
        删除成员
        +
        +
        编辑分班
        +
          +
        • + +
          +
        • + +
          +
        +
        取消 确定 diff --git a/public/assets/wechat/edit_userinfo.html b/public/assets/wechat/edit_userinfo.html index f4178fee4..48d207d4c 100644 --- a/public/assets/wechat/edit_userinfo.html +++ b/public/assets/wechat/edit_userinfo.html @@ -30,6 +30,7 @@
        电子邮箱地址不能为空 + 电子邮箱地址不合法
        diff --git a/public/assets/wechat/join_class.html b/public/assets/wechat/join_class.html index 4c81ff2e4..ad43db3a7 100644 --- a/public/assets/wechat/join_class.html +++ b/public/assets/wechat/join_class.html @@ -25,7 +25,5 @@
    -
    {{tip_1}}
    -
    diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html index 9a7705252..9a7e9fa2d 100644 --- a/public/assets/wechat/join_classgroup.html +++ b/public/assets/wechat/join_classgroup.html @@ -1,11 +1,11 @@
    -
    +
    欢迎加入班级
    {{current_course.name}}
    选择分班{{selectid}}
    +
    {{tip_1}}
    +
    \ No newline at end of file diff --git a/public/assets/wechat/select_my_coursegroup.html b/public/assets/wechat/select_my_coursegroup.html index c16b276e4..cc7a65753 100644 --- a/public/assets/wechat/select_my_coursegroup.html +++ b/public/assets/wechat/select_my_coursegroup.html @@ -2,24 +2,27 @@
    我的信息
    -
    {{current_edit_member.user.show_name}}
    +
    {{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}
    角色
    学生
    选择分班
      -
    • -
    • -
    • +
    • + +
      +
    • + +
    -
    {{tip_1}}
    -
    {{tip_2}}
    +
    {{tip_1}}
    +
    {{tip_2}}
    diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index ca4ad6d76..70c5d839d 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -258,7 +258,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location rms.save('current_edit_member', user); rms.save("course",vm.course); rms.save("tab_num",vm.currentTab); - $location.path("/select_my_coursegroup").search({id: courseid}); + $location.path("/select_my_coursegroup").search({id: courseid,user_id: user.id}); }; vm.review = function(user){ @@ -367,5 +367,24 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location }; + vm.goEditGroup = function(){ + if(!vm.isTeacher){ + return; + } + + rms.save('course_activities_page',vm.course_activities_page); + rms.save("course_activities",vm.course_activities); + rms.save('course_has_more', vm.course_has_more); + rms.save("tab_num",vm.currentTab); + rms.save("course",vm.course); + rms.save('current_course', vm.course); + + if(vm.course.groupnum == 0){ + $location.path("/edit_class_group").search({id: courseid}); + } + else{ + $location.path("/class_group").search({id: courseid}); + } + } }]); \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/class_group.js b/public/javascripts/wechat/controllers/class_group.js new file mode 100644 index 000000000..77de92332 --- /dev/null +++ b/public/javascripts/wechat/controllers/class_group.js @@ -0,0 +1,48 @@ +app.controller('ClassGroupController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms','common','$timeout', function($scope, config, $http, auth, $location, $routeParams,alertService,rms,common,$timeout){ +// common.checkLogin(); + + $scope.replaceUrl = function(url){ + return url; + }; + + var vm = $scope; + var courseid = $routeParams.id; + vm.alertService = alertService.create(); + + if(!vm.course){ + $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then( + function(response) { + console.log(response.data); + if (response.data.status == 0){ + vm.course = response.data.data; + console.log("courses"); + console.log(response.data.data); + } + else{ + vm.alertService.showMessage('提示', response.data.message); + } + if(!vm.course){ + vm.tip_1 = "该班级不存在或已被删除"; + } + } + ); + } + + + $http.get(config.apiUrl + 'courses/course_groups_withstudent/'+courseid+'?token='+auth.token()).then( + function(response) { + console.log("groups="); + console.log(response); + if(response.data.status == 0) { + vm.groups = response.data.data; + } + else{ + vm.groups = []; + } + }); + + vm.goEditGroup = function(){ + $location.path("/edit_class_group").search({id: courseid}); + } + +}]); \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/edit_class.js b/public/javascripts/wechat/controllers/edit_class.js index d61c25353..6cb50da1a 100644 --- a/public/javascripts/wechat/controllers/edit_class.js +++ b/public/javascripts/wechat/controllers/edit_class.js @@ -63,7 +63,7 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale vm.syllabus.courses.splice(index, 1); } - } + }; vm.newClass = function (frm, syllabus) { frm.$setSubmitted(); diff --git a/public/javascripts/wechat/controllers/edit_class_group.js b/public/javascripts/wechat/controllers/edit_class_group.js new file mode 100644 index 000000000..e80b35869 --- /dev/null +++ b/public/javascripts/wechat/controllers/edit_class_group.js @@ -0,0 +1,136 @@ + + +app.controller('EditClassGroupController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){ + var vm = $scope; + var courseid = $routeParams.id; + vm.alertService = alertService.create(); + vm.alertService_2 = alertService.create(); + + if(!vm.course){ + $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then( + function(response) { + console.log(response.data); + if (response.data.status == 0){ + vm.course = response.data.data; + console.log("courses"); + console.log(response.data.data); + } + else{ + vm.alertService.showMessage('提示', response.data.message); + } + if(!vm.course){ + vm.tip_1 = "该班级不存在或已被删除"; + } + } + ); + } + + $http.get(config.apiUrl + 'courses/course_groups/'+courseid+'?token='+auth.token()).then( + function(response) { + console.log("groups="); + console.log(response); + if(response.data.status == 0) { + vm.groups = response.data.data; + for(var i in vm.groups){ + vm.groups[i].tmpname = vm.groups[i].course_group.name; + } + } + else{ + vm.groups = []; + } + }); + + vm.addGroup = function(){ + vm.groups.push({tmpname:""}); + }; + + vm.deleteGroup = function(index){ + var group = vm.groups[index]; + if(group.course_group){ + vm.alertService_2.showMessage('提示', '您确定要删除该分班吗?', function() { + $http.post(config.apiUrl+'courses/delete_coursegroup', { + token: auth.token(), + id: courseid, + course_group_id:group.course_group.id + }).then(function(response){ + console.log(response); + if(response.data.status == 0){ + vm.alertService.showMessage('提示', "删除成功!",function(){ + vm.groups.splice(index, 1); + }); + } else { + vm.alertService.showMessage('提示', response.data.message); + } + }); + }); + + } else { + vm.groups.splice(index, 1); + } + + }; + + vm.newGroup = function (frm, groups) { + frm.$setSubmitted(); + console.log(groups); + + if(!frm.$valid){ + console.log(frm.$error); + return; + } + + if(vm.groups.length == 0){ + $location.path("/class").search({id: courseid,tag:1}); + return; + } + //不能有相同名称的分班 + for(var i=0;i< vm.groups.length-1;i++) { + for (var j=i+1;j Date: Tue, 20 Sep 2016 15:00:22 +0800 Subject: [PATCH 26/40] . --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 1305320cf..cbeade2a3 100644 --- a/Gemfile +++ b/Gemfile @@ -50,10 +50,10 @@ gem 'elasticsearch-model' gem 'elasticsearch-rails' #rails 3.2.22.2 bug - # gem "test-unit", "~>3.0" + gem "test-unit", "~>3.0" ### profile - # gem 'oneapm_rpm' + gem 'oneapm_rpm' group :development do gem 'grape-swagger' From 4e292425793d544a3346522b1931b92ba0631e7f Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 20 Sep 2016 15:11:00 +0800 Subject: [PATCH 27/40] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/wechats_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/wechats_helper.rb b/app/helpers/wechats_helper.rb index 5c6b3da8c..34c4dd9a1 100644 --- a/app/helpers/wechats_helper.rb +++ b/app/helpers/wechats_helper.rb @@ -3,9 +3,9 @@ module WechatsHelper def include_wechat_jsfile - if Rails.env.production? - javascript_include_tag '/javascripts/wechat/build/app.min.js' - else + # if Rails.env.production? + # javascript_include_tag '/javascripts/wechat/build/app.min.js' + # else wechat_path = File.join(Rails.root, "public", "javascripts", "wechat") srcs = Rails.application.config.wechat_srcs paths = [] @@ -15,6 +15,6 @@ module WechatsHelper end end javascript_include_tag *paths - end + # end end end From 930acd382cce98f74ee882f2b24f12d41c37080b Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 20 Sep 2016 15:14:48 +0800 Subject: [PATCH 28/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/wechats_helper.rb | 2 +- public/javascripts/wechat/directives/img_preview.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/wechats_helper.rb b/app/helpers/wechats_helper.rb index 34c4dd9a1..e76ea08d6 100644 --- a/app/helpers/wechats_helper.rb +++ b/app/helpers/wechats_helper.rb @@ -4,7 +4,7 @@ module WechatsHelper def include_wechat_jsfile # if Rails.env.production? - # javascript_include_tag '/javascripts/wechat/build/app.min.js' + javascript_include_tag '/javascripts/wechat/build/app.min.js' # else wechat_path = File.join(Rails.root, "public", "javascripts", "wechat") srcs = Rails.application.config.wechat_srcs diff --git a/public/javascripts/wechat/directives/img_preview.js b/public/javascripts/wechat/directives/img_preview.js index 08f33d381..ce973c69b 100644 --- a/public/javascripts/wechat/directives/img_preview.js +++ b/public/javascripts/wechat/directives/img_preview.js @@ -12,7 +12,7 @@ app.directive('imgPreview',["$timeout",'wx',function(timer,wx){ if(item.src){ srcList.push(item.src); $(item).click(function(e){ - wx.previewImage(this.src,srcList); + wx.previewImage({current:this.src,urls:srcList}); }); } }); From bda68495c979c5ca723f8d009ac509c9775f59f5 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 20 Sep 2016 15:19:06 +0800 Subject: [PATCH 29/40] . --- app/helpers/wechats_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/wechats_helper.rb b/app/helpers/wechats_helper.rb index e76ea08d6..5c6b3da8c 100644 --- a/app/helpers/wechats_helper.rb +++ b/app/helpers/wechats_helper.rb @@ -3,9 +3,9 @@ module WechatsHelper def include_wechat_jsfile - # if Rails.env.production? + if Rails.env.production? javascript_include_tag '/javascripts/wechat/build/app.min.js' - # else + else wechat_path = File.join(Rails.root, "public", "javascripts", "wechat") srcs = Rails.application.config.wechat_srcs paths = [] @@ -15,6 +15,6 @@ module WechatsHelper end end javascript_include_tag *paths - # end + end end end From ab72bf5f088a279b26f7674a3b379cb2631fe696 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 22 Sep 2016 09:48:37 +0800 Subject: [PATCH 30/40] =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/class_group.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/wechat/class_group.html b/public/assets/wechat/class_group.html index 04cdf8025..e5a1b8f47 100644 --- a/public/assets/wechat/class_group.html +++ b/public/assets/wechat/class_group.html @@ -3,7 +3,7 @@
    -
    {{group.name+"("+group.users.length+")"}}
    +
    {{group.name+"("+group.users.length+")"}}
    {{user.realname == "" ? user.name : user.realname}}
    From 1798b8a086d13e968a788833bd965d0f8dab7abb Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 22 Sep 2016 09:56:46 +0800 Subject: [PATCH 31/40] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=8F=AD=E7=BA=A7logob?= =?UTF-8?q?ug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 2 +- public/assets/wechat/edit_class_group.html | 2 +- public/assets/wechat/join_classgroup.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 5d2957d4c..b97fa1a64 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -334,7 +334,7 @@ class CoursesService # end groupnum = 0 groupnum = course.course_groups.length if course.course_groups - {:course => course,:syllabus_title => course.syllabus.nil? ? "":course.syllabus.title ,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0,:groupnum => groupnum} + {:course => course,:syllabus_title => course.syllabus.nil? ? "":course.syllabus.title ,:work_unit => work_unit, :img_url => "/images/"+url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0,:groupnum => groupnum} end #创建课程 diff --git a/public/assets/wechat/edit_class_group.html b/public/assets/wechat/edit_class_group.html index 3dda96d53..4c1c612a6 100644 --- a/public/assets/wechat/edit_class_group.html +++ b/public/assets/wechat/edit_class_group.html @@ -2,7 +2,7 @@
    分班管理
    -
    {{course.name}}
    +
    {{course.name}}
    分班名称删除
    diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html index 9a7e9fa2d..631ec4969 100644 --- a/public/assets/wechat/join_classgroup.html +++ b/public/assets/wechat/join_classgroup.html @@ -2,7 +2,7 @@
    欢迎加入班级
    -
    {{current_course.name}}
    +
    {{current_course.name}}
    选择分班{{selectid}}
    • From 72190a3639ca915e94404b8561a92e1c5dee3859 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 22 Sep 2016 10:47:02 +0800 Subject: [PATCH 32/40] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/join_classgroup.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html index 631ec4969..dce42ee42 100644 --- a/public/assets/wechat/join_classgroup.html +++ b/public/assets/wechat/join_classgroup.html @@ -3,7 +3,7 @@
      欢迎加入班级
      {{current_course.name}}
      -
      选择分班{{selectid}}
      +
      选择分班
      • From 11132d345914c00d59b32ea2d1521e0bc69d6ba9 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 22 Sep 2016 10:49:53 +0800 Subject: [PATCH 33/40] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E6=97=B6=E9=80=89=E6=8B=A9=E5=88=86=E7=8F=AD?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E5=85=A5=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/controllers/join_classgroup.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/javascripts/wechat/controllers/join_classgroup.js b/public/javascripts/wechat/controllers/join_classgroup.js index 4812ca767..a63744e3c 100644 --- a/public/javascripts/wechat/controllers/join_classgroup.js +++ b/public/javascripts/wechat/controllers/join_classgroup.js @@ -43,7 +43,8 @@ app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config', vm.cancel = function(){ - $location.path("/class").search({id: course_id,tag:1}); + rms.save('syllabuses',[]); + $location.path("/class_list"); }; vm.confirm = function(){ @@ -66,10 +67,12 @@ app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config', console.log(response); if(response.data.status == 0){ vm.alertService.showMessage('提示', "选择分班成功!",function(){ + rms.save('syllabuses',[]); $location.path("/class_list"); }); } else { vm.alertService.showMessage('提示', response.data.message,function(){ + rms.save('syllabuses',[]); $location.path("/class_list"); }); } From 0b1a22d9aa382ce7479d5f2750ebaf6af9d6b1b3 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 22 Sep 2016 13:56:57 +0800 Subject: [PATCH 34/40] =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/class_group.html | 2 +- public/assets/wechat/edit_class_member.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/wechat/class_group.html b/public/assets/wechat/class_group.html index e5a1b8f47..b097db9c6 100644 --- a/public/assets/wechat/class_group.html +++ b/public/assets/wechat/class_group.html @@ -3,7 +3,7 @@
        -
        {{group.name+"("+group.users.length+")"}}
        +
        {{group.name+"("+group.users.length+")"}}
        {{user.realname == "" ? user.name : user.realname}}
        diff --git a/public/assets/wechat/edit_class_member.html b/public/assets/wechat/edit_class_member.html index 1eb53c7bf..5530671f7 100644 --- a/public/assets/wechat/edit_class_member.html +++ b/public/assets/wechat/edit_class_member.html @@ -18,7 +18,7 @@
      • -
      • +
      From a169ad087bd9e7fd0bf985f570203813768a17e8 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 22 Sep 2016 14:03:59 +0800 Subject: [PATCH 35/40] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=88=86=E7=8F=AD?= =?UTF-8?q?=E6=97=B6=E9=80=89=E6=8B=A9=E6=9A=82=E6=97=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=88=97=E8=A1=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/controllers/join_classgroup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/javascripts/wechat/controllers/join_classgroup.js b/public/javascripts/wechat/controllers/join_classgroup.js index a63744e3c..ed7692494 100644 --- a/public/javascripts/wechat/controllers/join_classgroup.js +++ b/public/javascripts/wechat/controllers/join_classgroup.js @@ -54,6 +54,7 @@ app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config', } if(vm.selectid == 0){ + rms.save('syllabuses',[]); $location.path("/class_list"); return; } From dac9502f1fbdc47e6a720f4857ca8cb28beec38e Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 22 Sep 2016 14:25:09 +0800 Subject: [PATCH 36/40] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E6=9D=A5?= =?UTF-8?q?=E6=BA=90title=E6=98=BE=E7=A4=BA=E5=B8=A6html=E4=BB=A3=E7=A0=81?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resources_list.html.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index d7f0dee7f..0190e60dc 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -267,4 +267,9 @@ } } + + $(".resource-list-from").each(function(){ + var titleContent = $(this).text(); + $(this).attr("title",titleContent); + }); From 0716d4fa3863add1070fa7df6ebcff798bb41a9c Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 22 Sep 2016 14:29:00 +0800 Subject: [PATCH 37/40] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/edit_class_group.html | 2 +- public/assets/wechat/join_classgroup.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/wechat/edit_class_group.html b/public/assets/wechat/edit_class_group.html index 4c1c612a6..6f08d1b53 100644 --- a/public/assets/wechat/edit_class_group.html +++ b/public/assets/wechat/edit_class_group.html @@ -2,7 +2,7 @@
      分班管理
      -
      {{course.name}}
      +
      {{course.name}}
      分班名称删除
      diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html index dce42ee42..e4d92fbf8 100644 --- a/public/assets/wechat/join_classgroup.html +++ b/public/assets/wechat/join_classgroup.html @@ -2,7 +2,7 @@
      欢迎加入班级
      -
      {{current_course.name}}
      +
      {{current_course.name}}
      选择分班
      • From b965e270e24301ce85605fa80db827d2c8232c18 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 22 Sep 2016 15:27:16 +0800 Subject: [PATCH 38/40] =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E8=AF=BE=E7=A8=8B=E5=90=8D?= =?UTF-8?q?=EF=BC=8C=E8=AF=BE=E7=A8=8B=E5=90=8D=E4=B8=8E=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E5=90=8D=E4=B9=8B=E9=97=B4=E7=82=B9=E5=8F=B7=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=9B=BE=E6=A0=87=E5=9C=86=E5=BD=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/class.html | 2 +- public/assets/wechat/class_publishissue.html | 2 +- public/assets/wechat/class_publishnotice.html | 2 +- public/assets/wechat/edit_class_group.html | 2 +- public/assets/wechat/invite_code.html | 2 +- public/assets/wechat/join_classgroup.html | 4 ++-- public/assets/wechat/review_class_member.html | 4 ++-- public/assets/wechat/select_my_coursegroup.html | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 6678456b6..789ef7018 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -1,6 +1,6 @@
        -
        邀请码
        +
        邀请码
        diff --git a/public/assets/wechat/class_publishissue.html b/public/assets/wechat/class_publishissue.html index 5a65beabf..cf030d7c5 100644 --- a/public/assets/wechat/class_publishissue.html +++ b/public/assets/wechat/class_publishissue.html @@ -1,7 +1,7 @@
        -
        +
        标题
        diff --git a/public/assets/wechat/class_publishnotice.html b/public/assets/wechat/class_publishnotice.html index e56c762a6..21b1deeb7 100644 --- a/public/assets/wechat/class_publishnotice.html +++ b/public/assets/wechat/class_publishnotice.html @@ -1,7 +1,7 @@
        -
        +
        标题
        diff --git a/public/assets/wechat/edit_class_group.html b/public/assets/wechat/edit_class_group.html index 4c1c612a6..d3683358e 100644 --- a/public/assets/wechat/edit_class_group.html +++ b/public/assets/wechat/edit_class_group.html @@ -2,7 +2,7 @@
        分班管理
        -
        {{course.name}}
        +
        {{course.syllabus_title}}·{{course.name}}
        分班名称删除
        diff --git a/public/assets/wechat/invite_code.html b/public/assets/wechat/invite_code.html index c6d3b425f..ae30e335e 100644 --- a/public/assets/wechat/invite_code.html +++ b/public/assets/wechat/invite_code.html @@ -1,7 +1,7 @@
        - +
        邀请码:{{course.invite_code}}
        diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html index dce42ee42..4b14b0153 100644 --- a/public/assets/wechat/join_classgroup.html +++ b/public/assets/wechat/join_classgroup.html @@ -2,13 +2,13 @@
        欢迎加入班级
        -
        {{current_course.name}}
        +
        {{course.syllabus_title}}·{{current_course.name}}
        选择分班
        • -
        • +
        diff --git a/public/assets/wechat/review_class_member.html b/public/assets/wechat/review_class_member.html index b1f0dacc5..ee0138965 100644 --- a/public/assets/wechat/review_class_member.html +++ b/public/assets/wechat/review_class_member.html @@ -2,7 +2,7 @@
        -
        +
        {{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}
        角色
          @@ -29,7 +29,7 @@
        -
        +
        {{tip_2}}
        diff --git a/public/assets/wechat/select_my_coursegroup.html b/public/assets/wechat/select_my_coursegroup.html index cc7a65753..5bd563554 100644 --- a/public/assets/wechat/select_my_coursegroup.html +++ b/public/assets/wechat/select_my_coursegroup.html @@ -2,7 +2,7 @@
        我的信息
        -
        {{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}
        +
        {{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}
        角色
        学生
        选择分班
        @@ -10,7 +10,7 @@
      • -
      • +
      From 0431d28fd132b3a036400cb514e852679d45de01 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 22 Sep 2016 15:35:43 +0800 Subject: [PATCH 39/40] =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/edit_class_member.html | 2 +- public/assets/wechat/join_classgroup.html | 2 +- public/assets/wechat/select_my_coursegroup.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/assets/wechat/edit_class_member.html b/public/assets/wechat/edit_class_member.html index 5530671f7..cbbd96ba3 100644 --- a/public/assets/wechat/edit_class_member.html +++ b/public/assets/wechat/edit_class_member.html @@ -15,7 +15,7 @@
    编辑分班
      -
    • +
    • diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html index 91a1184d7..a63217288 100644 --- a/public/assets/wechat/join_classgroup.html +++ b/public/assets/wechat/join_classgroup.html @@ -5,7 +5,7 @@
      {{course.syllabus_title}}·{{current_course.name}}
      选择分班
        -
      • +
      • diff --git a/public/assets/wechat/select_my_coursegroup.html b/public/assets/wechat/select_my_coursegroup.html index 5bd563554..54c4c8c80 100644 --- a/public/assets/wechat/select_my_coursegroup.html +++ b/public/assets/wechat/select_my_coursegroup.html @@ -7,7 +7,7 @@
        学生
        选择分班
          -
        • +
        • From 61c2f8fdd6ca686c067f5ea20f775c784a0098f8 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 22 Sep 2016 16:17:23 +0800 Subject: [PATCH 40/40] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E7=8F=AD=E5=90=8D=E7=A7=B0=E8=BF=87=E9=95=BF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/edit_class_group.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/wechat/edit_class_group.html b/public/assets/wechat/edit_class_group.html index 756670b2a..f13f02100 100644 --- a/public/assets/wechat/edit_class_group.html +++ b/public/assets/wechat/edit_class_group.html @@ -4,7 +4,7 @@
          分班管理
          {{course.syllabus_title}}·{{course.name}}
          -
          分班名称删除
          +
          分班名称删除
          完成