From 2e561de52500f7e1ddddea2d757d2e15a604c42f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 31 Jul 2015 16:32:55 +0800 Subject: [PATCH 001/215] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=86=85=E9=83=A8?= =?UTF-8?q?=E7=9A=84=E7=BC=96=E5=8F=B7#2264=E4=B9=9F=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=EF=BC=9A=E5=85=B6=E5=AE=9E=E9=99=85=E7=9A=84?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 8c12d62e0..b72558de4 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -2,11 +2,11 @@

<%= l(:label_issue_edit) %>

-<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %> +<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.id}" %>
<%= link_to "#{@issue.project.name}"+">", project_issues_path(@issue.project) %> - <%= "#" + @issue.project_index %> + <%= "#" + @issue.id.to_s %>
From bb8b1f3f0899cd2cce795db74c6cd7d62cc50662 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 12 Aug 2015 17:43:22 +0800 Subject: [PATCH 002/215] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86git=E4=B8=8B=E6=8B=89=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/settings/_new_repositories.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb index ca771a487..c31ef5560 100644 --- a/app/views/projects/settings/_new_repositories.html.erb +++ b/app/views/projects/settings/_new_repositories.html.erb @@ -64,7 +64,7 @@
  • - <%= select_tag('repository_scm', + <%= label_tag('repository_scm', options_for_select(["Git"],@repository.class.name.demodulize), :data => {:remote => true, :method => 'get'})%> <% if @repository && ! @repository.class.scm_available %> From b1c8fdd9048ffbacd12f989022fa79c9ebcacfd5 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 13 Aug 2015 15:38:14 +0800 Subject: [PATCH 003/215] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=A1=B5=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f042bba50..1d0e99d1f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -86,7 +86,6 @@ class ProjectsController < ApplicationController @project_pages = Project.project_entities.visible.like(params[:name]).page(params[:page]).per(10) else @project_pages = Project.project_entities.visible.page(params[:page] ).per(10) - @project_pages = Project.project_entities.visible.page(params[:page] ).per(10) end @projects = @project_pages.order("created_on desc") @limit = 10#per_page_option From 902cfdcbe9e4b37d26ee1e0ce6f831124e2c162a Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Jan 2016 10:29:55 +0800 Subject: [PATCH 004/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B/=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E5=88=9B=E5=BB=BA=E5=8A=A8=E6=80=81=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=98=BE=E7=A4=BA=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 9 +-------- app/views/organizations/_org_course_create.html.erb | 6 +----- app/views/organizations/_project_create.html.erb | 6 +----- app/views/projects/_project_create.html.erb | 6 +----- app/views/users/_course_create.html.erb | 6 +----- app/views/users/_project_create.html.erb | 6 +----- 6 files changed, 6 insertions(+), 33 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 24e955d15..0194a2a9d 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,7 +1,6 @@ require 'elasticsearch/model' class Course < ActiveRecord::Base include Redmine::SafeAttributes - include ApplicationHelper STATUS_ACTIVE = 1 STATUS_CLOSED = 5 @@ -71,7 +70,7 @@ class Course < ActiveRecord::Base validates_length_of :description, :maximum => 10000 before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 - after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity + after_update :update_files_public,:update_course_ealasticsearch_index after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index before_destroy :delete_all_members,:delete_course_ealasticsearch_index @@ -429,12 +428,6 @@ class Course < ActiveRecord::Base end end end -#动态的更新 -def update_activity - update_course_activity(self.class, self.id) - update_user_activity(self.class, self.id) - update_org_activity(self.class, self.id) -end # Delete the previous articles index in Elasticsearch # Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil diff --git a/app/views/organizations/_org_course_create.html.erb b/app/views/organizations/_org_course_create.html.erb index a5544ab07..dc1e0ee81 100644 --- a/app/views/organizations/_org_course_create.html.erb +++ b/app/views/organizations/_org_course_create.html.erb @@ -17,13 +17,9 @@
    <%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
    -
    +
    创建时间:<%= format_time(activity.created_at) %>
    -
    - 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> -
    -
    diff --git a/db/migrate/20160118083751_add_status_to_message.rb b/db/migrate/20160118083751_add_status_to_message.rb new file mode 100644 index 000000000..46d63de3a --- /dev/null +++ b/db/migrate/20160118083751_add_status_to_message.rb @@ -0,0 +1,5 @@ +class AddStatusToMessage < ActiveRecord::Migration + def change + add_column :messages, :status, :integer, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index 601b09561..1cad3bd21 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160118014219) do +ActiveRecord::Schema.define(:version => 20160118083751) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1073,6 +1073,7 @@ ActiveRecord::Schema.define(:version => 20160118014219) do t.integer "sticky", :default => 0 t.integer "reply_id" t.integer "quotes" + t.integer "status", :default => 0 end add_index "messages", ["author_id"], :name => "index_messages_on_author_id" From 5862c16c680d503e41d6e04d431d3f70a1e95f84 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 Jan 2016 17:36:18 +0800 Subject: [PATCH 020/215] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=B2=BE=E5=93=81?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8E=A8=E8=8D=90=20=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=8E=89=E7=A7=81=E6=9C=89=E8=AF=BE=E7=A8=8B=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=8E=89=E5=B7=B2=E5=88=A0=E9=99=A4=E7=9A=84=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 780d73de2..712f2d075 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -21,16 +21,10 @@ module CoursesHelper # 查询符合条件的精品课程 def find_excelletn_course keywords, course # 用新课程名去匹配精品课程中按课程名和Tag名 - if !course.is_public? && !User.current.member_of_course?(course) - sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and + sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and ts.taggable_type = 'Course' and (t.name like '%#{keywords}%'or c.name like '%#{keywords}%')" - resultSetTag = Course.find_by_sql(sql) - else - sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and - ts.taggable_type = 'Course' and (t.name like '%#{keywords}%'or c.name like '%#{keywords}%') ORDER BY c.updated_at desc limit 0,5;" - resultSetTag = Course.visible.find_by_sql(sql) - end - + resultSetTag = Course.find_by_sql(sql).select{|e_course| e_course.is_public ==1 unless User.current.member_of_course?(e_course)}.first(3) + resultSetTag end # 判断精品课程是否可见,非课程成员无法查看私有课程 From 6e582fa631f57f9093a6bb23ab9055b97e6fa129 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 19 Jan 2016 09:55:28 +0800 Subject: [PATCH 021/215] =?UTF-8?q?=E8=80=81=E5=B8=88=E8=AF=84=E9=98=85?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=97=B6=E5=8F=AF=E4=BB=A5=E4=B8=8D=E5=86=99?= =?UTF-8?q?=E8=AF=84=E8=AF=AD=EF=BC=8C=E5=8F=AA=E6=9C=89=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=9A=84=E6=97=B6=E5=80=99=E6=89=8D=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E5=86=99=E8=AF=84=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_add_score.html.erb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 052443155..9d747790f 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -23,13 +23,17 @@ <% end%> \ No newline at end of file From 8e9c4bab6b0add76007314c9dde797682f2eac9d Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 19 Jan 2016 10:08:28 +0800 Subject: [PATCH 022/215] =?UTF-8?q?=E8=B5=9E=E5=A2=9E=E5=8A=A0tip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blogs/_article.html.erb | 4 ++-- app/views/organizations/_org_course_homework.html.erb | 4 ++-- app/views/organizations/_org_course_message.html.erb | 4 ++-- app/views/organizations/_org_course_news.html.erb | 4 ++-- app/views/organizations/_org_project_issue.html.erb | 4 ++-- app/views/organizations/_org_subfield_message.html.erb | 4 ++-- app/views/organizations/_project_message.html.erb | 4 ++-- app/views/projects/_project_news.html.erb | 4 ++-- app/views/users/_course_homework.html.erb | 4 ++-- app/views/users/_course_message.html.erb | 4 ++-- app/views/users/_course_news.html.erb | 4 ++-- app/views/users/_project_issue.html.erb | 4 ++-- app/views/users/_project_message.html.erb | 4 ++-- app/views/users/_user_blog.html.erb | 4 ++-- app/views/users/_user_homework_detail.html.erb | 4 ++-- app/views/users/_user_journalsformessage.html.erb | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index d6ce215c6..afe89362f 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -130,7 +130,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -172,7 +172,7 @@ <%= format_time(reply.created_on) %> <% if reply.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 50d4a07db..56c19f994 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -256,7 +256,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -297,7 +297,7 @@ <%= format_time(comment.created_on) %> <% if comment.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index 55be0bf91..79b9bbe05 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -77,7 +77,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -119,7 +119,7 @@ <%= format_time(reply.created_on) %> <% if reply.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index ddad08279..7d6940f52 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -49,7 +49,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -90,7 +90,7 @@ <%= format_time(comment.created_on) %> <% if comment.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 9c1863992..78964efbe 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -62,7 +62,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -103,7 +103,7 @@ <%= format_time(reply.created_on) %> <% if reply.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index 901c2ecf4..f8f412732 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -62,7 +62,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -99,7 +99,7 @@ <%= format_time(reply.created_on) %> <% if reply.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index c7d99c5fb..d15ceca38 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -62,7 +62,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -100,7 +100,7 @@ <%= format_time(reply.created_on) %> <% if reply.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index 2e7b1316a..ceee318a4 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -49,7 +49,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -90,7 +90,7 @@ <%= format_time(comment.created_on) %> <% if comment.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index d89b44651..f73e039f9 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -256,7 +256,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -297,7 +297,7 @@ <%= format_time(comment.created_on) %> <% if comment.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index d8268d698..bc14793db 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -97,7 +97,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -139,7 +139,7 @@ <%= format_time(reply.created_on) %> <% if reply.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index ddad08279..7d6940f52 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -49,7 +49,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -90,7 +90,7 @@ <%= format_time(comment.created_on) %> <% if comment.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 954c24dac..6f1fc8b7a 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -74,7 +74,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -115,7 +115,7 @@ <%= format_time(reply.created_on) %> <% if reply.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 75940b32c..ab7502bd5 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -96,7 +96,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -134,7 +134,7 @@ <%= format_time(reply.created_on) %> <% if reply.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index 440bcb773..1a4b90768 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -55,7 +55,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -96,7 +96,7 @@ <%= format_time(comment.created_on) %> <% if comment.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 652d2aca8..d1b3f62fc 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -260,7 +260,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if homework_common.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%> <% end %> @@ -300,7 +300,7 @@ <% end %> <%= format_time(comment.created_on) %> <% if comment.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index dd55155d0..609b1e35b 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -40,7 +40,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -76,7 +76,7 @@ <%= format_time(comment.created_on) %> <% if comment.user == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> From 610b54b27c632627d7f50a1f54069ad72aaf5ae4 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 19 Jan 2016 10:29:57 +0800 Subject: [PATCH 023/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AF=BC=E8=AF=AD?= =?UTF-8?q?=E6=94=BE=E7=BD=AE=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E4=B9=8B?= =?UTF-8?q?=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 10 +--------- app/models/course_activity.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 433a5801e..480c00480 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -72,7 +72,7 @@ class Course < ActiveRecord::Base before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity - after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index, :add_course_ead + after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index before_destroy :delete_all_members,:delete_course_ealasticsearch_index safe_attributes 'extra', @@ -385,14 +385,6 @@ class Course < ActiveRecord::Base self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false) end - # 发布新课导语 - def add_course_ead - name = Redmine::Configuration['course_message_lead_subject'] - content = Redmine::Configuration['course_message_lead_content'] - # message的status状态为0为正常,为1表示创建课程时发送的message - Message.create(:subject => name, :content => content, :board_id => self.boards.first.id, :author_id => self.tea_id , :sticky => true, :status => true ) - end - #项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题 #def name # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name) diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index e1f9ab9f5..88351acfd 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -6,6 +6,7 @@ class CourseActivity < ActiveRecord::Base belongs_to :user has_many :user_acts, :class_name => 'UserAcivity',:as =>:act after_save :add_user_activity, :add_course_activity + after_create :add_course_lead before_destroy :destroy_user_activity, :destroy_org_activity #在个人动态里面增加当前动态 @@ -60,4 +61,16 @@ class CourseActivity < ActiveRecord::Base org_activity = OrgActivity.where("org_act_type = '#{self.course_act_type.to_s}' and org_act_id = '#{self.course_act_id}'") org_activity.destroy_all end + + # 发布新课导语 + # 导语要放置在课程创建信息之后 + # 导语 + def add_course_lead + if self.course_act_type == "Course" + name = Redmine::Configuration['course_message_lead_subject'] + content = Redmine::Configuration['course_message_lead_content'] + # message的status状态为0为正常,为1表示创建课程时发送的message + Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) + end + end end From e293805488570ccd8705692133ed623fe9b69f1e Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 19 Jan 2016 15:41:53 +0800 Subject: [PATCH 024/215] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=97=B6=E8=8B=A5=E6=9C=AA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=88=99=E7=9B=B4=E6=8E=A5=E8=B7=B3=E5=88=B0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index ec54ae8a4..78babc43c 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -2,6 +2,7 @@ class PollController < ApplicationController before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll] before_filter :find_container, :only => [:new,:create, :index] + before_filter :is_logged, :only => [:index, :show, :poll_result,:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:commit_answer,:commit_poll,:statistics_result] before_filter :is_member_of_course, :only => [:index,:show,:poll_result] before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll] include PollHelper @@ -503,6 +504,10 @@ class PollController < ApplicationController end end + def is_logged + redirect_to signin_path unless User.current.logged? + end + def is_member_of_course render_403 unless(@course && (User.current.member_of_course?(@course) || User.current.admin?)) end From d0c2eabddd127952088d28d195061a22a79d6cda Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 19 Jan 2016 16:42:10 +0800 Subject: [PATCH 025/215] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E9=99=86=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=EF=BC=8C=E4=B9=9F=E8=83=BD=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- app/helpers/application_helper.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index fd43977ee..514f68d49 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -600,7 +600,7 @@ private def has_login unless @attachment && @attachment.container_type == "PhoneAppVersion" - render_403 unless User.current.logged? + render_403 if !User.current.logged? && @attachment.container_type != 'OrgSubfield' && @attachment.container_type != 'OrgDocumentComment' end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 07f7a0ed8..9f08a63ed 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1996,6 +1996,8 @@ module ApplicationHelper candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) elsif attachment.container.is_a?(OrgSubfield) candown = true + elsif attachment.container.is_a?(OrgDocumentComment) + candown = true elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board && attachment.container.board.course course = attachment.container.board.course From 6e56a0706a9c9444a95607a4907c07aa93899399 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 19 Jan 2016 16:53:34 +0800 Subject: [PATCH 026/215] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8D=95=E8=AF=8D=E6=8A=98=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blogs/_article.html.erb | 16 +++++++--------- app/views/blogs/_homepage.html.erb | 5 ++--- app/views/org_document_comments/show.html.erb | 7 ++++++- .../organizations/_org_course_homework.html.erb | 7 ++----- .../organizations/_org_course_message.html.erb | 16 +++++++--------- .../organizations/_org_course_news.html.erb | 6 +----- .../organizations/_org_course_poll.html.erb | 7 ++----- .../organizations/_org_project_issue.html.erb | 8 +------- .../organizations/_org_subfield_message.html.erb | 15 ++++++--------- .../organizations/_project_message.html.erb | 15 ++++++--------- app/views/organizations/_show_home_page.html.erb | 5 ++++- .../organizations/_show_org_document.html.erb | 5 ++++- app/views/projects/_project_news.html.erb | 6 +----- app/views/users/_course_homework.html.erb | 7 ++----- app/views/users/_course_message.html.erb | 15 ++++++--------- app/views/users/_course_news.html.erb | 6 +----- app/views/users/_course_poll.html.erb | 6 +----- app/views/users/_intro_content.html.erb | 12 ++++++++++++ app/views/users/_project_issue.html.erb | 8 +------- app/views/users/_project_message.html.erb | 15 ++++++--------- app/views/users/_user_blog.html.erb | 6 +----- app/views/users/_user_homework_detail.html.erb | 6 +----- app/views/users/user_system_messages.html.erb | 2 +- public/stylesheets/courses.css | 2 +- public/stylesheets/new_user.css | 4 ++-- public/stylesheets/project.css | 2 +- 26 files changed, 85 insertions(+), 124 deletions(-) create mode 100644 app/views/users/_intro_content.html.erb diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 22df4499a..4e0270da2 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -81,15 +81,13 @@ 更新时间:<%= format_time(UserActivity.where("act_type='#{activity.class}' and act_id =#{activity.id}").first.updated_at) %>
    -
    -
    - <% if activity.parent_id.nil? %> - <%= activity.content.to_s.html_safe%> - <% else %> - <%= activity.parent.content.to_s.html_safe%> - <% end %> -
    -
    + <% if activity.parent_id.nil? %> + <% content= activity.content%> + <% else %> + <% content= activity.parent.content%> + <% end %> + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> +
    - <% if User.current.logged? %> -
    - <%= link_to '文章', organization_org_document_comments_path(@organization) %>  - <% if User.current.logged? %> - ( - <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> - ) - <% end %> -  |  - <%= link_to '成员', members_organization_path(@organization.id) %>  - <% if User.current.logged? %> - (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>) - <% end %> -
    - <% end %> +
    + <%= link_to '文章', organization_org_document_comments_path(@organization) %>  + <%# if User.current.logged? %> + ( + <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> + ) + <%# end %> + <% if User.current.logged? %> +  |  + <%= link_to '成员', members_organization_path(@organization.id) %>  + (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>) + <% end %> +
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %> diff --git a/app/views/organizations/_show_home_page.html.erb b/app/views/organizations/_show_home_page.html.erb index 32d3ad10d..f6d5fc9ea 100644 --- a/app/views/organizations/_show_home_page.html.erb +++ b/app/views/organizations/_show_home_page.html.erb @@ -2,15 +2,13 @@
- <% if User.current.logged? %>
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %>
- <% end %> <% unless document.content.blank? %>
<%= document.content.html_safe %>
<% end %> - <% if params[:show_homepage].nil? and User.current.logged? %> + <% if params[:show_homepage].nil? %>
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
From fe0414c83fa9256d5e1a2f6ff502f5fa8e2facbd Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 20 Jan 2016 10:53:05 +0800 Subject: [PATCH 031/215] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E5=92=8C=E5=8D=9A=E5=AE=A2=E7=9A=84=E7=82=B9=E8=B5=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/praise_tread_controller.rb | 2 ++ app/views/blog_comments/show.html.erb | 24 +++++++++++++++---- app/views/org_document_comments/show.html.erb | 24 +++++++++++++++---- .../organizations/_show_org_document.html.erb | 20 ++++++++++++++-- 4 files changed, 60 insertions(+), 10 deletions(-) diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb index 1a01a2f07..96eeab884 100644 --- a/app/controllers/praise_tread_controller.rb +++ b/app/controllers/praise_tread_controller.rb @@ -119,6 +119,8 @@ class PraiseTreadController < ApplicationController @obj = Journal.find_by_id(id) when 'BlogComment' @obj = BlogComment.find_by_id(id) + when 'OrgDocumentComment' + @obj = OrgDocumentComment.find_by_id(id) when 'User' @obj = User.find_by_id(id) when 'Issue' diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 02f1ad1ad..6f4397569 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -116,9 +116,18 @@ <% count=@article.children.count%> <% end %>
- <% unless count == 0 %> + <%# unless count == 0 %>
-
回复(<%=count %>)
+
回复 + <%= count>0 ? "(#{count})" : "" %> + + <% if @article.author == User.current %> + + <% else %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%> + <% end %> + +
-
-
-<% end %> - - \ No newline at end of file diff --git a/app/views/exercise/commit_exercise.js.erb b/app/views/exercise/commit_exercise.js.erb index ac8c242d1..8b6e9f00c 100644 --- a/app/views/exercise/commit_exercise.js.erb +++ b/app/views/exercise/commit_exercise.js.erb @@ -1,8 +1,8 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>'); -showModal('ajax-modal', '270px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>'); +showModal('ajax-modal', '270px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().removeClass("alert_praise"); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("alert_box"); \ No newline at end of file diff --git a/app/views/exercise/index.html.erb b/app/views/exercise/index.html.erb index 9b6961e6c..8637273f1 100644 --- a/app/views/exercise/index.html.erb +++ b/app/views/exercise/index.html.erb @@ -25,7 +25,7 @@ $('#ajax-modal').before("" + ""); $('#ajax-modal').parent().removeClass("alert_praise"); - $('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); } @@ -57,7 +57,7 @@ $('#ajax-modal').before("" + ""); $('#ajax-modal').parent().removeClass("alert_praise"); - $('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); } } diff --git a/app/views/exercise/publish_exercise.js.erb b/app/views/exercise/publish_exercise.js.erb index c1c4a4fd5..004ca9625 100644 --- a/app/views/exercise/publish_exercise.js.erb +++ b/app/views/exercise/publish_exercise.js.erb @@ -1,10 +1,10 @@ -$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>"); -$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>"); -showModal('ajax-modal', '250px'); -//$('#ajax-modal').css('height','111px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); +$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>"); +$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>"); +showModal('ajax-modal', '250px'); +//$('#ajax-modal').css('height','111px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().removeClass("alert_praise"); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("poll_alert_form"); \ No newline at end of file diff --git a/app/views/exercise/republish_exercise.js.erb b/app/views/exercise/republish_exercise.js.erb index 2b4e67606..a55cefbde 100644 --- a/app/views/exercise/republish_exercise.js.erb +++ b/app/views/exercise/republish_exercise.js.erb @@ -1,10 +1,10 @@ -$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>"); -$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>"); -showModal('ajax-modal', '250px'); -//$('#ajax-modal').css('height','80px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); +$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>"); +$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>"); +showModal('ajax-modal', '250px'); +//$('#ajax-modal').css('height','80px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().removeClass("alert_praise"); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("poll_alert_form"); \ No newline at end of file diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 9513baab0..85b230be3 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -40,7 +40,7 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); } diff --git a/app/views/files/_project_file_new.html.erb b/app/views/files/_project_file_new.html.erb index 4ee1ccede..b66c470e3 100644 --- a/app/views/files/_project_file_new.html.erb +++ b/app/views/files/_project_file_new.html.erb @@ -6,7 +6,7 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","40%").css("left","36%"); + $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); } diff --git a/app/views/files/quote_resource_show.js.erb b/app/views/files/quote_resource_show.js.erb index 76025fbd2..12b6ea241 100644 --- a/app/views/files/quote_resource_show.js.erb +++ b/app/views/files/quote_resource_show.js.erb @@ -7,5 +7,5 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/files/quote_resource_show_org_subfield.js.erb b/app/views/files/quote_resource_show_org_subfield.js.erb index fe34e9624..a9207f7f4 100644 --- a/app/views/files/quote_resource_show_org_subfield.js.erb +++ b/app/views/files/quote_resource_show_org_subfield.js.erb @@ -1,11 +1,11 @@ -<% if @can_quote %> -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>'); -<% else %> -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>'); -<% end %> - -showModal('ajax-modal', '513px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","").css("left",""); +<% if @can_quote %> +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>'); +<% else %> +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>'); +<% end %> + +showModal('ajax-modal', '513px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/files/quote_resource_show_project.js.erb b/app/views/files/quote_resource_show_project.js.erb index 41dc19fc5..22a47fda9 100644 --- a/app/views/files/quote_resource_show_project.js.erb +++ b/app/views/files/quote_resource_show_project.js.erb @@ -7,5 +7,5 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","30%").css("left","35%"); +$('#ajax-modal').parent().css("top","30%").css("left","35%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/files/subfield_upload_file.js.erb b/app/views/files/subfield_upload_file.js.erb index fc3afc0ff..340a2890f 100644 --- a/app/views/files/subfield_upload_file.js.erb +++ b/app/views/files/subfield_upload_file.js.erb @@ -1,6 +1,6 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>'); -showModal('ajax-modal', '513px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>'); +showModal('ajax-modal', '513px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/files/upload_files_menu.js.erb b/app/views/files/upload_files_menu.js.erb index e083fac85..deec53ea3 100644 --- a/app/views/files/upload_files_menu.js.erb +++ b/app/views/files/upload_files_menu.js.erb @@ -3,13 +3,13 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","40%").css("left","36%"); + $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); <% elsif @course %> $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","40%").css("left","36%"); + $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); <% end %> \ No newline at end of file diff --git a/app/views/homework_attach/show.js.erb b/app/views/homework_attach/show.js.erb index 953d8bab2..98742e03e 100644 --- a/app/views/homework_attach/show.js.erb +++ b/app/views/homework_attach/show.js.erb @@ -1,10 +1,10 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show') %>'); -showModal('ajax-modal', '513px'); -$('#ajax-modal').css('height','569px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); -$('#ajax-modal').parent().addClass("alert_box"); - +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show') %>'); +showModal('ajax-modal', '513px'); +$('#ajax-modal').css('height','569px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().removeClass("alert_praise"); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); +$('#ajax-modal').parent().addClass("alert_box"); + diff --git a/app/views/homework_common/alert_anonymous_comment.js.erb b/app/views/homework_common/alert_anonymous_comment.js.erb index 1c354aa45..96e958648 100644 --- a/app/views/homework_common/alert_anonymous_comment.js.erb +++ b/app/views/homework_common/alert_anonymous_comment.js.erb @@ -1,6 +1,6 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms') %>'); -showModal('ajax-modal', '500px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + -""); -$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed"); \ No newline at end of file +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms') %>'); +showModal('ajax-modal', '500px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + +""); +$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9"); \ No newline at end of file diff --git a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb index 5177f4d92..1e81df9e7 100644 --- a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb +++ b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb @@ -1,6 +1,6 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>'); -showModal('ajax-modal', '500px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed"); \ No newline at end of file +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>'); +showModal('ajax-modal', '500px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9"); \ No newline at end of file diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb index da685b758..f83b51b55 100644 --- a/app/views/homework_common/score_rule_set.js.erb +++ b/app/views/homework_common/score_rule_set.js.erb @@ -3,4 +3,4 @@ showModal('ajax-modal', '350px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); -$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); \ No newline at end of file +$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9"); \ No newline at end of file diff --git a/app/views/homework_common/start_evaluation_set.js.erb b/app/views/homework_common/start_evaluation_set.js.erb index 659441ce8..6ed74d0f0 100644 --- a/app/views/homework_common/start_evaluation_set.js.erb +++ b/app/views/homework_common/start_evaluation_set.js.erb @@ -4,7 +4,7 @@ showModal('ajax-modal', '350px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); -$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); +$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9"); $(function() { $('#evaluation_start_time').datepicker(datepickerOptions); $('#evaluation_end_time').datepicker(datepickerOptions); }); \ No newline at end of file diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index c37360a3b..969e2643b 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -279,7 +279,7 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); } // 鼠标经过的时候显示内容 diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index b7e8a5d6d..880c6cc1c 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -242,7 +242,7 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","40%").css("left","36%"); + $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); } diff --git a/app/views/my/clear_user_avatar_temp.js.erb b/app/views/my/clear_user_avatar_temp.js.erb index 788678673..8795177fc 100644 --- a/app/views/my/clear_user_avatar_temp.js.erb +++ b/app/views/my/clear_user_avatar_temp.js.erb @@ -1,8 +1,8 @@ - $("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src')); - $('#ajax-modal').html($("#nh_tx_dialog_html").html()); - showModal('ajax-modal','460px'); - $('#ajax-modal').siblings().hide(); - $('#ajax-modal').parent().removeClass("alert_praise"); - //$('#ajax-modal').parent().css("top","").css("left",""); - $('#ajax-modal').parent().addClass("alert_box"); - $('#ajax-modal').parent().css("border", "2px solid #15bccf").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0"); \ No newline at end of file + $("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src')); + $('#ajax-modal').html($("#nh_tx_dialog_html").html()); + showModal('ajax-modal','460px'); + $('#ajax-modal').siblings().hide(); + $('#ajax-modal').parent().removeClass("alert_praise"); + //$('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().addClass("alert_box"); + $('#ajax-modal').parent().css("border", "3px solid #269ac9").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0"); \ No newline at end of file diff --git a/app/views/org_subfields/_resource.html.erb b/app/views/org_subfields/_resource.html.erb index 3cce9748f..9935555d3 100644 --- a/app/views/org_subfields/_resource.html.erb +++ b/app/views/org_subfields/_resource.html.erb @@ -1,96 +1,96 @@ - - -
-
-
- <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %> - <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> - <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %> - <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> - <% end %> - <% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> - -

- 上传: - 课件 |  - 软件 |  - 媒体 |  - 代码 |  - 论文 |  - 其他 -

- <% end %> -
-
- -
- <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> -
- -
-
+ + +
+
+
+ <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %> + <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> + <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %> + <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> + <% end %> + <% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> + +

+ 上传: + 课件 |  + 软件 |  + 媒体 |  + 代码 |  + 论文 |  + 其他 +

+ <% end %> +
+
+ +
+ <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> +
+ +
+
<% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index c5c016583..e6b667075 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -1,397 +1,397 @@ -<%= stylesheet_link_tag 'polls', :media => 'all' %> - - -
- - - -
- <%= render :partial => 'edit_head', :locals => {:poll => @poll}%> -
- - -
- <%= render :partial => 'poll_content', :locals => {:poll => @poll}%> -
- - - - -
-
- -
- - <%= l(:label_memo_create)%> - -
- - -
-
-
- - -
+<%= stylesheet_link_tag 'polls', :media => 'all' %> + + +
+ + + +
+ <%= render :partial => 'edit_head', :locals => {:poll => @poll}%> +
+ + +
+ <%= render :partial => 'poll_content', :locals => {:poll => @poll}%> +
+ + + + +
+
+ +
+ + <%= l(:label_memo_create)%> + +
+ + +
+
+
+ + +
diff --git a/app/views/poll/commit_poll.js.erb b/app/views/poll/commit_poll.js.erb index 76e5e53df..a5c7f74cd 100644 --- a/app/views/poll/commit_poll.js.erb +++ b/app/views/poll/commit_poll.js.erb @@ -5,5 +5,5 @@ $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); $('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("alert_box"); \ No newline at end of file diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index 92a42cbac..e9deff3f4 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -1,91 +1,91 @@ -<%= stylesheet_link_tag 'polls', :media => 'all' %> - -
- <%= render :partial => 'poll_list'%> +<%= stylesheet_link_tag 'polls', :media => 'all' %> + +
+ <%= render :partial => 'poll_list'%>
\ No newline at end of file diff --git a/app/views/poll/other_poll.js.erb b/app/views/poll/other_poll.js.erb index eee4ed4a1..26ec89046 100644 --- a/app/views/poll/other_poll.js.erb +++ b/app/views/poll/other_poll.js.erb @@ -1,13 +1,13 @@ - -<% if @polls.empty? %> - alert('您目前还没有自己新建的问卷'); -<% else %> - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>'); - - - showModal('ajax-modal', '513px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","").css("left",""); - $('#ajax-modal').parent().addClass("popbox_polls"); + +<% if @polls.empty? %> + alert('您目前还没有自己新建的问卷'); +<% else %> + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>'); + + + showModal('ajax-modal', '513px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before(""); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); + $('#ajax-modal').parent().addClass("popbox_polls"); <% end %> \ No newline at end of file diff --git a/app/views/poll/publish_poll.js.erb b/app/views/poll/publish_poll.js.erb index 516e32f34..91dcdc882 100644 --- a/app/views/poll/publish_poll.js.erb +++ b/app/views/poll/publish_poll.js.erb @@ -6,5 +6,5 @@ $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); $('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("poll_alert_form"); \ No newline at end of file diff --git a/app/views/poll/republish_poll.js.erb b/app/views/poll/republish_poll.js.erb index 3b5c5bd3b..1d025a5b2 100644 --- a/app/views/poll/republish_poll.js.erb +++ b/app/views/poll/republish_poll.js.erb @@ -6,5 +6,5 @@ $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); $('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("poll_alert_form"); \ No newline at end of file diff --git a/app/views/projects/join_project.js.erb b/app/views/projects/join_project.js.erb index 92cdfcf2c..679e86d3f 100644 --- a/app/views/projects/join_project.js.erb +++ b/app/views/projects/join_project.js.erb @@ -1,10 +1,10 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>'); -showModal('ajax-modal', '540px'); -$('#ajax-modal').css('height','260px'); -//$('#ajax-modal').siblings().remove(); -$('#ajax-modal').siblings().hide(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left",""); -$('#ajax-modal').parent().addClass("alert_box"); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>'); +showModal('ajax-modal', '540px'); +$('#ajax-modal').css('height','260px'); +//$('#ajax-modal').siblings().remove(); +$('#ajax-modal').siblings().hide(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().removeClass("alert_praise"); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); +$('#ajax-modal').parent().addClass("alert_box"); diff --git a/app/views/student_work/create.js.erb b/app/views/student_work/create.js.erb index 67a1ccb50..1dea5965f 100644 --- a/app/views/student_work/create.js.erb +++ b/app/views/student_work/create.js.erb @@ -1,24 +1,24 @@ -<% if @has_commit %> - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/has_commit_work') %>'); - showModal('ajax-modal', '500px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before("" + - ""); - $('#ajax-modal').parent().css("top","").css("left",""); - $('#ajax-modal').parent().addClass("anonymos"); -<% elsif @submit_result%> - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>'); - showModal('ajax-modal', '500px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before("" + - ""); - $('#ajax-modal').parent().css("top","").css("left",""); - $('#ajax-modal').parent().addClass("anonymos"); -<% else %> - window.location.href = '<%= new_student_work_url(:homework => @homework.id)%>'; -<% end %> - -function clickCanel() { - hideModal('#popbox02'); - window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>'; +<% if @has_commit %> + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/has_commit_work') %>'); + showModal('ajax-modal', '500px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); + $('#ajax-modal').parent().addClass("anonymos"); +<% elsif @submit_result%> + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>'); + showModal('ajax-modal', '500px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); + $('#ajax-modal').parent().addClass("anonymos"); +<% else %> + window.location.href = '<%= new_student_work_url(:homework => @homework.id)%>'; +<% end %> + +function clickCanel() { + hideModal('#popbox02'); + window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>'; } \ No newline at end of file diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index cb8e7edf9..f72faaac2 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -1,118 +1,118 @@ -
-
编辑作品
-
-
- -
- -
-
- - - 截止时间:<%= @homework.end_time%> - -
- - <%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%> - -
-
- <%= @homework.description.html_safe %> -
-
-
-
- -
- <%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%> -
- 提示:作品名称和描述中不要出现真实的姓名信息 -
-
- <% if @homework.homework_type == 3 %> - - - <% str = User.current.id.to_s%> - <% @work.student_work_projects.where("is_leader = ?", 0).each do |pro| %> - <% str += ','+pro.user_id.to_s %> - <% end %> - <%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>str %> - <% end %> -
- -
-

-
-
- - -
-

-
- -
- <%= render :partial => 'users/user_homework_attachment', :locals => {:container => @work, :has_program=>false,:has_group=>false} %> -
- - <% if @homework.homework_type == 3 %> - - <% end %> - -
- 确定 - - <%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%> -
-
- <% end%> -
-
- +
+

