From eb5d1c9efe445ff514b822cc0dddd65c0f66682a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 26 Aug 2014 10:44:44 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A6=96=E9=A1=B5=E6=96=87=E6=98=8E=E5=90=8D?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E8=B6=85=E5=87=BA=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/show.html.erb | 2 +- db/schema.rb | 99 ++++++-------------------------- 2 files changed, 19 insertions(+), 82 deletions(-) diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 7b8ed310e..47e3e8419 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -7,7 +7,7 @@ <% @events_by_day.keys.sort.reverse.each do |day| %> <% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%> -
+
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
diff --git a/db/schema.rb b/db/schema.rb index 525cfb745..e39644b3b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -177,58 +177,6 @@ ActiveRecord::Schema.define(:version => 20140814062455) do 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 @@ -441,10 +389,10 @@ ActiveRecord::Schema.define(:version => 20140814062455) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "sort_type" - t.integer "show_course", :default => 1 - t.integer "show_contest", :default => 1 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 "forums", :force => true do |t| @@ -872,18 +820,18 @@ ActiveRecord::Schema.define(:version => 20140814062455) do 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.string "subject", :null => false + t.text "content", :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + 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.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" @@ -907,19 +855,6 @@ ActiveRecord::Schema.define(:version => 20140814062455) do 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 @@ -970,11 +905,10 @@ ActiveRecord::Schema.define(:version => 20140814062455) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + 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 "softapplications", :force => true do |t| @@ -1080,8 +1014,8 @@ ActiveRecord::Schema.define(:version => 20140814062455) do 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 "technical_title" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1139,6 +1073,9 @@ ActiveRecord::Schema.define(:version => 20140814062455) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "level" + t.integer "file" + t.integer "issue" end create_table "user_statuses", :force => true do |t| From 30cbbb5a2a9a4aef6132857366de4cd8c836079e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 26 Aug 2014 16:39:12 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=BC=95=E7=94=A8=E5=9B=9E=E5=B8=96?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86=20#1491?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index 44d6dfbe4..a8def56f5 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -32,7 +32,7 @@ <%= f.select :board_id, boards_options_for_select(@message.course.boards) %>

<% end %> <% end %> -
+
<%= text_area :quote,:quote,:style => 'display:none' %>

From 79e83b9a857bddcc0a53587faff728b51687df66 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 26 Aug 2014 16:44:56 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=BB=E9=A2=98=E6=98=BE=E7=A4=BA=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E8=BE=B9=E6=A1=86=20#1490?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/edit.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb index 2577a4634..62d29ebd8 100644 --- a/app/views/messages/edit.html.erb +++ b/app/views/messages/edit.html.erb @@ -4,7 +4,7 @@ <%= course_board_breadcrumb(@message) %> <% end %> -

<%= avatar(@topic.author, :size => "24") %><%=h @topic.subject %>

+

<%= avatar(@topic.author, :size => "24") %><%=h @topic.subject %>

