From 21f81a931afc105bde4d15c0bea6165e8054c4a0 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 11 Aug 2015 11:26:22 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E7=9A=84=E2=80=9C=E6=96=B0=E5=BB=BA=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E2=80=9D=E2=80=9C=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E2=80=9D=E2=80=9C=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B=E2=80=9D?= =?UTF-8?q?=E2=80=9D=E5=8A=A0=E5=85=A5=E9=A1=B9=E7=9B=AE=E2=80=9C=E7=9A=84?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e53d734c6..b2e6258ee 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -5,14 +5,14 @@ <% if @user.allowed_to?(:add_project, nil, :global => true) %> 新建项目 <% else %> - 加入项目 + 加入项目 <% end %> <% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %> - 新建课程 + 新建课程 <% else %> - 加入课程 + 加入课程 <% end %>
From a87269298457474cc5e27d01644b9d6f1d6f4462 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 11 Aug 2015 14:49:32 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=B8=BAactivities=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0created=5Fat=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/projects/en.yml | 6 +++--- ...0810064247_add_created_at_to_activities.rb | 8 +++++++ .../20150811010817_update_activities_data.rb | 21 +++++++++++++++++++ db/schema.rb | 21 +++++++------------ 4 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20150810064247_add_created_at_to_activities.rb create mode 100644 db/migrate/20150811010817_update_activities_data.rb diff --git a/config/locales/projects/en.yml b/config/locales/projects/en.yml index b142c6ca8..703e0878e 100644 --- a/config/locales/projects/en.yml +++ b/config/locales/projects/en.yml @@ -42,10 +42,10 @@ en: label_member: "Members" project_module_attachments: "Resources" - label_project_mail_attachments: Project Resources - label_project_mail_upload: had uploaded project resources + label_project_mail_attachments: "Project Resources" + label_project_mail_upload: "had uploaded project resources" - label_invite: Invitation + label_invite: "Invitation" label_invite_new_user: "Send email to invite new user" label_invite_trustie_user: "Invite the Trustie registered user" diff --git a/db/migrate/20150810064247_add_created_at_to_activities.rb b/db/migrate/20150810064247_add_created_at_to_activities.rb new file mode 100644 index 000000000..864ed82d6 --- /dev/null +++ b/db/migrate/20150810064247_add_created_at_to_activities.rb @@ -0,0 +1,8 @@ +class AddCreatedAtToActivities < ActiveRecord::Migration + def up + add_column :activities, :created_at, :timestamp + end + def end + remove_column :activities, :created_at + end +end diff --git a/db/migrate/20150811010817_update_activities_data.rb b/db/migrate/20150811010817_update_activities_data.rb new file mode 100644 index 000000000..de4a080f2 --- /dev/null +++ b/db/migrate/20150811010817_update_activities_data.rb @@ -0,0 +1,21 @@ +class UpdateActivitiesData < ActiveRecord::Migration + def up + count = Activity.all.count / 10 + 1 + transaction do + for i in 1 ... count do i + Activity.all.each do |activity| + type = activity.act_type + if type=='Contest' || type=='Message' || type=='News'|| type=='Journal'|| type=='Issue'|| type=='Principal'||type=='JournalsForMessage' + activity.created_at = activity.act.created_on if activity.act + elsif type=='Contestnotification' || type=='HomeworkCommon' || type=='Poll' + activity.created_at = activity.act.created_at if activity.act + end + activity.save + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 30ca29d12..db9b9ff9b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,14 +11,15 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150801034945) do +ActiveRecord::Schema.define(:version => 20150810064247) 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.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" @@ -454,13 +455,6 @@ ActiveRecord::Schema.define(:version => 20150801034945) do 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 @@ -863,6 +857,7 @@ ActiveRecord::Schema.define(:version => 20150801034945) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.datetime "updated_on" end add_index "news", ["author_id"], :name => "index_news_on_author_id" From 9b424a5b17dcc285c6c0d8b25f1384a411d20d4d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 14 Aug 2015 17:25:53 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E8=B0=83=E6=9F=A5----=E7=82=B9=E5=87=BB=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E5=A6=82=E5=9B=BE=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E5=A4=84=E4=B9=9F=E8=BF=94=E5=9B=9E=E7=9B=B8=E5=85=B3=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll.html.erb | 12 +++++++----- public/stylesheets/polls.css | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index b4d944220..1828ede6d 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -2,11 +2,13 @@ <% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%> <% if @is_teacher%>
  • - <% if has_commit %> - <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%> - <% else %> - <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %> - <% end %> +
    + <% if has_commit %> + <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%> + <% else %> + <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %> + <% end %> +
  • <% if poll.polls_status == 1%> diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 97faa0f57..9f7b2d021 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -130,7 +130,7 @@ a:hover.btn_de{ background:#ff5d31;} a.btn_pu{ border:1px solid #3cb761; color:#3cb761; } a:hover.btn_pu{ background:#3cb761;} .pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; height:19px; padding-top:3px; } -.polls_title_w { width:280px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} +.polls_title_w { max-width:280px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} .polls_title_st { max-width:530px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} .polls_de_grey{ color:#b1b1b1; margin-top:3px;} .ml5{ margin-left:5px;} From ac4d529ebc5ab9eb0b1039514948dd72cd144251 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 15 Aug 2015 10:45:56 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8F=96=E6=B6=88=EF=BC=8C=E5=B9=B6=E8=AE=BE=E5=AE=9A=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E4=B8=BA=E5=86=85=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 44 +++++++-------- app/views/boards/_form.html.erb | 2 +- app/views/boards/show.html.erb | 55 ++----------------- .../_homework_detail_manual_form.html.erb | 2 +- app/views/homework_common/new.html.erb | 28 +++------- config/locales/my/zh.yml | 1 - config/locales/projects/zh.yml | 1 - 7 files changed, 37 insertions(+), 96 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 21f781a1a..87c1e288b 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -19,28 +19,28 @@ class HomeworkCommonController < ApplicationController end def new - # @homework_type = "1" - # - # @homework = HomeworkCommon.new - # @homework.safe_attributes = params[:homework_common] - # @homework.late_penalty = 2 - # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.publish_time = Time.now.strftime('%Y-%m-%d') - # - # if @homework_type == "1" - # #匿评作业相关属性 - # @homework_detail_manual = HomeworkDetailManual.new - # @homework_detail_manual.ta_proportion = 0.6 - # @homework_detail_manual.absence_penalty = 2 - # @homework_detail_manual.evaluation_num = 3 - # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') - # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.homework_detail_manual = @homework_detail_manual - # elsif @homework_type == "2" - # #编程作业相关属性 - # @homework_detail_programing = HomeworkDetailPrograming.new - # @homework.homework_detail_programing = @homework_detail_programing - # end + @homework_type = "1" + + @homework = HomeworkCommon.new + @homework.safe_attributes = params[:homework_common] + @homework.late_penalty = 2 + @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') + @homework.publish_time = Time.now.strftime('%Y-%m-%d') + + if @homework_type == "1" + #匿评作业相关属性 + @homework_detail_manual = HomeworkDetailManual.new + @homework_detail_manual.ta_proportion = 0.6 + @homework_detail_manual.absence_penalty = 2 + @homework_detail_manual.evaluation_num = 3 + @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') + @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') + @homework.homework_detail_manual = @homework_detail_manual + elsif @homework_type == "2" + #编程作业相关属性 + @homework_detail_programing = HomeworkDetailPrograming.new + @homework.homework_detail_programing = @homework_detail_programing + end respond_to do |format| format.html end diff --git a/app/views/boards/_form.html.erb b/app/views/boards/_form.html.erb index 47ae0672d..a4f58dcc3 100644 --- a/app/views/boards/_form.html.erb +++ b/app/views/boards/_form.html.erb @@ -1,7 +1,7 @@ <%= error_messages_for @board %>
    -

    +

    <%= f.text_field :name, :required => true %>

    diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 5520f526d..609294161 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -1,12 +1,5 @@