+
+ +
+ <%= render :partial => 'users/user_homework_attachment', :locals => {:container => @work, :has_program=>false,:has_group=>false} %> +
+ + <% if @homework.homework_type == 3 %> + + <% end %> + +
+ 确定 + + <%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%> +
+
+ <% end%> +
+
+ \ No newline at end of file diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index b314bcf6d..afc97aca9 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -30,7 +30,7 @@ $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); - $('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); + $('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9"); } $(function(){ diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index bd13fb7c1..99c317314 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -1,177 +1,177 @@ - - - -
-
提交作品
-
-
- -
- -
-
- - - 截止时间:<%= @homework.end_time%> - -
- - <%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%> - -
-
- <%= @homework.description.html_safe %> -
-
- <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %> -
-
-
-
-
- -
- <%= form_for(@student_work, - :html => { :multipart => true }, - :url => {:controller => 'student_work', - :action => 'create', - :homework => @homework.id - },:remote=>true ) do |f| %> -
- 提示:作品名称和描述中不要出现真实的姓名信息 -
-
- <% if @homework.homework_type == 3 %> - - - <%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %> - <% end %> -
- <%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请简洁的概括作品的功能或特性", :onkeyup => "regexStudentWorkName();" %> -
-

-
-
- <%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请介绍你的作品", :onkeyup => "regexStudentWorkDescription();"%> - -
-

-
- -
- <%= render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false} %> -
-
-
-
-
- - <% if @homework.homework_type == 3 %> - - <% end %> - - - - - -
- 提交 - - <%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id), :class => "fr mr10 mt3"%> -
-
- <% end%> -
+ + + +
+
提交作品
+
+
+ +
+ +
+
+ + + 截止时间:<%= @homework.end_time%> + +
+ + <%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%> + +
+
+ <%= @homework.description.html_safe %> +
+
+ <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %> +
+
+
+
+
+ +
+ <%= form_for(@student_work, + :html => { :multipart => true }, + :url => {:controller => 'student_work', + :action => 'create', + :homework => @homework.id + },:remote=>true ) do |f| %> +
+ 提示:作品名称和描述中不要出现真实的姓名信息 +
+
+ <% if @homework.homework_type == 3 %> + + + <%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %> + <% end %> +
+ <%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请简洁的概括作品的功能或特性", :onkeyup => "regexStudentWorkName();" %> +
+

+
+
+ <%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请介绍你的作品", :onkeyup => "regexStudentWorkDescription();"%> + +
+