<%= form_for @message, { :as => :message, From c6b189a846132fc2f2b49755134c7af6ebdd6ed5 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 26 Aug 2014 17:46:21 +0800 Subject: [PATCH 04/12] =?UTF-8?q?wiki=E6=98=BE=E7=A4=BA=E6=9C=AA=E5=AF=B9?= =?UTF-8?q?=E9=9D=9E=E6=B1=89=E5=AD=97=E7=B1=BB=E5=9E=8B=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C=E5=A4=84=E7=90=86=20#1486?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/wiki/diff.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/wiki/diff.html.erb b/app/views/wiki/diff.html.erb index c1062924c..ef26c570c 100644 --- a/app/views/wiki/diff.html.erb +++ b/app/views/wiki/diff.html.erb @@ -22,6 +22,6 @@ %>, <%= format_time(@diff.content_to.updated_on) %>)

-
+
<%= simple_format_without_paragraph @diff.to_html %>
From 97f8aedd13ba11928b6f4708388d8a1ab29cb388 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 27 Aug 2014 11:31:18 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A6=96=E9=A1=B5=E6=8F=8F=E8=BF=B0=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=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/views/users/show.html.erb | 18 +++++++++--------- app/views/users/user_activities.html.erb | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index b70d73eb6..068390192 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -72,7 +72,7 @@ <% end %> -

<%= textilizable act.notes %>

+

<%= textAreailizable act.notes %>

<%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>
@@ -113,7 +113,7 @@ -

<%= act.description.html_safe %>

+

<%=textAreailizable act, :description %>

@@ -141,7 +141,7 @@ <% if act.notes.nil? %> <% desStr = '' %> <% else %> - <% desStr=act.notes.html_safe %> + <% desStr= textAreailizable(act, :notes) %> <% end %>

<%= desStr %>

@@ -168,7 +168,7 @@ -

<%= act.long_comments.html_safe %>

+

<%= textAreailizable act,:long_comments %>

@@ -194,7 +194,7 @@ -

<%= h act.content.truncate(240, omission: '...') %>

+

<%= textAreailizable(act,:content) %>

@@ -242,7 +242,7 @@ -

<%= act.description.html_safe %>

+

<%= textAreailizable act,:description %>

@@ -287,7 +287,7 @@
--> - <%= textilizable act, :description %> + <%= textAreailizable act, :description %> @@ -314,7 +314,7 @@ <% end %> -

<%= h act.description %>

+

<%= textAreailizable act, :description %>

@@ -384,7 +384,7 @@ -

<%= textilizable e.notes %>

+

<%= textAreailizable e.notes %>

diff --git a/app/views/users/user_activities.html.erb b/app/views/users/user_activities.html.erb index 2b4cf8819..080e772a1 100644 --- a/app/views/users/user_activities.html.erb +++ b/app/views/users/user_activities.html.erb @@ -13,7 +13,7 @@ <%# end -%> <%# end -%> - +
<%# end %> --> From a77b07a99b05d899d19e8697bd12088071c4530e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 27 Aug 2014 17:53:57 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 53 +++++++++++++++++------------ 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 3d541fd61..f8b4578eb 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -57,36 +57,45 @@ class FilesController < ApplicationController elsif params[:course_id] @isproject = false + sort = "" if params[:sort] - if params[:sort].include?":" - @orderBy = params[:sort].split(":")[0] - @orderType = params[:sort].split(":")[1].split(",")[0] - else - @orderBy = params[:sort].split(",")[0] - @orderType = "asc" + params[:sort].split(",").each do |sort_type| + order_by = sort_type.split(":") + + case order_by[0] + when "filename" + attribute = "filename" + when "size" + attribute = "filesize" + when "attach_type" + attribute = "attachtype" + when "content_type" + attribute = "created_on" + when "field_file_dense" + attribute = "is_public" + when "downloads" + attribute = "downloads" + when "created_on" + attribute = "created_on" + end + + if order_by.count == 1 + sort += "#{Attachment.table_name}.#{attribute} desc " + elsif order_by.count == 2 + sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} " + end + if sort_type != params[:sort].split(",").last + sort += "," + end end end - - if @orderBy=="size" - @orderBy="filesize" - elsif @orderBy=="field_file_dense" - @orderBy="is_public" - elsif @orderBy=="attach_type" - @orderBy="attachtype" - elsif @orderBy=="content_type" - @orderBy="attachtype" - end - - if @orderBy - @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)] - else - @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)] - end + @containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)] show_attachments @containers render :layout => 'base_courses' end + end def new From 5afcb73624bddc0763ec190bd16f3d401fb1cc34 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 28 Aug 2014 11:06:01 +0800 Subject: [PATCH 07/12] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=B8=AD=E8=8B=B1?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=202.=E4=BF=AE=E6=94=B9=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=B7=AE=E5=88=AB=E9=A1=B5=E9=9D=A2=E4=BC=9A=E8=B6=85=E5=87=BA?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/issues_helper.rb | 2 +- app/views/journals/diff.html.erb | 2 +- config/locales/zh.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 315a86340..637c92db3 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -326,7 +326,7 @@ module IssuesHelper if detail.property == 'attr' && detail.prop_key == 'description' s = l(:text_journal_changed_no_detail, :label => label) unless no_html - diff_link = link_to 'diff', + diff_link = link_to l(:label_diff), {:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id, :only_path => options[:only_path]}, :title => l(:label_view_diff) diff --git a/app/views/journals/diff.html.erb b/app/views/journals/diff.html.erb index d846b9d19..6e67f0544 100644 --- a/app/views/journals/diff.html.erb +++ b/app/views/journals/diff.html.erb @@ -1,7 +1,7 @@

<%=h @issue.tracker %> #<%= @issue.id %>

<%= authoring @journal.created_on, @journal.user, :label => :label_updated_time_by %>

-
+
<%= simple_format_without_paragraph @diff.to_html %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4f0744d86..674b88dbe 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1214,7 +1214,7 @@ zh: notice_issue_successful_create: 问题 %{id} 已创建。 label_between: 介于 setting_issue_group_assignment: 允许问题被分配给组 - label_diff: diff + label_diff: 查看差别 description_query_sort_criteria_direction: 排序方式 description_project_scope: 搜索范围 description_filter: 过滤器 From 19be668221194fd48c8174bc4d79a2240db93e30 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 28 Aug 2014 11:52:02 +0800 Subject: [PATCH 08/12] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3RImagic=E4=BF=9D?= =?UTF-8?q?=E5=AD=98gif=E6=A0=BC=E5=BC=8F=E5=9B=BE=E7=89=87=E9=97=AE?= =?UTF-8?q?=E9=A2=98=202.=E4=BF=AE=E6=AD=A3=E8=AF=BE=E7=A8=8B=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/avatar_controller.rb | 17 ++++++++++------- app/controllers/courses_controller.rb | 9 +++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index fa7eb6052..b7dec5453 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -55,17 +55,20 @@ class AvatarController < ApplicationController # saved = @avatar.save begin f = Magick::ImageList.new(diskfile) - width = 300.0 - proportion = (width/f[0].columns) - height = (f[0].rows*proportion) - f.resize_to_fill!(width,height) - # f.scale!(width,height) - f.write(diskfile) + # gif格式不再做大小处理 + if f.format != 'GIF' + width = 300.0 + proportion = (width/f[0].columns) + height = (f[0].rows*proportion) + f.resize_to_fill!(width,height) + f.write(diskfile) + end + rescue Exception => e logger.error "[Error] avatar : avatar_controller#upload ===> #{e}" end - + respond_to do |format| format.js format.api { diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 38ae662fc..aa5e2c2a6 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -605,6 +605,15 @@ class CoursesController < ApplicationController events = @activity.events(@date_from, @date_to, :is_public => 1) end + # 无新动态时,显示老动态 + if events.count == 0 + if User.current.member_of_course?(@course)|| User.current.admin? + events = @activity.events + else + events = @activity.events(:is_public => 1) + end + end + @offset, @limit = api_offset_and_limit({:limit => 10}) @events_count = events.count @events_pages = Paginator.new @events_count, @limit, params['page'] From bdeb2e59471e6940a7b4981194ae617504ba2785 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 28 Aug 2014 14:02:14 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=90=AF=E7=94=A8=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84wiki=E7=BC=96=E8=BE=91=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 1 + db/schema.rb | 84 +++++++++++++++++++++++--- 2 files changed, 78 insertions(+), 7 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f3ab77603..c0561bd1c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -594,6 +594,7 @@ class ProjectsController < ApplicationController "show_news" => true, "show_bids" => true, "show_contests" => true, + "show_wiki_edits"=>true, "show_journals_for_messages" => true } @date_to ||= Date.today + 1 diff --git a/db/schema.rb b/db/schema.rb index 82a6ad97b..b4dab9094 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -177,6 +177,58 @@ ActiveRecord::Schema.define(:version => 20140826072838) do 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 @@ -385,9 +437,9 @@ ActiveRecord::Schema.define(:version => 20140826072838) do 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.string "page_type" t.integer "sort_type" t.integer "image_width", :default => 107 t.integer "image_height", :default => 63 @@ -406,6 +458,26 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.datetime "updated_at", :null => false end + create_table "gitlab_projects", :force => true do |t| + t.integer "gitlab_project_id" + t.integer "project_id" + t.string "repository_url" + t.string "web_url" + t.string "localfile_url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "gitlab_users", :force => true do |t| + t.integer "gitlab_user_id" + t.integer "user_id" + t.string "email" + t.string "password" + t.string "login", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "groups_users", :id => false, :force => true do |t| t.integer "group_id", :null => false t.integer "user_id", :null => false @@ -911,10 +983,11 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + 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 "softapplications", :force => true do |t| @@ -1020,8 +1093,8 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "identity" t.string "technical_title" + t.integer "identity" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1079,9 +1152,6 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "level" - t.integer "file" - t.integer "issue" end create_table "user_statuses", :force => true do |t| From 82b23da54bf34ed13cf92e1bd6b674693a66eaec Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 28 Aug 2014 14:05:48 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0js=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_homework_form.html.erb | 13 ++- app/views/courses/new_homework.html.erb | 53 +++++++++++- db/schema.rb | 99 ++++++++++++++++++----- 3 files changed, 143 insertions(+), 22 deletions(-) diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index bfecb5304..f93d57f90 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -22,15 +22,22 @@ <%= error_messages_for 'bid' %>

<%= l(:label_homeworks_form_new_description) %>

-

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %>

+

+ <%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %> -

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

+

+

+ +

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> -

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}",:readonly => "readonly") %><%= calendar_for('bid_deadline')%> +

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();") %><%= calendar_for('bid_deadline')%> + + +