+
+ +
+ <%= render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false} %> +
+
+
+
+
+ + <% if @homework.homework_type == 3 %> + + <% end %> + + + + + +
+ 提交 + + <%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id), :class => "fr mr10 mt3"%> +
+
+ <% end%> +
\ No newline at end of file diff --git a/app/views/student_work/update.js.erb b/app/views/student_work/update.js.erb index f485cb8cc..9dc381e42 100644 --- a/app/views/student_work/update.js.erb +++ b/app/views/student_work/update.js.erb @@ -1,16 +1,16 @@ -<% if @submit_result%> -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_edit_information') %>'); -showModal('ajax-modal', '500px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().css("top","").css("left",""); -$('#ajax-modal').parent().addClass("anonymos"); -<% else %> -window.location.href = '<%= edit_student_work_url(@work)%>'; -<% end %> - -function clickCanel() { - hideModal('#popbox02'); - window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>'; +<% if @submit_result%> +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_edit_information') %>'); +showModal('ajax-modal', '500px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); +$('#ajax-modal').parent().addClass("anonymos"); +<% else %> +window.location.href = '<%= edit_student_work_url(@work)%>'; +<% end %> + +function clickCanel() { + hideModal('#popbox02'); + window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>'; } \ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index d145dab90..01afbfebe 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -131,10 +131,10 @@
- diff --git a/app/views/users/_share_news_to_course.html.erb b/app/views/users/_share_news_to_course.html.erb new file mode 100644 index 000000000..9865f6af2 --- /dev/null +++ b/app/views/users/_share_news_to_course.html.erb @@ -0,0 +1,56 @@ + + +
+
+
发送到
+
+ +
+
+
+ +
+ <%= form_tag search_user_course_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + + <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> + <% end %> +
+ <%= form_tag share_news_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %> +
+ + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
+ <% if !courses.empty? %> + <% courses.each do |course| %> +
    +
  • + +
  • +
  • <%= truncate(course.name,:lendght=>25) + '['+course.time.to_s+course.term + ']'%>
  • +
+ <% end %> +
+
+
+
+ + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %> +
+ +
+
+ <% end %> +
+ diff --git a/app/views/users/_share_news_to_org.html.erb b/app/views/users/_share_news_to_org.html.erb new file mode 100644 index 000000000..f57a91ae6 --- /dev/null +++ b/app/views/users/_share_news_to_org.html.erb @@ -0,0 +1,59 @@ +
+
发送到
+
+ +
+ <%= form_tag search_user_org_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_org_form' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + <% end %> +
+
+<%= form_tag share_news_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
+ +
    + <% unless @orgs.empty? %> + <% @orgs.each do |org|%> +
  • + +
  • + <%end%> + <%end%> +
+
+
+
    + + + <%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%> + + + + + +
+
+
+
目标地址:
+
+ <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %> +
+
+ 取消 +
+
+<%end %> \ No newline at end of file diff --git a/app/views/users/_share_news_to_project.html.erb b/app/views/users/_share_news_to_project.html.erb new file mode 100644 index 000000000..0ae011caf --- /dev/null +++ b/app/views/users/_share_news_to_project.html.erb @@ -0,0 +1,54 @@ +
+
+
发送到
+
+ +
+
+
+ +
+ <%= form_tag search_user_project_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + + <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> + <% end %> +
+ <%= form_tag share_news_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %> +
+ + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
+ <% if !projects.empty? %> + <% projects.each do |project| %> +
    +
  • + +
  • +
  • <%= project.name%>
  • +
+ <% end %> +
+
+
+
+ + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %> +
+ +
+
+ <% end %> +
+ diff --git a/app/views/users/search_user_course.js.erb b/app/views/users/search_user_course.js.erb index d0ac40ed0..138eab6f9 100644 --- a/app/views/users/search_user_course.js.erb +++ b/app/views/users/search_user_course.js.erb @@ -9,7 +9,11 @@ //$("#upload_box").css('left','').css('top',''); //$("#upload_box").html('<%#= escape_javascript( render :partial => "resource_share_popup" ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); //$("#upload_box").css('display','block'); -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_popup' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% if params[:send_type].present? && params[:send_type] == 'news' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% else %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_popup' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); diff --git a/app/views/users/search_user_org.js.erb b/app/views/users/search_user_org.js.erb index db099fe72..fb6efec9a 100644 --- a/app/views/users/search_user_org.js.erb +++ b/app/views/users/search_user_org.js.erb @@ -1,4 +1,8 @@ -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% if params[:send_type].present? && params[:send_type] == 'news' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% else %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb index 5218c22ab..926b7aa58 100644 --- a/app/views/users/search_user_project.js.erb +++ b/app/views/users/search_user_project.js.erb @@ -1,4 +1,8 @@ -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); +<% if params[:send_type].present? && params[:send_type] == 'news' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); +<% else %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); +<% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); diff --git a/app/views/users/share_news_to_course.js.erb b/app/views/users/share_news_to_course.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_news_to_course.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/app/views/users/share_news_to_org.js.erb b/app/views/users/share_news_to_org.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_news_to_org.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/app/views/users/share_news_to_project.js.erb b/app/views/users/share_news_to_project.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_news_to_project.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index ccbe67004..c2b089c02 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -532,6 +532,9 @@ RedmineApp::Application.routes.draw do post "add_exist_file_to_course" post "add_exist_file_to_project" post 'add_exist_file_to_org' + post 'share_news_to_course' + post 'share_news_to_project' + post 'share_news_to_org' get 'resource_preview' get 'rename_resource' get 'search_user_project' diff --git a/db/schema.rb b/db/schema.rb index bac1882c5..92cf224fc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160115125217) do +ActiveRecord::Schema.define(:version => 20160120032758) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1082,14 +1082,15 @@ ActiveRecord::Schema.define(:version => 20160115125217) do create_table "news", :force => true do |t| t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" t.text "description" - t.integer "author_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false t.integer "course_id" - t.integer "sticky", :default => 0 + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" end add_index "news", ["author_id"], :name => "index_news_on_author_id" @@ -1709,6 +1710,10 @@ ActiveRecord::Schema.define(:version => 20160115125217) do t.string "extra" end + create_table "temp", :id => false, :force => true do |t| + t.integer "id", :default => 0, :null => false + end + create_table "time_entries", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false From 0db69e1ebfc991a88f3785bf2b19f1a885660d17 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 16:32:47 +0800 Subject: [PATCH 036/215] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=AF=BC=E8=AF=AD=E6=97=B6=E9=97=B4=E5=92=8C=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=8A=A8=E6=80=81=E6=97=B6=E9=97=B4=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- app/models/course.rb | 10 +--------- app/models/course_activity.rb | 4 +++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 13d8e99b6..7b7bcbcf4 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -37,7 +37,7 @@ module CoursesHelper a_courses = [] courses = Course.search(keywords) courses.each do |c| - a_courses << c.id unless current_course.id != c.id + a_courses << c.id end a_courses << a_tags unless a_tags.length == 0 # 过滤条件:精品课程、本身不在搜索范围 diff --git a/app/models/course.rb b/app/models/course.rb index e715e9198..0d663b19a 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -72,7 +72,7 @@ class Course < ActiveRecord::Base before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity - after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index, :add_course_ead + after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index before_destroy :delete_all_members,:delete_course_ealasticsearch_index safe_attributes 'extra', @@ -405,14 +405,6 @@ class Course < ActiveRecord::Base self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false) end - # 发布新课导语 - def add_course_ead - name = Redmine::Configuration['course_message_lead_subject'] - content = Redmine::Configuration['course_message_lead_content'] - # message的status状态为0为正常,为1表示创建课程时发送的message - Message.create(:subject => name, :content => content, :board_id => self.boards.first.id, :author_id => self.tea_id , :sticky => true, :status => true ) - end - #项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题 #def name # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name) diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index 88351acfd..194e1183a 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -70,7 +70,9 @@ class CourseActivity < ActiveRecord::Base name = Redmine::Configuration['course_message_lead_subject'] content = Redmine::Configuration['course_message_lead_content'] # message的status状态为0为正常,为1表示创建课程时发送的message - Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) + message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) + # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 + message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) end end end From f3b5f4e5f762b6c52bf698c2b12b33cbd546f0a6 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 16:58:41 +0800 Subject: [PATCH 037/215] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8tab=E9=A1=B5=E9=80=9A=E8=BF=87=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E5=9D=97=E5=B1=95=E7=A4=BA=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 66f60d020..ebc60c312 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -969,7 +969,17 @@ module ApplicationHelper first_page = FirstPage.find_by_page_type('project') if args.empty? title = @html_title || [] - title << @project.name if @project + if @project + title << @project.name + elsif @course + title << @course.name + elsif @organization + title << @organization.name + elsif @user + title << @user.login + else + title << User.current.login + end if first_page.nil? || first_page.web_title.nil? title << Setting.app_title unless Setting.app_title == title.last else From 340d404ecd2f626689b35f06caf5e286ef3cde49 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 20 Jan 2016 17:23:02 +0800 Subject: [PATCH 038/215] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=8F=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E9=80=9A=E7=9F=A5=E5=A2=9E=E5=8A=A0=E6=9F=A5=E3=80=81?= =?UTF-8?q?=E6=94=B9=E3=80=81=E5=88=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/news_controller.rb | 15 ++ app/models/news.rb | 6 +- .../news/_edit_for_org_subfield.html.erb | 49 +++++ app/views/news/_organization_show.html.erb | 173 ++++++++++++++++++ app/views/news/edit.html.erb | 8 +- app/views/news/show.html.erb | 2 + ...60120032758_add_org_subfield_id_to_news.rb | 5 + public/javascripts/project.js | 21 ++- 8 files changed, 273 insertions(+), 6 deletions(-) create mode 100644 app/views/news/_edit_for_org_subfield.html.erb create mode 100644 app/views/news/_organization_show.html.erb create mode 100644 db/migrate/20160120032758_add_org_subfield_id_to_news.rb diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index d3ac71b99..8d0309588 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -144,6 +144,10 @@ class NewsController < ApplicationController if @course render :layout => 'base_courses' end + elsif @news.org_subfield_id + @org_subfield = OrgSubfield.find(@news.org_subfield_id) + @organization = @org_subfield.organization + render :layout => 'base_org' end end @@ -221,8 +225,14 @@ class NewsController < ApplicationController end def edit + if @news.org_subfield_id + @org_subfield = OrgSubfield.find(@news.org_subfield_id) + @organization = @org_subfield.organization + end if @course render :layout => "base_courses" + elsif @org_subfield + render :layout => 'base_org' end end @@ -240,12 +250,17 @@ class NewsController < ApplicationController end def destroy + if @news.org_subfield_id + @org_subfield = OrgSubfield.find(@news.org_subfield_id) + end @news.destroy # modify by nwb if @project redirect_to project_news_index_url(@project) elsif @course redirect_to course_news_index_url(@course) + elsif @org_subfield + redirect_to organization_path(@org_subfield.organization, :org_subfield_id => @org_subfield.id) end end diff --git a/app/models/news.rb b/app/models/news.rb index 0ff0786ab..fee5d2801 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -58,7 +58,7 @@ class News < ActiveRecord::Base after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity,:act_as_system_message, :add_author_as_watcher, :send_mail, :add_news_count after_update :update_activity - after_destroy :delete_kindeditor_assets, :decrease_news_count + after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities scope :visible, lambda {|*args| includes(:project).where(Project.allowed_to_condition(args.shift || User.current, :view_news, *args)) @@ -188,4 +188,8 @@ class News < ActiveRecord::Base Mailer.run.news_added(self) if Setting.notified_events.include?('news_added') end + def delete_org_activities + OrgActivity.where("container_type='OrgSubfield' and org_act_type='News' and org_act_id=?", self.id).destroy_all + end + end \ No newline at end of file diff --git a/app/views/news/_edit_for_org_subfield.html.erb b/app/views/news/_edit_for_org_subfield.html.erb new file mode 100644 index 000000000..75f24e6b7 --- /dev/null +++ b/app/views/news/_edit_for_org_subfield.html.erb @@ -0,0 +1,49 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false) %> +<% end %> + +
+
+
+
+ +

+
+ +
+
+
\ No newline at end of file diff --git a/app/views/news/_organization_show.html.erb b/app/views/news/_organization_show.html.erb new file mode 100644 index 000000000..aa610720c --- /dev/null +++ b/app/views/news/_organization_show.html.erb @@ -0,0 +1,173 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> +<% end %> + + + + +
+
+
+ <%= link_to image_tag(url_to_avatar(@news.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@news.author) %> +
+
+ <% if User.current.logged? %> + + <%end%> + +
+ +
+ <% if @news.try(:author).try(:realname) == ' ' %> + <%= link_to @news.try(:author), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @news.try(:author).try(:realname), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
+
<%= format_time( @news.created_on)%>
+
+
+ <%= @news.description.html_safe%> +
+
+
+ <%= link_to_attachments_course @news, :author => false %> +
+
+
+
+
+
+ <% unless @comments.empty? %> +
+
回复(<%=@comments.count %>)
+
+
+
+ <% @comments.each_with_index do |reply,i| %> + +
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
+
+
+ <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
+
+ <%= reply.comments.html_safe%> +
+
+ <%= format_time(reply.created_on) %> + +
+

+
+
+
+ <% end %> +
+ + <% end %> +
+ <% if @news.commentable? %> +
+ +
+
+ <%= form_for @comment, :url=>{:controller => 'comments', :action => 'create', :id => @news}, :html => {:multipart => true, :id => 'add_comment_form'} do |f| %> +
+ <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= f.kindeditor :comments, :editor_id => 'comment_editor', + :owner_id => @comment.nil? ? 0: @comment.id, + :owner_type => OwnerTypeHelper::COMMENT, + :width => '99%', + :height => 100, + :minHeight=>100, + :input_html => { :id => 'comment_content', + :class => 'talk_text fl', + :maxlength => 5000 }%> +
+

+

+ + <%= l(:label_cancel_with_space) %> + + + <%= l(:label_comment_with_space) %> + +

+ <% end %> +
+
+
+ <% end %> +
+
diff --git a/app/views/news/edit.html.erb b/app/views/news/edit.html.erb index b043b06f8..24d7f2040 100644 --- a/app/views/news/edit.html.erb +++ b/app/views/news/edit.html.erb @@ -16,8 +16,10 @@
<%= labelled_form_for :news, @news, :url => news_path(@news), :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> - <%#= labelled_form_for :news, :url =>{:controller=>'news',:action => 'new', :course_id => @course.id}, - :html => {:nhname=>'form',:multipart => true, :id => 'news-form'} do |f| %> - <%= render :partial => 'course_news_new', :locals => {:f => f, :news => @news, :edit_mode => true, :course => @course} %> + <% if @org_subfield %> + <%= render :partial => 'edit_for_org_subfield', :locals => {:f => f, :news => @news} %> + <% else %> + <%= render :partial => 'course_news_new', :locals => {:f => f, :news => @news, :edit_mode => true, :course => @course} %> + <% end %> <% end %>
diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index 846be063f..4f6ca056e 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -2,6 +2,8 @@ <%= render :partial => 'project_show', locals: {project: @project} %> <% elsif @course %> <%= render :partial => 'course_show', locals: {course: @course} %> +<% elsif @organization %> + <%= render :partial => 'organization_show', :locals => {:org_subfield => @org_subfield} %> <% end %> \ No newline at end of file diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index be212fb29..45721fd1b 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -114,7 +114,9 @@ $(function(){ dialogClass: 'BluePopupBox', minWidth: 753 }); - $('#BluePopupBox').parent().css("border","3px solid #269ac9"); + $('#BluePopupBox').parent().resizable("disable"); + $('#BluePopupBox').parent().removeClass("ui-state-disabled"); + $('#BluePopupBox').parent().css("border","3px solid #269ac9").css("padding","10px"); $('a.ProBtn').live('click', function(){ $("#BluePopupBox").dialog("open"); @@ -205,7 +207,9 @@ $(function(){ dialogClass: 'BluePopupBox', minWidth: 290 }); - $('#GroupPopupBox').parent().css("border","3px solid #269ac9"); + $('#GroupPopupBox').parent().resizable("disable"); + $('#GroupPopupBox').parent().removeClass("ui-state-disabled"); + $('#GroupPopupBox').parent().css("border","3px solid #269ac9").css("padding","10px"); $('a.groupBtn').live('click', function(){ $("#GroupPopupBox").dialog("open"); diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index fb5e64523..64cd2e959 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1,3 +1,4 @@ + /* CSS Document */ /* 2015-06-26 */ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} @@ -555,7 +556,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- /*.navHomepageProfile ul li ul {display:none;} .navHomepageProfile ul li:hover ul {display:block;}*/ .homepageLeft {width:240px; float:left; margin-right:10px; margin-bottom:10px;} -.homepageRight {width:750px; float:left; margin-top:10px; margin-bottom:10px;} +.homepageRight {width:750px; float:left; margin-top:10px; margin-bottom:10px; margin-top:10px;} .homepagePortraitContainer {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px;} .homepagePortraitImage {width:78px; height:78px; position:relative; border:1px solid #cbcbcb; padding: 2px;} .homepagePortraitImage:hover {border:1px solid #269ac9;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 234905c7a..7770fa1ac 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -306,7 +306,7 @@ a:hover.bgreen_n_btn{background:#08a384;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} .bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} -.grey_border{border:1px solid #dddddd !important; } +.grey_border{border:1px solid #dddddd !important;} /* commonpic */ .pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;} .pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;} From 01016c67a92b06abf6d635507b9b73f2b56a50cd Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 18:28:27 +0800 Subject: [PATCH 040/215] =?UTF-8?q?issue=E5=B1=9E=E6=80=A7=E5=B1=80?= =?UTF-8?q?=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 2 + .../users/_project_issue_detail.html.erb | 134 ++++++++++++++++++ public/stylesheets/project.css | 6 +- public/stylesheets/public.css | 4 + 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 app/views/users/_project_issue_detail.html.erb diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 6f1fc8b7a..4c89110ad 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -57,6 +57,8 @@ <% end %>
+ <%# 局部刷新:修改xissue属性 %> + <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb new file mode 100644 index 000000000..0c0ac2f1d --- /dev/null +++ b/app/views/users/_project_issue_detail.html.erb @@ -0,0 +1,134 @@ + +
+
+ + + + + +
\ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 46364eee0..cf23eb963 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1163,4 +1163,8 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .mb10 {margin-bottom: 10px} .mb15 {margin-bottom: 15px} div.disable_link {background-color: #c1c1c1 !important;} -.reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:400px; height:80px; overflow-y:auto;outline: none;} \ No newline at end of file +.reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:400px; height:80px; overflow-y:auto;outline: none;} + +/*问题跟踪局部修改属性*/ +.proInfoBox2{ border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;} +.proInfoBox2 ul li{ height:24px; position:relative;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 2126e36d8..baa3f6fcf 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -140,6 +140,7 @@ h4{ font-size:14px; color:#3b3b3b;} .w50 {width:50px;} .w60{ width:60px;} .w70{ width:70px;} +.w80{ width:80px;} .w90{ width:90px;} .w100{width: 100px;} .w210{ width:210px;} @@ -323,6 +324,9 @@ a:hover.bgreen_n_btn{background:#08a384;} .pic_text02{display:block; background:url(../images/new_project/public_icon.png) 0px -642px no-repeat; width:20px; height:19px;} .pic_edit{display:block; background:url(../images/new_project/public_icon.png) 0px -32px no-repeat; width:20px; height:15px;} .pic_edit:hover{display:block; background:url(../images/new_project/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;} +.pic_edit2{display:inline-block; background:url(../images/public_icon.png) 0px -32px no-repeat; width:20px; height:15px; vertical-align:middle; display:none;} +.pic_edit2:hover{display:inline-block; background:url(../images/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;} + From c7522067e6e1f5b4d5779d19d0c9f47d57f9576f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 18:37:39 +0800 Subject: [PATCH 041/215] =?UTF-8?q?=E4=BF=AE=E6=94=B9base=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_recommendation.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb index bd44afad2..455ced056 100644 --- a/app/views/courses/_recommendation.html.erb +++ b/app/views/courses/_recommendation.html.erb @@ -1,6 +1,6 @@ <% unless excellent_course_recommend(course).count == 0 %> diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index e5aba7c02..25fbc841b 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -115,7 +115,7 @@ ) if @message.destroyable_by?(User.current) %> <% end %> -
  • <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
  • +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %>
  • diff --git a/app/views/org_subfields/show.html.erb b/app/views/org_subfields/show.html.erb index 82203b4de..7d3a2b969 100644 --- a/app/views/org_subfields/show.html.erb +++ b/app/views/org_subfields/show.html.erb @@ -178,20 +178,6 @@ } - - function org_id_click(){ - var sendText = $("input[name='org_id']:checked").next().text(); - var orgDirection = "目标地址:" - $(".orgDirection").text(orgDirection + sendText); - } - function subfield_click(){ - var sendText = $("input[name='org_id']:checked").next().text(); - var orgDirection = "目标地址:" - var sendColumn = $("input[name='subfield']:checked").next().text(); - $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn); - } - - function course_attachmenttypes_change(id, type) { <% if @course%> $.ajax({ diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index 349f7c86e..16a2a55d6 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -13,7 +13,6 @@ <% end %> TO <%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%> -
    <% if activity.parent_id.nil? %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 5abd08224..8a7c6d4cd 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -71,9 +71,7 @@ ) if activity.course_destroyable_by?(User.current) %> <% end %> -
  • - <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %> -
  • +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
  • diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index d4a7a9e60..ec36854cb 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -71,9 +71,7 @@ ) if activity.destroyable_by?(User.current) %> <% end %> -
  • - <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %> -
  • +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
  • diff --git a/app/views/users/_share_message_to_course.html.erb b/app/views/users/_share_message_to_course.html.erb new file mode 100644 index 000000000..eda4a9b97 --- /dev/null +++ b/app/views/users/_share_message_to_course.html.erb @@ -0,0 +1,56 @@ + + +
    +
    +
    发送到
    +
    + +
    +
    +
    + +
    + <%= form_tag search_user_course_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + + <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> + <% end %> +
    + <%= form_tag share_message_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %> +
    + + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
    + <% if !courses.empty? %> + <% courses.each do |course| %> +
      +
    • + +
    • +
    • <%= truncate(course.name,:lendght=>25) + '['+course.time.to_s+course.term + ']'%>
    • +
    + <% end %> +
    +
    +
    +
    + + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %> +
    + +
    +
    + <% end %> +
    + diff --git a/app/views/users/_share_message_to_org.html.erb b/app/views/users/_share_message_to_org.html.erb new file mode 100644 index 000000000..da3c7a072 --- /dev/null +++ b/app/views/users/_share_message_to_org.html.erb @@ -0,0 +1,59 @@ +
    +
    发送到
    +
    + +
    + <%= form_tag search_user_org_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_org_form' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + <% end %> +
    +
    +<%= form_tag share_message_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
    + +
      + <% unless @orgs.empty? %> + <% @orgs.each do |org|%> +
    • + +
    • + <%end%> + <%end%> +
    +
    +
    +
      + + + <%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%> + + + + + +
    +
    +
    +
    目标地址:
    +
    + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %> +
    +
    + 取消 +
    +
    +<%end %> \ No newline at end of file diff --git a/app/views/users/_share_message_to_project.html.erb b/app/views/users/_share_message_to_project.html.erb new file mode 100644 index 000000000..4b79a779c --- /dev/null +++ b/app/views/users/_share_message_to_project.html.erb @@ -0,0 +1,53 @@ +
    +
    +
    发送到
    +
    + +
    +
    +
    + +
    + <%= form_tag search_user_project_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + + <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> + <% end %> +
    + <%= form_tag share_message_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %> +
    + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
    + <% if !projects.empty? %> + <% projects.each do |project| %> +
      +
    • + +
    • +
    • <%= project.name%>
    • +
    + <% end %> +
    +
    +
    +
    + + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %> +
    + +
    +
    + <% end %> +
    + diff --git a/app/views/users/search_user_course.js.erb b/app/views/users/search_user_course.js.erb index 138eab6f9..eed7499d5 100644 --- a/app/views/users/search_user_course.js.erb +++ b/app/views/users/search_user_course.js.erb @@ -11,8 +11,10 @@ //$("#upload_box").css('display','block'); <% if params[:send_type].present? && params[:send_type] == 'news' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); -<% else %> +<% elsif params[:send_type] == 'file' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_popup' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% elsif params[:send_type] == 'message' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); <% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/search_user_org.js.erb b/app/views/users/search_user_org.js.erb index fb6efec9a..877629e34 100644 --- a/app/views/users/search_user_org.js.erb +++ b/app/views/users/search_user_org.js.erb @@ -1,7 +1,9 @@ <% if params[:send_type].present? && params[:send_type] == 'news' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); -<% else %> +<% elsif params[:send_type] == 'file' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% elsif params[:send_type] == 'message' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); <% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb index 926b7aa58..f80be34f8 100644 --- a/app/views/users/search_user_project.js.erb +++ b/app/views/users/search_user_project.js.erb @@ -1,7 +1,9 @@ <% if params[:send_type].present? && params[:send_type] == 'news' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); -<% else %> +<% elsif params[:send_type] == 'file' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); +<% elsif params[:send_type] == 'message' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); <% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/share_message_to_course.js.erb b/app/views/users/share_message_to_course.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_message_to_course.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/app/views/users/share_message_to_org.js.erb b/app/views/users/share_message_to_org.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_message_to_org.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/app/views/users/share_message_to_project.js.erb b/app/views/users/share_message_to_project.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_message_to_project.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3a4d2fb92..4f191a9bf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -541,6 +541,9 @@ RedmineApp::Application.routes.draw do post 'share_news_to_course' post 'share_news_to_project' post 'share_news_to_org' + post 'share_message_to_course' + post 'share_message_to_project' + post 'share_message_to_org' get 'resource_preview' get 'rename_resource' get 'search_user_project' From b6e13340e56a09dfd4060760df1b744379466645 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 25 Jan 2016 15:33:50 +0800 Subject: [PATCH 106/215] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?= =?UTF-8?q?=E7=9A=84=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 4 ++- .../users/_user_journalsformessage.html.erb | 27 +++++++++++++++++-- app/views/words/create_reply.js.erb | 6 +---- app/views/words/destroy.js.erb | 12 ++++++--- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index d24427a9d..699a5e8ca 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -73,7 +73,6 @@ class WordsController < ApplicationController # render 'test/index' # } format.js { - @reply_type = params[:reply_type] @user_activity_id = params[:user_activity_id] @activity = JournalsForMessage.find(parent_id) @is_activity = params[:is_activity] @@ -95,6 +94,9 @@ class WordsController < ApplicationController @user = User.find(@journal_destroyed.jour_id) @jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count @is_user = true + @user_activity_id = params[:user_activity_id] if params[:user_activity_id] + @is_activity = params[:is_activity].to_i if params[:is_activity] + @activity = @journal_destroyed.parent if @journal_destroyed.parent elsif @journal_destroyed.jour_type == 'HomeworkCommon' @homework = HomeworkCommon.find @journal_destroyed.jour_id if params[:user_activity_id] diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index e30fd1824..d7247621a 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -39,6 +39,22 @@ 更新时间:<%= format_time(PrincipalActivity.where("principal_act_type='#{activity.class}' and principal_act_id =#{activity.id}").first.updated_at) %>
    + <% if activity.user == User.current || User.current.admin?%> +
    +
      +
    • +
        +
      • + <%= link_to(l(:label_bid_respond_delete), + {:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user,:user_activity_id => user_activity_id,:is_activity=>is_activity}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', + :class => "postOptionLink", :title => l(:button_delete)) %> +
      • +
      +
    • +
    +
    + <% end%>
    @@ -71,7 +87,7 @@ - -
    - <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %> -
    -
    - -
    - <%student_work_scores.each do |student_score|%> -
    - <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%> -
    - <% end%> -
    - - 收起 -
    - - +
    +
    +
      +
    • + 上交时间: + <%=format_time work.created_at %> +
    • + + <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %> + +
    • + <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> +
    • +
    • + <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%> +
    • + <% end%> + <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> + +
    • + <%= render :partial => 'student_work_praise' %> +
    • + <% end%> +
      + +
    • + 编程代码: +
      +
      +
      +
      +
    • + +
    • + + 测试结果: + +
      + <% work.student_work_tests.each_with_index do |test, index| %> +
      +

      + 第<%= work.student_work_tests.count - index%>次测试 +

      + + <%= test.created_at.to_s(:db) %> + +
      +
      + <% if test.status.to_i == -2 %> +
      + <%= test.results.first %> +
      + <% else %> +
      +
        + <% test.results.each_with_index do |x, i| %> +
      • + 测试<%=i+1%> + <% if x["status"].to_i != 0 %> + 测试错误! + 您的输出: + <%=x["result"]%> + 正确输出: + <%=x["output"]%> +
        + <% else %> + 测试正确! +
        + <% end %> +
      • + <% end %> +
      +
      + <% end %> + <% end %> +
      +
    • + +
    • + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> + +
      + <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%> +
      + <% end%> +
      +
    • +
    + +
    + <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %> +
    +
    + +
    + <%student_work_scores.each do |student_score|%> +
    + <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%> +
    + <% end%> +
    +
    + + 收起 +
    +
    + diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 662ddece4..d66a30718 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -1,139 +1,140 @@ -
    -
    - <% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %> - <% if @homework.homework_type != 3 %> - <% is_my_work = work.user == User.current%> - <% else %> - <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %> - <% is_my_work = pro && pro.student_work_id == work.id%> - <% end %> -
      -
    • - 上交时间: - <%=format_time work.created_at %> -
    • - - <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %> - -
    • - <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %> -
    • -
    • - <%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%> -
    • - <% end%> - <% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %> - -
    • - <%= render :partial => 'student_work_praise' %> -
    • - <% end%> -
      - - - - <% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %> -
      -
    • - 参与人员: - <%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%> - <% members = work.student_work_projects.where("is_leader = 0") %> - <% members.each do |member| if !members.empty? %> - 、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %> - <% end %> - <% end %> -
    • - <% if @homework.homework_detail_group.base_on_project == 1 %> -
    • - 关联项目: - <% if work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %> - <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> - <% else %> - <%=work.project.name %> - <% end %> - <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> - (综合评分:<%=work.project.project_score.score.to_i %>) -
    • - <% end %> - <% end%> - -
    • - 内容: -
      - <%= text_format(work.description) if work.description%> -
      -
      -
    • -
    • - 附件: - <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %> - <% if com_attachments.empty?%> - 尚未提交附件 - <% else%> -
      - <%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %> -
      - <% end%> -
      -
    • -
    • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%> - -
      - <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%> -
      - <% end%> -
      -
    • -
    - -
    - <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %> -
    -
    - -
    - <%student_work_scores.each do |student_score|%> -
    - <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%> -
    - <% end%> -
    - - 收起 -
    -
    - \ No newline at end of file diff --git a/app/views/student_work/_work_attachments_status.html.erb b/app/views/student_work/_work_attachments_status.html.erb index c4b2a795e..6a8591197 100644 --- a/app/views/student_work/_work_attachments_status.html.erb +++ b/app/views/student_work/_work_attachments_status.html.erb @@ -1,7 +1,7 @@ <% attachments.each_with_index do |attachment,i| %>
    - + <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%> From 520811fdc79fbae2b94644ee016322774bb694a2 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 26 Jan 2016 11:17:55 +0800 Subject: [PATCH 112/215] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=8C=89=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 18 ++++++----------- app/controllers/words_controller.rb | 1 + app/models/journals_for_message.rb | 2 +- ...160126024429_update_journal_for_message.rb | 20 +++++++++++++++++++ db/schema.rb | 2 +- 5 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 db/migrate/20160126024429_update_journal_for_message.rb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 8794808a3..cb8afd3a1 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -755,23 +755,17 @@ class UsersController < ApplicationController if params[:type].present? case params[:type] when "public" - jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 0').order('created_on DESC') - @jour_count = jours.count - @jour = jours.limit(10).offset(@page * 10) + jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 0').order('updated_on DESC') when "private" - jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 1').order('created_on DESC') - @jour_count = jours.count - @jour = jours.limit(10).offset(@page * 10) + jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 1').order('updated_on DESC') else - jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') - @jour_count = jours.count - @jour = jours.limit(10).offset(@page * 10) + jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('updated_on DESC') end else - jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') - @jour_count = jours.count - @jour = jours.limit(10).offset(@page * 10) + jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('updated_on DESC') end + @jour_count = jours.count + @jour = jours.limit(10).offset(@page * 10) @type = params[:type] if User.current == @user jours.update_all(:is_readed => true, :status => false) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 699a5e8ca..351be4e64 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -62,6 +62,7 @@ class WordsController < ApplicationController update_forge_activity('JournalsForMessage',parent_id) update_org_activity('JournalsForMessage',parent_id) update_principal_activity('JournalsForMessage',parent_id) + (JournalsForMessage.find parent_id).update_attribute(:updated_on,Time.now) end respond_to do |format| # format.html { diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 9e0ce2dd2..cdcf9d19e 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -70,7 +70,7 @@ class JournalsForMessage < ActiveRecord::Base validates :notes, presence: true, if: :is_homework_jour? after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_at_message, :act_as_user_feedback_message, :act_as_principal_activity, :act_as_student_score after_create :reset_counters! - after_update :update_ativity + #after_update :update_activity after_destroy :reset_counters! after_save :be_user_score after_destroy :down_user_score diff --git a/db/migrate/20160126024429_update_journal_for_message.rb b/db/migrate/20160126024429_update_journal_for_message.rb new file mode 100644 index 000000000..f6b848c79 --- /dev/null +++ b/db/migrate/20160126024429_update_journal_for_message.rb @@ -0,0 +1,20 @@ +class UpdateJournalForMessage < ActiveRecord::Migration + def up + journals = JournalsForMessage.where("m_parent_id is null and jour_type ='Principal' ") + count = journals.count / 30 + 2 + transaction do + for i in 1 ... count do i + journals.page(i).per(30).each do |jour| + act = UserActivity.where("act_type='JournalsForMessage' and act_id = #{jour.id}").first + unless act.nil? + jour.updated_on = act.updated_at + jour.save + end + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 8af34d878..736ce0f4e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160122143138) do +ActiveRecord::Schema.define(:version => 20160126024429) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From 19003f27fca2dcbd89d4c79ad829bbbbc9205882 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 26 Jan 2016 15:05:45 +0800 Subject: [PATCH 113/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=B7=BB=E5=8A=A0is?= =?UTF-8?q?=5Fcopy=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 5 ++++- db/migrate/20160126031857_add_is_copy_to_course.rb | 5 +++++ db/schema.rb | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160126031857_add_is_copy_to_course.rb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 43a49c7d9..0697f0d0a 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -441,7 +441,10 @@ class CoursesController < ApplicationController @course = cs.create_course(params,User.current)[:course] if params[:copy_course] copy_course = Course.find params[:copy_course].to_i - @course.update_attributes(:open_student => copy_course.open_student, :publish_resource => copy_course.publish_resource) + @course.is_copy = 1 + @course.open_student = copy_course.open_student + @course.publish_resource = copy_course.publish_resource + @course.save if params[:checkAll] attachments = copy_course.attachments attachments.each do |attachment| diff --git a/db/migrate/20160126031857_add_is_copy_to_course.rb b/db/migrate/20160126031857_add_is_copy_to_course.rb new file mode 100644 index 000000000..f60914bbd --- /dev/null +++ b/db/migrate/20160126031857_add_is_copy_to_course.rb @@ -0,0 +1,5 @@ +class AddIsCopyToCourse < ActiveRecord::Migration + def change + add_column :courses, :is_copy, :integer, :default => 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index 736ce0f4e..42a5ea702 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160126024429) do +ActiveRecord::Schema.define(:version => 20160126031857) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -501,6 +501,7 @@ ActiveRecord::Schema.define(:version => 20160126024429) do t.string "end_term" t.integer "is_excellent", :default => 0 t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 end create_table "custom_fields", :force => true do |t| From 89a919163c58a751f13d07cdb47ae14574fd1d02 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 26 Jan 2016 15:25:25 +0800 Subject: [PATCH 114/215] =?UTF-8?q?=E4=B8=80=E6=97=A6=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=A7=81=E6=9C=89=EF=BC=8C=E5=B0=B1disabled=E6=8E=89=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E6=B8=B8=E5=AE=A2=E4=B8=8B=E8=BD=BD=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/new.html.erb | 5 +++-- app/views/organizations/setting.html.erb | 14 ++++++++++++-- public/javascripts/application.js | 13 +++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb index ea7fbbb30..e12bf3849 100644 --- a/app/views/organizations/new.html.erb +++ b/app/views/organizations/new.html.erb @@ -30,14 +30,15 @@
  • - + (打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)
  • - + (打钩为允许游客下载文件) +
  • diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 9ec118bec..b9b2f9b4c 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -63,11 +63,12 @@
  • 公开 : - class="ml3" /> + class="ml3" />
    下载支持 : - class="ml3" /> + name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />  允许游客下载 + <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
    保存 <% end %> @@ -187,4 +188,13 @@ $("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入"); } } + +// $(document).ready(function(){ +// if ( $("#is_public").attr("checked") != true){ +// alert($(this).attr("checked")); +// $("#allow_download").attr("checked", false); +// $("#allow_download").attr("disabled", true); +// $("#allow_down_hint").html(""); +// } +// }); \ No newline at end of file diff --git a/public/javascripts/application.js b/public/javascripts/application.js index f982d92f6..8fba6770a 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1135,3 +1135,16 @@ function chooseSendType(res_id,res_ids, user_id, send_type){ } lastSendType = sendType; } + +function disable_down(source, des, hint){ + if (source.attr("checked")){ + des.attr("disabled", false); + hint.html(""); + } + else{ + des.attr("checked", false); + des.attr("disabled", true); + hint.html("(私有组织不允许游客下载资源)"); + + } +} From af7ca36c92ad8f8bcbf0931e8d4293d292b05243 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 26 Jan 2016 15:59:39 +0800 Subject: [PATCH 115/215] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=88=96=E9=80=80=E5=87=BA=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 9 ++++----- app/views/layouts/_project_info.html.erb | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 4e90fc106..f326f2099 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -697,17 +697,16 @@ module CoursesHelper def join_in_course_header(course, user, options=[]) if user.logged? joined = course.members.map{|member| member.user_id}.include? user.id - text = joined ? ("".html_safe + l(:label_course_exit_student)) : ("".html_safe + l(:label_course_join_student)) + text = joined ? l(:label_course_exit_student) : l(:label_course_join_student) url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) method = joined ? 'delete' : 'post' if joined - link = "#{l(:label_course_join_student)}" + link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) + link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) else - link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a") + "#{l(:label_course_exit_student)}".html_safe + link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a") end else - link = "#{l(:label_course_join_student)}" + - "#{l(:label_course_exit_student)}" + link = "#{l(:label_course_join_student)}" end link.html_safe end diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index d4b5b20fe..db9e24a36 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -15,7 +15,10 @@ <% end %>
    -加入课程 + <% unless is_teacher %> + +
    <%= join_in_course_header(@course, User.current) %>
    + <% end %>
    <% case object_flag %> <% when '10' %> From 4b95ee95c073876faa641a07dfa6dfc87b70e981 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 27 Jan 2016 16:12:34 +0800 Subject: [PATCH 120/215] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=B8=96=E5=AD=90=EF=BC=8C=E5=9C=A8=E7=99=BB=E9=99=86=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E5=B0=B1=E8=83=BD=E5=8F=91=E9=80=81=EF=BC=9B?= =?UTF-8?q?=E5=9C=A8=E7=BB=84=E7=BB=87=E6=A0=8F=E7=9B=AE=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E5=B8=96=E5=AD=90=E6=A0=8F=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=BE=91=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E3=80=81=E5=8F=91=E9=80=81=E9=80=89=E9=A1=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messages/_org_subfield_show.html.erb | 2 +- .../_org_subfield_message.html.erb | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index 7fdf5d02c..1e31881d5 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -68,7 +68,7 @@ <%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
    - <% if @message.org_subfield_editable_by?(User.current) %> + <% if User.current.logged? %>
    From ec41cd4318c79ae5637c44c7299310d59d2d685e Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 27 Jan 2016 17:26:57 +0800 Subject: [PATCH 121/215] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E9=A2=98=E5=BA=93=E4=B8=AD=E7=9A=84=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 57 ++++++++++++++- .../_homework_detail_information.html.erb | 27 +++++++ .../users/_homework_search_input.html.erb | 29 ++++++++ .../users/_show_user_homework_form.html.erb | 33 ++++++--- app/views/users/_show_user_homeworks.html.erb | 71 ++++++++++++------- app/views/users/_user_homework_form.html.erb | 2 +- app/views/users/show_homework_detail.js.erb | 1 + app/views/users/user_homework_type.js.erb | 4 ++ app/views/users/user_import_homeworks.js.erb | 7 +- app/views/users/user_search_homeworks.js.erb | 4 +- config/routes.rb | 6 +- public/stylesheets/new_user.css | 23 +++++- public/stylesheets/public.css | 21 ++++++ 13 files changed, 238 insertions(+), 47 deletions(-) create mode 100644 app/views/users/_homework_detail_information.html.erb create mode 100644 app/views/users/_homework_search_input.html.erb create mode 100644 app/views/users/show_homework_detail.js.erb create mode 100644 app/views/users/user_homework_type.js.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cb8afd3a1..51feecb23 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -403,8 +403,47 @@ class UsersController < ApplicationController #导入作业 def user_import_homeworks + @user = User.current @select_course = params[:select_course] ? 1 : 0 - @user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc") + #@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc") + visible_course = Course.where("is_public = 1 && is_delete = 0") + visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" + @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids}").order("created_at desc") + @type = params[:type] + @limit = 10 + @is_remote = true + @hw_count = @homeworks.count + @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 + @offset ||= @hw_pages.offset + @homeworks = paginateHelper @homeworks,10 + respond_to do |format| + format.js + end + end + + def user_homework_type + @user = User.current + if(params[:type].blank? || params[:type] == "1") #公共题库 + visible_course = Course.where("is_public = 1 && is_delete = 0") + visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" + @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids}").order("created_at desc") + elsif params[:type] == "2" #我的题库 + @homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc") + end + @type = params[:type] + @limit = 10 + @is_remote = true + @hw_count = @homeworks.count + @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 + @offset ||= @hw_pages.offset + @homeworks = paginateHelper @homeworks,10 + respond_to do |format| + format.js + end + end + + def show_homework_detail + @homework = HomeworkCommon.find params[:homework].to_i respond_to do |format| format.js end @@ -412,7 +451,21 @@ class UsersController < ApplicationController #用户主页过滤作业 def user_search_homeworks - @user_homeworks = HomeworkCommon.where("user_id = '#{@user.id}' and lower(name) like '%#{params[:name].to_s.downcase}%'").order("created_at desc") + search = params[:name].to_s.strip.downcase + if(params[:type].blank? || params[:type] == "1") #全部 + visible_course = Course.where("is_public = 1 && is_delete = 0") + visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" + @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and (name like '%#{search}%')").order("created_at desc") + elsif params[:type] == "2" #课程资源 + @homeworks = HomeworkCommon.where("user_id = #{@user.id} and (name like '%#{search}%')").order("created_at desc") + end + @type = params[:type] + @limit = 10 + @is_remote = true + @hw_count = @homeworks.count + @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 + @offset ||= @hw_pages.offset + @homeworks = paginateHelper @homeworks,10 respond_to do |format| format.js end diff --git a/app/views/users/_homework_detail_information.html.erb b/app/views/users/_homework_detail_information.html.erb new file mode 100644 index 000000000..6887444ab --- /dev/null +++ b/app/views/users/_homework_detail_information.html.erb @@ -0,0 +1,27 @@ +
    题目信息
    +
    + <% if homework.nil? %> + 请先在左侧选择作业 + <% else %> +
    标题:<%=homework.name %>
    + 来源:<%=homework.course.name %>
    + <% if homework.homework_type == 2 && homework.homework_detail_programing %> + 编程语言:<%=homework.language_name %>
    + <% end %> + 贡献者:<%=homework.user.show_name %>
    + 描述如下: +
    +
    + <%=homework.description.html_safe %> +
    + <% if homework.homework_type == 2 %> +
    + 测试集:<%=homework.homework_tests.count %>组 +
    + <% elsif homework.homework_type ==3 && homework.homework_detail_group %> +
    + 分组人数:<%=homework.homework_detail_group.min_num %> - <%=homework.homework_detail_group.max_num %>人 +
    + <% end %> + <% end %> +
    \ No newline at end of file diff --git a/app/views/users/_homework_search_input.html.erb b/app/views/users/_homework_search_input.html.erb new file mode 100644 index 000000000..ba85f0d09 --- /dev/null +++ b/app/views/users/_homework_search_input.html.erb @@ -0,0 +1,29 @@ + + \ No newline at end of file diff --git a/app/views/users/_show_user_homework_form.html.erb b/app/views/users/_show_user_homework_form.html.erb index ef0265683..bd70e27fb 100644 --- a/app/views/users/_show_user_homework_form.html.erb +++ b/app/views/users/_show_user_homework_form.html.erb @@ -1,13 +1,24 @@ -<% user_homeworks.each do |homework|%> -
      -
    • - -
    • - +
    • + <% case homework.homework_type %> + <% when 1 %> + 普通 + <% when 2 %> + 编程 + <% when 3 %> + 分组 + <% end %> +
    • <%= homework.user.show_name %>
    • <%=format_date homework.publish_time %>
    diff --git a/app/views/users/_show_user_homeworks.html.erb b/app/views/users/_show_user_homeworks.html.erb index ad1fcdf7a..f013705c5 100644 --- a/app/views/users/_show_user_homeworks.html.erb +++ b/app/views/users/_show_user_homeworks.html.erb @@ -10,13 +10,14 @@
      +
    • 作业类型
    • 贡献者
    • 发布时间
    <%= form_tag(user_select_homework_users_path, :multipart => true,:remote => true,:name=>"select_homework_form",:id=>'select_homework_form') do %> -
    +
    <%= render :partial => 'users/show_user_homework_form', :locals => {:homeworks => @homeworks}%>
    <% end %> diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 409b914b4..3f5c21567 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1442,14 +1442,15 @@ a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.chooseActive {background-color:#269ac9; color:#ffffff;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner li {height:40px; line-height:40px; vertical-align:middle;} -.subjectName {width:360px; padding-left:10px;} +.subjectName {width:260px; padding-left:10px;} +.subjectType {width:100px; text-align:center;} .subjectPublisher {width:100px; text-align:center;} .subjectDate {width:115px; text-align:center;} -.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} -.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} +.subjectRow {width:585px; height:30px; color:#7a7a7a; font-size:12px;} +.subjectRow li {height:30px; line-height:30px; vertical-align:middle;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;outline: none;} .subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} -.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} +.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:470px; overflow-y:auto;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;} .popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 611e96a2c..2d6bad0a1 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -1027,13 +1027,14 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner li {height:40px; line-height:40px; vertical-align:middle;} .subjectName {width:360px; padding-left:10px;} +.subjectType {width:100px; text-align:center;} .subjectPublisher {width:100px; text-align:center;} .subjectDate {width:115px; text-align:center;} -.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} -.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} +.subjectRow {width:585px; height:30px; color:#7a7a7a; font-size:12px;} +.subjectRow li {height:30px; line-height:30px; vertical-align:middle;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;outline: none;} .subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} -.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} +.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:470px; overflow-y:auto;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;} .popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} From c857fb734b5306248d87c8c10d92a09dad5307b1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 28 Jan 2016 10:16:45 +0800 Subject: [PATCH 123/215] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=9B=9E=E5=A4=8D=E6=A1=86?= =?UTF-8?q?=E7=9A=84=E9=AB=98=E5=BA=A6=E5=92=8C=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_org_subfield_show.html.erb | 2 +- public/javascripts/application.js | 3 +++ public/javascripts/create_kindeditor.js | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index 1e31881d5..fab0f752e 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -58,7 +58,7 @@ } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>"); + init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 8fba6770a..7f60b11b4 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1032,6 +1032,7 @@ function subfield_click(){ $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn); } +//send_type:发送的类型,file对应文件,message对应帖子,news对应通知或新闻 function observeSearchfieldOnInput(fieldId, url,send_id,send_ids, send_type) { $('#'+fieldId).each(function() { var $this = $(this); @@ -1107,6 +1108,7 @@ function show_send(id, user_id, send_type){ //id 发送的id //发送的id数组 +//send_type:发送的类型,file对应文件,message对应帖子,news对应通知或新闻 function chooseSendType(res_id,res_ids, user_id, send_type){ sendType = $(".resourcesSendType").val(); @@ -1136,6 +1138,7 @@ function chooseSendType(res_id,res_ids, user_id, send_type){ lastSendType = sendType; } +//组织新建和配置中,选择组织为私有后,disbled掉允许游客下载选项 function disable_down(source, des, hint){ if (source.attr("checked")){ des.attr("disabled", false); diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js index 0eac4b01e..ea6262931 100644 --- a/public/javascripts/create_kindeditor.js +++ b/public/javascripts/create_kindeditor.js @@ -10,16 +10,16 @@ function sd_create_editor(params){ resizeType : 1,minWidth:"1px",width:"94%", height:"33px",// == undefined ? "30px":paramsHeight+"px", minHeight:"33px",// == undefined ? "30px":paramsHeight+"px", + width:params.width, items:['emoticons','fontname', 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', 'formatblock', 'fontsize', '|','indent', 'outdent', '|','imagedirectupload'], afterChange:function(){//按键事件 - var edit = this.edit; var body = edit.doc.body; edit.iframe.height(paramsHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight)); + //this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight)); }, afterBlur:function(){ //params.toolbar_container.hide(); From a613b58b46fd321779113d183e37bc6109c71c39 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 28 Jan 2016 11:08:16 +0800 Subject: [PATCH 124/215] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E7=9A=84=E9=AB=98=E5=BA=A6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_programing_attr.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_programing_attr.html.erb b/app/views/users/_user_programing_attr.html.erb index 3f2e53fe8..71816689b 100644 --- a/app/views/users/_user_programing_attr.html.erb +++ b/app/views/users/_user_programing_attr.html.erb @@ -7,7 +7,7 @@ <%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
    -
    +
    <% if edit_mode && homework.is_program_homework? %> <% homework.homework_tests.each_with_index do |test, index| %>
    From c942c843b94fec9d660b60e64e87728bb7958b9d Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 28 Jan 2016 16:27:46 +0800 Subject: [PATCH 125/215] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=95=E7=94=A8=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 21 ++++++++++++------- .../_homework_detail_information.html.erb | 6 +++++- .../users/_show_user_homework_form.html.erb | 1 + app/views/users/_show_user_homeworks.html.erb | 3 ++- app/views/users/_user_homework_form.html.erb | 3 +++ app/views/users/user_select_homework.js.erb | 1 + .../20160128024452_add_quotes_to_homework.rb | 5 +++++ db/schema.rb | 3 ++- public/stylesheets/new_user.css | 9 ++++---- public/stylesheets/public.css | 9 ++++---- 10 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 db/migrate/20160128024452_add_quotes_to_homework.rb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9cf69504b..190784f26 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -408,7 +408,7 @@ class UsersController < ApplicationController #@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc") visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" - @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids}").order("created_at desc") + @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc") @type = params[:type] @limit = 15 @is_remote = true @@ -426,9 +426,9 @@ class UsersController < ApplicationController if(params[:type].blank? || params[:type] == "1") #公共题库 visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" - @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids}").order("created_at desc") + @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc") elsif params[:type] == "2" #我的题库 - @homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc") + @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc") end @type = params[:type] @limit = 15 @@ -451,13 +451,14 @@ class UsersController < ApplicationController #用户主页过滤作业 def user_search_homeworks + @user = User.current search = params[:name].to_s.strip.downcase if(params[:type].blank? || params[:type] == "1") #全部 visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" - @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and (name like '%#{search}%')").order("created_at desc") + @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'} and (name like '%#{search}%')").order("created_at desc") elsif params[:type] == "2" #课程资源 - @homeworks = HomeworkCommon.where("user_id = #{@user.id} and (name like '%#{search}%')").order("created_at desc") + @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc") end @type = params[:type] @limit = 15 @@ -479,6 +480,7 @@ class UsersController < ApplicationController @homework = HomeworkCommon.new @select_course = params[:select_course] || 0 if homework + @ref_homework = homework @homework.name = homework.name @homework.description = homework.description @homework.end_time = homework.end_time @@ -636,13 +638,15 @@ class UsersController < ApplicationController homework_detail_manual.save if homework_detail_manual homework_detail_programing.save if homework_detail_programing homework_detail_group.save if homework_detail_group - + if params[:quotes] && !params[:quotes].blank? + homework = HomeworkCommon.find params[:quotes].to_i + homework.update_attribute(:quotes, homework.quotes+1) + end if params[:is_in_course] == "1" redirect_to homework_common_index_path(:course => homework.course_id) else redirect_to user_homeworks_user_path(User.current.id) end - end end else @@ -1681,7 +1685,8 @@ class UsersController < ApplicationController end attach_copied_obj.save unless Project.find(project_id).project_score.nil? - Project.find(project_id).project_score.update_attribute(:attach_num, Project.find(project_id).project_score.attach_num + 1) + Project.find(project_id).project_score.update_attribute(:attach_num, + Project.find(project_id).project_score.attach_num + 1) end end end diff --git a/app/views/users/_homework_detail_information.html.erb b/app/views/users/_homework_detail_information.html.erb index 6887444ab..d650cd084 100644 --- a/app/views/users/_homework_detail_information.html.erb +++ b/app/views/users/_homework_detail_information.html.erb @@ -8,7 +8,11 @@ <% if homework.homework_type == 2 && homework.homework_detail_programing %> 编程语言:<%=homework.language_name %>
    <% end %> - 贡献者:<%=homework.user.show_name %>
    + 贡献者:<%=homework.user.show_name %> + <% if homework.user.user_extensions.occupation && homework.user.user_extensions.occupation!="" %> + ,<%=homework.user.user_extensions.occupation%> + <% end %> +
    描述如下:
    diff --git a/app/views/users/_show_user_homework_form.html.erb b/app/views/users/_show_user_homework_form.html.erb index b316093c3..43d204508 100644 --- a/app/views/users/_show_user_homework_form.html.erb +++ b/app/views/users/_show_user_homework_form.html.erb @@ -16,6 +16,7 @@ 分组 <% end %> +
  • <%= homework.quotes %>
  • <%= homework.user.show_name %>
  • <%=format_date homework.publish_time %>
  • diff --git a/app/views/users/_show_user_homeworks.html.erb b/app/views/users/_show_user_homeworks.html.erb index f013705c5..9f90a633f 100644 --- a/app/views/users/_show_user_homeworks.html.erb +++ b/app/views/users/_show_user_homeworks.html.erb @@ -10,7 +10,8 @@
      -
    • 作业类型
    • +
    • 类型
    • +
    • 引用数
    • 贡献者
    • 发布时间
    diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 5781a3416..4082854da 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -34,6 +34,9 @@
    <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%> + <% unless edit_mode %> + + <% end %> <% if edit_mode %> <% end %> diff --git a/app/views/users/user_select_homework.js.erb b/app/views/users/user_select_homework.js.erb index 9b4b43b33..306374b84 100644 --- a/app/views/users/user_select_homework.js.erb +++ b/app/views/users/user_select_homework.js.erb @@ -5,6 +5,7 @@ $("#homework_end_time").val("<%= @homework.end_time%>"); <% if @select_course == "0"%> $("#course_id").val("<%= @homework.course_id%>"); <% end%> +$("#ref_homework_id").val("<%= @ref_homework.id%>"); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true,:has_group => true,:show_member=>true})%>"); homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>"); <% if @homework_detail_group %> diff --git a/db/migrate/20160128024452_add_quotes_to_homework.rb b/db/migrate/20160128024452_add_quotes_to_homework.rb new file mode 100644 index 000000000..7f02062fb --- /dev/null +++ b/db/migrate/20160128024452_add_quotes_to_homework.rb @@ -0,0 +1,5 @@ +class AddQuotesToHomework < ActiveRecord::Migration + def change + add_column :homework_commons, :quotes, :integer, :default => 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index 42a5ea702..4539131c1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160126031857) do +ActiveRecord::Schema.define(:version => 20160128024452) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -783,6 +783,7 @@ ActiveRecord::Schema.define(:version => 20160126031857) do t.datetime "updated_at", :null => false t.integer "teacher_priority", :default => 1 t.integer "anonymous_comment", :default => 0 + t.integer "quotes", :default => 0 end add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 3f5c21567..d31c1ee0c 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1442,10 +1442,11 @@ a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.chooseActive {background-color:#269ac9; color:#ffffff;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner li {height:40px; line-height:40px; vertical-align:middle;} -.subjectName {width:260px; padding-left:10px;} -.subjectType {width:100px; text-align:center;} -.subjectPublisher {width:100px; text-align:center;} -.subjectDate {width:115px; text-align:center;} +.subjectName {width:270px; padding-left:10px; padding-right:10px;} +.subjectPublisher {width:80px; text-align:center;} +.subjectDate {width:80px; text-align:center;} +.subjectType {width:70px; text-align:center;} +.subjectCount {width:65px; text-align:center;} .subjectRow {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subjectRow li {height:30px; line-height:30px; vertical-align:middle;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;outline: none;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 2d6bad0a1..be9d51799 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -1026,10 +1026,11 @@ a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.chooseActive {background-color:#269ac9; color:#ffffff;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner li {height:40px; line-height:40px; vertical-align:middle;} -.subjectName {width:360px; padding-left:10px;} -.subjectType {width:100px; text-align:center;} -.subjectPublisher {width:100px; text-align:center;} -.subjectDate {width:115px; text-align:center;} +.subjectName {width:270px; padding-left:10px; padding-right:10px;} +.subjectPublisher {width:80px; text-align:center;} +.subjectDate {width:80px; text-align:center;} +.subjectType {width:70px; text-align:center;} +.subjectCount {width:65px; text-align:center;} .subjectRow {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subjectRow li {height:30px; line-height:30px; vertical-align:middle;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;outline: none;} From 280f679b0c24c1125dd3fc091e5c76f1f84c9617 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 28 Jan 2016 16:49:25 +0800 Subject: [PATCH 126/215] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98=E5=BF=AB=E6=8D=B7=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E7=9A=84=E5=AE=BD=E5=BA=A6=EF=BC=9B2.https://www.trus?= =?UTF-8?q?tie.net/manual/feedback=E9=93=BE=E6=8E=A5=E5=88=B0=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9=E4=B8=AD=E5=BF=83=EF=BC=9B3.=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=86=E6=98=BE=E7=A4=BA=E6=9B=B4=E5=A4=9A=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue_detail.html.erb | 14 +++++++------- config/routes.rb | 1 + public/javascripts/create_kindeditor.js | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index 774d92cb9..1235b4e53 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -57,12 +57,12 @@ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
  •  指派  : 

    - - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %> + + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:100px; display:inline-block;" %> <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, - {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %> + {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"undis issueEdit", :style => "width:130px;"}) %>
  • <% end %>
    @@ -93,22 +93,22 @@
    •  开始  : 

      -

      <%= format_date(activity.start_date) %>

      +

      <%= format_date(activity.start_date) %>

    •  周期  : 

      - <%= l_hours(activity.estimated_hours) %>
    • + <%= l_hours(activity.estimated_hours) %>
    •  计划完成  : 

      - <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
    • + <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
    •  目标版本  : 

      - <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
    • + <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
    diff --git a/config/routes.rb b/config/routes.rb index 07c161265..da876d664 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1128,6 +1128,7 @@ RedmineApp::Application.routes.draw do match "/system_log" ,:to => 'system_log#index' match 'system_log/clear' get 'upload_files_menu', :to => 'files#upload_files_menu' + get '/manual/feedback', to:redirect("http://forge.trustie.net/forums/1/memos/1168") ##ended by lizanle resources :git_callback do diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js index ea6262931..bc28aa2bd 100644 --- a/public/javascripts/create_kindeditor.js +++ b/public/javascripts/create_kindeditor.js @@ -14,7 +14,7 @@ function sd_create_editor(params){ items:['emoticons','fontname', 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', 'formatblock', 'fontsize', '|','indent', 'outdent', - '|','imagedirectupload'], + '|','imagedirectupload','more'], afterChange:function(){//按键事件 var edit = this.edit; var body = edit.doc.body; From e9a7f6f82667136f49114bddcf8c2f0ef222ac95 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jan 2016 11:02:57 +0800 Subject: [PATCH 127/215] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=88=90=E7=BB=A9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 56 +++++++++++++++++++++++---- app/helpers/courses_helper.rb | 2 +- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 0697f0d0a..0961f2480 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -321,11 +321,12 @@ class CoursesController < ApplicationController def export_course_member_excel @all_members = student_homework_score(0,0,0,"desc") + @homeworks = @course.homework_commons.order("created_at desc") filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}"; respond_to do |format| format.xls { - send_data(member_to_xls(@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present", + send_data(member_to_xls(@homeworks,@course,@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present", :filename => filename_for_content_disposition("#{filename}.xls")) } end @@ -963,7 +964,7 @@ class CoursesController < ApplicationController sql_select = "" if groupid == 0 sql_select = "SELECT members.*,( - SELECT SUM(student_works.final_score) + SELECT SUM(IF(student_works.final_score is null,null,student_works.final_score - student_works.absence_penalty - student_works.late_penalty)) FROM student_works,homework_commons WHERE student_works.homework_common_id = homework_commons.id AND homework_commons.course_id = #{@course.id} @@ -975,7 +976,7 @@ class CoursesController < ApplicationController WHERE members.course_id = #{@course.id} ORDER BY score #{score_sort_by}" else sql_select = "SELECT members.*,( - SELECT SUM(student_works.final_score) + SELECT SUM(IF(student_works.final_score is null,null,student_works.final_score - student_works.absence_penalty - student_works.late_penalty)) FROM student_works,homework_commons WHERE student_works.homework_common_id = homework_commons.id AND homework_commons.course_id = #{@course.id} @@ -1009,16 +1010,54 @@ class CoursesController < ApplicationController end - def member_to_xls members,groups + def member_to_xls homeworks, course, members,groups xls_report = StringIO.new book = Spreadsheet::Workbook.new sheet1 = book.create_worksheet :name => "student" - blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 - sheet1.row(0).default_format = blue + #sheet1.row(0).default_format = blue + #sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_class),l(:excel_f_score),l(:excel_commit_time)]) + sheet1[0,0] = "课程编号" + sheet1[0,1] = course.id + sheet1[1,0] = "课程学期" + sheet1[1,1] = course.time.to_s+"年"+course.term + sheet1[2,0] = "课程名称" + sheet1[2,1] = course.name + sheet1[3,0] = "教师团队" + sheet1[3,1] = (searchTeacherAndAssistant course).map{|member| member.user.show_name}.join('、') + sheet1[4,0] = "主讲教师" + sheet1[4,1] = course.teacher.show_name + sheet1[5,0] = "排名" + sheet1[5,1] = "学生姓名" + sheet1[5,2] = "昵称" + sheet1[5,3] = "学号" + for i in 0 ... homeworks.count + sheet1[5,i+4] = "第"+(i+1).to_s+"次" + end + sheet1[5,homeworks.count+4] = "总成绩" + sheet1[5,0] = "排名" + sheet1[5,0] = "排名" + count_row = 6 + members.each_with_index do |member, i| + sheet1[count_row,0]= i+1 + sheet1[count_row,1] = member.user.lastname.to_s + member.user.firstname.to_s + sheet1[count_row,2] = member.user.login + sheet1[count_row,3] = member.user.user_extensions.student_id + homeworks.each_with_index do |homework, j| + student_works = homework.student_works.where("user_id = #{member.user.id}") + if student_works.empty? + sheet1[count_row,j+4] = format("%0.2f",0) + else + final_score = student_works.first.final_score.nil? ? 0 : student_works.first.final_score + score = final_score - student_works.first.absence_penalty - student_works.first.late_penalty + sheet1[count_row,j+4] = format("%0.2f",score <0 ? 0:score) + end + end + sheet1[count_row,homeworks.count+4] = format("%0.2f",member.score.nil? ? 0:member.score.to_s) + count_row += 1 + end - sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_score)]) - count_row = 1 +=begin group0 = CourseGroup.new(); group0.id = 0; group0.name = l(:excel_member_with_out_class) @@ -1040,6 +1079,7 @@ class CoursesController < ApplicationController end end end +=end book.write xls_report xls_report.string end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index f326f2099..1e4cedf14 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -795,7 +795,7 @@ module CoursesHelper # 学生按作业总分排序,取前8个 def hero_homework_score(course, score_sort_by) sql_select = "SELECT members.*,( - SELECT SUM(student_works.final_score) + SELECT SUM(IF(student_works.final_score is null,null,student_works.final_score - student_works.absence_penalty - student_works.late_penalty)) FROM student_works,homework_commons WHERE student_works.homework_common_id = homework_commons.id AND homework_commons.course_id = #{course.id} From d3ba23bc64d1a64f033017056dbd7fd0dc164674 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jan 2016 15:37:03 +0800 Subject: [PATCH 128/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 11 +++++ app/controllers/homework_common_controller.rb | 6 ++- .../_user_homework_search_list.html.erb | 46 +++++++++++++++++++ app/views/courses/homework_search.js.erb | 5 ++ .../_homework_search_form.html.erb | 6 +++ app/views/homework_common/index.html.erb | 5 +- app/views/users/_user_homework_list.html.erb | 4 +- config/routes.rb | 1 + 8 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 app/views/courses/_user_homework_search_list.html.erb create mode 100644 app/views/courses/homework_search.js.erb create mode 100644 app/views/homework_common/_homework_search_form.html.erb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 0961f2480..97dacb178 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -907,6 +907,17 @@ class CoursesController < ApplicationController return 404 end end + #搜索作业 + def homework_search + @search = "%#{params[:search].strip.downcase}%" + @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) + @page = params[:page] ? params[:page].to_i + 1 : 0 + if @is_teacher + @homeworks = @course.homework_commons.where("name like '%#{@search}%'").order("created_at desc").limit(10).offset(@page * 10) + else + @homeworks = @course.homework_commons.where("name like '%#{@search}%' and publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) + end + end private def update_quotes attachment diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index d345fba5f..398b385a4 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -15,8 +15,12 @@ class HomeworkCommonController < ApplicationController @new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.course = @course @page = params[:page] ? params[:page].to_i + 1 : 0 - @homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) + if @is_teacher + @homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) + else + @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) + end @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_new = params[:is_new] diff --git a/app/views/courses/_user_homework_search_list.html.erb b/app/views/courses/_user_homework_search_list.html.erb new file mode 100644 index 000000000..585d8761a --- /dev/null +++ b/app/views/courses/_user_homework_search_list.html.erb @@ -0,0 +1,46 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> +<% end %> + + +
    + <% homework_commons.each do |homework_common|%> + + <%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %> + <% end%> + <% if homework_commons.count == 10%> + <%= link_to "点击展开更多",homework_search_course_path(course_id,:page => page,:search=>search),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> + <% end%> +
    \ No newline at end of file diff --git a/app/views/courses/homework_search.js.erb b/app/views/courses/homework_search.js.erb new file mode 100644 index 000000000..3c644ad9e --- /dev/null +++ b/app/views/courses/homework_search.js.erb @@ -0,0 +1,5 @@ +<% if @page == 0 %> + $("#user_homework_list").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id,:search=>@search} )%>"); +<% else %> + $("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id,:search=>@search} )%>"); +<% end %> \ No newline at end of file diff --git a/app/views/homework_common/_homework_search_form.html.erb b/app/views/homework_common/_homework_search_form.html.erb new file mode 100644 index 000000000..aa3eef59e --- /dev/null +++ b/app/views/homework_common/_homework_search_form.html.erb @@ -0,0 +1,6 @@ +<%= form_tag( url_for(:controller => 'courses',:action => 'homework_search',:id=>course.id), + :remote=>true ,:method => 'get',:class=>'resourcesSearchloadBox',:id=>'resource_search_form') do %> + + <%= submit_tag '',:class=>'homepageSearchIcon',:onfocus=>'this.blur();',:style=>'border-style:none' %> + +<% end %> \ No newline at end of file diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index bc960154e..5c91a37fc 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -36,6 +36,9 @@
    作业
    +
    + <%= render :partial => 'homework_search_form',:locals => {:course=>@course} %> +
    @@ -50,8 +53,8 @@ <% end%>
    <% end%> - <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0,:is_in_course => 1,:course_id => @course.id} %> +
    diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 36f823a9a..28544fbf3 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -14,6 +14,7 @@ .homepagePostReplyInputContainer .ke-inline-block {display: none;} .homepagePostReplyInputContainer .ke-container {float: left;} +
    <% homework_commons.each do |homework_common|%> \ No newline at end of file diff --git a/app/views/users/_intro_content.html.erb b/app/views/users/_intro_content.html.erb index 668a26cec..53d556e86 100644 --- a/app/views/users/_intro_content.html.erb +++ b/app/views/users/_intro_content.html.erb @@ -1,13 +1,13 @@ -
    -
    - <%= content.to_s.html_safe%> -
    -
    - \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index b2c74a96c..29a9329a3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1217,6 +1217,7 @@ ActiveRecord::Schema.define(:version => 20160122143138) do create_table "org_members", :force => true do |t| t.integer "user_id" t.integer "organization_id" + t.string "role" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end From 3aaa078a4bad4a0976d1c4bc3ce50b7399072547 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 16:26:00 +0800 Subject: [PATCH 130/215] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/_project_activities.html.erb | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index deb0af842..7fc5c347c 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -1,4 +1,4 @@ -<%= import_ke(enable_at: true, prettify: false, init_activity: true) %> +<%= import_ke(enable_at: true,init_activity: true) %> <% unless forge_acts.empty? %> <% forge_acts.each do |activity| -%> @@ -68,7 +68,7 @@ } $(function () { - init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>"); + sd_create_editor_from_data(<%= activity.id %>, null, "100%", "<%= activity.class.to_s %>"); }); From dc3278274d5e7ae262a809047ef7a7625ef5dc30 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 16:55:07 +0800 Subject: [PATCH 131/215] =?UTF-8?q?=E4=BF=AE=E6=94=B9kindeditor=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- .../_simple_ke_reply_form.html.erb | 2 +- app/views/blog_comments/quote.js.erb | 2 +- app/views/blog_comments/reply.js.erb | 2 +- app/views/blog_comments/show.html.erb | 2 +- app/views/blogs/_article.html.erb | 2 +- app/views/blogs/_article_list.html.erb | 22 +++++++++---------- app/views/boards/_course_show_detail.html.erb | 2 +- .../boards/_project_show_detail.html.erb | 2 +- app/views/comments/create.js.erb | 2 +- app/views/courses/_course_activity.html.erb | 2 +- app/views/courses/_courses_jours.html.erb | 2 +- app/views/courses/syllabus.html.erb | 4 ++-- .../set_evaluation_attr.js.erb | 4 ++-- .../start_anonymous_comment.js.erb | 4 ++-- .../stop_anonymous_comment.js.erb | 4 ++-- app/views/issues/_list.html.erb | 2 +- app/views/issues/add_journal.js.erb | 3 ++- app/views/issues/add_journal_in_org.js.erb | 2 +- app/views/memos/show.html.erb | 4 ++-- app/views/messages/_course_show.html.erb | 4 ++-- .../messages/_org_subfield_show.html.erb | 2 +- app/views/messages/_project_show.html.erb | 2 +- app/views/messages/_reply_message.html.erb | 2 +- app/views/messages/quote.js.erb | 2 +- app/views/messages/reply.js.erb | 2 +- app/views/news/_course_news_detail.html.erb | 2 +- app/views/news/_project_news_detail.html.erb | 2 +- .../_reply_form.html.erb | 2 +- .../_simple_ke_reply_form.html.erb | 2 +- .../org_document_comments/add_reply.js.erb | 2 +- .../org_document_comments/index.html.erb | 2 +- app/views/org_document_comments/quote.js.erb | 2 +- app/views/org_document_comments/show.html.erb | 2 +- .../org_subfields/_show_details.html.erb | 2 +- .../organizations/_org_activities.html.erb | 2 +- .../_org_course_homework.html.erb | 2 +- .../_org_course_message.html.erb | 2 +- .../organizations/_org_course_news.html.erb | 2 +- .../organizations/_org_project_issue.html.erb | 2 +- .../_org_subfield_message.html.erb | 2 +- .../organizations/_org_subfield_news.html.erb | 2 +- .../organizations/_project_message.html.erb | 2 +- .../organizations/_show_org_document.html.erb | 3 +-- app/views/organizations/show.html.erb | 2 +- .../projects/_project_activities.html.erb | 2 +- app/views/projects/_project_news.html.erb | 2 +- .../student_work/cancel_relate_project.js.erb | 4 ++-- .../forbidden_anonymous_comment.js.erb | 4 ++-- app/views/student_work/set_score_rule.js.erb | 4 ++-- .../student_work/student_work_project.js.erb | 4 ++-- app/views/users/_course_homework.html.erb | 2 +- .../users/_course_journalsformessage.html.erb | 2 +- app/views/users/_course_message.html.erb | 2 +- app/views/users/_course_news.html.erb | 2 +- app/views/users/_project_issue_reply.html.erb | 2 +- app/views/users/_project_message.html.erb | 2 +- app/views/users/_project_news.html.erb | 2 +- app/views/users/_user_activities.html.erb | 21 +++++++++--------- app/views/users/_user_blog.html.erb | 2 +- .../users/_user_homework_detail.html.erb | 2 +- app/views/users/_user_homework_list.html.erb | 2 +- .../users/_user_journalsformessage.html.erb | 2 +- app/views/users/_user_jours_list.html.erb | 20 ++++++++--------- app/views/words/create_reply.js.erb | 2 +- app/views/words/destroy.js.erb | 4 ++-- app/views/words/leave_homework_message.js.erb | 4 ++-- 67 files changed, 109 insertions(+), 108 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3a0808bdd..ab091b61c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2808,7 +2808,7 @@ int main(int argc, char** argv){ end if opt[:init_activity] - ss += javascript_include_tag "init_activity_KindEditor" + ss += javascript_include_tag "create_kindeditor" end ss.html_safe diff --git a/app/views/blog_comments/_simple_ke_reply_form.html.erb b/app/views/blog_comments/_simple_ke_reply_form.html.erb index 61669058b..292587cad 100644 --- a/app/views/blog_comments/_simple_ke_reply_form.html.erb +++ b/app/views/blog_comments/_simple_ke_reply_form.html.erb @@ -21,8 +21,8 @@ <% end %> +
    -

    diff --git a/app/views/blog_comments/quote.js.erb b/app/views/blog_comments/quote.js.erb index cd53707d5..9bd226ce1 100644 --- a/app/views/blog_comments/quote.js.erb +++ b/app/views/blog_comments/quote.js.erb @@ -3,7 +3,7 @@ if($("#reply_message_<%= @blogComment.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%", "<%=@blogComment.class.to_s%>"); + sd_create_editor_from_data(<%= @blogComment.id%>,null,"100%", "<%=@blogComment.class.to_s%>"); }); }else if($("#reply_to_message_<%= @blogComment.id%>").length >0) { $("#reply_to_message_<%= @blogComment.id%>").replaceWith("

    "); diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb index 2a4e71f1c..915ab892d 100644 --- a/app/views/blog_comments/reply.js.erb +++ b/app/views/blog_comments/reply.js.erb @@ -5,4 +5,4 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); //init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity'); <% end %> -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); \ No newline at end of file +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity'); \ No newline at end of file diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 4a407089f..e6d8be24e 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -27,7 +27,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @article.id%>,null,"85%", '<%=@article.class.to_s%>'); + sd_create_editor_from_data(<%= @article.id%>,null,"100%", '<%=@article.class.to_s%>'); showNormalImage('message_description_<%= @article.id %>'); }); diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 4ca86e7ae..05f69055f 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -198,8 +198,8 @@ +
    -

    diff --git a/app/views/blogs/_article_list.html.erb b/app/views/blogs/_article_list.html.erb index ca85c0ba2..f3fd1aa61 100644 --- a/app/views/blogs/_article_list.html.erb +++ b/app/views/blogs/_article_list.html.erb @@ -1,19 +1,19 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false) %> - <%= javascript_include_tag "init_activity_KindEditor" %> + <%= javascript_include_tag "create_kindeditor" %> <% end %> <% if topic %> diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb index 1898fce02..88fd7d224 100644 --- a/app/views/boards/_course_show_detail.html.erb +++ b/app/views/boards/_course_show_detail.html.erb @@ -40,7 +40,7 @@ } $(function () { - init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>"); + sd_create_editor_from_data(<%= topic.id%>, null, "100%", "<%=topic.class.to_s%>"); }); <% if topic %> diff --git a/app/views/boards/_project_show_detail.html.erb b/app/views/boards/_project_show_detail.html.erb index 367f0552c..fc24dfd09 100644 --- a/app/views/boards/_project_show_detail.html.erb +++ b/app/views/boards/_project_show_detail.html.erb @@ -39,7 +39,7 @@ } $(function () { - init_activity_KindEditor_data(<%= topic.id%>, null, "87%"); + sd_create_editor_from_data(<%= topic.id%>, null, "100%"); }); <% if topic %> diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb index f94eda065..0814b5f50 100644 --- a/app/views/comments/create.js.erb +++ b/app/views/comments/create.js.erb @@ -5,4 +5,4 @@ <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% end %> -init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity"); +sd_create_editor_from_data('<%= @user_activity_id%>',"","100%", "UserActivity"); diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index 1b0d5330d..65aa142af 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -107,7 +107,7 @@ } $(function () { - init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>"); + sd_create_editor_from_data(<%= activity.id%>, null, "100%", "<%= activity.class.to_s %>"); }); <% if activity && activity.course_act%> diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 0c4f4c1e0..c7e4a7428 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -32,9 +32,9 @@
    <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'}, :html=>{:id => "course_feedback_new"},:method => "post") do |f|%> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> +

    -
    取消 留言 <% end %> diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb index c9d333e6d..3bace514b 100644 --- a/app/views/courses/syllabus.html.erb +++ b/app/views/courses/syllabus.html.erb @@ -40,7 +40,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @article.id%>,null,"87%", "<%=@article.class.to_s%>"); + sd_create_editor_from_data(<%= @article.id%>,null,"100%", "<%=@article.class.to_s%>"); showNormalImage('message_description_<%= @article.id %>'); }); @@ -201,8 +201,8 @@ +
    -

    diff --git a/app/views/homework_common/set_evaluation_attr.js.erb b/app/views/homework_common/set_evaluation_attr.js.erb index 73436750c..987abd351 100644 --- a/app/views/homework_common/set_evaluation_attr.js.erb +++ b/app/views/homework_common/set_evaluation_attr.js.erb @@ -1,8 +1,8 @@ clickCanel(); <% if @user_activity_id != -1 %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>"); -init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); +sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> \ No newline at end of file diff --git a/app/views/homework_common/start_anonymous_comment.js.erb b/app/views/homework_common/start_anonymous_comment.js.erb index 8b2e9ed04..91a68011e 100644 --- a/app/views/homework_common/start_anonymous_comment.js.erb +++ b/app/views/homework_common/start_anonymous_comment.js.erb @@ -3,11 +3,11 @@ <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); $("#evaluation_start_time_<%=@homework.id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); - init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); + sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); $("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); + sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% end %> /*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/ <% elsif @statue == 2 %> diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb index 2f8d8c6d6..874374476 100644 --- a/app/views/homework_common/stop_anonymous_comment.js.erb +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -2,11 +2,11 @@ alert('关闭成功'); <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); $("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>"); -init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); +sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); $("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity'); <% end %> /* $("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/ diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 2a1ae56d4..3ee20ee2a 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -18,7 +18,7 @@ } $(function () { - init_activity_KindEditor_data(<%= issue.id%>, null, "87%", "<%= issue.class.name %>"); + sd_create_editor_from_data(<%= issue.id%>, null, "100%", "<%= issue.class.name %>"); }); <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index 9099c31b6..43d7f741b 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -21,6 +21,7 @@ sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); <%else%> $("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); + sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity"); +//init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); // sd_create_editor_from_data(<%#= @issue.id%>, null, "100%"); <%end %> diff --git a/app/views/issues/add_journal_in_org.js.erb b/app/views/issues/add_journal_in_org.js.erb index 34e874f13..ed4666d0c 100644 --- a/app/views/issues/add_journal_in_org.js.erb +++ b/app/views/issues/add_journal_in_org.js.erb @@ -1,3 +1,3 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); \ No newline at end of file +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 3028f3369..e59c8359d 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -34,7 +34,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @memo.id%>,null,"87%", "<%=@memo.class.to_s%>"); + sd_create_editor_from_data(<%= @memo.id%>,null,"100%", "<%=@memo.class.to_s%>"); }); function del_confirm(){ @@ -124,8 +124,8 @@ <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> +
    -

    diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 022b8c76b..00f22cc95 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -27,7 +27,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>"); + sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); @@ -175,4 +175,4 @@ postContent = postContent.replace(/ /g," "); $("#message_description_<%= @topic.id %>").html(postContent); }); - + diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index fab0f752e..5fc7ed746 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -58,7 +58,7 @@ } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>"); + sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index a0e9db171..2009c7133 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -88,7 +88,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>"); + sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_reply_message.html.erb b/app/views/messages/_reply_message.html.erb index a859a088a..15cb465de 100644 --- a/app/views/messages/_reply_message.html.erb +++ b/app/views/messages/_reply_message.html.erb @@ -18,8 +18,8 @@ <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'new_form'} do |f| %> +
    -

    diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb index b0e8ecb85..89f953bb9 100644 --- a/app/views/messages/quote.js.erb +++ b/app/views/messages/quote.js.erb @@ -11,7 +11,7 @@ if($("#reply_message_<%= @message.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @message.id%>,null,"85%", "<%=@message.class.to_s%>"); + sd_create_editor_from_data(<%= @message.id%>,null,"100%", "<%=@message.class.to_s%>"); }); }else if($("#reply_to_message_<%= @message.id%>").length >0) { $("#reply_to_message_<%= @message.id%>").replaceWith("

    "); diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb index f61de74f0..385a49a82 100644 --- a/app/views/messages/reply.js.erb +++ b/app/views/messages/reply.js.erb @@ -5,4 +5,4 @@ <% elsif @org_subfield %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); <%end%> -init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", "UserActivity"); \ No newline at end of file +sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity"); \ No newline at end of file diff --git a/app/views/news/_course_news_detail.html.erb b/app/views/news/_course_news_detail.html.erb index 954f7dbf1..6092a8590 100644 --- a/app/views/news/_course_news_detail.html.erb +++ b/app/views/news/_course_news_detail.html.erb @@ -40,7 +40,7 @@ } $(function () { - init_activity_KindEditor_data(<%= news.id%>, null, "87%"); + sd_create_editor_from_data(<%= news.id%>, null, "100%"); showNormalImage('activity_description_<%= news.id %>'); }); diff --git a/app/views/news/_project_news_detail.html.erb b/app/views/news/_project_news_detail.html.erb index fdb035bf5..a0610ae63 100644 --- a/app/views/news/_project_news_detail.html.erb +++ b/app/views/news/_project_news_detail.html.erb @@ -40,7 +40,7 @@ } $(function () { - init_activity_KindEditor_data(<%= news.id%>, null, "87%"); + sd_create_editor_from_data(<%= news.id%>, null, "100%"); showNormalImage('activity_description_<%= news.id %>'); }); diff --git a/app/views/org_document_comments/_reply_form.html.erb b/app/views/org_document_comments/_reply_form.html.erb index 8808ff8b7..60db259c6 100644 --- a/app/views/org_document_comments/_reply_form.html.erb +++ b/app/views/org_document_comments/_reply_form.html.erb @@ -1,2 +1,2 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); diff --git a/app/views/org_document_comments/_simple_ke_reply_form.html.erb b/app/views/org_document_comments/_simple_ke_reply_form.html.erb index cfa197ff4..c0166f5ce 100644 --- a/app/views/org_document_comments/_simple_ke_reply_form.html.erb +++ b/app/views/org_document_comments/_simple_ke_reply_form.html.erb @@ -18,8 +18,8 @@ <%= form_for @org_comment, :as => :reply, :url => {:controller => 'org_document_comments',:action => 'reply', :id => @org_comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %> +
    -

    diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb index 968d7295d..79858dd03 100644 --- a/app/views/org_document_comments/add_reply.js.erb +++ b/app/views/org_document_comments/add_reply.js.erb @@ -1,2 +1,2 @@ $("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>"); -init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>"); +sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>"); diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index 7734a2853..7dba82d9a 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -19,7 +19,7 @@ <% @documents.each do |document| %> <%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first, :flag => 0} %> diff --git a/app/views/org_document_comments/quote.js.erb b/app/views/org_document_comments/quote.js.erb index 7ea5daf7b..53d22eb58 100644 --- a/app/views/org_document_comments/quote.js.erb +++ b/app/views/org_document_comments/quote.js.erb @@ -3,7 +3,7 @@ if($("#reply_message_<%= @org_comment.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%", "<%=@org_comment.class.to_s%>"); + sd_create_editor_from_data(<%= @org_comment.id%>,null,"100%", "<%=@org_comment.class.to_s%>"); }); }else if($("#reply_to_message_<%= @org_comment.id %>").length >0) { $("#reply_to_message_<%= @org_comment.id%>").replaceWith("

    "); diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 405631369..561364d64 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -1,7 +1,7 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %> diff --git a/app/views/org_subfields/_show_details.html.erb b/app/views/org_subfields/_show_details.html.erb index eda9c9d57..3a605f75d 100644 --- a/app/views/org_subfields/_show_details.html.erb +++ b/app/views/org_subfields/_show_details.html.erb @@ -38,7 +38,7 @@ <% org_activities.each do |act| %> <% if act.container_type == 'Organization' %> diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index 6579ccbca..20b98ffa0 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -38,7 +38,7 @@ <% org_activities.each do |act| %> <% if act.container_type == 'Organization' %> diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 3dccdcc2b..b5e3c6958 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -326,8 +326,8 @@ <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> +
    -

    diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index 339ff8b26..4f13e1b4f 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -142,8 +142,8 @@ <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> +
    -

    diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index b6e2f74ef..665f5c1ae 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -108,8 +108,8 @@
    <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> +
    -

    diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 763a76d5e..2495e0044 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -125,8 +125,8 @@
    <%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%> +
    -

    diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index a14138903..4763089a0 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -143,8 +143,8 @@ <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> +
    -

    diff --git a/app/views/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index 41eb473e8..891ad14a7 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -128,8 +128,8 @@
    <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> +
    -

    diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index baa687107..6cc3f5740 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -120,8 +120,8 @@ <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> +
    -

    diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index b29bac7d1..da458636a 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -117,9 +117,8 @@
    <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> +
    - -
    diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 78fb12279..a271abe02 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -61,7 +61,7 @@ <% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %> <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index 7fc5c347c..062d64096 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -1,4 +1,4 @@ -<%= import_ke(enable_at: true,init_activity: true) %> +<%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <% user_activities.each do |user_activity| if user_activities %> @@ -74,7 +75,7 @@ } $(function() { - init_activity_KindEditor_data(<%= user_activity.id%>, null, "87%", "<%=user_activity.class.to_s%>"); + sd_create_editor_from_data(<%= user_activity.id %>, null, "100%", "<%= user_activity.class.to_s %>"); }); <% unless user_activity.act_type == "ProjectCreateInfo" %> diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index 7658bc581..244951dfa 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -120,8 +120,8 @@ +
    -

    diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 36b2be34f..01673d164 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -328,8 +328,8 @@ <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%> <%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %> <%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %> +
    -

    diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 36f823a9a..e55065c52 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -17,7 +17,7 @@ <% homework_commons.each do |homework_common|%> <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>0} %> diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index d4d9a2cd7..285866f9d 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -5,7 +5,7 @@ <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); <% end %> - init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity"); + sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity"); <% else %> <% if !@jfm.nil? && @jfm.jour_type == 'Principal' %> $("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>"); diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 6a56249a3..cd48ae74c 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -19,10 +19,10 @@ <% elsif @homework%> <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); - init_activity_KindEditor_data(<%= @homework.id%>,"","87%"); + sd_create_editor_from_data(<%= @homework.id%>,"","100%"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); + sd_create_editor_from_data(<%= @user_activity_id%>,"","100%"); <% end %> <% end %> var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') diff --git a/app/views/words/leave_homework_message.js.erb b/app/views/words/leave_homework_message.js.erb index 5eeb9ce64..acb16be50 100644 --- a/app/views/words/leave_homework_message.js.erb +++ b/app/views/words/leave_homework_message.js.erb @@ -1,7 +1,7 @@ <% if @user_activity_id %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); + sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% elsif @homework_common_id && @is_in_course %> $("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>"); - init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%", "HomeworkCommon"); + sd_create_editor_from_data(<%= @homework_common_id%>,"","100%", "HomeworkCommon"); <% end %> From 8358140c87d14a232aad9d97cc1c28ac7c9df750 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jan 2016 17:02:25 +0800 Subject: [PATCH 132/215] =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E7=89=88=E6=9C=AC=E5=AD=97=E4=BD=93=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3a0808bdd..9f516ae1a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -51,7 +51,7 @@ module ApplicationHelper def link_to_user_version(version, options = {}) return '' unless version && version.is_a?(Version) - link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue " + link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => "linkBlue" end # 判断课程是否为精品课程 From 68bd1098319f4388cd8b821b0664f419a2af63e0 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 17:26:28 +0800 Subject: [PATCH 133/215] =?UTF-8?q?=E5=AF=B9=E5=AD=90=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=89=B9=E5=87=86=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/setting.html.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index b9b2f9b4c..a91a079ef 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -58,6 +58,11 @@
    http:// .trustie.net申请 + <% if @organization.domain.present? %> + (已批准) + <% elsif OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).count > 0 %> + (您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准) + <% end %>

    From 125f00689b2cad67214ded459487fd6652565cc2 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 17:49:20 +0800 Subject: [PATCH 134/215] =?UTF-8?q?=E6=8A=8A=E7=BB=84=E7=BB=87=E6=9C=AA?= =?UTF-8?q?=E8=AF=BB=E6=B6=88=E6=81=AF=E5=8A=A0=E5=85=A5=E9=93=83=E9=93=9B?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index d89f2f57a..a74c20751 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -345,7 +345,8 @@ class User < Principal user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count - messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", User.current.id,0, User.current.onclick_time.onclick_time).count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count end # 查询指派给我的缺陷记录 From b7f1177938198fcf63eadb7732ba1b73f064311b Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 18:11:16 +0800 Subject: [PATCH 135/215] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E5=88=A0=E9=99=A4=E5=8F=91=E9=80=81?= =?UTF-8?q?=E8=BF=87=E6=9D=A5=E7=9A=84=E5=B8=96=E5=AD=90=E6=8A=A5404?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B2.=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=9A=84=E7=8A=B6=E6=80=81=E8=83=BD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 ++ app/helpers/users_helper.rb | 3 ++- app/views/organizations/_org_subfield_message.html.erb | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 22b58fe49..12f112345 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -192,11 +192,13 @@ class UsersController < ApplicationController forge_querys = ForgeMessage.where("user_id =? and viewed =?", user, 0) user_querys = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0) forum_querys = MemoMessage.where("user_id =? and viewed =?", user, 0) + org_querys = OrgMessage.where("user_id=? and viewed=0", user) if User.current.id == @user.id course_querys.update_all(:viewed => true) forge_querys.update_all(:viewed => true) user_querys.update_all(:viewed => true) forum_querys.update_all(:viewed => true) + org_querys.update_all(:viewed => true) end end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index bfc01a102..4edfed578 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -89,10 +89,11 @@ module UsersHelper def unviewed_message(user) course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count + org_count = OrgMessage.where("user_id =? and viewed =?", user, 0).count user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count user_memo_count = MemoMessage.where("user_id =? and viewed =?", user, 0).count at_count = user.at_messages.where(viewed: false).count - messages_count = course_count + forge_count + user_feedback_count + user_memo_count + at_count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + at_count + org_count end def user_mail_notification_options(user) diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index a14138903..5feed27f2 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -57,8 +57,10 @@ ) if activity.org_subfield_editable_by?(User.current) %>
  • - <%= delete_link( + <%= link_to( + l(:button_delete), {:controller => 'messages', :action => 'destroy', :id => activity, :board_id => activity.board_id}, + :method => 'post', :data => {:confirm => l(:text_are_you_sure)}, :class => 'postOptionLink' ) if activity.org_subfield_editable_by?(User.current) %> From 265359cd74c7253e22379ca7e11fd9de25d1bef8 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jan 2016 18:17:27 +0800 Subject: [PATCH 136/215] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=97=B6=E4=BD=9C=E4=B8=9A=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_homework_type_notice.html.erb | 13 +++ app/views/users/_user_group_attr.html.erb | 2 +- .../users/_user_homework_attachment.html.erb | 10 +- app/views/users/_user_homework_form.html.erb | 14 ++- .../users/_user_journalsformessage.html.erb | 2 +- public/images/hwork_icon.png | Bin 10436 -> 10537 bytes public/javascripts/homework.js | 104 +++++++++++++++--- public/stylesheets/new_user.css | 4 + public/stylesheets/public.css | 4 + 9 files changed, 127 insertions(+), 26 deletions(-) create mode 100644 app/views/users/_homework_type_notice.html.erb diff --git a/app/views/users/_homework_type_notice.html.erb b/app/views/users/_homework_type_notice.html.erb new file mode 100644 index 000000000..4dda65e49 --- /dev/null +++ b/app/views/users/_homework_type_notice.html.erb @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index a815d85e7..48c303a29 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -16,7 +16,7 @@

    提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计。

  • 取消 diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 5f4cb4a8e..673cee0e1 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -72,11 +72,15 @@ 上传附件 <%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr15",:title=>"请从资源库中选择文件作为作品的附件",:remote => true%> <% if defined?(has_program) && has_program %> - 编程 - +
    + 编程 + +
    <% end %> <% if defined?(has_group) && has_group %> - 分组 +
    + 分组 +
    <% end %>
    diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 4082854da..cc7e4bb8e 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -9,9 +9,11 @@ } else { $("#anonymous_comment").attr('checked',false); } - $("#BluePopupBox a.BlueCirBtn").click(); + <% if edit_mode && homework.is_program_homework? %> + $("#BluePopupBox a.BlueCirBtn").click(); + <% end %> <% if edit_mode && homework.is_group_homework? %> - $("#GroupPopupBox a.group_btn").click(); + $("#GroupPopupBox a.group_save_btn").click(); <% end %> }); function checked_val() { @@ -141,4 +143,10 @@ \ No newline at end of file +
    + +<% unless edit_mode %> + +<% end %> \ No newline at end of file diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index d7247621a..b377f445c 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -42,7 +42,7 @@ <% if activity.user == User.current || User.current.admin?%>
      -
    • +
      • <%= link_to(l(:label_bid_respond_delete), diff --git a/public/images/hwork_icon.png b/public/images/hwork_icon.png index 8ae87460fd13f21c15c187d31792b29d6d0ae6dd..f531c3d4c4c2881b535f5eabf341d5c071102b70 100644 GIT binary patch delta 9339 zcmZ{pRZtwjwyt9Y4>C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b/public/javascripts/homework.js @@ -106,7 +106,46 @@ $(function(){ $('a.pic_date').on('click', function(){ $(this).parent().prev().first().focus(); }) - + + $("#NoticePopupBox").dialog({ + modal: true, + autoOpen: false, + dialogClass: 'BluePopupBox', + minWidth: 500 + }); + $('#NoticePopupBox').parent().resizable("disable"); + $('#NoticePopupBox').parent().removeClass("ui-state-disabled"); + $('#NoticePopupBox').parent().css("border","3px solid #269ac9").css("padding","10px"); + $('a#switch_type').live('click', function(){ + if($("input[name=homework_type]").val() == "3"){ + $("#NoticePopupBox" ).dialog("close"); + $("input[name=homework_type]").val(1); + $('span.group_detail_info').text(''); + $("#group_setting a").removeClass("fontBlue2"); + $("#BluePopupBox").dialog("open"); + $(".ui-dialog-titlebar").hide(); + $("a.CloseBtn").on('click', function(){ + $("#BluePopupBox" ).dialog("close"); + }); + $('#textarea_input_test').focus(); + } else if($("input[name=homework_type]").val() == "2") { + $("#NoticePopupBox" ).dialog("close"); + $("input[name=homework_type]").val(1); + $('span.program_detail_info').text(""); + $("span.program_detail_info").removeClass("fontBlue2"); + $("#program_setting a").removeClass("fontBlue2"); + $("#GroupPopupBox").dialog("open"); + $(".ui-dialog-titlebar").hide(); + $("a.popClose").on('click', function(){ + $("#GroupPopupBox" ).dialog("close"); + }); + $("#cancel_group").on('click', function(){ + $("#GroupPopupBox" ).dialog("close"); + }); + $('#min_num').focus(); + } + }); + $("#BluePopupBox").dialog({ modal: true, @@ -120,12 +159,25 @@ $(function(){ $('#BluePopupBox').parent().css("position","fixed"); $('a.ProBtn').live('click', function(){ - $("#BluePopupBox").dialog("open"); - $(".ui-dialog-titlebar").hide(); - $("a.CloseBtn").on('click', function(){ - $("#BluePopupBox" ).dialog("close"); - }); - $('#textarea_input_test').focus(); + if($("input[name=homework_type]").val() == "3"){ + $("#NoticePopupBox").dialog("open"); + $(".ui-dialog-titlebar").hide(); + $("a.CloseBtn").on('click', function(){ + $("#NoticePopupBox" ).dialog("close"); + }); + $("#cancel_switch").on('click', function(){ + $("#NoticePopupBox" ).dialog("close"); + }); + $("#switch_homework_type_notice").text("您的作业类型将改为“分组作业”,并且您的编程设置将被清除。请问是否继续?"); + } + else { + $("#BluePopupBox").dialog("open"); + $(".ui-dialog-titlebar").hide(); + $("a.CloseBtn").on('click', function(){ + $("#BluePopupBox" ).dialog("close"); + }); + $('#textarea_input_test').focus(); + } }); var saveProgramAnswers = function() { @@ -162,7 +214,9 @@ $(function(){ if (valid) { $("input[name=homework_type]").val(2); - $('span.program_detail_info').text('('+language+','+test_numbers/2+'组测试)'); + $('span.program_detail_info').text('('+language+'语言,'+test_numbers/2+'组测试)'); + $("span.program_detail_info").addClass("fontBlue2"); + $("#program_setting a").addClass("fontBlue2"); //保存js值 var data = { language_type: $('select.language_type').val(), @@ -213,15 +267,28 @@ $(function(){ $('#GroupPopupBox').parent().css("border","3px solid #269ac9").css("padding","10px"); $('a.groupBtn').live('click', function(){ - $("#GroupPopupBox").dialog("open"); - $(".ui-dialog-titlebar").hide(); - $("a.popClose").on('click', function(){ - $("#GroupPopupBox" ).dialog("close"); - }); - $("#cancel_group").on('click', function(){ - $("#GroupPopupBox" ).dialog("close"); - }); - $('#min_num').focus(); + if($("input[name=homework_type]").val() == "2"){ + $("#NoticePopupBox").dialog("open"); + $(".ui-dialog-titlebar").hide(); + $("a.CloseBtn").on('click', function(){ + $("#NoticePopupBox" ).dialog("close"); + }); + $("#cancel_switch").on('click', function(){ + $("#NoticePopupBox" ).dialog("close"); + }); + $("#switch_homework_type_notice").text("您的作业类型将改为“编程作业”,并且您的分组设置将被清除。请问是否继续?"); + } + else { + $("#GroupPopupBox").dialog("open"); + $(".ui-dialog-titlebar").hide(); + $("a.popClose").on('click', function () { + $("#GroupPopupBox").dialog("close"); + }); + $("#cancel_group").on('click', function () { + $("#GroupPopupBox").dialog("close"); + }); + $('#min_num').focus(); + } }); var saveGroupAttr = function() { @@ -245,6 +312,7 @@ $(function(){ if (valid) { $("input[name=homework_type]").val(3); $('span.group_detail_info').text('分组人数:'+min+'-'+max+' 人'); + $("#group_setting a").addClass("fontBlue2"); //保存js值 var data = { base_on_project: base_on_project, @@ -259,7 +327,7 @@ $(function(){ return valid; }; - $("#GroupPopupBox a.group_btn").live('click', function(){ + $("#GroupPopupBox a.group_save_btn").live('click', function(){ if(saveGroupAttr()){ if($( "#GroupPopupBox" ).dialog( "isOpen" )){ $("#GroupPopupBox").dialog( "close" ); diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index d31c1ee0c..62987c167 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -195,6 +195,7 @@ a.c_green{ color:#28be6c;} .fontBlue {color:#3498db;} a.underline {text-decoration:underline;} a.fontBlue {color:#297fb8;} +.fontBlue2 {color:#269ac9 !important;} a.fontGrey {color:#cecece;} a.fontGrey2 {color:#888888;} a.linkOrange {color:#ff7143;} @@ -1456,3 +1457,6 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;} .subjectContent {color:#888888; line-height:18px; font-size:12px;} .popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} .subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;} + +.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} +.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index be9d51799..0eb1cf112 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -225,6 +225,7 @@ a.c_green{ color:#28be6c;} .fontGrey3 {color:#484848;} .fontGrey4{color:#999999;} .fontBlue {color:#3498db;} +.fontBlue2 {color:#269ac9 !important;} a.underline {text-decoration:underline;} a.fontBlue {color:#297fb8;} a.fontGrey {color:#cecece;} @@ -1040,3 +1041,6 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;} .subjectContent {color:#888888; line-height:18px; font-size:12px;} .popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} .subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;} + +.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} +.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} From 7b56dc7f8eaef447620827479fb6eb83874bd379 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 18:43:14 +0800 Subject: [PATCH 137/215] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E8=A7=A3=E5=86=B3=E7=BC=96=E8=BE=91=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 550642120..18d8905db 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -46,6 +46,7 @@ RedmineApp::Application.routes.draw do end end member do + get 'edit' get 'setting'#, :action => 'settings', :as => 'settings' get 'clear_org_avatar_temp' put 'set_homepage' From 82fb50ccd207d03c990d1f20fecbabe058dde3e8 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jan 2016 19:22:10 +0800 Subject: [PATCH 138/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E4=BD=9C=E4=B8=9A=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/member.rb | 9 +++++++-- app/views/courses/_show_member_score.html.erb | 2 +- app/views/homework_common/_homework_search_form.html.erb | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/models/member.rb b/app/models/member.rb index ed7ee81e6..413fedc07 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -150,7 +150,7 @@ class Member < ActiveRecord::Base #当前学生在指定作业内的得分 def homework_common_score homework_common - StudentWork.select("final_score").where(:homework_common_id => homework_common.id,:user_id => self.user_id) + StudentWork.select("IF(final_score is null,null,final_score - absence_penalty - late_penalty) as final_score").where(:homework_common_id => homework_common.id,:user_id => self.user_id) end def student_work_score_avg @@ -158,7 +158,12 @@ class Member < ActiveRecord::Base end def student_work_score_sum - StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").sum(:final_score).try(:round, 2).to_f + sql_select = "SELECT (SUM(IF(student_works.final_score is null,null,student_works.final_score - student_works.absence_penalty - student_works.late_penalty))) as score + FROM student_works,homework_commons + WHERE student_works.homework_common_id = homework_commons.id + AND homework_commons.course_id = #{self.course_id} + AND student_works.user_id = #{self.user_id}" + score = StudentWork.find_by_sql(sql_select) end protected diff --git a/app/views/courses/_show_member_score.html.erb b/app/views/courses/_show_member_score.html.erb index 2d08e853e..612f408d7 100644 --- a/app/views/courses/_show_member_score.html.erb +++ b/app/views/courses/_show_member_score.html.erb @@ -28,7 +28,7 @@
      • <% end %> -
      • 作业积分(总分)<%= @member_score.student_work_score_sum %>
      • +
      • 作业积分(总分)<%= (@member_score.student_work_score_sum).first.score %>
    diff --git a/app/views/homework_common/_homework_search_form.html.erb b/app/views/homework_common/_homework_search_form.html.erb index aa3eef59e..f71cec9a5 100644 --- a/app/views/homework_common/_homework_search_form.html.erb +++ b/app/views/homework_common/_homework_search_form.html.erb @@ -1,6 +1,6 @@ <%= form_tag( url_for(:controller => 'courses',:action => 'homework_search',:id=>course.id), :remote=>true ,:method => 'get',:class=>'resourcesSearchloadBox',:id=>'resource_search_form') do %> - + <%= submit_tag '',:class=>'homepageSearchIcon',:onfocus=>'this.blur();',:style=>'border-style:none' %> <% end %> \ No newline at end of file From 1b5cdbe62861f3023ad9a7cdf7046580a7dd4fd2 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jan 2016 19:41:47 +0800 Subject: [PATCH 139/215] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=9A=84=E7=A7=81?= =?UTF-8?q?=E6=9C=89=E8=AF=BE=E7=A8=8B=EF=BC=8C=E7=82=B9=E5=87=BB=E2=80=9C?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E2=80=9D=E8=BF=94=E5=9B=9E403=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E2=80=9C=E4=BD=9C=E4=B8=9A=E2=80=9D=E4=B9=9F?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E8=BF=94=E5=9B=9E403?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 398b385a4..a891d3354 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -344,7 +344,7 @@ class HomeworkCommonController < ApplicationController #当前用户是不是课程的成员 def member_of_course - render_403 unless @course.is_public || User.current.member_of_course?(@course) || User.current.admin? + render_403 unless @course.is_public==1 || User.current.member_of_course?(@course) || User.current.admin? end def get_assigned_homeworks(student_works, n, index) From 50bac16d7c27803367b13ad458470c9e71c2cd13 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 20:05:04 +0800 Subject: [PATCH 140/215] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=AD=90=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E7=94=B3=E8=AF=B7=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/setting.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index a91a079ef..f2e4d5631 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -58,7 +58,7 @@
    http:// .trustie.net申请 - <% if @organization.domain.present? %> + <% if @organization.domain.present? and OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content == @organization.domain %> (已批准) <% elsif OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).count > 0 %> (您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准) From bb0ff4a14cdb8da8d3bc028472d5f966b0367b29 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 29 Jan 2016 20:31:25 +0800 Subject: [PATCH 141/215] =?UTF-8?q?elasticsearch=E5=9C=A8=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E7=8E=AF=E5=A2=83=E4=B8=8B=E7=9A=84=E8=A1=A5=E4=B8=81?= =?UTF-8?q?,=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../initializers/elasticsearch_dev_patch.rb | 53 + db/schema.rb | 4115 ++++++++--------- 2 files changed, 2110 insertions(+), 2058 deletions(-) create mode 100644 config/initializers/elasticsearch_dev_patch.rb diff --git a/config/initializers/elasticsearch_dev_patch.rb b/config/initializers/elasticsearch_dev_patch.rb new file mode 100644 index 000000000..4eda95ee5 --- /dev/null +++ b/config/initializers/elasticsearch_dev_patch.rb @@ -0,0 +1,53 @@ +#coding=utf-8 + +# elasticsearch 在开发环境下也要打开,很烦人的 + +if Rails.env.development? + + require 'elasticsearch/model' + module Elasticsearch + module Model + class NoObject + + instance_methods.each do |m| + undef_method(m) unless [:undef_method, :method_missing].include?(m) + end + + def method_missing(method, *args, &block) + puts "NoObject #{method} #{args}" + end + + def NoObject.included(mod) + puts "#{self} included in #{mod}" + end + + def self.extended(mod) + puts "#{self} extended in #{mod}" + end + + def initialize + puts methods + end + end + + def self.included(base) + base.instance_eval do + def settings(a) + end + + def __elasticsearch__ + @__elasticsearch__ ||= NoObject.new + end + end + + base.class_eval do + def __elasticsearch__ + @__elasticsearch__ ||= NoObject.new + end + end + end + + end + end + +end \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 5ad9b97ff..2e5bfde22 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,2058 +1,2057 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20160128024452) do - - create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false - t.integer "activity_container_id" - t.string "activity_container_type", :default => "" - t.datetime "created_at" - end - - add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" - add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" - add_index "activities", ["user_id"], :name => "index_activities_on_user_id" - - create_table "activity_notifies", :force => true do |t| - t.integer "activity_container_id" - t.string "activity_container_type" - t.integer "activity_id" - t.string "activity_type" - t.integer "notify_to" - t.datetime "created_on" - t.integer "is_read" - end - - add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" - add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" - add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" - - create_table "api_keys", :force => true do |t| - t.string "access_token" - t.datetime "expires_at" - t.integer "user_id" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" - add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - - create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - end - - create_table "apply_project_masters", :force => true do |t| - t.integer "user_id" - t.string "apply_type" - t.integer "apply_id" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "at_messages", :force => true do |t| - t.integer "user_id" - t.integer "at_message_id" - t.string "at_message_type" - t.boolean "viewed", :default => false - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sender_id" - end - - add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" - - create_table "attachment_histories", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.string "filename", :default => "" - t.string "disk_filename", :default => "" - t.integer "filesize", :default => 0 - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "" - t.integer "downloads", :default => 0 - t.integer "author_id" - t.datetime "created_on" - t.string "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.integer "copy_from" - t.integer "quotes" - t.integer "version" - t.integer "attachment_id" - end - - create_table "attachments", :force => true do |t| - t.integer "container_id" - t.string "container_type", :limit => 30 - t.string "filename", :default => "", :null => false - t.string "disk_filename", :default => "", :null => false - t.integer "filesize", :default => 0, :null => false - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "", :null => false - t.integer "downloads", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.string "description" - t.string "disk_directory" - t.integer "attachtype", :default => 1 - t.integer "is_public", :default => 1 - t.integer "copy_from" - t.integer "quotes" - end - - add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" - add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" - add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" - - create_table "attachmentstypes", :force => true do |t| - t.integer "typeId", :null => false - t.string "typeName", :limit => 50 - end - - create_table "auth_sources", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 60, :default => "", :null => false - t.string "host", :limit => 60 - t.integer "port" - t.string "account" - t.string "account_password", :default => "" - t.string "base_dn" - t.string "attr_login", :limit => 30 - t.string "attr_firstname", :limit => 30 - t.string "attr_lastname", :limit => 30 - t.string "attr_mail", :limit => 30 - t.boolean "onthefly_register", :default => false, :null => false - t.boolean "tls", :default => false, :null => false - t.string "filter" - t.integer "timeout" - end - - add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" - - create_table "biding_projects", :force => true do |t| - t.integer "project_id" - t.integer "bid_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "bids", :force => true do |t| - t.string "name" - t.string "budget", :null => false - t.integer "author_id" - t.date "deadline" - t.text "description" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "commit" - t.integer "reward_type" - t.integer "homework_type" - t.integer "parent_id" - t.string "password" - t.integer "is_evaluation" - t.integer "proportion", :default => 60 - t.integer "comment_status", :default => 0 - t.integer "evaluation_num", :default => 3 - t.integer "open_anonymous_evaluation", :default => 1 - end - - create_table "blog_comments", :force => true do |t| - t.integer "blog_id", :null => false - t.integer "parent_id" - t.string "title", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comment_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "blogs", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.integer "position", :default => 1 - t.integer "article_count", :default => 0, :null => false - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comments_id" - t.integer "parent_id" - t.integer "author_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "homepage_id" - end - - create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false - t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false - t.integer "last_message_id" - t.integer "parent_id" - t.integer "course_id" - t.integer "org_subfield_id" - end - - add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" - add_index "boards", ["project_id"], :name => "boards_project_id" - - create_table "bug_to_osps", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "changes", :force => true do |t| - t.integer "changeset_id", :null => false - t.string "action", :limit => 1, :default => "", :null => false - t.text "path", :null => false - t.text "from_path" - t.string "from_revision" - t.string "revision" - t.string "branch" - end - - add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" - - create_table "changeset_parents", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "parent_id", :null => false - end - - add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" - add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" - - create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false - t.string "committer" - t.datetime "committed_on", :null => false - t.text "comments" - t.date "commit_date" - t.string "scmid" - t.integer "user_id" - end - - add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" - add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true - add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" - add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" - add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" - - create_table "changesets_issues", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "issue_id", :null => false - end - - add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - - create_table "comments", :force => true do |t| - t.string "commented_type", :limit => 30, :default => "", :null => false - t.integer "commented_id", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.text "comments" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - add_index "comments", ["author_id"], :name => "index_comments_on_author_id" - add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" - - create_table "contest_notifications", :force => true do |t| - t.text "title" - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contesting_projects", :force => true do |t| - t.integer "project_id" - t.string "contest_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "contesting_softapplications", :force => true do |t| - t.integer "softapplication_id" - t.integer "contest_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "contestnotifications", :force => true do |t| - t.integer "contest_id" - t.string "title" - t.string "summary" - t.text "description" - t.integer "author_id" - t.integer "notificationcomments_count" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contests", :force => true do |t| - t.string "name" - t.string "budget", :default => "" - t.integer "author_id" - t.date "deadline" - t.string "description" - t.integer "commit" - t.string "password" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - create_table "course_activities", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_act_id" - t.string "course_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_attachments", :force => true do |t| - t.string "filename" - t.string "disk_filename" - t.integer "filesize" - t.string "content_type" - t.string "digest" - t.integer "downloads" - t.string "author_id" - t.string "integer" - t.string "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id", :default => 0 - end - - create_table "course_contributor_scores", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.integer "message_num" - t.integer "message_reply_num" - t.integer "news_reply_num" - t.integer "resource_num" - t.integer "journal_num" - t.integer "journal_reply_num" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "total_score" - end - - create_table "course_groups", :force => true do |t| - t.string "name" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_infos", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_messages", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_message_id" - t.string "course_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "content" - t.integer "status" - end - - create_table "course_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "course_id" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "courses", :force => true do |t| - t.integer "tea_id" - t.string "name" - t.integer "state" - t.string "code" - t.integer "time" - t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "location" - t.string "term" - t.string "string" - t.string "password" - t.string "setup_time" - t.string "endup_time" - t.string "class_period" - t.integer "school_id" - t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 - t.integer "lft" - t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 - t.integer "end_time" - t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - end - - create_table "custom_fields", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.string "field_format", :limit => 30, :default => "", :null => false - t.text "possible_values" - t.string "regexp", :default => "" - t.integer "min_length", :default => 0, :null => false - t.integer "max_length", :default => 0, :null => false - t.boolean "is_required", :default => false, :null => false - t.boolean "is_for_all", :default => false, :null => false - t.boolean "is_filter", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "searchable", :default => false - t.text "default_value" - t.boolean "editable", :default => true - t.boolean "visible", :default => true, :null => false - t.boolean "multiple", :default => false - end - - add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" - - create_table "custom_fields_projects", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "project_id", :default => 0, :null => false - end - - add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true - - create_table "custom_fields_trackers", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true - - create_table "custom_values", :force => true do |t| - t.string "customized_type", :limit => 30, :default => "", :null => false - t.integer "customized_id", :default => 0, :null => false - t.integer "custom_field_id", :default => 0, :null => false - t.text "value" - end - - add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" - add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - - create_table "delayed_jobs", :force => true do |t| - t.integer "priority", :default => 0, :null => false - t.integer "attempts", :default => 0, :null => false - t.text "handler", :null => false - t.text "last_error" - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" - t.string "locked_by" - t.string "queue" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "documents", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "category_id", :default => 0, :null => false - t.string "title", :limit => 60, :default => "", :null => false - t.text "description" - t.datetime "created_on" - t.integer "user_id", :default => 0 - t.integer "is_public", :default => 1 - end - - add_index "documents", ["category_id"], :name => "index_documents_on_category_id" - add_index "documents", ["created_on"], :name => "index_documents_on_created_on" - add_index "documents", ["project_id"], :name => "documents_project_id" - - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 - t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false - end - - create_table "editor_of_documents", :force => true do |t| - t.integer "editor_id" - t.integer "org_document_comment_id" - t.datetime "created_at" - end - - create_table "enabled_modules", :force => true do |t| - t.integer "project_id" - t.string "name", :null => false - t.integer "course_id" - end - - add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" - - create_table "enumerations", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "is_default", :default => false, :null => false - t.string "type" - t.boolean "active", :default => true, :null => false - t.integer "project_id" - t.integer "parent_id" - t.string "position_name", :limit => 30 - end - - add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" - add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - - create_table "exercise_answers", :force => true do |t| - t.integer "user_id" - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_choices", :force => true do |t| - t.integer "exercise_question_id" - t.text "choice_text" - t.integer "choice_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_questions", :force => true do |t| - t.text "question_title" - t.integer "question_type" - t.integer "question_number" - t.integer "exercise_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_score" - end - - create_table "exercise_standard_answers", :force => true do |t| - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_users", :force => true do |t| - t.integer "user_id" - t.integer "exercise_id" - t.integer "score" - t.datetime "start_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "end_at" - t.integer "status" - end - - create_table "exercises", :force => true do |t| - t.text "exercise_name" - t.text "exercise_description" - t.integer "course_id" - t.integer "exercise_status" - t.integer "user_id" - t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "publish_time" - t.datetime "end_time" - t.integer "show_result" - end - - create_table "first_pages", :force => true do |t| - t.string "web_title" - t.string "title" - t.text "description" - t.string "page_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sort_type" - t.integer "image_width", :default => 107 - t.integer "image_height", :default => 63 - t.integer "show_course", :default => 1 - t.integer "show_contest", :default => 1 - end - - create_table "forge_activities", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_act_id" - t.string "forge_act_type" - t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" - - create_table "forge_messages", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_message_id" - t.string "forge_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "secret_key" - t.integer "status" - end - - create_table "forums", :force => true do |t| - t.string "name", :null => false - t.text "description" - t.integer "topic_count", :default => 0 - t.integer "memo_count", :default => 0 - t.integer "last_memo_id", :default => 0 - t.integer "creator_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sticky" - t.integer "locked" - end - - create_table "groups_users", :id => false, :force => true do |t| - t.integer "group_id", :null => false - t.integer "user_id", :null => false - end - - add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - - create_table "homework_attaches", :force => true do |t| - t.integer "bid_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - t.string "name" - t.text "description" - t.integer "state" - t.integer "project_id", :default => 0 - t.float "score", :default => 0.0 - t.integer "is_teacher_score", :default => 0 - end - - add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" - - create_table "homework_commons", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "homework_type", :default => 1 - t.string "late_penalty" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 - t.integer "anonymous_comment", :default => 0 - t.integer "quotes", :default => 0 - end - - add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" - - create_table "homework_detail_groups", :force => true do |t| - t.integer "homework_common_id" - t.integer "min_num" - t.integer "max_num" - t.integer "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" - - create_table "homework_detail_manuals", :force => true do |t| - t.float "ta_proportion" - t.integer "comment_status" - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "absence_penalty", :default => 1 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "homework_detail_programings", :force => true do |t| - t.string "language" - t.text "standard_code", :limit => 2147483647 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "ta_proportion", :default => 0.1 - t.integer "question_id" - end - - create_table "homework_evaluations", :force => true do |t| - t.string "user_id" - t.string "homework_attach_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "homework_for_courses", :force => true do |t| - t.integer "course_id" - t.integer "bid_id" - end - - add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" - add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" - - create_table "homework_tests", :force => true do |t| - t.text "input" - t.text "output" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "result" - t.text "error_msg" - end - - create_table "homework_users", :force => true do |t| - t.string "homework_attach_id" - t.string "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "invite_lists", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "mail" - end - - create_table "issue_categories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.integer "assigned_to_id" - end - - add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" - add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" - - create_table "issue_relations", :force => true do |t| - t.integer "issue_from_id", :null => false - t.integer "issue_to_id", :null => false - t.string "relation_type", :default => "", :null => false - t.integer "delay" - end - - add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true - add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" - add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" - - create_table "issue_statuses", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_closed", :default => false, :null => false - t.boolean "is_default", :default => false, :null => false - t.integer "position", :default => 1 - t.integer "default_done_ratio" - end - - add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" - add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" - add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" - - create_table "issues", :force => true do |t| - t.integer "tracker_id", :null => false - t.integer "project_id", :null => false - t.string "subject", :default => "", :null => false - t.text "description" - t.date "due_date" - t.integer "category_id" - t.integer "status_id", :null => false - t.integer "assigned_to_id" - t.integer "priority_id", :null => false - t.integer "fixed_version_id" - t.integer "author_id", :null => false - t.integer "lock_version", :default => 0, :null => false - t.datetime "created_on" - t.datetime "updated_on" - t.date "start_date" - t.integer "done_ratio", :default => 0, :null => false - t.float "estimated_hours" - t.integer "parent_id" - t.integer "root_id" - t.integer "lft" - t.integer "rgt" - t.boolean "is_private", :default => false, :null => false - t.datetime "closed_on" - t.integer "project_issues_index" - end - - add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" - add_index "issues", ["author_id"], :name => "index_issues_on_author_id" - add_index "issues", ["category_id"], :name => "index_issues_on_category_id" - add_index "issues", ["created_on"], :name => "index_issues_on_created_on" - add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" - add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" - add_index "issues", ["project_id"], :name => "issues_project_id" - add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" - add_index "issues", ["status_id"], :name => "index_issues_on_status_id" - add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" - - create_table "join_in_competitions", :force => true do |t| - t.integer "user_id" - t.integer "competition_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "join_in_contests", :force => true do |t| - t.integer "user_id" - t.integer "bid_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "journal_details", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - - create_table "journal_replies", :id => false, :force => true do |t| - t.integer "journal_id" - t.integer "user_id" - t.integer "reply_id" - end - - add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" - add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" - add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" - - create_table "journals", :force => true do |t| - t.integer "journalized_id", :default => 0, :null => false - t.string "journalized_type", :limit => 30, :default => "", :null => false - t.integer "user_id", :default => 0, :null => false - t.text "notes" - t.datetime "created_on", :null => false - t.boolean "private_notes", :default => false, :null => false - end - - add_index "journals", ["created_on"], :name => "index_journals_on_created_on" - add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" - add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" - add_index "journals", ["user_id"], :name => "index_journals_on_user_id" - - create_table "journals_for_messages", :force => true do |t| - t.integer "jour_id" - t.string "jour_type" - t.integer "user_id" - t.text "notes" - t.integer "status" - t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.string "m_parent_id" - t.boolean "is_readed" - t.integer "m_reply_count" - t.integer "m_reply_id" - t.integer "is_comprehensive_evaluation" - t.integer "private", :default => 0 - end - - create_table "kindeditor_assets", :force => true do |t| - t.string "asset" - t.integer "file_size" - t.string "file_type" - t.integer "owner_id" - t.string "asset_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "owner_type", :default => 0 - end - - create_table "member_roles", :force => true do |t| - t.integer "member_id", :null => false - t.integer "role_id", :null => false - t.integer "inherited_from" - end - - add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" - add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" - - create_table "members", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "project_id", :default => 0 - t.datetime "created_on" - t.boolean "mail_notification", :default => false, :null => false - t.integer "course_id", :default => -1 - t.integer "course_group_id", :default => 0 - end - - add_index "members", ["project_id"], :name => "index_members_on_project_id" - add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true - add_index "members", ["user_id"], :name => "index_members_on_user_id" - - create_table "memo_messages", :force => true do |t| - t.integer "user_id" - t.integer "forum_id" - t.integer "memo_id" - t.string "memo_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "memos", :force => true do |t| - t.integer "forum_id", :null => false - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false - t.integer "author_id", :null => false - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count", :default => 0 - end - - create_table "message_alls", :force => true do |t| - t.integer "user_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "messages", :force => true do |t| - t.integer "board_id", :null => false - t.integer "parent_id" - t.string "subject", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "replies_count", :default => 0, :null => false - t.integer "last_reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.integer "quotes" - t.integer "status", :default => 0 - end - - add_index "messages", ["author_id"], :name => "index_messages_on_author_id" - add_index "messages", ["board_id"], :name => "messages_board_id" - add_index "messages", ["created_on"], :name => "index_messages_on_created_on" - add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" - add_index "messages", ["parent_id"], :name => "messages_parent_id" - - create_table "news", :force => true do |t| - t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" - t.text "description" - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false - t.integer "course_id" - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - end - - add_index "news", ["author_id"], :name => "index_news_on_author_id" - add_index "news", ["created_on"], :name => "index_news_on_created_on" - add_index "news", ["project_id"], :name => "news_project_id" - - create_table "no_uses", :force => true do |t| - t.integer "user_id", :null => false - t.string "no_use_type" - t.integer "no_use_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "notificationcomments", :force => true do |t| - t.string "notificationcommented_type" - t.integer "notificationcommented_id" - t.integer "author_id" - t.text "notificationcomments" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "onclick_times", :force => true do |t| - t.integer "user_id" - t.datetime "onclick_time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "open_id_authentication_associations", :force => true do |t| - t.integer "issued" - t.integer "lifetime" - t.string "handle" - t.string "assoc_type" - t.binary "server_url" - t.binary "secret" - end - - create_table "open_id_authentication_nonces", :force => true do |t| - t.integer "timestamp", :null => false - t.string "server_url" - t.string "salt", :null => false - end - - create_table "open_source_projects", :force => true do |t| - t.string "name" - t.text "description" - t.integer "commit_count", :default => 0 - t.integer "code_line", :default => 0 - t.integer "users_count", :default => 0 - t.date "last_commit_time" - t.string "url" - t.date "date_collected" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "option_numbers", :force => true do |t| - t.integer "user_id" - t.integer "memo" - t.integer "messages_for_issues" - t.integer "issues_status" - t.integer "replay_for_message" - t.integer "replay_for_memo" - t.integer "follow" - t.integer "tread" - t.integer "praise_by_one" - t.integer "praise_by_two" - t.integer "praise_by_three" - t.integer "tread_by_one" - t.integer "tread_by_two" - t.integer "tread_by_three" - t.integer "changeset" - t.integer "document" - t.integer "attachment" - t.integer "issue_done_ratio" - t.integer "post_issue" - t.integer "score_type" - t.integer "total_score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - end - - create_table "org_activities", :force => true do |t| - t.integer "user_id" - t.integer "org_act_id" - t.string "org_act_type" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_courses", :force => true do |t| - t.integer "organization_id" - t.integer "course_id" - t.datetime "created_at" - end - - create_table "org_document_comments", :force => true do |t| - t.text "title" - t.text "content" - t.integer "organization_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - end - - create_table "org_member_roles", :force => true do |t| - t.integer "org_member_id" - t.integer "role_id" - end - - create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_messages", :force => true do |t| - t.integer "user_id" - t.integer "sender_id" - t.integer "organization_id" - t.string "message_type" - t.integer "message_id" - t.integer "viewed" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - end - - create_table "org_projects", :force => true do |t| - t.integer "organization_id" - t.integer "project_id" - t.datetime "created_at" - end - - create_table "org_subfield_messages", :force => true do |t| - t.integer "org_subfield_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_subfields", :force => true do |t| - t.integer "organization_id" - t.integer "priority" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "field_type" - t.integer "hide", :default => 0 - end - - create_table "organizations", :force => true do |t| - t.string "name" - t.text "description" - t.integer "creator_id" - t.integer "home_id" - t.string "domain" - t.boolean "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "allow_guest_download", :default => true - end - - create_table "phone_app_versions", :force => true do |t| - t.string "version" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_answers", :force => true do |t| - t.integer "poll_question_id" - t.text "answer_text" - t.integer "answer_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_questions", :force => true do |t| - t.string "question_title" - t.integer "question_type" - t.integer "is_necessary" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_number" - end - - create_table "poll_users", :force => true do |t| - t.integer "user_id" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_votes", :force => true do |t| - t.integer "user_id" - t.integer "poll_question_id" - t.integer "poll_answer_id" - t.text "vote_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "polls", :force => true do |t| - t.string "polls_name" - t.string "polls_type" - t.integer "polls_group_id" - t.integer "polls_status" - t.integer "user_id" - t.datetime "published_at" - t.datetime "closed_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "polls_description" - t.integer "show_result", :default => 1 - end - - create_table "praise_tread_caches", :force => true do |t| - t.integer "object_id", :null => false - t.string "object_type" - t.integer "praise_num" - t.integer "tread_num" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "praise_treads", :force => true do |t| - t.integer "user_id", :null => false - t.integer "praise_tread_object_id" - t.string "praise_tread_object_type" - t.integer "praise_or_tread" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "principal_activities", :force => true do |t| - t.integer "user_id" - t.integer "principal_id" - t.integer "principal_act_id" - t.string "principal_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_infos", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_scores", :force => true do |t| - t.string "project_id" - t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "act_num", :default => 0 - t.integer "attach_num", :default => 0 - t.datetime "commit_time" - end - - create_table "project_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "project_id" - t.integer "project_type" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - end - - add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" - - create_table "projecting_softapplictions", :force => true do |t| - t.integer "user_id" - t.integer "softapplication_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "identifier" - t.integer "status", :default => 1, :null => false - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "commits_count", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "issues_count", :default => 0 - t.integer "attachments_count", :default => 0 - t.integer "boards_count", :default => 0 - t.integer "news_count", :default => 0 - t.integer "acts_count", :default => 0 - t.integer "journals_count", :default => 0 - t.integer "boards_reply_count", :default => 0 - end - - add_index "projects", ["lft"], :name => "index_projects_on_lft" - add_index "projects", ["rgt"], :name => "index_projects_on_rgt" - - create_table "projects_trackers", :id => false, :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true - add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - - create_table "queries", :force => true do |t| - t.integer "project_id" - t.string "name", :default => "", :null => false - t.text "filters" - t.integer "user_id", :default => 0, :null => false - t.boolean "is_public", :default => false, :null => false - t.text "column_names" - t.text "sort_criteria" - t.string "group_by" - t.string "type" - end - - add_index "queries", ["project_id"], :name => "index_queries_on_project_id" - add_index "queries", ["user_id"], :name => "index_queries_on_user_id" - - create_table "relative_memo_to_open_source_projects", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "relative_memos", :force => true do |t| - t.integer "osp_id" - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false - t.integer "author_id" - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 - t.string "url" - t.string "username" - t.string "userhomeurl" - t.date "date_collected" - t.string "topic_resource" - end - - create_table "repositories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "url", :default => "", :null => false - t.string "login", :limit => 60, :default => "" - t.string "password", :default => "" - t.string "root_url", :default => "" - t.string "type" - t.string "path_encoding", :limit => 64 - t.string "log_encoding", :limit => 64 - t.text "extra_info" - t.string "identifier" - t.boolean "is_default", :default => false - t.boolean "hidden", :default => false - end - - add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - - create_table "roles", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "assignable", :default => true - t.integer "builtin", :default => 0, :null => false - t.text "permissions" - t.string "issues_visibility", :limit => 30, :default => "default", :null => false - end - - create_table "schools", :force => true do |t| - t.string "name" - t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "logo_link" - t.string "pinyin" - end - - create_table "seems_rateable_cached_ratings", :force => true do |t| - t.integer "cacheable_id", :limit => 8 - t.string "cacheable_type" - t.float "avg", :null => false - t.integer "cnt", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_rates", :force => true do |t| - t.integer "rater_id", :limit => 8 - t.integer "rateable_id" - t.string "rateable_type" - t.float "stars", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "is_teacher_score", :default => 0 - end - - create_table "settings", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "value" - t.datetime "updated_on" - end - - add_index "settings", ["name"], :name => "index_settings_on_name" - - create_table "shares", :force => true do |t| - t.date "created_on" - t.string "url" - t.string "title" - t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - t.integer "user_id" - t.string "description" - end - - create_table "shield_activities", :force => true do |t| - t.string "container_type" - t.integer "container_id" - t.string "shield_type" - t.integer "shield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "softapplications", :force => true do |t| - t.string "name" - t.text "description" - t.integer "app_type_id" - t.string "app_type_name" - t.string "android_min_version_available" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "contest_id" - t.integer "softapplication_id" - t.integer "is_public" - t.string "application_developers" - t.string "deposit_project_url" - t.string "deposit_project" - t.integer "project_id" - end - - create_table "student_work_projects", :force => true do |t| - t.integer "homework_common_id" - t.integer "student_work_id" - t.integer "project_id" - t.integer "user_id" - t.integer "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" - add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" - add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" - add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" - - create_table "student_work_tests", :force => true do |t| - t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 - t.text "results" - t.text "src" - end - - create_table "student_works", :force => true do |t| - t.string "name" - t.text "description", :limit => 2147483647 - t.integer "homework_common_id" - t.integer "user_id" - t.float "final_score" - t.float "teacher_score" - t.float "student_score" - t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "late_penalty", :default => 0 - t.integer "absence_penalty", :default => 0 - t.float "system_score", :default => 0.0 - t.boolean "is_test", :default => false - end - - add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" - - create_table "student_works_evaluation_distributions", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "student_works_scores", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "students_for_courses", :force => true do |t| - t.integer "student_id" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" - add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" - - create_table "subfield_subdomain_dirs", :force => true do |t| - t.integer "org_subfield_id" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" - end - - create_table "taggings", :force => true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context", :limit => 128 - t.datetime "created_at" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" - add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" - - create_table "tags", :force => true do |t| - t.string "name" - end - - create_table "teachers", :force => true do |t| - t.string "tea_name" - t.string "location" - t.integer "couurse_time" - t.integer "course_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "extra" - end - - create_table "time_entries", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "issue_id" - t.float "hours", :null => false - t.string "comments" - t.integer "activity_id", :null => false - t.date "spent_on", :null => false - t.integer "tyear", :null => false - t.integer "tmonth", :null => false - t.integer "tweek", :null => false - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" - add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" - add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" - add_index "time_entries", ["project_id"], :name => "time_entries_project_id" - add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - - create_table "tokens", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "value", :limit => 40, :default => "", :null => false - t.datetime "created_on", :null => false - end - - add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" - add_index "tokens", ["value"], :name => "tokens_value", :unique => true - - create_table "trackers", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_in_chlog", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "is_in_roadmap", :default => true, :null => false - t.integer "fields_bits", :default => 0 - end - - create_table "user_activities", :force => true do |t| - t.string "act_type" - t.integer "act_id" - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false - t.date "birthday" - t.string "brief_introduction" - t.integer "gender" - t.string "location" - t.string "occupation" - t.integer "work_experience" - t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "technical_title" - t.integer "identity" - t.string "student_id" - t.string "teacher_realname" - t.string "student_realname" - t.string "location_city" - t.integer "school_id" - t.string "description", :default => "" - end - - create_table "user_feedback_messages", :force => true do |t| - t.integer "user_id" - t.integer "journals_for_message_id" - t.string "journals_for_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_grades", :force => true do |t| - t.integer "user_id", :null => false - t.integer "project_id", :null => false - t.float "grade", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" - add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" - add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" - - create_table "user_levels", :force => true do |t| - t.integer "user_id" - t.integer "level" - end - - create_table "user_preferences", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.text "others" - t.boolean "hide_mail", :default => false - t.string "time_zone" - end - - add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" - - create_table "user_score_details", :force => true do |t| - t.integer "current_user_id" - t.integer "target_user_id" - t.string "score_type" - t.string "score_action" - t.integer "user_id" - t.integer "old_score" - t.integer "new_score" - t.integer "current_user_level" - t.integer "target_user_level" - t.integer "score_changeable_obj_id" - t.string "score_changeable_obj_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "grade", :default => 0.0 - end - - add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" - add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" - add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "users", :force => true do |t| - t.string "login", :default => "", :null => false - t.string "hashed_password", :limit => 40, :default => "", :null => false - t.string "firstname", :limit => 30, :default => "", :null => false - t.string "lastname", :default => "", :null => false - t.string "mail", :limit => 60, :default => "", :null => false - t.boolean "admin", :default => false, :null => false - t.integer "status", :default => 1, :null => false - t.datetime "last_login_on" - t.string "language", :limit => 5, :default => "" - t.integer "auth_source_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "type" - t.string "identity_url" - t.string "mail_notification", :default => "", :null => false - t.string "salt", :limit => 64 - t.integer "gid" - end - - add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" - add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" - add_index "users", ["type"], :name => "index_users_on_type" - - create_table "versions", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :default => "", :null => false - t.string "description", :default => "" - t.date "effective_date" - t.datetime "created_on" - t.datetime "updated_on" - t.string "wiki_page_title" - t.string "status", :default => "open" - t.string "sharing", :default => "none", :null => false - end - - add_index "versions", ["project_id"], :name => "versions_project_id" - add_index "versions", ["sharing"], :name => "index_versions_on_sharing" - - create_table "visitors", :force => true do |t| - t.integer "user_id" - t.integer "master_id" - t.datetime "updated_on" - t.datetime "created_on" - end - - add_index "visitors", ["master_id"], :name => "index_visitors_master_id" - add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" - add_index "visitors", ["user_id"], :name => "index_visitors_user_id" - - create_table "watchers", :force => true do |t| - t.string "watchable_type", :default => "", :null => false - t.integer "watchable_id", :default => 0, :null => false - t.integer "user_id" - end - - add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" - add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" - add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" - - create_table "web_footer_companies", :force => true do |t| - t.string "name" - t.string "logo_size" - t.string "url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "web_footer_oranizers", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - - create_table "wiki_content_versions", :force => true do |t| - t.integer "wiki_content_id", :null => false - t.integer "page_id", :null => false - t.integer "author_id" - t.binary "data", :limit => 2147483647 - t.string "compression", :limit => 6, :default => "" - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" - add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" - - create_table "wiki_contents", :force => true do |t| - t.integer "page_id", :null => false - t.integer "author_id" - t.text "text", :limit => 2147483647 - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" - add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" - - create_table "wiki_pages", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title", :null => false - t.datetime "created_on", :null => false - t.boolean "protected", :default => false, :null => false - t.integer "parent_id" - end - - add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" - add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" - add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" - - create_table "wiki_redirects", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title" - t.string "redirects_to" - t.datetime "created_on", :null => false - end - - add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" - add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" - - create_table "wikis", :force => true do |t| - t.integer "project_id", :null => false - t.string "start_page", :null => false - t.integer "status", :default => 1, :null => false - end - - add_index "wikis", ["project_id"], :name => "wikis_project_id" - - create_table "workflows", :force => true do |t| - t.integer "tracker_id", :default => 0, :null => false - t.integer "old_status_id", :default => 0, :null => false - t.integer "new_status_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - t.boolean "assignee", :default => false, :null => false - t.boolean "author", :default => false, :null => false - t.string "type", :limit => 30 - t.string "field_name", :limit => 30 - t.string "rule", :limit => 30 - end - - add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" - add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" - add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" - add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - - create_table "works_categories", :force => true do |t| - t.string "category" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "zip_packs", :force => true do |t| - t.integer "user_id" - t.integer "homework_id" - t.string "file_digest" - t.string "file_path" - t.integer "pack_times", :default => 1 - t.integer "pack_size", :default => 0 - t.text "file_digests" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - -end +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20160128024452) do + + create_table "activities", :force => true do |t| + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false + t.integer "activity_container_id" + t.string "activity_container_type", :default => "" + t.datetime "created_at" + end + + add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" + add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" + add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + + create_table "activity_notifies", :force => true do |t| + t.integer "activity_container_id" + t.string "activity_container_type" + t.integer "activity_id" + t.string "activity_type" + t.integer "notify_to" + t.datetime "created_on" + t.integer "is_read" + end + + add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" + add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" + add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" + + create_table "api_keys", :force => true do |t| + t.string "access_token" + t.datetime "expires_at" + t.integer "user_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" + add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + + create_table "applied_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + end + + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "at_messages", :force => true do |t| + t.integer "user_id" + t.integer "at_message_id" + t.string "at_message_type" + t.boolean "viewed", :default => false + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sender_id" + end + + add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" + + create_table "attachment_histories", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.string "filename", :default => "" + t.string "disk_filename", :default => "" + t.integer "filesize", :default => 0 + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "" + t.integer "downloads", :default => 0 + t.integer "author_id" + t.datetime "created_on" + t.string "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.integer "copy_from" + t.integer "quotes" + t.integer "version" + t.integer "attachment_id" + end + + create_table "attachments", :force => true do |t| + t.integer "container_id" + t.string "container_type", :limit => 30 + t.string "filename", :default => "", :null => false + t.string "disk_filename", :default => "", :null => false + t.integer "filesize", :default => 0, :null => false + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "", :null => false + t.integer "downloads", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.string "description" + t.string "disk_directory" + t.integer "attachtype", :default => 1 + t.integer "is_public", :default => 1 + t.integer "copy_from" + t.integer "quotes" + end + + add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" + add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" + add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" + + create_table "attachmentstypes", :force => true do |t| + t.integer "typeId", :null => false + t.string "typeName", :limit => 50 + end + + create_table "auth_sources", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 60, :default => "", :null => false + t.string "host", :limit => 60 + t.integer "port" + t.string "account" + t.string "account_password", :default => "" + t.string "base_dn" + t.string "attr_login", :limit => 30 + t.string "attr_firstname", :limit => 30 + t.string "attr_lastname", :limit => 30 + t.string "attr_mail", :limit => 30 + t.boolean "onthefly_register", :default => false, :null => false + t.boolean "tls", :default => false, :null => false + t.string "filter" + t.integer "timeout" + end + + add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" + + create_table "biding_projects", :force => true do |t| + t.integer "project_id" + t.integer "bid_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "bids", :force => true do |t| + t.string "name" + t.string "budget", :null => false + t.integer "author_id" + t.date "deadline" + t.text "description" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "commit" + t.integer "reward_type" + t.integer "homework_type" + t.integer "parent_id" + t.string "password" + t.integer "is_evaluation" + t.integer "proportion", :default => 60 + t.integer "comment_status", :default => 0 + t.integer "evaluation_num", :default => 3 + t.integer "open_anonymous_evaluation", :default => 1 + end + + create_table "blog_comments", :force => true do |t| + t.integer "blog_id", :null => false + t.integer "parent_id" + t.string "title", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comment_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "blogs", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.integer "position", :default => 1 + t.integer "article_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comments_id" + t.integer "parent_id" + t.integer "author_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "homepage_id" + end + + create_table "boards", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false + t.string "description" + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false + t.integer "last_message_id" + t.integer "parent_id" + t.integer "course_id" + t.integer "org_subfield_id" + end + + add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" + add_index "boards", ["project_id"], :name => "boards_project_id" + + create_table "bug_to_osps", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "changes", :force => true do |t| + t.integer "changeset_id", :null => false + t.string "action", :limit => 1, :default => "", :null => false + t.text "path", :null => false + t.text "from_path" + t.string "from_revision" + t.string "revision" + t.string "branch" + end + + add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" + + create_table "changeset_parents", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "parent_id", :null => false + end + + add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" + add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" + + create_table "changesets", :force => true do |t| + t.integer "repository_id", :null => false + t.string "revision", :null => false + t.string "committer" + t.datetime "committed_on", :null => false + t.text "comments" + t.date "commit_date" + t.string "scmid" + t.integer "user_id" + end + + add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" + add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true + add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" + add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" + add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" + + create_table "changesets_issues", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "issue_id", :null => false + end + + add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + + create_table "comments", :force => true do |t| + t.string "commented_type", :limit => 30, :default => "", :null => false + t.integer "commented_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.text "comments" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + add_index "comments", ["author_id"], :name => "index_comments_on_author_id" + add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" + + create_table "contest_notifications", :force => true do |t| + t.text "title" + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contesting_projects", :force => true do |t| + t.integer "project_id" + t.string "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contesting_softapplications", :force => true do |t| + t.integer "softapplication_id" + t.integer "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contestnotifications", :force => true do |t| + t.integer "contest_id" + t.string "title" + t.string "summary" + t.text "description" + t.integer "author_id" + t.integer "notificationcomments_count" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contests", :force => true do |t| + t.string "name" + t.string "budget", :default => "" + t.integer "author_id" + t.date "deadline" + t.string "description" + t.integer "commit" + t.string "password" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + create_table "course_activities", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_act_id" + t.string "course_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_attachments", :force => true do |t| + t.string "filename" + t.string "disk_filename" + t.integer "filesize" + t.string "content_type" + t.string "digest" + t.integer "downloads" + t.string "author_id" + t.string "integer" + t.string "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id", :default => 0 + end + + create_table "course_contributor_scores", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.integer "message_num" + t.integer "message_reply_num" + t.integer "news_reply_num" + t.integer "resource_num" + t.integer "journal_num" + t.integer "journal_reply_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "total_score" + end + + create_table "course_groups", :force => true do |t| + t.string "name" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_infos", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_messages", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_message_id" + t.string "course_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "content" + t.integer "status" + end + + create_table "course_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "course_id" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "courses", :force => true do |t| + t.integer "tea_id" + t.string "name" + t.integer "state" + t.string "code" + t.integer "time" + t.string "extra" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "location" + t.string "term" + t.string "string" + t.string "password" + t.string "setup_time" + t.string "endup_time" + t.string "class_period" + t.integer "school_id" + t.text "description" + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 + t.integer "lft" + t.integer "rgt" + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 + t.integer "end_time" + t.string "end_term" + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + end + + create_table "custom_fields", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.string "field_format", :limit => 30, :default => "", :null => false + t.text "possible_values" + t.string "regexp", :default => "" + t.integer "min_length", :default => 0, :null => false + t.integer "max_length", :default => 0, :null => false + t.boolean "is_required", :default => false, :null => false + t.boolean "is_for_all", :default => false, :null => false + t.boolean "is_filter", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "searchable", :default => false + t.text "default_value" + t.boolean "editable", :default => true + t.boolean "visible", :default => true, :null => false + t.boolean "multiple", :default => false + end + + add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" + + create_table "custom_fields_projects", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "project_id", :default => 0, :null => false + end + + add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true + + create_table "custom_fields_trackers", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true + + create_table "custom_values", :force => true do |t| + t.string "customized_type", :limit => 30, :default => "", :null => false + t.integer "customized_id", :default => 0, :null => false + t.integer "custom_field_id", :default => 0, :null => false + t.text "value" + end + + add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" + add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + + create_table "delayed_jobs", :force => true do |t| + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "documents", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "category_id", :default => 0, :null => false + t.string "title", :limit => 60, :default => "", :null => false + t.text "description" + t.datetime "created_on" + t.integer "user_id", :default => 0 + t.integer "is_public", :default => 1 + end + + add_index "documents", ["category_id"], :name => "index_documents_on_category_id" + add_index "documents", ["created_on"], :name => "index_documents_on_created_on" + add_index "documents", ["project_id"], :name => "documents_project_id" + + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 + t.string "File" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false + end + + create_table "editor_of_documents", :force => true do |t| + t.integer "editor_id" + t.integer "org_document_comment_id" + t.datetime "created_at" + end + + create_table "enabled_modules", :force => true do |t| + t.integer "project_id" + t.string "name", :null => false + t.integer "course_id" + end + + add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" + + create_table "enumerations", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "is_default", :default => false, :null => false + t.string "type" + t.boolean "active", :default => true, :null => false + t.integer "project_id" + t.integer "parent_id" + t.string "position_name", :limit => 30 + end + + add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" + add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + + create_table "exercise_answers", :force => true do |t| + t.integer "user_id" + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_choices", :force => true do |t| + t.integer "exercise_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "exercise_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_score" + end + + create_table "exercise_standard_answers", :force => true do |t| + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_users", :force => true do |t| + t.integer "user_id" + t.integer "exercise_id" + t.integer "score" + t.datetime "start_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "end_at" + t.integer "status" + end + + create_table "exercises", :force => true do |t| + t.text "exercise_name" + t.text "exercise_description" + t.integer "course_id" + t.integer "exercise_status" + t.integer "user_id" + t.integer "time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "publish_time" + t.datetime "end_time" + t.integer "show_result" + end + + create_table "first_pages", :force => true do |t| + t.string "web_title" + t.string "title" + t.text "description" + t.string "page_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sort_type" + t.integer "image_width", :default => 107 + t.integer "image_height", :default => 63 + t.integer "show_course", :default => 1 + t.integer "show_contest", :default => 1 + end + + create_table "forge_activities", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_act_id" + t.string "forge_act_type" + t.integer "org_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" + + create_table "forge_messages", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_message_id" + t.string "forge_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "secret_key" + t.integer "status" + end + + create_table "forums", :force => true do |t| + t.string "name", :null => false + t.text "description" + t.integer "topic_count", :default => 0 + t.integer "memo_count", :default => 0 + t.integer "last_memo_id", :default => 0 + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sticky" + t.integer "locked" + end + + create_table "groups_users", :id => false, :force => true do |t| + t.integer "group_id", :null => false + t.integer "user_id", :null => false + end + + add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true + + create_table "homework_attaches", :force => true do |t| + t.integer "bid_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + t.string "name" + t.text "description" + t.integer "state" + t.integer "project_id", :default => 0 + t.float "score", :default => 0.0 + t.integer "is_teacher_score", :default => 0 + end + + add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + + create_table "homework_commons", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "homework_type", :default => 1 + t.string "late_penalty" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 + t.integer "quotes", :default => 0 + end + + add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + + create_table "homework_detail_groups", :force => true do |t| + t.integer "homework_common_id" + t.integer "min_num" + t.integer "max_num" + t.integer "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" + + create_table "homework_detail_manuals", :force => true do |t| + t.float "ta_proportion" + t.integer "comment_status" + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "absence_penalty", :default => 1 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_detail_programings", :force => true do |t| + t.string "language" + t.text "standard_code", :limit => 2147483647 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "ta_proportion", :default => 0.1 + t.integer "question_id" + end + + create_table "homework_evaluations", :force => true do |t| + t.string "user_id" + t.string "homework_attach_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_for_courses", :force => true do |t| + t.integer "course_id" + t.integer "bid_id" + end + + add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" + add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + + create_table "homework_tests", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "result" + t.text "error_msg" + end + + create_table "homework_users", :force => true do |t| + t.string "homework_attach_id" + t.string "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "invite_lists", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "mail" + end + + create_table "issue_categories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.integer "assigned_to_id" + end + + add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" + add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" + + create_table "issue_relations", :force => true do |t| + t.integer "issue_from_id", :null => false + t.integer "issue_to_id", :null => false + t.string "relation_type", :default => "", :null => false + t.integer "delay" + end + + add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true + add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" + add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" + + create_table "issue_statuses", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_closed", :default => false, :null => false + t.boolean "is_default", :default => false, :null => false + t.integer "position", :default => 1 + t.integer "default_done_ratio" + end + + add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" + add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" + add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" + + create_table "issues", :force => true do |t| + t.integer "tracker_id", :null => false + t.integer "project_id", :null => false + t.string "subject", :default => "", :null => false + t.text "description" + t.date "due_date" + t.integer "category_id" + t.integer "status_id", :null => false + t.integer "assigned_to_id" + t.integer "priority_id", :null => false + t.integer "fixed_version_id" + t.integer "author_id", :null => false + t.integer "lock_version", :default => 0, :null => false + t.datetime "created_on" + t.datetime "updated_on" + t.date "start_date" + t.integer "done_ratio", :default => 0, :null => false + t.float "estimated_hours" + t.integer "parent_id" + t.integer "root_id" + t.integer "lft" + t.integer "rgt" + t.boolean "is_private", :default => false, :null => false + t.datetime "closed_on" + t.integer "project_issues_index" + end + + add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" + add_index "issues", ["author_id"], :name => "index_issues_on_author_id" + add_index "issues", ["category_id"], :name => "index_issues_on_category_id" + add_index "issues", ["created_on"], :name => "index_issues_on_created_on" + add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" + add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" + add_index "issues", ["project_id"], :name => "issues_project_id" + add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" + add_index "issues", ["status_id"], :name => "index_issues_on_status_id" + add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" + + create_table "join_in_competitions", :force => true do |t| + t.integer "user_id" + t.integer "competition_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "join_in_contests", :force => true do |t| + t.integer "user_id" + t.integer "bid_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "journal_details", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + + create_table "journal_replies", :id => false, :force => true do |t| + t.integer "journal_id" + t.integer "user_id" + t.integer "reply_id" + end + + add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" + add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" + add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" + + create_table "journals", :force => true do |t| + t.integer "journalized_id", :default => 0, :null => false + t.string "journalized_type", :limit => 30, :default => "", :null => false + t.integer "user_id", :default => 0, :null => false + t.text "notes" + t.datetime "created_on", :null => false + t.boolean "private_notes", :default => false, :null => false + end + + add_index "journals", ["created_on"], :name => "index_journals_on_created_on" + add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" + add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" + add_index "journals", ["user_id"], :name => "index_journals_on_user_id" + + create_table "journals_for_messages", :force => true do |t| + t.integer "jour_id" + t.string "jour_type" + t.integer "user_id" + t.text "notes" + t.integer "status" + t.integer "reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.string "m_parent_id" + t.boolean "is_readed" + t.integer "m_reply_count" + t.integer "m_reply_id" + t.integer "is_comprehensive_evaluation" + t.integer "private", :default => 0 + end + + create_table "kindeditor_assets", :force => true do |t| + t.string "asset" + t.integer "file_size" + t.string "file_type" + t.integer "owner_id" + t.string "asset_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "owner_type", :default => 0 + end + + create_table "member_roles", :force => true do |t| + t.integer "member_id", :null => false + t.integer "role_id", :null => false + t.integer "inherited_from" + end + + add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" + add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" + + create_table "members", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "project_id", :default => 0 + t.datetime "created_on" + t.boolean "mail_notification", :default => false, :null => false + t.integer "course_id", :default => -1 + t.integer "course_group_id", :default => 0 + end + + add_index "members", ["project_id"], :name => "index_members_on_project_id" + add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true + add_index "members", ["user_id"], :name => "index_members_on_user_id" + + create_table "memo_messages", :force => true do |t| + t.integer "user_id" + t.integer "forum_id" + t.integer "memo_id" + t.string "memo_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "memos", :force => true do |t| + t.integer "forum_id", :null => false + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :null => false + t.integer "author_id", :null => false + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count", :default => 0 + end + + create_table "message_alls", :force => true do |t| + t.integer "user_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "messages", :force => true do |t| + t.integer "board_id", :null => false + t.integer "parent_id" + t.string "subject", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "replies_count", :default => 0, :null => false + t.integer "last_reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.integer "quotes" + t.integer "status", :default => 0 + end + + add_index "messages", ["author_id"], :name => "index_messages_on_author_id" + add_index "messages", ["board_id"], :name => "messages_board_id" + add_index "messages", ["created_on"], :name => "index_messages_on_created_on" + add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" + add_index "messages", ["parent_id"], :name => "messages_parent_id" + + create_table "news", :force => true do |t| + t.integer "project_id" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" + t.text "description" + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.integer "comments_count", :default => 0, :null => false + t.integer "course_id" + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + end + + add_index "news", ["author_id"], :name => "index_news_on_author_id" + add_index "news", ["created_on"], :name => "index_news_on_created_on" + add_index "news", ["project_id"], :name => "news_project_id" + + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "notificationcomments", :force => true do |t| + t.string "notificationcommented_type" + t.integer "notificationcommented_id" + t.integer "author_id" + t.text "notificationcomments" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "open_id_authentication_associations", :force => true do |t| + t.integer "issued" + t.integer "lifetime" + t.string "handle" + t.string "assoc_type" + t.binary "server_url" + t.binary "secret" + end + + create_table "open_id_authentication_nonces", :force => true do |t| + t.integer "timestamp", :null => false + t.string "server_url" + t.string "salt", :null => false + end + + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "option_numbers", :force => true do |t| + t.integer "user_id" + t.integer "memo" + t.integer "messages_for_issues" + t.integer "issues_status" + t.integer "replay_for_message" + t.integer "replay_for_memo" + t.integer "follow" + t.integer "tread" + t.integer "praise_by_one" + t.integer "praise_by_two" + t.integer "praise_by_three" + t.integer "tread_by_one" + t.integer "tread_by_two" + t.integer "tread_by_three" + t.integer "changeset" + t.integer "document" + t.integer "attachment" + t.integer "issue_done_ratio" + t.integer "post_issue" + t.integer "score_type" + t.integer "total_score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + end + + create_table "org_activities", :force => true do |t| + t.integer "user_id" + t.integer "org_act_id" + t.string "org_act_type" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_courses", :force => true do |t| + t.integer "organization_id" + t.integer "course_id" + t.datetime "created_at" + end + + create_table "org_document_comments", :force => true do |t| + t.text "title" + t.text "content" + t.integer "organization_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + end + + create_table "org_member_roles", :force => true do |t| + t.integer "org_member_id" + t.integer "role_id" + end + + create_table "org_members", :force => true do |t| + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_messages", :force => true do |t| + t.integer "user_id" + t.integer "sender_id" + t.integer "organization_id" + t.string "message_type" + t.integer "message_id" + t.integer "viewed" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + end + + create_table "org_projects", :force => true do |t| + t.integer "organization_id" + t.integer "project_id" + t.datetime "created_at" + end + + create_table "org_subfield_messages", :force => true do |t| + t.integer "org_subfield_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_subfields", :force => true do |t| + t.integer "organization_id" + t.integer "priority" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "field_type" + t.integer "hide", :default => 0 + end + + create_table "organizations", :force => true do |t| + t.string "name" + t.text "description" + t.integer "creator_id" + t.integer "home_id" + t.string "domain" + t.boolean "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "allow_guest_download", :default => true + end + + create_table "phone_app_versions", :force => true do |t| + t.string "version" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_answers", :force => true do |t| + t.integer "poll_question_id" + t.text "answer_text" + t.integer "answer_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_questions", :force => true do |t| + t.string "question_title" + t.integer "question_type" + t.integer "is_necessary" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_number" + end + + create_table "poll_users", :force => true do |t| + t.integer "user_id" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_votes", :force => true do |t| + t.integer "user_id" + t.integer "poll_question_id" + t.integer "poll_answer_id" + t.text "vote_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "polls", :force => true do |t| + t.string "polls_name" + t.string "polls_type" + t.integer "polls_group_id" + t.integer "polls_status" + t.integer "user_id" + t.datetime "published_at" + t.datetime "closed_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "polls_description" + t.integer "show_result", :default => 1 + end + + create_table "praise_tread_caches", :force => true do |t| + t.integer "object_id", :null => false + t.string "object_type" + t.integer "praise_num" + t.integer "tread_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "praise_treads", :force => true do |t| + t.integer "user_id", :null => false + t.integer "praise_tread_object_id" + t.string "praise_tread_object_type" + t.integer "praise_or_tread" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "principal_activities", :force => true do |t| + t.integer "user_id" + t.integer "principal_id" + t.integer "principal_act_id" + t.string "principal_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_infos", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_scores", :force => true do |t| + t.string "project_id" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 + t.datetime "commit_time" + end + + create_table "project_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "project_id" + t.integer "project_type" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + end + + add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" + + create_table "projecting_softapplictions", :force => true do |t| + t.integer "user_id" + t.integer "softapplication_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "projects", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false + t.integer "parent_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "identifier" + t.integer "status", :default => 1, :null => false + t.integer "lft" + t.integer "rgt" + t.boolean "inherit_members", :default => false, :null => false + t.integer "project_type" + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 + t.integer "user_id" + t.integer "dts_test", :default => 0 + t.string "enterprise_name" + t.integer "organization_id" + t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "commits_count", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "issues_count", :default => 0 + t.integer "attachments_count", :default => 0 + t.integer "boards_count", :default => 0 + t.integer "news_count", :default => 0 + t.integer "acts_count", :default => 0 + t.integer "journals_count", :default => 0 + t.integer "boards_reply_count", :default => 0 + end + + add_index "projects", ["lft"], :name => "index_projects_on_lft" + add_index "projects", ["rgt"], :name => "index_projects_on_rgt" + + create_table "projects_trackers", :id => false, :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true + add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + + create_table "queries", :force => true do |t| + t.integer "project_id" + t.string "name", :default => "", :null => false + t.text "filters" + t.integer "user_id", :default => 0, :null => false + t.boolean "is_public", :default => false, :null => false + t.text "column_names" + t.text "sort_criteria" + t.string "group_by" + t.string "type" + end + + add_index "queries", ["project_id"], :name => "index_queries_on_project_id" + add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + + create_table "relative_memo_to_open_source_projects", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "relative_memos", :force => true do |t| + t.integer "osp_id" + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + t.string "username" + t.string "userhomeurl" + t.date "date_collected" + t.string "topic_resource" + end + + create_table "repositories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "url", :default => "", :null => false + t.string "login", :limit => 60, :default => "" + t.string "password", :default => "" + t.string "root_url", :default => "" + t.string "type" + t.string "path_encoding", :limit => 64 + t.string "log_encoding", :limit => 64 + t.text "extra_info" + t.string "identifier" + t.boolean "is_default", :default => false + t.boolean "hidden", :default => false + end + + add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + + create_table "roles", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "assignable", :default => true + t.integer "builtin", :default => 0, :null => false + t.text "permissions" + t.string "issues_visibility", :limit => 30, :default => "default", :null => false + end + + create_table "schools", :force => true do |t| + t.string "name" + t.string "province" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "logo_link" + t.string "pinyin" + end + + create_table "seems_rateable_cached_ratings", :force => true do |t| + t.integer "cacheable_id", :limit => 8 + t.string "cacheable_type" + t.float "avg", :null => false + t.integer "cnt", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_rates", :force => true do |t| + t.integer "rater_id", :limit => 8 + t.integer "rateable_id" + t.string "rateable_type" + t.float "stars", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "is_teacher_score", :default => 0 + end + + create_table "settings", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "value" + t.datetime "updated_on" + end + + add_index "settings", ["name"], :name => "index_settings_on_name" + + create_table "shares", :force => true do |t| + t.date "created_on" + t.string "url" + t.string "title" + t.integer "share_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + t.integer "user_id" + t.string "description" + end + + create_table "shield_activities", :force => true do |t| + t.string "container_type" + t.integer "container_id" + t.string "shield_type" + t.integer "shield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "softapplications", :force => true do |t| + t.string "name" + t.text "description" + t.integer "app_type_id" + t.string "app_type_name" + t.string "android_min_version_available" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "contest_id" + t.integer "softapplication_id" + t.integer "is_public" + t.string "application_developers" + t.string "deposit_project_url" + t.string "deposit_project" + t.integer "project_id" + end + + create_table "student_work_projects", :force => true do |t| + t.integer "homework_common_id" + t.integer "student_work_id" + t.integer "project_id" + t.integer "user_id" + t.integer "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" + add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" + add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" + add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" + + create_table "student_work_tests", :force => true do |t| + t.integer "student_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 + t.text "results" + t.text "src" + end + + create_table "student_works", :force => true do |t| + t.string "name" + t.text "description", :limit => 2147483647 + t.integer "homework_common_id" + t.integer "user_id" + t.float "final_score" + t.float "teacher_score" + t.float "student_score" + t.float "teaching_asistant_score" + t.integer "project_id", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "late_penalty", :default => 0 + t.integer "absence_penalty", :default => 0 + t.float "system_score", :default => 0.0 + t.boolean "is_test", :default => false + end + + add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + + create_table "student_works_evaluation_distributions", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "student_works_scores", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "students_for_courses", :force => true do |t| + t.integer "student_id" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" + add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" + + create_table "subfield_subdomain_dirs", :force => true do |t| + t.integer "org_subfield_id" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "system_messages", :force => true do |t| + t.integer "user_id" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "description" + t.string "subject" + end + + create_table "taggings", :force => true do |t| + t.integer "tag_id" + t.integer "taggable_id" + t.string "taggable_type" + t.integer "tagger_id" + t.string "tagger_type" + t.string "context", :limit => 128 + t.datetime "created_at" + end + + add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" + add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" + + create_table "tags", :force => true do |t| + t.string "name" + end + + create_table "teachers", :force => true do |t| + t.string "tea_name" + t.string "location" + t.integer "couurse_time" + t.integer "course_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "extra" + end + + create_table "time_entries", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "issue_id" + t.float "hours", :null => false + t.string "comments" + t.integer "activity_id", :null => false + t.date "spent_on", :null => false + t.integer "tyear", :null => false + t.integer "tmonth", :null => false + t.integer "tweek", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" + add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" + add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" + add_index "time_entries", ["project_id"], :name => "time_entries_project_id" + add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" + + create_table "tokens", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "value", :limit => 40, :default => "", :null => false + t.datetime "created_on", :null => false + end + + add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" + add_index "tokens", ["value"], :name => "tokens_value", :unique => true + + create_table "trackers", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_in_chlog", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "is_in_roadmap", :default => true, :null => false + t.integer "fields_bits", :default => 0 + end + + create_table "user_activities", :force => true do |t| + t.string "act_type" + t.integer "act_id" + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + create_table "user_extensions", :force => true do |t| + t.integer "user_id", :null => false + t.date "birthday" + t.string "brief_introduction" + t.integer "gender" + t.string "location" + t.string "occupation" + t.integer "work_experience" + t.integer "zip_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "technical_title" + t.integer "identity" + t.string "student_id" + t.string "teacher_realname" + t.string "student_realname" + t.string "location_city" + t.integer "school_id" + t.string "description", :default => "" + end + + create_table "user_feedback_messages", :force => true do |t| + t.integer "user_id" + t.integer "journals_for_message_id" + t.string "journals_for_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_grades", :force => true do |t| + t.integer "user_id", :null => false + t.integer "project_id", :null => false + t.float "grade", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" + add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" + add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" + + create_table "user_levels", :force => true do |t| + t.integer "user_id" + t.integer "level" + end + + create_table "user_preferences", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.text "others" + t.boolean "hide_mail", :default => false + t.string "time_zone" + end + + add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" + + create_table "user_score_details", :force => true do |t| + t.integer "current_user_id" + t.integer "target_user_id" + t.string "score_type" + t.string "score_action" + t.integer "user_id" + t.integer "old_score" + t.integer "new_score" + t.integer "current_user_level" + t.integer "target_user_level" + t.integer "score_changeable_obj_id" + t.string "score_changeable_obj_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_scores", :force => true do |t| + t.integer "user_id", :null => false + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "active" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "grade", :default => 0.0 + end + + add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" + add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" + add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" + + create_table "user_wechats", :force => true do |t| + t.integer "subscribe" + t.string "openid" + t.string "nickname" + t.integer "sex" + t.string "language" + t.string "city" + t.string "province" + t.string "country" + t.string "headimgurl" + t.string "subscribe_time" + t.string "unionid" + t.string "remark" + t.integer "groupid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "users", :force => true do |t| + t.string "login", :default => "", :null => false + t.string "hashed_password", :limit => 40, :default => "", :null => false + t.string "firstname", :limit => 30, :default => "", :null => false + t.string "lastname", :default => "", :null => false + t.string "mail", :limit => 60, :default => "", :null => false + t.boolean "admin", :default => false, :null => false + t.integer "status", :default => 1, :null => false + t.datetime "last_login_on" + t.string "language", :limit => 5, :default => "" + t.integer "auth_source_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "type" + t.string "identity_url" + t.string "mail_notification", :default => "", :null => false + t.string "salt", :limit => 64 + t.integer "gid" + end + + add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" + add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" + add_index "users", ["type"], :name => "index_users_on_type" + + create_table "versions", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :default => "", :null => false + t.string "description", :default => "" + t.date "effective_date" + t.datetime "created_on" + t.datetime "updated_on" + t.string "wiki_page_title" + t.string "status", :default => "open" + t.string "sharing", :default => "none", :null => false + end + + add_index "versions", ["project_id"], :name => "versions_project_id" + add_index "versions", ["sharing"], :name => "index_versions_on_sharing" + + create_table "visitors", :force => true do |t| + t.integer "user_id" + t.integer "master_id" + t.datetime "updated_on" + t.datetime "created_on" + end + + add_index "visitors", ["master_id"], :name => "index_visitors_master_id" + add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" + add_index "visitors", ["user_id"], :name => "index_visitors_user_id" + + create_table "watchers", :force => true do |t| + t.string "watchable_type", :default => "", :null => false + t.integer "watchable_id", :default => 0, :null => false + t.integer "user_id" + end + + add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" + add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" + add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" + + create_table "web_footer_companies", :force => true do |t| + t.string "name" + t.string "logo_size" + t.string "url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "web_footer_oranizers", :force => true do |t| + t.string "name" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "wechat_logs", :force => true do |t| + t.string "openid", :null => false + t.text "request_raw" + t.text "response_raw" + t.text "session_raw" + t.datetime "created_at", :null => false + end + + create_table "wiki_content_versions", :force => true do |t| + t.integer "wiki_content_id", :null => false + t.integer "page_id", :null => false + t.integer "author_id" + t.binary "data", :limit => 2147483647 + t.string "compression", :limit => 6, :default => "" + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" + add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" + + create_table "wiki_contents", :force => true do |t| + t.integer "page_id", :null => false + t.integer "author_id" + t.text "text", :limit => 2147483647 + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" + add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" + + create_table "wiki_pages", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title", :null => false + t.datetime "created_on", :null => false + t.boolean "protected", :default => false, :null => false + t.integer "parent_id" + end + + add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" + add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" + add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" + + create_table "wiki_redirects", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title" + t.string "redirects_to" + t.datetime "created_on", :null => false + end + + add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" + add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" + + create_table "wikis", :force => true do |t| + t.integer "project_id", :null => false + t.string "start_page", :null => false + t.integer "status", :default => 1, :null => false + end + + add_index "wikis", ["project_id"], :name => "wikis_project_id" + + create_table "workflows", :force => true do |t| + t.integer "tracker_id", :default => 0, :null => false + t.integer "old_status_id", :default => 0, :null => false + t.integer "new_status_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + t.boolean "assignee", :default => false, :null => false + t.boolean "author", :default => false, :null => false + t.string "type", :limit => 30 + t.string "field_name", :limit => 30 + t.string "rule", :limit => 30 + end + + add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" + add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" + add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" + add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" + + create_table "works_categories", :force => true do |t| + t.string "category" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "zip_packs", :force => true do |t| + t.integer "user_id" + t.integer "homework_id" + t.string "file_digest" + t.string "file_path" + t.integer "pack_times", :default => 1 + t.integer "pack_size", :default => 0 + t.text "file_digests" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + +end From 63596c2ca542a86d780e72a37c9aed1ad2e2e78b Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 29 Jan 2016 21:14:44 +0800 Subject: [PATCH 142/215] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E4=B8=BAJournalsForMessage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/words/create_reply.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index d9e00a112..b4e28c894 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,7 +1,7 @@ <% if @save_succ %> <% if @user_activity_id %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>"); - init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity"); + init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "JournalsForMessage"); <% else %> <% if !@jfm.nil? && @jfm.jour_type == 'Principal' %> $("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>"); From eb9232a087583c021bcc58c189a455ac7a3e5800 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 29 Jan 2016 21:15:23 +0800 Subject: [PATCH 143/215] =?UTF-8?q?at=20controller=20=E7=9A=84json?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 783e7d323..d6470ce51 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -770,6 +770,7 @@ class ApplicationController < ActionController::Base end def api_request? + return false if params[:controller] == 'at' %w(xml json).include? params[:format] end From 71778ba94846058982514e8702b401843b6baed6 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 29 Jan 2016 22:09:16 +0800 Subject: [PATCH 144/215] =?UTF-8?q?=E6=8B=B7=E8=B4=9D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 6 ++++- app/helpers/avatar_helper.rb | 36 ++++++++++++++++++++++--- app/models/course_activity.rb | 2 +- app/views/courses/_copy_course.html.erb | 3 ++- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 97dacb178..36060d41c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -442,10 +442,14 @@ class CoursesController < ApplicationController @course = cs.create_course(params,User.current)[:course] if params[:copy_course] copy_course = Course.find params[:copy_course].to_i - @course.is_copy = 1 + @course.is_copy = params[:copy_course].to_i @course.open_student = copy_course.open_student @course.publish_resource = copy_course.publish_resource @course.save + + #copy avatar + copy_avatar(@course, copy_course) + if params[:checkAll] attachments = copy_course.attachments attachments.each do |attachment| diff --git a/app/helpers/avatar_helper.rb b/app/helpers/avatar_helper.rb index 3f6802f59..0291d177f 100644 --- a/app/helpers/avatar_helper.rb +++ b/app/helpers/avatar_helper.rb @@ -1,9 +1,24 @@ module AvatarHelper AVATAR_SIZE="50x50" + + def copy_avatar(des, src) + src_file = disk_filename(src.class,src.id) + des_file = disk_filename(des.class,des.id) + + FileUtils.cp(src_file, des_file) if File.exist?(src_file) + end - def avatar_image(source) - File.join(relative_path, avatar_directory(source.class), source.id.to_s) + def avatar_image(source, copyed=false) + source_type = source.class + source_id = source.id + + course = Course.find(source_id) rescue nil + if course && copyed + source_id = course.is_copy + end + + File.join(relative_path, avatar_directory(source_type), source_id.to_s) end def relative_path @@ -23,7 +38,18 @@ module AvatarHelper end def disk_filename(source_type,source_id,image_file=nil) - File.join(storage_path,avatar_directory(source_type),avatar_filename(source_id,image_file)) + File.join(storage_path,avatar_directory(source_type),avatar_filename(source_id,image_file)) + end + + def copy_course?(source_type, source_id) + file= disk_filename(source_type, source_id) + if source_type == Course && !File.exist?(file) + course = Course.find(source_id) rescue nil + if course && course.is_copy>0 + return true + end + end + false end def file_extension(filename=nil) @@ -35,7 +61,9 @@ module AvatarHelper return File.join(relative_path,'AnonymousUser','0') end if source.class && source.id && File.exist?(disk_filename(source.class,source.id)) - avatar_image(source) + avatar_image(source, false) + elsif copy_course?(source.class, source.id) + avatar_image(source, true) else File.join(relative_path,avatar_directory(source.class),'0') end diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index 194e1183a..c9c6cec4b 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -72,7 +72,7 @@ class CourseActivity < ActiveRecord::Base # message的status状态为0为正常,为1表示创建课程时发送的message message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 - message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) + message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) if message.course_acts.first end end end diff --git a/app/views/courses/_copy_course.html.erb b/app/views/courses/_copy_course.html.erb index a759946f6..c7547adcd 100644 --- a/app/views/courses/_copy_course.html.erb +++ b/app/views/courses/_copy_course.html.erb @@ -39,12 +39,13 @@
  • - <%= image_tag(url_to_avatar(@new_course), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%> + <%= image_tag(url_to_avatar(@course), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>
  • + From 8b9bcb4719b883cca76af9b9a7f356fa2c9cd2da Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 1 Feb 2016 10:04:07 +0800 Subject: [PATCH 145/215] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=A2=98=E5=BA=93?= =?UTF-8?q?=E7=9A=84=E6=90=9C=E7=B4=A2=E4=B8=8D=E8=B5=B7=E4=BD=9C=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 12f112345..9eabc95f2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -458,9 +458,9 @@ class UsersController < ApplicationController if(params[:type].blank? || params[:type] == "1") #全部 visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" - @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'} and (name like '%#{search}%')").order("created_at desc") + @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("created_at desc") elsif params[:type] == "2" #课程资源 - @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc") + @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("created_at desc") end @type = params[:type] @limit = 15 From 83a3c879d4b40b5858a8ce01ee0174a491761b65 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 1 Feb 2016 10:40:42 +0800 Subject: [PATCH 146/215] =?UTF-8?q?=E7=A7=81=E4=BF=A1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- public/images/hwork_icon.png | Bin 10436 -> 10537 bytes public/stylesheets/new_user.css | 2 ++ public/stylesheets/public.css | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3a0808bdd..9f516ae1a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -51,7 +51,7 @@ module ApplicationHelper def link_to_user_version(version, options = {}) return '' unless version && version.is_a?(Version) - link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue " + link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => "linkBlue" end # 判断课程是否为精品课程 diff --git a/public/images/hwork_icon.png b/public/images/hwork_icon.png index 8ae87460fd13f21c15c187d31792b29d6d0ae6dd..f531c3d4c4c2881b535f5eabf341d5c071102b70 100644 GIT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c1ee0c..bc7922194 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -693,6 +693,8 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;} .homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;} .homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} +.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} +.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;text-align:center;} a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyPortrait {float:left; width:33px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index be9d51799..a3135b78e 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -611,6 +611,8 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;} .homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;} .homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} +.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} +.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} /*a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}*/ /*a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;}*/ .homepagePostReplyPortrait {float:left; width:45px;} From 4d048ec5964cc13d746ba1a2af21f0247a6d1091 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 1 Feb 2016 11:12:04 +0800 Subject: [PATCH 147/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E7=9A=84=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E4=B8=BA0=E7=9A=84=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_recommendation.html.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb index 2b890ca5d..f26c5fd41 100644 --- a/app/views/courses/_recommendation.html.erb +++ b/app/views/courses/_recommendation.html.erb @@ -8,8 +8,13 @@

    <%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %>

    - <%= l(:project_module_attachments) %>(<%= link_to e_course.attachments.count, course_files_path(e_course), :class => "linkBlue2" %>) - <%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)

    + <% if e_course.attachments.count > 0 %> + <%= l(:project_module_attachments) %>(<%= link_to e_course.attachments.count, course_files_path(e_course), :class => "linkBlue2" %>) + <% end %> + <% if e_course.homework_commons.count > 0 %> + <%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>) + <% end %> +

  • From cdd997e45ef4ab1d7de64403de5d4eedf0a21603 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 1 Feb 2016 14:50:45 +0800 Subject: [PATCH 148/215] =?UTF-8?q?kindeditor=E5=9B=9E=E5=A4=8D=E6=A1=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 2 +- app/views/boards/_course_show_detail.html.erb | 20 ++++---- .../boards/_project_show_detail.html.erb | 20 ++++---- app/views/courses/_course_activity.html.erb | 48 ------------------- app/views/issues/index.html.erb | 18 +++---- app/views/news/_course_news_detail.html.erb | 20 ++++---- app/views/news/_project_news_detail.html.erb | 20 ++++---- .../org_document_comments/index.html.erb | 12 ----- app/views/org_document_comments/show.html.erb | 2 +- .../org_subfields/_show_post_type.html.erb | 13 ----- app/views/organizations/show.html.erb | 12 ----- app/views/users/_user_homework_list.html.erb | 12 ----- 12 files changed, 51 insertions(+), 148 deletions(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index e6d8be24e..856a122d3 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -1,6 +1,6 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false) %> - <%= javascript_include_tag "init_activity_KindEditor",'blog' %> + <%= javascript_include_tag "create_kindeditor",'blog' %> <% end %> <% course_activities.each do |activity| if course_activities %> \ No newline at end of file From 105393548bac00e33d238221f7525282c9b7eeae Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 2 Feb 2016 11:23:17 +0800 Subject: [PATCH 150/215] =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 441 ++++++++--------- app/views/courses/syllabus.html.erb | 451 +++++++++--------- app/views/memos/show.html.erb | 11 +- app/views/messages/_course_show.html.erb | 13 +- .../messages/_org_subfield_show.html.erb | 421 ++++++++-------- app/views/messages/_project_show.html.erb | 11 +- app/views/news/_course_show.html.erb | 11 +- app/views/news/_organization_show.html.erb | 367 +++++++------- app/views/news/_project_show.html.erb | 11 +- 9 files changed, 891 insertions(+), 846 deletions(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 4a407089f..51df656f0 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -1,218 +1,223 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false) %> - <%= javascript_include_tag "init_activity_KindEditor",'blog' %> -<% end %> - - - -
    -
    -
    - <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> -
    -
    - <% if @article.author.id == User.current.id%> - - <%end%> - -
    - -
    - <% if @article.try(:author).try(:realname) == ' ' %> - <%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% else %> - <%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% end %> -
    -
    <%= format_time( @article.created_on)%>
    -
    -
    - <%= @article.content.html_safe%> -
    -
    -
    - <%#= link_to_attachments_course @topic, :author => false %> - <% if @article.attachments.any?%> - <% options = {:author => true, :deletable => false} %> - <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => @article.attachments, :options => options, :is_float => true} %> - <% end %> -
    -
    -
    -
    -
    - <% count=0 %> - <% if @article.parent %> - <% count=@article.parent.children.count%> - <% else %> - <% count=@article.children.count%> - <% end %> -
    - <%# unless count == 0 %> -
    -
    回复 - <%= count>0 ? "(#{count})" : "" %> - - <% if @article.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%> - <% end %> - -
    -
    - -
    -
    - <%@article.children.reorder('created_on desc').each_with_index do |reply,i| %> - -
    -
    - <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> -
    -
    -
    - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% end %> -
    -
    - <%= reply.content.html_safe%> -
    -
    - <%= format_time(reply.created_on) %> - - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> - - -
    -

    -
    -
    -
    - <% end %> -
    - - <%# end %> -
    - <% if !@article.locked? && User.current.logged?%> -
    - -
    -
    - <%= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> - <%= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %> - <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> - <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %> - <% end %> -
    -
    -
    - <% end %> -
    -
    - +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false) %> + <%= javascript_include_tag "init_activity_KindEditor",'blog' %> +<% end %> + + + +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> +
    +
    + <% if @article.author.id == User.current.id%> + + <%end%> + +
    + +
    + <% if @article.try(:author).try(:realname) == ' ' %> + <%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
    +
    <%= format_time( @article.created_on)%>
    +
    +
    + <%= @article.content.html_safe%> +
    +
    +
    + <%#= link_to_attachments_course @topic, :author => false %> + <% if @article.attachments.any?%> + <% options = {:author => true, :deletable => false} %> + <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => @article.attachments, :options => options, :is_float => true} %> + <% end %> +
    +
    +
    +
    +
    + <% count=0 %> + <% if @article.parent %> + <% count=@article.parent.children.count%> + <% else %> + <% count=@article.children.count%> + <% end %> +
    + <%# unless count == 0 %> +
    +
    回复 + <%= count>0 ? "(#{count})" : "" %> + + <% if @article.author == User.current %> + + <% else %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%> + <% end %> + +
    +
    + +
    +
    + <%@article.children.reorder('created_on desc').each_with_index do |reply,i| %> + +
    +
    + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
    +
    +
    + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
    +
    + <%= reply.content.html_safe%> +
    +
    + <%= format_time(reply.created_on) %> + + <% if reply.author == User.current %> + + <% else %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> + <% end %> + + +
    +

    +
    +
    +
    + <% end %> +
    + + <%# end %> +
    + <% if !@article.locked? && User.current.logged?%> +
    + +
    +
    + <%= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> + <%= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %> + <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> + <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %> + <% end %> +
    +
    +
    + <% end %> +
    +
    + diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb index c9d333e6d..aedf62eaf 100644 --- a/app/views/courses/syllabus.html.erb +++ b/app/views/courses/syllabus.html.erb @@ -1,224 +1,229 @@ - -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> - <%= javascript_include_tag 'blog' %> -<% end %> - - - - -
    -
    -
    - <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> -
    -
    - <% if User.current && @article.author.id == User.current.id%> -
    -
      -
    • -
        -
      • - 重设大纲 -
      • -
      • - <%= link_to( - '取消大纲', - {:controller => 'blog_comments',:action => 'destroy',:user_id=>BlogComment.find(@course.outline).author_id,:blog_id=>BlogComment.find(@course.outline).blog_id, :id => @course.outline,:course_id=>@course.id}, - :method => :delete, - :data => {:confirm => '您确定要取消么?'}, - :class => 'postOptionLink' - ) if User.current && User.current.id == @article.author.id %> -
      • -
      -
    • -
    -
    - - - - - - - - - <%end%> - -
    - -
    - <% if @article.try(:author).try(:realname) == ' ' %> - <%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% else %> - <%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% end %> -
    -
    <%= format_time( @article.created_on)%>
    -
    -
    - <%= @article.content.html_safe%> -
    -
    -
    - <%#= link_to_attachments_course @topic, :author => false %> - <% if @article.attachments.any?%> - <% options = {:author => true, :deletable => false} %> - <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => @article.attachments, :options => options, :is_float => true} %> - <% end %> -
    -
    -
    -
    -
    - <% count=0 %> - <% if @article.parent %> - <% count=@article.parent.children.count%> - <% else %> - <% count=@article.children.count%> - <% end %> -
    - <% unless count == 0 %> -
    -
    回复(<%=count %>)
    -
    - -
    -
    - <%@article.children.reorder('created_on desc').each_with_index do |reply,i| %> - -
    -
    - <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> -
    -
    -
    - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% end %> -
    -
    - <%= reply.content.html_safe%> -
    -
    - <%= format_time(reply.created_on) %> - -
    -

    -
    -
    -
    - <% end %> -
    - - <% end %> -
    - <% if !@article.locked? && User.current.logged?%> - - - - - - - - - - - - - -
    -
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@article.author_id), :alt => "用户头像" %>
    -
    -
    - <%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%> - - - - - - -
    - -
    -

    - <% end%> -
    -
    -
    -
    -
    - <% end %> -
    -
    - + +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> +
    +
    + <% if User.current && @article.author.id == User.current.id%> +
    +
      +
    • +
        +
      • + 重设大纲 +
      • +
      • + <%= link_to( + '取消大纲', + {:controller => 'blog_comments',:action => 'destroy',:user_id=>BlogComment.find(@course.outline).author_id,:blog_id=>BlogComment.find(@course.outline).blog_id, :id => @course.outline,:course_id=>@course.id}, + :method => :delete, + :data => {:confirm => '您确定要取消么?'}, + :class => 'postOptionLink' + ) if User.current && User.current.id == @article.author.id %> +
      • +
      +
    • +
    +
    + + + + + + + + + <%end%> + +
    + +
    + <% if @article.try(:author).try(:realname) == ' ' %> + <%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
    +
    <%= format_time( @article.created_on)%>
    +
    +
    + <%= @article.content.html_safe%> +
    +
    +
    + <%#= link_to_attachments_course @topic, :author => false %> + <% if @article.attachments.any?%> + <% options = {:author => true, :deletable => false} %> + <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => @article.attachments, :options => options, :is_float => true} %> + <% end %> +
    +
    +
    +
    +
    + <% count=0 %> + <% if @article.parent %> + <% count=@article.parent.children.count%> + <% else %> + <% count=@article.children.count%> + <% end %> +
    + <% unless count == 0 %> +
    +
    回复(<%=count %>)
    +
    + +
    +
    + <%@article.children.reorder('created_on desc').each_with_index do |reply,i| %> + +
    +
    + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
    +
    +
    + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
    +
    + <%= reply.content.html_safe%> +
    +
    + <%= format_time(reply.created_on) %> + +
    +

    +
    +
    +
    + <% end %> +
    + + <% end %> +
    + <% if !@article.locked? && User.current.logged?%> + + + + + + + + + + + + + +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@article.author_id), :alt => "用户头像" %>
    +
    +
    + <%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%> + + + + + + +
    + +
    +

    + <% end%> +
    +
    +
    +
    +
    + <% end %> +
    +
    + \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 3028f3369..f5b171d8b 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -139,8 +139,13 @@
    \ No newline at end of file diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 022b8c76b..57a75dde6 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -171,8 +171,13 @@
    + diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index fab0f752e..7cc60abf9 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -1,208 +1,213 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> -<% end %> - - - - -
    -
    -
    - <%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %> -
    -
    - <% if User.current.logged? %> - - <%end%> - -
    - -
    - <% if @topic.try(:author).try(:realname) == ' ' %> - <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% else %> - <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% end %> -
    -
    <%= format_time( @topic.created_on)%>
    -
    -
    - <%= @topic.content.html_safe%> -
    -
    -
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %> -
    -
    -
    -
    -
    -
    - <% unless @replies.empty? %> -
    -
    回复(<%=@reply_count %>)
    -
    - -
    -
    - <% @replies.each_with_index do |reply,i| %> - -
    -
    - <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> -
    -
    -
    - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% end %> -
    -
    - <%= reply.content.html_safe%> -
    -
    - <%= format_time(reply.created_on) %> - -
    -

    -
    -
    -
    - <% end %> -
    - - <% end %> -
    - <% if !@topic.locked? && authorize_for_course('messages', 'reply') %> -
    - -
    -
    - <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %> - <%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %> - <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %> - <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %> - <% end %> -
    -
    -
    - <% end %> -
    -
    - +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> +<% end %> + + + + +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %> +
    +
    + <% if User.current.logged? %> + + <%end%> + +
    + +
    + <% if @topic.try(:author).try(:realname) == ' ' %> + <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
    +
    <%= format_time( @topic.created_on)%>
    +
    +
    + <%= @topic.content.html_safe%> +
    +
    +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %> +
    +
    +
    +
    +
    +
    + <% unless @replies.empty? %> +
    +
    回复(<%=@reply_count %>)
    +
    + +
    +
    + <% @replies.each_with_index do |reply,i| %> + +
    +
    + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
    +
    +
    + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
    +
    + <%= reply.content.html_safe%> +
    +
    + <%= format_time(reply.created_on) %> + +
    +

    +
    +
    +
    + <% end %> +
    + + <% end %> +
    + <% if !@topic.locked? && authorize_for_course('messages', 'reply') %> +
    + +
    +
    + <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %> + <%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %> + <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %> + <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %> + <% end %> +
    +
    +
    + <% end %> +
    +
    + diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index a0e9db171..988902b81 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -227,8 +227,13 @@
    diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 05a430d57..3236aa6a0 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -184,8 +184,13 @@
    diff --git a/app/views/news/_organization_show.html.erb b/app/views/news/_organization_show.html.erb index 3189b03bf..0a7770ac0 100644 --- a/app/views/news/_organization_show.html.erb +++ b/app/views/news/_organization_show.html.erb @@ -1,181 +1,186 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> -<% end %> - - - - -
    -
    -
    - <%= link_to image_tag(url_to_avatar(@news.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@news.author) %> -
    -
    - <% if User.current.logged? %> - - <%end%> - -
    - -
    - <% if @news.try(:author).try(:realname) == ' ' %> - <%= link_to @news.try(:author), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% else %> - <%= link_to @news.try(:author).try(:realname), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> - <% end %> -
    -
    <%= format_time( @news.created_on)%>
    -
    -
    - <%= @news.description.html_safe%> -
    -
    -
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @news} %> -
    -
    -
    -
    -
    -
    - <% unless @comments.empty? %> -
    -
    回复(<%=@comments.count %>)
    -
    -
    -
    - <% @comments.each_with_index do |reply,i| %> - -
    -
    - <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> -
    -
    -
    - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% end %> -
    -
    - <%= reply.comments.html_safe%> -
    -
    - <%= format_time(reply.created_on) %> - -
    -

    -
    -
    -
    - <% end %> -
    - - <% end %> -
    - <% if @news.commentable? %> -
    - -
    -
    - <%= form_for @comment, :url=>{:controller => 'comments', :action => 'create', :id => @news}, :html => {:multipart => true, :id => 'add_comment_form'} do |f| %> -
    - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor :comments, :editor_id => 'comment_editor', - :owner_id => @comment.nil? ? 0: @comment.id, - :owner_type => OwnerTypeHelper::COMMENT, - :width => '99%', - :height => 100, - :minHeight=>100, - :input_html => { :id => 'comment_content', - :class => 'talk_text fl', - :maxlength => 5000 }%> -
    -

    -

    - - <%= l(:label_cancel_with_space) %> - - - <%= l(:label_comment_with_space) %> - -

    - <% end %> -
    -
    -
    - <% end %> -
    -
    - +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> +<% end %> + + + + +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@news.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@news.author) %> +
    +
    + <% if User.current.logged? %> + + <%end%> + +
    + +
    + <% if @news.try(:author).try(:realname) == ' ' %> + <%= link_to @news.try(:author), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @news.try(:author).try(:realname), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
    +
    <%= format_time( @news.created_on)%>
    +
    +
    + <%= @news.description.html_safe%> +
    +
    +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @news} %> +
    +
    +
    +
    +
    +
    + <% unless @comments.empty? %> +
    +
    回复(<%=@comments.count %>)
    +
    +
    +
    + <% @comments.each_with_index do |reply,i| %> + +
    +
    + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
    +
    +
    + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
    +
    + <%= reply.comments.html_safe%> +
    +
    + <%= format_time(reply.created_on) %> + +
    +

    +
    +
    +
    + <% end %> +
    + + <% end %> +
    + <% if @news.commentable? %> +
    + +
    +
    + <%= form_for @comment, :url=>{:controller => 'comments', :action => 'create', :id => @news}, :html => {:multipart => true, :id => 'add_comment_form'} do |f| %> +
    + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= f.kindeditor :comments, :editor_id => 'comment_editor', + :owner_id => @comment.nil? ? 0: @comment.id, + :owner_type => OwnerTypeHelper::COMMENT, + :width => '99%', + :height => 100, + :minHeight=>100, + :input_html => { :id => 'comment_content', + :class => 'talk_text fl', + :maxlength => 5000 }%> +
    +

    +

    + + <%= l(:label_cancel_with_space) %> + + + <%= l(:label_comment_with_space) %> + +

    + <% end %> +
    +
    +
    + <% end %> +
    +
    + diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 144b93b28..74378e3fd 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -184,8 +184,13 @@
    From d6e248805f6176c5067cf9c0d9cf3e7ec17b9a73 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 11:37:48 +0800 Subject: [PATCH 151/215] =?UTF-8?q?changeset=5Fnum=20nil=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9f516ae1a..d15d350e6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -67,7 +67,7 @@ module ApplicationHelper # 获取项目/课程总分 # 发布缺陷 4分 回复缺陷 1分 提交一次 4分 讨论帖子 2分 回复帖子 1分 发布新闻 1分 def static_project_score obj - score = obj.issue_num * 4 + obj.issue_journal_num + obj.changeset_num * 4 + obj.board_num * 2 + obj.board_message_num + obj.news_num + obj.attach_num * 5 + score = obj.issue_num * 4 + obj.issue_journal_num + (obj.changeset_num||0) * 4 + obj.board_num * 2 + obj.board_message_num + obj.news_num + obj.attach_num * 5 end # 获取组织成员中文名字 From f3a0e71ceeb5e5e73dd855391e36943812641f72 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 11:38:04 +0800 Subject: [PATCH 152/215] =?UTF-8?q?issue=E4=B8=AD=E5=9B=9E=E5=A4=8Dat?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=8D=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/add_journal.js.erb | 4 ++-- app/views/issues/add_reply.js.erb | 2 +- app/views/issues/delete_journal.js.erb | 2 +- app/views/issues/reply.js.erb | 2 +- app/views/issues/update.js.erb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index 9099c31b6..48a9b012e 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -2,7 +2,7 @@ $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); $("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>"); $("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>') - sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); + sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%=@issue.class.name%>"); issue_desc_editor = KindEditor.create('#issue_description', {"width":"85%", "resizeType":0, @@ -18,7 +18,7 @@ "fileManagerJson":"/kindeditor/filemanager"}); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') - sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); + sd_create_editor_from_data(<%= @issue.id %>, null, "100%","<%=@issue.class.name%>"); <%else%> $("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); diff --git a/app/views/issues/add_reply.js.erb b/app/views/issues/add_reply.js.erb index 0ee9d30e7..500451781 100644 --- a/app/views/issues/add_reply.js.erb +++ b/app/views/issues/add_reply.js.erb @@ -1,3 +1,3 @@ $("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)') -sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); \ No newline at end of file +sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>"); \ No newline at end of file diff --git a/app/views/issues/delete_journal.js.erb b/app/views/issues/delete_journal.js.erb index 63a1a5f96..7c7f25c1c 100644 --- a/app/views/issues/delete_journal.js.erb +++ b/app/views/issues/delete_journal.js.erb @@ -1,3 +1,3 @@ $("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); $(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)') -sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); \ No newline at end of file +sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>"); \ No newline at end of file diff --git a/app/views/issues/reply.js.erb b/app/views/issues/reply.js.erb index 316c078f2..2d42475f6 100644 --- a/app/views/issues/reply.js.erb +++ b/app/views/issues/reply.js.erb @@ -2,7 +2,7 @@ if($("#reply_message_<%= @jour.id%>").length > 0) { $("#reply_message_<%= @jour.id%>").replaceWith("<%= escape_javascript(render :partial => 'issues/issue_reply_ke_form') %>"); $(function(){ $('input[name=quote]').val("<%= raw escape_javascript(@tempContent.html_safe) %>"); - sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); + sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%= @issue.class.name %>"); }); }else if($("#reply_to_message_<%= @issue.id%>").length >0) { $("#reply_to_message_<%= @issue.id%>").replaceWith("

    "); diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index ede4a0534..16ca863e4 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -5,7 +5,7 @@ $("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/e $("#issue_detail").show(); $("#issue_edit").hide(); $("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); -sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); +sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>"); $(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)') //edit里的编辑器貌似显示不出来,所以手动js生成。 issue_desc_editor = KindEditor.create('#issue_description', From 28035dfc47ed9a6742923b0403ed294f90fdc909 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 12:40:00 +0800 Subject: [PATCH 153/215] =?UTF-8?q?=E5=AD=90=E5=9F=9F=E5=90=8D=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../initializers/elasticsearch_dev_patch.rb | 4 +-- config/initializers/subdomain.rb | 27 ++++++++++++++++--- config/routes.rb | 18 ++++++------- db/schema.rb | 11 +++++++- 4 files changed, 45 insertions(+), 15 deletions(-) diff --git a/config/initializers/elasticsearch_dev_patch.rb b/config/initializers/elasticsearch_dev_patch.rb index 4eda95ee5..ac9b800ba 100644 --- a/config/initializers/elasticsearch_dev_patch.rb +++ b/config/initializers/elasticsearch_dev_patch.rb @@ -10,7 +10,7 @@ if Rails.env.development? class NoObject instance_methods.each do |m| - undef_method(m) unless [:undef_method, :method_missing].include?(m) + undef_method(m) unless [:object_id, :__send__, :undef_method, :method_missing].include?(m) end def method_missing(method, *args, &block) @@ -50,4 +50,4 @@ if Rails.env.development? end end -end \ No newline at end of file +end diff --git a/config/initializers/subdomain.rb b/config/initializers/subdomain.rb index b868e7e0b..474503339 100644 --- a/config/initializers/subdomain.rb +++ b/config/initializers/subdomain.rb @@ -1,9 +1,30 @@ class Subdomain + def initialize(opt={}) + @opt = {}.merge(opt) + end + def matches?(request) - o = Organization.where(domain: request.subdomain).first - request.path_parameters[:id] = o.id if o - !o.nil? + puts request.path_parameters + o = Secdomain.where(subname: request.subdomain).first + + if(@opt[:sub]) + if o && o.sub_type == 2 && request.path_parameters[:sub_dir_name] == 'news' + request.path_parameters[:id] = o.pid + request.path_parameters[:controller] = 'org_subfields' + request.path_parameters[:action] = 'show' + return true + end + end + + + if o && o.controller + request.path_parameters[:id] = o.pid + request.path_parameters[:controller] = o.controller + request.path_parameters[:action] = o.action + return true + end + false end end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 550642120..f4d8daf4f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -31,6 +31,15 @@ RedmineApp::Application.routes.draw do # Enable Grack support # mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] + constraints(Subdomain.new) do + get '/', to: 'organizations#show' + end + + constraints(Subdomain.new(sub: true)) do + get '/:sub_dir_name', to: 'fake#fake' + end + + resources :shield_activities do collection do delete 'show_acts' @@ -75,16 +84,7 @@ RedmineApp::Application.routes.draw do end - constraints(Subdomain.new) do - get '/', to: 'organizations#show' - end - get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'} - get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'} - get '/', to: 'organizations#show', defaults: { id: 1 }, constraints: {subdomain: 'team'} - get '/', to: 'users#show', defaults: {id: 7}, constraints: {subdomain: 'whm'} - get '/', to: 'users#show', defaults: {id: 5}, constraints: {subdomain: 'yg'} - get '/', to: 'users#show', defaults: {id:11}, constraints: {subdomain: 'wt'} resources :org_member do member do diff --git a/db/schema.rb b/db/schema.rb index 2e5bfde22..7b68815a8 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160128024452) do +ActiveRecord::Schema.define(:version => 20160202034530) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1534,6 +1534,15 @@ ActiveRecord::Schema.define(:version => 20160128024452) do t.string "pinyin" end + create_table "secdomains", :force => true do |t| + t.integer "sub_type" + t.string "subname" + t.integer "pid", :default => 0 + t.string "desc" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "seems_rateable_cached_ratings", :force => true do |t| t.integer "cacheable_id", :limit => 8 t.string "cacheable_type" From dab99eb044f06ce78db5d809228706ae5a65209a Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 2 Feb 2016 13:38:37 +0800 Subject: [PATCH 154/215] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=A1=86=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index e59c8359d..3d52206a4 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -3,19 +3,6 @@ <%= javascript_include_tag 'forum' %> <% end %> - - \ No newline at end of file diff --git a/app/views/users/user_import_homeworks.js.erb b/app/views/users/user_import_homeworks.js.erb index 3be46e119..ac6665800 100644 --- a/app/views/users/user_import_homeworks.js.erb +++ b/app/views/users/user_import_homeworks.js.erb @@ -1,4 +1,6 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_homeworks') %>'); showModal('ajax-modal', '1040px'); $('#ajax-modal').siblings().remove(); -$('#ajax-modal').parent().css("top","20%").css("left","25%").css("position","fixed").css("border","3px solid #269ac9"); \ No newline at end of file +var mTop = ($(window).height()-646)/2; +var mLeft = ($(window).width()-1054)/2; +$('#ajax-modal').parent().css("border","3px solid #269ac9").css("top","mTop").css("left","mLeft").css("position","fixed"); \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 32370c4a7..8951e8c1f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1374,7 +1374,6 @@ ActiveRecord::Schema.define(:version => 20160128024452) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 - t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 t.datetime "commit_time" end @@ -1863,25 +1862,6 @@ ActiveRecord::Schema.define(:version => 20160128024452) do add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "users", :force => true do |t| t.string "login", :default => "", :null => false t.string "hashed_password", :limit => 40, :default => "", :null => false @@ -1957,14 +1937,6 @@ ActiveRecord::Schema.define(:version => 20160128024452) do t.datetime "updated_at", :null => false end - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - create_table "wiki_content_versions", :force => true do |t| t.integer "wiki_content_id", :null => false t.integer "page_id", :null => false From ea8e73ad54931382763141976d0eb1696839bf7c Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 2 Feb 2016 15:47:12 +0800 Subject: [PATCH 156/215] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E7=9A=84=E6=8B=96?= =?UTF-8?q?=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_user_homeworks.html.erb | 2 +- app/views/users/user_import_homeworks.js.erb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/users/_show_user_homeworks.html.erb b/app/views/users/_show_user_homeworks.html.erb index 9f90a633f..d2b3f286d 100644 --- a/app/views/users/_show_user_homeworks.html.erb +++ b/app/views/users/_show_user_homeworks.html.erb @@ -1,4 +1,4 @@ -
    +
    选用题库中的题目
    公共题库 diff --git a/app/views/users/user_import_homeworks.js.erb b/app/views/users/user_import_homeworks.js.erb index 3be46e119..d1cb29faa 100644 --- a/app/views/users/user_import_homeworks.js.erb +++ b/app/views/users/user_import_homeworks.js.erb @@ -1,4 +1,5 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_homeworks') %>'); showModal('ajax-modal', '1040px'); $('#ajax-modal').siblings().remove(); -$('#ajax-modal').parent().css("top","20%").css("left","25%").css("position","fixed").css("border","3px solid #269ac9"); \ No newline at end of file +$('#ajax-modal').parent().css("top","20%").css("left","25%").css("position","fixed").css("border","3px solid #269ac9"); +$('#ajax-modal').css("margin","15px"); From d42f144f23be556cf9c9f7851143d70ca13af05b Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 2 Feb 2016 15:50:28 +0800 Subject: [PATCH 157/215] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E3=80=81=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=B8=96=E5=AD=90=E6=8F=8F=E8=BF=B0=E6=A1=86=E7=9A=84?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A2=9E=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/edit.html.erb | 8 +- app/views/homework_common/index.html.erb | 8 +- app/views/org_document_comments/edit.html.erb | 22 +-- app/views/org_document_comments/new.html.erb | 25 ++-- app/views/users/_user_homework_form.html.erb | 128 ++++++++++++++++- app/views/users/user_homeworks.html.erb | 8 +- public/javascripts/des_kindEditor.js | 136 ++++++++++++++++++ 7 files changed, 303 insertions(+), 32 deletions(-) create mode 100644 public/javascripts/des_kindEditor.js diff --git a/app/views/homework_common/edit.html.erb b/app/views/homework_common/edit.html.erb index ac772171d..f95739f26 100644 --- a/app/views/homework_common/edit.html.erb +++ b/app/views/homework_common/edit.html.erb @@ -5,7 +5,11 @@ $("#homework_end_time").val(""); $("#course_id").val($("#option_select").val()); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new })%>"); - homework_description_editor.html(""); + //homework_description_editor.html(""); + $("#homework_name_span").text(""); + $("#homework_end_time_span").text(""); + $("#homework_end_time_span").text(""); + $("#homework_course_id_span").text(""); $("#homework_editor").toggle(); } function cancel_edit(){ @@ -26,7 +30,7 @@
    -
    +
    <%= form_for @homework do |f| %> diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 5c91a37fc..ac4ac9853 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -6,7 +6,11 @@ document.getElementById("anonymous_comment").checked = true; $("#course_id").val($("#option_select").val()); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>"); - homework_description_editor.html(""); + //homework_description_editor.html(""); + $("#homework_name_span").text(""); + $("#homework_end_time_span").text(""); + $("#homework_end_time_span").text(""); + $("#homework_course_id_span").text(""); $("#homework_editor").toggle(); } @@ -44,7 +48,7 @@ <% if @is_teacher%> -
    +
    <%= labelled_form_for @new_homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
    <%= render :partial => 'users/user_homework_form', :locals => { :homework => @new_homework,:f => f,:edit_mode => false,:select_course => false } %> diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index 1b807220d..b17ae0e75 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -1,9 +1,13 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> + <%= javascript_include_tag "des_KindEditor" %> <% end %> -<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %> -
    -
    +
    + <%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %> +
    -
    -
    +
    +
    +
    - <%= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %> + + <%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>

    @@ -49,12 +55,11 @@
    - 确定 + 确定 - 取消 + 取消
    -
    + <% end %>
    -<% end %> \ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index cc7e4bb8e..7a5bd8f27 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -23,6 +23,119 @@ $("#anonymous_comment").val(0); } } + function nh_reset_homework_form(params){ + if(params.textarea.html() != "") { + cancel_edit(); + } else { + params.form[0].reset(); + params.textarea.empty(); + if(params.editor != undefined){ + params.editor.html(params.textarea.html()); + } + } + } + function init_homework_form(params){ + params.form.submit(function(){ + var flag = false; + if(params.form.attr('data-remote') != undefined ){ + flag = true + } + var is_checked = false; + checked_val(); + if(!regex_homework_name()){ + $("#homework_name").focus(); + } + else if(!regex_homework_end_time()){ + $("#homework_end_time").focus(); + } + else if(!regex_homework_end_publish_time()){ + $("#homework_end_time").focus(); + } + else if(!regex_course_id()){ + $("#course_id").focus(); + } + else{ + params.textarea.html(params.editor.html()); + params.editor.sync(); + is_checked = true; + } + /*var is_checked = nh_check_field({ + issubmit:true, + content:params.editor, + contentmsg:params.contentmsg, + textarea:params.textarea + });*/ + if(is_checked){ + if(flag){ + return true; + }else{ + $(this)[0].submit(); + return false; + } + } + return false; + }); + } + function init_homework_editor(params){ + params.textarea.removeAttr('placeholder'); + var editor = params.kindutil.create(params.textarea, { + resizeType : 1,minWidth:"1px",width:"100%",minHeight:"30px",height:"30px", + items : ['code','emoticons','fontname', + 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', + 'formatblock', 'fontsize', '|','indent', 'outdent', + '|','imagedirectupload','table', 'media', 'preview',"more" + ], + afterChange:function(){//按键事件 + var edit = this.edit; + var body = edit.doc.body; + //paramsHeight = params.kindutil.removeUnit(this.height); + edit.iframe.height(150); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150)); + }, + afterCreate:function(){ + //init + var edit = this.edit; + var body = edit.doc.body; + edit.iframe[0].scroll = 'no'; + body.style.overflowY = 'hidden'; + //reset height + var edit = this.edit; + var body = edit.doc.body; + edit.html(params.textarea.innerHTML); + //paramsHeight = params.kindutil.removeUnit(this.height); + edit.iframe.height(150); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150)); + + } + }).loadPlugin('paste'); + return editor; + } + KindEditor.ready(function(K){ + $("div[nhname='homework_common_form']").each(function(){ + var params = {}; + params.kindutil = K; + params.div_form = $(this); + params.form = $("form",params.div_form); + if(params.form==undefined || params.form.length==0){ + return; + } + params.textarea = $("textarea[nhname='homework_textarea']",params.div_form); + params.cancel_btn = $("#new_message_cancel_btn"); + params.submit_btn = $("#new_message_submit_btn"); + if(params.textarea.data('init') == undefined) { + params.editor = init_homework_editor(params); + init_homework_form(params); + params.submit_btn.click(function () { + params.form.submit(); + }); + params.cancel_btn.click(function () { + reset_homework(); + nh_reset_homework_form(params); + }); + params.textarea.data('init', 1); + } + }); + }); <% end %> @@ -70,10 +183,12 @@
    <% if edit_mode %> - <%= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px", :owner_id => homework.id, :owner_type => OwnerTypeHelper::HOMEWORKCOMMON, at_id: homework.id, at_type: homework.class.to_s %> + + <%#= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px", :owner_id => homework.id, :owner_type => OwnerTypeHelper::HOMEWORKCOMMON, at_id: homework.id, at_type: homework.class.to_s %> <% else %> <%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %> - <%= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px",at_id: homework.id, at_type: homework.class.to_s %> + + <%#= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px",at_id: homework.id, at_type: homework.class.to_s %> <% end %>
    @@ -89,17 +204,16 @@ <%= render :partial => 'users/user_homework_attachment', :locals => {:container => homework, :has_program=>!(edit_mode && homework.homework_type != 2), :has_group=>(!(edit_mode && homework.homework_type != 3))&& homework.student_works.empty?,:show_member => true} %>
    -
    <% if edit_mode %> - 确定 + 确定 <%#= link_to "取消",user_homeworks_user_path(User.current.id),:class => "fr mr10 mt3"%> - 取消 + 取消 <% else %> - 发送 + 发送 - 取消 + 取消 <% end %>
    diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 7be803720..d0adb291f 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -5,7 +5,11 @@ $("#homework_end_time").val(""); $("#course_id").val($("#option_select").val()); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true })%>"); - homework_description_editor.html(""); + //homework_description_editor.html(""); + $("#homework_name_span").text(""); + $("#homework_end_time_span").text(""); + $("#homework_end_time_span").text(""); + $("#homework_course_id_span").text(""); $("#homework_editor").toggle(); } @@ -29,7 +33,7 @@ <% if @is_teacher%> -
    +
    <% homework = HomeworkCommon.new %> <% homework.homework_detail_manual = HomeworkDetailManual.new%> <%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %> diff --git a/public/javascripts/des_kindEditor.js b/public/javascripts/des_kindEditor.js new file mode 100644 index 000000000..1b952672a --- /dev/null +++ b/public/javascripts/des_kindEditor.js @@ -0,0 +1,136 @@ +function init_des_editor(params){ + // var minHeight; //最小高度 + var paramsHeight = params.height; //设定的高度 + var paramsWidth = params.width == undefined ? "100%" : params.width; + + var editor = params.kindutil.create(params.textarea, { + resizeType : 1,minWidth:"1px",width:paramsWidth, + height:"30px",// paramsHeight == undefined ? "30px":paramsHeight+"px", + minHeight:"30px",// paramsHeight == undefined ? "30px":paramsHeight+"px", + items : ['code','emoticons','fontname', + 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', + 'formatblock', 'fontsize', '|','indent', 'outdent', + '|','imagedirectupload','table', 'media', 'preview',"more" + ], + afterChange:function(){//按键事件 + //nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); + var edit = this.edit; + var body = edit.doc.body; + edit.iframe.height(paramsHeight); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, paramsHeight)); + }, + afterCreate:function(){ + //init + var edit = this.edit; + var body = edit.doc.body; + edit.iframe[0].scroll = 'no'; + body.style.overflowY = 'hidden'; + //reset height + var edit = this.edit; + edit.html(params.textarea.innerHTML); + var body = edit.doc.body; + paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; + edit.iframe.height(paramsHeight); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight), paramsHeight)); + + } + }).loadPlugin('paste'); + return editor; +} + +function nh_check_field(params){ + var result=true; + if(!check_org_title()) { + result=false; + return result; + } + if(params.content!=undefined){ + if(params.content.isEmpty()){ + result=false; + } + if(params.content.html()!=params.textarea.html() || params.issubmit==true){ + params.textarea.html(params.content.html()); + params.content.sync(); + + if(params.content.isEmpty()){ + params.contentmsg.html('内容不能为空'); + params.contentmsg.css({color:'#ff0000'}); + }else{ + params.contentmsg.html('填写正确'); + params.contentmsg.css({color:'#008000'}); + } + } + } + return result; +} +function init_form(params){ + params.form.submit(function(){ + var flag = false; + if(params.form.attr('data-remote') != undefined ){ + flag = true + } + var is_checked = nh_check_field({ + issubmit:true, + //title:params.texttitle, + content:params.editor, + //titlemsg:params.titlemsg, + contentmsg:params.contentmsg, + textarea:params.textarea + }); + if(is_checked){ + if(flag){ + return true; + }else{ + $(this)[0].submit(); + return false; + } + } + return false; + }); +} +function nh_reset_form(params){ + params.form[0].reset(); + params.texttitle.empty(); + params.textarea.empty(); + if(params.editor != undefined){ + params.editor.html(params.textarea.html()); + } + params.contentmsg.hide(); + params.titlemsg.html(""); +} +//第二个参数是高度,可以传,可以不传 +function init_des_data(){ + var height = arguments[0] ? arguments[0] : undefined; + var width = arguments[1] ? arguments[1] : undefined; + KindEditor.ready(function (K) { + $("div[nhname='new_topic_form']").each(function () { + var params = {}; + params.kindutil = K; + params.div_form = $(this); + params.form = $("form", params.div_form); + if (params.form == undefined || params.form.length == 0) { + return; + } + //params.texttitle = $("#document_title", params.div_form); + params.textarea = $("textarea[nhname='description_textarea']", params.div_form); + //params.titlemsg = $("#doc_title_hint", params.div_form); + params.contentmsg = $("#homework_course_id_span", params.div_form); + params.cancel_btn = $("#new_topic_cancel_btn"); + params.submit_btn = $("#new_topic_submit_btn"); + params.height = height; + params.width = width; + if (params.textarea.data('init') == undefined) { + params.editor = init_des_editor(params); + init_form(params); + params.cancel_btn.click(function () { + nh_reset_form(params); + }); + params.submit_btn.click(function () { + params.form.submit(); + }); + params.textarea.data('init', 1); + $(this).show(); + } + }); + }); +} \ No newline at end of file From ed2a3c976d8a6d122222f287407d8e3e4d23b3dd Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 16:25:26 +0800 Subject: [PATCH 158/215] =?UTF-8?q?=E6=89=A7=E8=A1=8Ctask=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E4=BB=A3=E5=85=A5=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/elasticsearch_batch_op.rake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tasks/elasticsearch_batch_op.rake b/lib/tasks/elasticsearch_batch_op.rake index 91c2ddff9..034887373 100644 --- a/lib/tasks/elasticsearch_batch_op.rake +++ b/lib/tasks/elasticsearch_batch_op.rake @@ -1,12 +1,12 @@ namespace :importer do - task :importuser do + task :importuser => :environment do ENV['CLASS']='User' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importproject do + task :importproject => :environment do ENV['CLASS']='Project' ENV['SCOPE']='indexable' @@ -14,21 +14,21 @@ namespace :importer do ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importcourse do + task :importcourse => :environment do ENV['CLASS']='Course' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importattachment do + task :importattachment => :environment do ENV['CLASS']='Attachment' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importmemo do + task :importmemo => :environment do ENV['CLASS']='Memo' ENV['SCOPE']='indexable' ENV['FORCE']='y' From 609d98f8a3dbafd37f106c2b9e816f143dfb763f Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 16:33:08 +0800 Subject: [PATCH 159/215] =?UTF-8?q?=E6=89=A7=E8=A1=8Ctask=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E4=BB=A3=E5=85=A5=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/elasticsearch_batch_op.rake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/tasks/elasticsearch_batch_op.rake b/lib/tasks/elasticsearch_batch_op.rake index 034887373..4be382367 100644 --- a/lib/tasks/elasticsearch_batch_op.rake +++ b/lib/tasks/elasticsearch_batch_op.rake @@ -1,4 +1,11 @@ namespace :importer do + task :import_all => :environment do + Rake::Task["importer:importuser"].execute + Rake::Task["importer:importproject"].execute + Rake::Task["importer:importcourse"].execute + Rake::Task["importer:importattachment"].execute + Rake::Task["importer:importmemo"].execute + end task :importuser => :environment do ENV['CLASS']='User' ENV['SCOPE']='indexable' From eed62501451aca017d8513a7b5051ed2a975f991 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 17:36:11 +0800 Subject: [PATCH 160/215] =?UTF-8?q?secdomain=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/subdomain.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/subdomain.rb b/config/initializers/subdomain.rb index 474503339..f813a24a0 100644 --- a/config/initializers/subdomain.rb +++ b/config/initializers/subdomain.rb @@ -6,7 +6,7 @@ class Subdomain def matches?(request) puts request.path_parameters - o = Secdomain.where(subname: request.subdomain).first + o = ::Secdomain.where(subname: request.subdomain).first if(@opt[:sub]) if o && o.sub_type == 2 && request.path_parameters[:sub_dir_name] == 'news' From 7f8f3fa15230cba9e9b6250ead642dfbe2710833 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 18:47:53 +0800 Subject: [PATCH 161/215] =?UTF-8?q?=E8=A2=ABrubymine=E5=9D=91=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E4=B8=A4=E4=B8=AA=E6=96=87=E4=BB=B6=E6=B2=A1?= =?UTF-8?q?=E5=8A=A0=E8=BF=9B=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/secdomain.rb | 18 ++++++++++++ .../20160202034530_create_secdomains.rb | 28 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 app/models/secdomain.rb create mode 100644 db/migrate/20160202034530_create_secdomains.rb diff --git a/app/models/secdomain.rb b/app/models/secdomain.rb new file mode 100644 index 000000000..4d0abe5db --- /dev/null +++ b/app/models/secdomain.rb @@ -0,0 +1,18 @@ +class Secdomain < ActiveRecord::Base + attr_accessible :pid, :subname, :sub_type, :desc + + validates_presence_of :subname, :sub_type + validates_uniqueness_of :subname + + def controller + return 'organizations' if sub_type == 2 + return 'users' if sub_type == 3 + nil + end + + def action + return 'show' if sub_type == 2 + return 'show' if sub_type == 3 + nil + end +end diff --git a/db/migrate/20160202034530_create_secdomains.rb b/db/migrate/20160202034530_create_secdomains.rb new file mode 100644 index 000000000..49650d073 --- /dev/null +++ b/db/migrate/20160202034530_create_secdomains.rb @@ -0,0 +1,28 @@ +class CreateSecdomains < ActiveRecord::Migration + def change + create_table :secdomains do |t| + t.integer :sub_type #1.系统预留 2.Organization 3.users + t.string :subname #子域名 + t.integer :pid, default: 0 #参数id + t.string :desc + + t.timestamps + end + + #系统保留 + Secdomain.create(sub_type: 1, subname: 'gitlab') + Secdomain.create(sub_type: 1, subname: 'wechat') + Secdomain.create(sub_type: 1, subname: 'judge') + + #organization + Secdomain.create(sub_type: 2, subname: 'micros', pid: 5) + Secdomain.create(sub_type: 2, subname: 'nubot', pid: 23) + Secdomain.create(sub_type: 2, subname: 'team', pid: 1) + + #users + Secdomain.create(sub_type: 3, subname: 'whm', pid: 7) + Secdomain.create(sub_type: 3, subname: 'yg', pid: 5) + Secdomain.create(sub_type: 3, subname: 'wt', pid: 11) + + end +end From eb3644a197caf5fc3c4df1af6f725996c363a22c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 19:16:15 +0800 Subject: [PATCH 162/215] =?UTF-8?q?=E5=B0=86=E4=B8=80=E5=A0=86=E7=9A=84rak?= =?UTF-8?q?e=E5=91=BD=E4=BB=A4=E5=8F=98=E4=B8=BA=E4=B8=80=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/elasticsearch_batch_op.rake | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/tasks/elasticsearch_batch_op.rake b/lib/tasks/elasticsearch_batch_op.rake index 4be382367..b9933cf75 100644 --- a/lib/tasks/elasticsearch_batch_op.rake +++ b/lib/tasks/elasticsearch_batch_op.rake @@ -1,17 +1,11 @@ namespace :importer do - task :import_all => :environment do - Rake::Task["importer:importuser"].execute - Rake::Task["importer:importproject"].execute - Rake::Task["importer:importcourse"].execute - Rake::Task["importer:importattachment"].execute - Rake::Task["importer:importmemo"].execute - end + task :importuser => :environment do ENV['CLASS']='User' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' - Rake::Task["elasticsearch:import:model"].invoke + Rake::Task["elasticsearch:import:model"].execute end task :importproject => :environment do @@ -19,27 +13,30 @@ namespace :importer do ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' - Rake::Task["elasticsearch:import:model"].invoke + Rake::Task["elasticsearch:import:model"].execute end task :importcourse => :environment do ENV['CLASS']='Course' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' - Rake::Task["elasticsearch:import:model"].invoke + Rake::Task["elasticsearch:import:model"].execute end task :importattachment => :environment do ENV['CLASS']='Attachment' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' - Rake::Task["elasticsearch:import:model"].invoke + Rake::Task["elasticsearch:import:model"].execute end task :importmemo => :environment do ENV['CLASS']='Memo' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' - Rake::Task["elasticsearch:import:model"].invoke + Rake::Task["elasticsearch:import:model"].execute end + + desc "Run all tasks" + task :all => [:importuser,:importproject,:importcourse,:importattachment,:importmemo] end \ No newline at end of file From 1f7bcbed20ef8f63fad191ab166fc8266d74b290 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 21:28:52 +0800 Subject: [PATCH 163/215] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=A2=98=E5=BA=93=E6=A0=87=E9=A2=98=E4=B8=AD=E7=9A=84=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/import_fix.rake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/tasks/import_fix.rake diff --git a/lib/tasks/import_fix.rake b/lib/tasks/import_fix.rake new file mode 100644 index 000000000..e5bd1a796 --- /dev/null +++ b/lib/tasks/import_fix.rake @@ -0,0 +1,14 @@ +namespace :import do + desc "fix import name" + task :fix => :environment do + HomeworkCommon.find_each do |homework| + name = homework.name.sub("\n", " ").sub("\r\n", " ") + if name != homework.name + homework.name = name + homework.save! + end + + end + end + +end From 0a0d67642a090781a86f921c2e83ffb8fc465e16 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 3 Feb 2016 12:17:45 +0800 Subject: [PATCH 164/215] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 2 ++ app/views/users/user_select_homework.js.erb | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 7a5bd8f27..0d542882a 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -16,6 +16,7 @@ $("#GroupPopupBox a.group_save_btn").click(); <% end %> }); + var homework_description_editor; function checked_val() { if ($("#anonymous_comment").is(":checked")) { $("#anonymous_comment").val(1); @@ -124,6 +125,7 @@ params.submit_btn = $("#new_message_submit_btn"); if(params.textarea.data('init') == undefined) { params.editor = init_homework_editor(params); + homework_description_editor = params.editor; init_homework_form(params); params.submit_btn.click(function () { params.form.submit(); diff --git a/app/views/users/user_select_homework.js.erb b/app/views/users/user_select_homework.js.erb index 306374b84..21fd9db26 100644 --- a/app/views/users/user_select_homework.js.erb +++ b/app/views/users/user_select_homework.js.erb @@ -8,11 +8,13 @@ $("#homework_end_time").val("<%= @homework.end_time%>"); $("#ref_homework_id").val("<%= @ref_homework.id%>"); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true,:has_group => true,:show_member=>true})%>"); homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>"); -<% if @homework_detail_group %> +//$("input[name='homework_type']").val("<%#= @homework.homework_type%>"); +<% if @homework_detail_programing %> + $("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>"); + $("#BluePopupBox a.BlueCirBtn").click(); +<% elsif @homework_detail_group %> $('span.group_detail_info').text('分组人数:<%=@homework_detail_group.min_num %>-<%=@homework_detail_group.max_num %> 人'); + $("#GroupPopupBox").html("<%=escape_javascript( render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework => @homework})%>"); + $("#GroupPopupBox a.group_save_btn").click(); <% end %> -$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>"); -$("#GroupPopupBox").html("<%=escape_javascript( render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework => @homework})%>"); -//$("input[name='homework_type']").val("<%#= @homework.homework_type%>"); $("#homework_editor").show(); -$("#BluePopupBox a.BlueCirBtn").click(); From 02f80075576e40c05b0987cc22686297ba3f2474 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 3 Feb 2016 12:42:42 +0800 Subject: [PATCH 165/215] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E6=A0=B7=E5=BC=8F=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_show_home_page.html.erb | 2 +- public/stylesheets/org.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/_show_home_page.html.erb b/app/views/organizations/_show_home_page.html.erb index f447c5022..0e725532e 100644 --- a/app/views/organizations/_show_home_page.html.erb +++ b/app/views/organizations/_show_home_page.html.erb @@ -50,7 +50,7 @@
    From 1234bc0aefba2d5ea138dfe74051f8fcb8779979 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 22 Feb 2016 15:34:50 +0800 Subject: [PATCH 198/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AF=BC=E8=AF=AD?= =?UTF-8?q?=E4=BB=8E=E5=B8=96=E5=AD=90=E4=B8=AD=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course_activity.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index c9c6cec4b..9c1431d5d 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -67,8 +67,9 @@ class CourseActivity < ActiveRecord::Base # 导语 def add_course_lead if self.course_act_type == "Course" - name = Redmine::Configuration['course_message_lead_subject'] - content = Redmine::Configuration['course_message_lead_content'] + lead_message = Message.find(12440) + name = lead_message.subject + content = lead_message.content # message的status状态为0为正常,为1表示创建课程时发送的message message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 From 78c70dce81ff65935ee4262334eba09ba5cec5de Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 22 Feb 2016 15:52:16 +0800 Subject: [PATCH 199/215] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E9=95=BF=E5=BA=A6=E5=BC=95=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/show.html.erb | 4 ++-- public/stylesheets/project.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index afe4740eb..76d5745df 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -36,12 +36,12 @@ <% if @changesets && !@changesets.empty? %> <% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %> <%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> -
    <%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %>
    +
    提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
    <%= @changesets_latest_coimmit.message %>
    <% else %> -
    <%=@changesets_latest_coimmit.author_email %>
    +
    提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
    <%= @changesets_latest_coimmit.message %>
    diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 29c099d3d..11c01aa09 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1168,3 +1168,4 @@ div.disable_link {background-color: #c1c1c1 !important;} /*问题跟踪局部修改属性*/ .proInfoBox2{ border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;} .proInfoBox2 ul li{ height:24px; position:relative;} +.maxwidth150{max-width: 150px;} From 2156b6db76fd977fcf48540fe015867158bbbe49 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 22 Feb 2016 16:56:37 +0800 Subject: [PATCH 200/215] =?UTF-8?q?issue=E5=9B=9E=E5=A4=8D=20Forge?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0=E6=8E=92=E5=BA=8F=E9=9D=A0?= =?UTF-8?q?=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journal.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/models/journal.rb b/app/models/journal.rb index 2da815a44..b184c82e6 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -52,6 +52,7 @@ class Journal < ActiveRecord::Base # fq after_save :act_as_activity,:be_user_score, :act_as_forge_message, :act_as_at_message + after_create :update_issue_time # end #after_destroy :down_user_score #before_save :be_user_score @@ -230,4 +231,12 @@ class Journal < ActiveRecord::Base project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num + 1) end end + + # 回复issue的时候,更新issue的时候 + def update_issue_time + if self.journalized_type == "Issue" + forge_activity = ForgeActivity.where("forge_act_id =? and forge_act_type =?", self.issue, "Issue").first + forge_activity.update_attribute(:created_at, self.created_on) unless forge_activity.nil? + end + end end From 98946b98552be3e4c8ebc6cced2ef16c6c877423 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 22 Feb 2016 18:10:20 +0800 Subject: [PATCH 201/215] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BC=B9=E6=A1=86=E7=9A=84=E5=BB=B6=E8=BF=9F?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 17 ++++++ app/controllers/users_controller.rb | 14 ++--- app/helpers/courses_helper.rb | 2 +- app/helpers/files_helper.rb | 3 +- app/views/files/_course_list.html.erb | 3 ++ app/views/files/_upload_course_files.erb | 53 ++++++++++++++++--- ...160222064143_add_publish_to_attachments.rb | 21 ++++++++ 7 files changed, 98 insertions(+), 15 deletions(-) create mode 100644 db/migrate/20160222064143_add_publish_to_attachments.rb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index c4932b1b2..e83a13ad9 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -488,6 +488,23 @@ class FilesController < ApplicationController if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added') Mailer.run.attachments_added(attachments[:files]) end + if !attachments.empty? && attachments[:files] + attachments[:files].each do |attachment| + if params[:publish_time] + if params[:publish_time] == "" + attachment.publish_time = Date.today + else + attachment.publish_time = params[:publish_time] + end + else + attachment.publish_time = Date.today + end + if attachment.publish_time > Date.today + attachment.is_publish = 0 + end + attachment.save + end + end if params[:course_attachment_type] && params[:course_attachment_type].is_a?(Array) params[:course_attachment_type].each do |type| tag_name = get_tag_name_by_type_number type diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 625a1de74..fb35d8495 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2144,22 +2144,22 @@ class UsersController < ApplicationController if(params[:type].blank? || params[:type] == "1") #全部 if User.current.id.to_i == params[:id].to_i user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - @attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ - "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") + @attachments = Attachment.where("(author_id = #{params[:id]} and is_publish = 1 and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ + "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1)").order("created_on desc") else user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #Ta的资源库的话,应该是他上传的公开资源 加上 他加入的所有我可见课程里的公开资源 - @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 " + + @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and is_publish = 1 " + "and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) " + - "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") + "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1)").order("created_on desc") end elsif params[:type] == "2" #课程资源 if User.current.id.to_i == params[:id].to_i user_course_ids = User.current.courses.map { |c| c.id} - @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) ").order("created_on desc") + @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc") else user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中 - @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and container_type = 'Course')"+ - "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") + @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and container_type = 'Course' and is_publish = 1)"+ + "or (container_type = 'Course' and is_public = 1 and is_publish = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") end elsif params[:type] == "3" #项目资源 if User.current.id.to_i == params[:id].to_i diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 40ed4a21a..6d0066fbc 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -746,7 +746,7 @@ module CoursesHelper return[] unless course result = [] course.attachments.each do |attachment| - if attachment.is_public? || User.current.member_of_course?(course) || User.current.admin? + if attachment.is_public? ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? result << attachment end end diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index bd023f6d0..6b748649b 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -123,7 +123,8 @@ module FilesHelper attachments.each do |attachment| if attachment.is_public? || (attachment.container_type == "Project" && User.current.member_of?(attachment.project)) || - (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| + (attachment.container_type == "Course" && User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id)))|| + (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)) && attachment.is_publish == 1)|| attachment.author_id == User.current.id || attachment.container_type == "OrgSubfield" result << attachment diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 47c08d2fb..d7aade6c2 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -18,6 +18,9 @@ 私有 <%end %>
    + <% if file.is_publish == 0 %> + <%=file.publish_time %>  0点发布 + <% end %>
    上传时间:<%= format_time(file.created_on)%> diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 6cce4bf2e..2e53f05d2 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -21,10 +21,20 @@ <%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
    - - <%= l(:button_cancel)%> - - <%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %> + <% if User.current.allowed_to?(:as_teacher,course) %> +
    + +
    + + <%#= calendar_for('attachment_publish_time')%> +
    + +
    +
    + <% end %> + <%= l(:button_cancel)%> + <%= l(:button_confirm)%> + <%#= submit_tag '确定',:onclick=>'submit_course_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %> <% end %>
    @@ -35,8 +45,39 @@
    \ No newline at end of file diff --git a/db/migrate/20160222064143_add_publish_to_attachments.rb b/db/migrate/20160222064143_add_publish_to_attachments.rb new file mode 100644 index 000000000..5ca354396 --- /dev/null +++ b/db/migrate/20160222064143_add_publish_to_attachments.rb @@ -0,0 +1,21 @@ +class AddPublishToAttachments < ActiveRecord::Migration + def change + add_column :attachments, :is_publish, :integer, :default => 1 + add_column :attachments, :publish_time, :date +=begin + count = Attachment.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + Attachment.page(i).per(30).each do |atta| + begin + atta.publish_time = atta.created_on.strftime('%d-%b-%Y') + atta.save + ensure + logger.error("===================>>container_id is null") + end + end + end + end +=end + end +end From 6b4be999ee12dd494241794042cd97c27da2c586 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 22 Feb 2016 18:35:04 +0800 Subject: [PATCH 202/215] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=9A=84=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/resource_publish.rake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/tasks/resource_publish.rake diff --git a/lib/tasks/resource_publish.rake b/lib/tasks/resource_publish.rake new file mode 100644 index 000000000..2df0c6145 --- /dev/null +++ b/lib/tasks/resource_publish.rake @@ -0,0 +1,11 @@ +#coding=utf-8 + +namespace :resource_publish do + desc "start publish resource" + task :publish => :environment do + attachments = Attachment.where("publish_time = '#{Date.today}'") + attachments.each do |attachment| + attachment.update_column('is_publish', 1) + end + end +end \ No newline at end of file From e62386ad656c4708644e2cc1e8ccba372f516538 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 23 Feb 2016 09:12:50 +0800 Subject: [PATCH 203/215] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=B1=80=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/trustie/gitlab/helper.rb | 24 ++++++++++++++++++++++++ lib/trustie/gitlab/sync.rb | 8 +++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/trustie/gitlab/helper.rb b/lib/trustie/gitlab/helper.rb index 61c1fbd17..a306bb855 100644 --- a/lib/trustie/gitlab/helper.rb +++ b/lib/trustie/gitlab/helper.rb @@ -3,6 +3,15 @@ module Trustie module Gitlab module Helper + GUEST = 10 + REPORTER = 20 + DEVELOPER = 30 + MASTER = 40 + OWNER = 50 + # 项目公开和私有 + PUBLIC = 20 + PRIVATE = 0 + def change_password(uid, en_pwd, salt) return unless uid options = {:encrypted_password=>en_pwd, :password_salt=>salt} @@ -44,6 +53,21 @@ module Trustie self.g.delete_user(user.gid) end + def get_gitlab_role m + case m.roles.first.position + when 1,2 + GUEST + when 5 + REPORTER + when 4 + DEVELOPER + when 3 + MASTER + else + GUEST + end + end + end end end \ No newline at end of file diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index d41b813e7..2f4f77c53 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -61,7 +61,7 @@ module Trustie unless gid gid = sync_user(m.user).id end - self.g.add_team_member(gproject.id, gid, UserLevel::DEVELOPER) + self.g.add_team_member(gproject.id, gid, get_gitlab_role(m)) rescue => e puts e end @@ -111,7 +111,7 @@ module Trustie unless gid gid = sync_user(m.user).id end - self.g.add_team_member(gproject.id, gid, UserLevel::DEVELOPER) + self.g.add_team_member(gproject.id, gid, get_gitlab_role(m)) rescue => e puts e end @@ -125,7 +125,7 @@ module Trustie unless gid gid = sync_user(m.user).id end - self.g.add_team_member(project.gpid, gid, UserLevel::DEVELOPER) + self.g.add_team_member(project.gpid, gid, get_gitlab_role(m)) rescue => e puts e end @@ -134,6 +134,8 @@ module Trustie def remove_project end + + end end From a2e60944be2fd3e8fcd9e9e1f6fc6316164c9406 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 23 Feb 2016 11:04:19 +0800 Subject: [PATCH 204/215] =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=9A=84=E5=BB=B6=E6=9C=9F=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 27 +++++++- app/helpers/courses_helper.rb | 2 +- app/views/files/_course_list.html.erb | 80 +---------------------- app/views/files/_hidden_file.html.erb | 54 +++++++++++++++ app/views/files/_resource_detail.html.erb | 77 ++++++++++++++++++++++ app/views/files/_upload_course_files.erb | 2 +- app/views/files/file_hidden.js.erb | 6 ++ app/views/files/republish_file.js.erb | 2 + config/routes.rb | 3 + 9 files changed, 173 insertions(+), 80 deletions(-) create mode 100644 app/views/files/_hidden_file.html.erb create mode 100644 app/views/files/_resource_detail.html.erb create mode 100644 app/views/files/file_hidden.js.erb create mode 100644 app/views/files/republish_file.js.erb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index e83a13ad9..b18612243 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -26,7 +26,7 @@ class FilesController < ApplicationController before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project, :search_tag_attachment,:subfield_upload_file,:search_org_subfield_tag_attachment, :search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache, - :search_files_in_subfield,:upload_files_menu] + :search_files_in_subfield,:upload_files_menu,:file_hidden,:republish_file] helper :sort include SortHelper @@ -96,6 +96,31 @@ class FilesController < ApplicationController end end + def file_hidden + @file = Attachment.find params[:id] + @course = Course.find params[:course_id] + respond_to do |format| + format.js + end + end + + def republish_file + @file = Attachment.find params[:id] + @course = Course.find params[:course_id] + if params[:publish_time] + unless params[:publish_time] == "" + @file.publish_time = params[:publish_time] + end + end + if @file.publish_time > Date.today + @file.is_publish = 0 + end + @file.save + respond_to do |format| + format.js + end + end + def search_project sort = "" @sort = "" diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 6d0066fbc..2cdb277be 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -746,7 +746,7 @@ module CoursesHelper return[] unless course result = [] course.attachments.each do |attachment| - if attachment.is_public? ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? + if attachment.is_public? ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? result << attachment end end diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index d7aade6c2..7724bb861 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -1,82 +1,8 @@ - -<% delete_allowed = User.current.allowed_to?(:manage_files, course) %> <% curse_attachments.each do |file| %> <% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %> -
    -
    -
    - <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %> -
    -
    -
    - <%= link_to truncate(file.filename,length: 35, omission: '...'), - download_named_attachment_path(file.id, file.filename), - :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %> - <%= file_preview_eye(file, class: 'preview') %> - - <% if file.is_public? == false%> - 私有 - <%end %> - - <% if file.is_publish == 0 %> - <%=file.publish_time %>  0点发布 - <% end %> -
    -
    - 上传时间:<%= format_time(file.created_on)%> - <% if file.tag_list.length > 0%> - 上传类型:<%= file.tag_list[0] %> - <% end %> -

    文件大小:<%= number_to_human_size(file.filesize) %>

    -

    下载<%= file.downloads%>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

    -
    -
    -
    - - <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> - <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> -
    -
    - -
      -
    • - <% if User.current.logged? %> - - <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> - <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %> -
        - -
      • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • -
      • <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
      • - <% if @course.is_public? %> -
      • - - <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %> - -
      • - <%end%> -
      • - <%= link_to( '删除资源', attachment_path(file), - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %> -
      • -
      - - <% end %> - <%else%> -
        -
      • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • -
      - <% end %> - <% end %> -
    • -
    - -
    -
    -
    -
    -
    -
    +
    + <%=render :partial=>'files/resource_detail',:locals => {:file => file} %> +
    <% else %>
    <%= file.filename %>是私有资源
    <% end %> diff --git a/app/views/files/_hidden_file.html.erb b/app/views/files/_hidden_file.html.erb new file mode 100644 index 000000000..eb0f366a3 --- /dev/null +++ b/app/views/files/_hidden_file.html.erb @@ -0,0 +1,54 @@ +发布设置 + +<%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> +
    + +
    + + <%#= calendar_for('attachment_publish_time')%> +
    + +
    +
    + +
    + + +
    +<% end %> +
    + \ No newline at end of file diff --git a/app/views/files/_resource_detail.html.erb b/app/views/files/_resource_detail.html.erb new file mode 100644 index 000000000..fd0a165aa --- /dev/null +++ b/app/views/files/_resource_detail.html.erb @@ -0,0 +1,77 @@ +<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %> +
    +
    +
    + <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %> +
    +
    +
    + <%= link_to truncate(file.filename,length: 35, omission: '...'), + download_named_attachment_path(file.id, file.filename), + :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %> + <%= file_preview_eye(file, class: 'preview') %> + + <% if file.is_public? == false%> + 私有 + <%end %> + + <% if file.is_publish == 0 %> + <%=file.publish_time %>  0点发布 + <% end %> +
    +
    + 上传时间:<%= format_time(file.created_on)%> + <% if file.tag_list.length > 0%> + 上传类型:<%= file.tag_list[0] %> + <% end %> +

    文件大小:<%= number_to_human_size(file.filesize) %>

    +

    下载<%= file.downloads%>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

    +
    +
    +
    + + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> + <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> +
    +
    + +
      +
    • + <% if User.current.logged? %> + + <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> + <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %> +
        + +
      • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • +
      • <%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %>
      • +
      • <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
      • + <% if @course.is_public? %> +
      • + + <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %> + +
      • + <%end%> +
      • + <%= link_to( '删除资源', attachment_path(file), + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %> +
      • +
      + + <% end %> + <%else%> +
        +
      • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • +
      + <% end %> + <% end %> +
    • +
    + +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 2e53f05d2..1b8b140a5 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -28,7 +28,7 @@ <%#= calendar_for('attachment_publish_time')%>
    - +
    <% end %> diff --git a/app/views/files/file_hidden.js.erb b/app/views/files/file_hidden.js.erb new file mode 100644 index 000000000..b95ab5104 --- /dev/null +++ b/app/views/files/file_hidden.js.erb @@ -0,0 +1,6 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>'); +showModal('ajax-modal', '311px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); +$('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/files/republish_file.js.erb b/app/views/files/republish_file.js.erb new file mode 100644 index 000000000..e85e5eb50 --- /dev/null +++ b/app/views/files/republish_file.js.erb @@ -0,0 +1,2 @@ +hideModal(); +$("#resource_detail_<%=@file.id %>").html("<%= escape_javascript(render :partial=>'files/resource_detail',:locals => {:file => @file}) %>") \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 7060e4eb6..095470139 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -695,6 +695,7 @@ RedmineApp::Application.routes.draw do end member do match "quote_resource_show", :via => [:get] + get "file_hidden" end end @@ -1015,6 +1016,8 @@ RedmineApp::Application.routes.draw do end member do match "quote_resource_show", :via => [:get] + get "file_hidden" + post "republish_file" end end resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do From ed7183b1a966ee41124d16fc60ca449aa6b9240c Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 23 Feb 2016 11:31:34 +0800 Subject: [PATCH 205/215] 0 --- lib/trustie/gitlab/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/trustie/gitlab/helper.rb b/lib/trustie/gitlab/helper.rb index a306bb855..9fb1f5735 100644 --- a/lib/trustie/gitlab/helper.rb +++ b/lib/trustie/gitlab/helper.rb @@ -11,7 +11,7 @@ module Trustie # 项目公开和私有 PUBLIC = 20 PRIVATE = 0 - + def change_password(uid, en_pwd, salt) return unless uid options = {:encrypted_password=>en_pwd, :password_salt=>salt} From b6bf78a5df895e00e08f5e1ebebe8f0f0b9b04b8 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 23 Feb 2016 11:35:07 +0800 Subject: [PATCH 206/215] =?UTF-8?q?=E5=BD=93=E5=A4=A9=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=9A=84=E8=B5=84=E6=BA=90=E6=98=BE=E7=A4=BA=E6=9C=AA=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E3=80=81=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E7=94=A8=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 2 ++ app/views/files/_hidden_file.html.erb | 1 + app/views/files/_upload_course_files.erb | 1 + 3 files changed, 4 insertions(+) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index b18612243..ca37e445c 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -114,6 +114,8 @@ class FilesController < ApplicationController end if @file.publish_time > Date.today @file.is_publish = 0 + else + @file.is_publish = 1 end @file.save respond_to do |format| diff --git a/app/views/files/_hidden_file.html.erb b/app/views/files/_hidden_file.html.erb index eb0f366a3..8e359c605 100644 --- a/app/views/files/_hidden_file.html.erb +++ b/app/views/files/_hidden_file.html.erb @@ -1,3 +1,4 @@ + 发布设置 <%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 1b8b140a5..de43977cd 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -1,3 +1,4 @@ +

    <%= l(:label_upload_files)%>

    From c91ef44570f7941f759a82bfbdb3d87dab1f67ac Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 23 Feb 2016 12:52:04 +0800 Subject: [PATCH 207/215] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=AD=90=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=EF=BC=9A=E6=89=80=E6=9C=89=E5=AD=90=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=88=B0secdomains=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E7=BB=84=E7=BB=87=E8=A1=A8=E4=B8=AD=E7=9A=84=E5=AD=90?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E8=BF=81=E7=A7=BB=E5=88=B0secdomains?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=EF=BC=8C=E5=B9=B6=E4=BF=AE=E6=94=B9=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_subfields_controller.rb | 3 ++- app/controllers/organizations_controller.rb | 9 +++++++-- app/views/organizations/_subfield_list.html.erb | 2 +- app/views/organizations/setting.html.erb | 11 ++++++----- app/views/users/user_organizations.html.erb | 5 ----- .../20160223021012_add_index_to_secdomain.rb | 5 +++++ .../20160223021227_move_domain_to_secdomain.rb | 14 ++++++++++++++ ...60223031843_remove_domain_from_organizations.rb | 8 ++++++++ db/schema.rb | 9 +++++++-- 9 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20160223021012_add_index_to_secdomain.rb create mode 100644 db/migrate/20160223021227_move_domain_to_secdomain.rb create mode 100644 db/migrate/20160223031843_remove_domain_from_organizations.rb diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index bae0232a5..2a4bcf9c8 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -30,7 +30,8 @@ class OrgSubfieldsController < ApplicationController if params[:id] @organization = Organization.find(params[:id]) else - @organization = Organization.where("domain=?",request.subdomain).first + domain = Secdomain.where("subname=?", request.subdomain).first + @organization = Organization.find(domain.pid) end @org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+ "subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+ diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 6e2da311f..f225e7f50 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -139,7 +139,7 @@ class OrganizationsController < ApplicationController end def check_uniq_domain - @is_exist = (Organization.where("domain=?", params[:org_domain]).count > 0) + @is_exist = (Secdomain.where("subname=?",params[:org_domain]).count > 0) end def find_organization @@ -322,7 +322,12 @@ class OrganizationsController < ApplicationController def agree_apply_subdomain @organization = Organization.find(params[:organization_id]) OrgMessage.find(params[:act_id]).update_attribute(:viewed, 1) - @organization.update_attribute(:domain, params[:org_domain]) + if Secdomain.where("pid=? and sub_type=2",@organization.id).count > 0 + domain = Secdomain.where("pid=? and sub_type=2",params[:organization_id]).first + Secdomain.update(domain.id, :subname => params[:org_domain]) + else + Secdomain.create(:sub_type => 2, :pid => params[:organization_id], :subname => params[:org_domain]) + end if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=?",params[:org_domain]).count == 0 OrgMessage.create(:user_id => params[:user_id], :organization_id => @organization.id, :message_type => 'AgreeApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain]) end diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index b49436d4e..eed0dabf6 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -28,7 +28,7 @@
  • 新增
  • <%= field.field_type == "Post" ? "帖子" : "资源" %>
  • <% else %> - - + + <% end %> <% else %> diff --git a/app/views/news/_course_news_detail.html.erb b/app/views/news/_course_news_detail.html.erb index 61db84134..bd3215fb3 100644 --- a/app/views/news/_course_news_detail.html.erb +++ b/app/views/news/_course_news_detail.html.erb @@ -3,18 +3,6 @@ <%= javascript_include_tag "create_kindeditor" %> <% end %> - <% if newss%> <% newss.each do |news| %> - + <% unless forge_acts.empty? %> <% forge_acts.each do |activity| -%> - + <% user_activities.each do |user_activity| if user_activities %>