<%= f.select :is_evaluation, is_evaluation_option %>

diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb index b3fff9e5f..e339db2d7 100644 --- a/app/views/courses/new_homework.html.erb +++ b/app/views/courses/new_homework.html.erb @@ -1,9 +1,60 @@ + +

<%=l(:label_course_new_homework)%>

<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
<%= render :partial => 'homework_form', :locals => { :f => f } %> - <%= submit_tag l(:button_create), :class => "enterprise" %> + <%= javascript_tag "$('#bid_name').focus();" %> <% end %>
\ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 82a6ad97b..e23fd19d2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -177,6 +177,58 @@ ActiveRecord::Schema.define(:version => 20140826072838) do 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 @@ -389,10 +441,10 @@ ActiveRecord::Schema.define(:version => 20140826072838) do 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 + t.integer "image_width", :default => 107 + t.integer "image_height", :default => 63 end create_table "forums", :force => true do |t| @@ -826,18 +878,18 @@ ActiveRecord::Schema.define(:version => 20140826072838) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + 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.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" @@ -861,6 +913,19 @@ ActiveRecord::Schema.define(:version => 20140826072838) do 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 @@ -911,10 +976,11 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + 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 "softapplications", :force => true do |t| @@ -1020,8 +1086,8 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "identity" t.string "technical_title" + t.integer "identity" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1079,9 +1145,6 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "level" - t.integer "file" - t.integer "issue" end create_table "user_statuses", :force => true do |t| From 51b21000a79f71c63c44e36789c7c5456e0fb602 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 28 Aug 2014 14:35:42 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E9=99=90=E5=AE=9A=E4=B8=BA=E5=85=A8=E5=B1=80=E5=94=AF?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/repository.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index 260069f94..5680f05a7 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -39,7 +39,8 @@ class Repository < ActiveRecord::Base validates_length_of :password, :maximum => 255, :allow_nil => true validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH, :allow_blank => true validates_presence_of :identifier#, :unless => Proc.new { |r| r.is_default? || r.set_as_default? } - validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true + #validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true + validates_uniqueness_of :identifier, :allow_blank => true validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph) # donwcase letters, digits, dashes, underscores but not digits only validates_format_of :identifier, :with => /^[a-z0-9_\-]+$/, :allow_blank => true From bcb9e8688c273ebc6ddb510cf55630aa00afb4cc Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 28 Aug 2014 14:39:09 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/index.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index f5018fc94..2446c4e3d 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -37,21 +37,21 @@