From 21f81a931afc105bde4d15c0bea6165e8054c4a0 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 11 Aug 2015 11:26:22 +0800
Subject: [PATCH 01/16] =?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 02/16] =?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 5cf6b7e76afc83018bd71e5e5905418db210d73d Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 14 Aug 2015 09:38:24 +0800
Subject: [PATCH 03/16] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8F=91=E5=B8=83?=
=?UTF-8?q?=E6=97=B6=E9=97=B4--->=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index 7159c3c83..6eb722981 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -24,7 +24,7 @@
<%= course_activity_desc activity%>
- <%= l :label_activity_time %> : <%= format_time(activity.created_at) %>
+ <%= activity.course_act_type == "Course" ? l(:label_create_time) : l(:label_activity_time) %> : <%= format_time(activity.created_at) %>
<%= link_to_attachments_course(activity.course_act) if activity.course_act_type.to_s == "News" %>
From 35d6c76a8e99ba2a9d5487e29ba1726501f6a935 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 14 Aug 2015 13:55:46 +0800
Subject: [PATCH 04/16] =?UTF-8?q?=E9=83=A8=E5=88=86=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E4=B8=8D?=
=?UTF-8?q?=E6=AD=A3=E7=A1=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...50811083234_update_course_activity_time.rb | 22 -------------------
.../20150814024425_change_attachment_time.rb | 13 +++++++++++
...50814031258_update_course_activity_time.rb | 22 +++++++++++++++++++
db/schema.rb | 2 +-
4 files changed, 36 insertions(+), 23 deletions(-)
delete mode 100644 db/migrate/20150811083234_update_course_activity_time.rb
create mode 100644 db/migrate/20150814024425_change_attachment_time.rb
create mode 100644 db/migrate/20150814031258_update_course_activity_time.rb
diff --git a/db/migrate/20150811083234_update_course_activity_time.rb b/db/migrate/20150811083234_update_course_activity_time.rb
deleted file mode 100644
index 9ba8140d8..000000000
--- a/db/migrate/20150811083234_update_course_activity_time.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-class UpdateCourseActivityTime < ActiveRecord::Migration
- def up
- count = CourseActivity.all.count / 10 + 1
- transaction do
- for i in 1 ... count do i
- CourseActivity.page(i).per(10).each do |activity|
- if activity.course_act
- if activity.course_act.respond_to?("created_at")
- activity.created_at = activity.course_act.created_at
- elsif activity.course_act.respond_to?("created_on")
- activity.created_at = activity.course_act.created_on
- end
- activity.save
- end
- end
- end
- end
- end
-
- def down
- end
-end
diff --git a/db/migrate/20150814024425_change_attachment_time.rb b/db/migrate/20150814024425_change_attachment_time.rb
new file mode 100644
index 000000000..fd1ffb7a7
--- /dev/null
+++ b/db/migrate/20150814024425_change_attachment_time.rb
@@ -0,0 +1,13 @@
+class ChangeAttachmentTime < ActiveRecord::Migration
+ def up
+ Attachment.where("container_type = 'Course'").each do |attachment|
+ if attachment.container && attachment.container.created_at.to_i > attachment.created_on.to_i
+ attachment.created_on = attachment.container.created_at + 3600 * 24
+ attachment.save
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20150814031258_update_course_activity_time.rb b/db/migrate/20150814031258_update_course_activity_time.rb
new file mode 100644
index 000000000..155e212a3
--- /dev/null
+++ b/db/migrate/20150814031258_update_course_activity_time.rb
@@ -0,0 +1,22 @@
+class UpdateCourseActivityTime < ActiveRecord::Migration
+ def up
+ count = CourseActivity.all.count / 10 + 1
+ transaction do
+ for i in 1 ... count do i
+ CourseActivity.page(i).per(10).each do |activity|
+ if activity.course_act
+ if activity.course_act.respond_to?("created_at")
+ activity.created_at = activity.course_act.created_at
+ elsif activity.course_act.respond_to?("created_on")
+ activity.created_at = activity.course_act.created_on
+ end
+ activity.save
+ end
+ end
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1488ca365..2014bf1ef 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 => 20150811083234) do
+ActiveRecord::Schema.define(:version => 20150814031258) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
From 50fa03d00cd0a2bdfd6184a68945ee5fb6d94a6b Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 14 Aug 2015 14:44:31 +0800
Subject: [PATCH 05/16] =?UTF-8?q?=E5=8F=91=E5=B8=83=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=AF=A5=E9=97=AE=E5=8D=B7=E6=89=8D=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E5=9C=A8=E5=8A=A8=E6=80=81=EF=BC=8C=E5=8F=96=E6=B6=88?=
=?UTF-8?q?=E5=8F=91=E5=B8=83=E5=90=8E=E5=8F=96=E6=B6=88=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E8=AF=A5=E5=8A=A8=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/poll.rb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/models/poll.rb b/app/models/poll.rb
index 34a381246..3adbbb791 100644
--- a/app/models/poll.rb
+++ b/app/models/poll.rb
@@ -10,7 +10,7 @@ class Poll < ActiveRecord::Base
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# 课程动态
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
- after_create :act_as_activity, :act_as_course_activity
+ before_save :act_as_activity, :act_as_course_activity
acts_as_event :title => Proc.new {|o| "#{l(:label_course_poll)}: #{o.polls_name}" },
:description => :polls_description,
@@ -32,7 +32,11 @@ class Poll < ActiveRecord::Base
#课程动态公共表记录
def act_as_course_activity
if self.polls_type == "Course"
- self.course_acts << CourseActivity.new(:user_id => self.user_id,:course_id => self.polls_group_id)
+ if self.polls_status == 2 #问卷是发布状态
+ self.course_acts << CourseActivity.new(:user_id => self.user_id,:course_id => self.polls_group_id)
+ elsif self.polls_status == 1 #问卷是新建状态
+ self.course_acts.destroy_all
+ end
end
end
end
From a8283a28617d18113b45e511ad22c43bd7b0174c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 14 Aug 2015 14:46:14 +0800
Subject: [PATCH 06/16] =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=88=B0=E7=AD=94?=
=?UTF-8?q?=E9=A2=98=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/courses_helper.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index ac142f5a1..f9fb31969 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -704,7 +704,7 @@ module CoursesHelper
url = course_feedback_path(activity.course)
when "Poll"
title = "问卷 " + activity.course_act.polls_name
- url = poll_index_path(:polls_type => "Course", :polls_group_id => activity.course_id)
+ url = poll_path(activity.course_act_id)
end
end
link_to title.gsub(/<(?!img)[^>]*>/,'').html_safe, url, :class => "problem_tit c_dblue fl fb"
From 16aea5ef4291b6c7371315f33730e2a5a4b7755c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 14 Aug 2015 15:44:54 +0800
Subject: [PATCH 07/16] =?UTF-8?q?=E8=BF=9F=E4=BA=A4=E6=89=A3=E5=88=860-50?=
=?UTF-8?q?=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../_homework_detail_manual_form.html.erb | 3 ++-
.../_homework_detail_programing_form.html.erb | 3 ++-
public/javascripts/course.js | 18 ++++++++++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/app/views/homework_common/_homework_detail_manual_form.html.erb b/app/views/homework_common/_homework_detail_manual_form.html.erb
index ffec93e73..3af12973a 100644
--- a/app/views/homework_common/_homework_detail_manual_form.html.erb
+++ b/app/views/homework_common/_homework_detail_manual_form.html.erb
@@ -48,7 +48,8 @@
-
- <%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
+ <%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
+
分
diff --git a/app/views/homework_common/_homework_detail_programing_form.html.erb b/app/views/homework_common/_homework_detail_programing_form.html.erb
index 8c589c040..829905327 100644
--- a/app/views/homework_common/_homework_detail_programing_form.html.erb
+++ b/app/views/homework_common/_homework_detail_programing_form.html.erb
@@ -43,7 +43,8 @@
-
- <%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
+ <%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
+
分
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 6ba202b28..be29fdc30 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -412,6 +412,24 @@ function regex_homework_name()
}
}
+//处理迟交扣分
+function check_late_penalty()
+{
+ var obj = $("input[name='late_penalty']");
+ var regex = /^\d+$/;
+ if(regex.test(obj.val()))
+ {
+ if(obj.val() > 50)
+ {
+ obj.val("50");
+ }
+ }
+ else
+ {
+ obj.val("0");
+ }
+}
+
//验证匿评数量
function regex_evaluation_num()
{
From 6051d0797d4018af815c3d45b31a681641451a89 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 14 Aug 2015 16:24:43 +0800
Subject: [PATCH 08/16] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=B8=8D=E6=AD=A3=E7=A1=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 67 ++-------------------------
app/views/courses/search.html.erb | 12 ++---
2 files changed, 11 insertions(+), 68 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 71715035e..29f2e00f4 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -106,74 +106,17 @@ class CoursesController < ApplicationController
# 课程搜索
# add by nwb
def search
- courses_all = Course.all_course
- name = params[:name]
- if name.blank?
- @courses = []
- @courses_all = []
- @course_count = 0
- @course_pages = Paginator.new @course_count, per_page_option, params['page']
+ if params[:name].empty?
+ courses = Course.visible
+ @courses = paginateHelper courses,10
else
- @courses = courses_all.visible
- if params[:name].present?
- @courses_all = @courses.like(params[:name])
- else
- @courses_all = @courses;
- end
- @course_count = @courses_all.count
- @course_pages = Paginator.new @course_count, per_page_option, params['page']
-
- # 课程的动态数
- # @course_activity_count=Hash.new
- # @courses_all.each do |course|
- # @course_activity_count[course.id]=0
- # end
- #
- # case params[:course_sort_type]
- # when '0'
- # @courses = @courses_all.order("created_at desc")
- # @s_type = 0
- # @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
- #
- # @course_activity_count=get_course_activity @courses,@course_activity_count
- #
- # when '1'
- # @courses = @courses_all.order("course_ac_para desc")
- # @s_type = 1
- # @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
- #
- # @course_activity_count=get_course_activity @courses,@course_activity_count
- #
- # when '2'
- # @courses = @courses_all.order("watchers_count desc")
- # @s_type = 2
- # @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
- #
- # @course_activity_count=get_course_activity @courses,@course_activity_count
- #
- # when '3'
- # @course_activity_count=get_course_activity @courses_all,@course_activity_count_array
- # @courses=handle_course @courses_all,@course_activity_count
- # @s_type = 3
- # @courses = @courses[@course_pages.offset, @course_pages.per_page]
- #
- # else
- # @s_type = 0
- # @courses = @courses_all.order("created_at desc")
- # @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
- #
- # @course_activity_count=get_course_activity @courses,@course_activity_count
- #
- # end
+ courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'")
+ @courses = paginateHelper courses,10
end
respond_to do |format|
format.html {
render :layout => 'course_base'
- scope = Course
- unless params[:closed]
- scope = scope.active
- end
}
format.atom {
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
diff --git a/app/views/courses/search.html.erb b/app/views/courses/search.html.erb
index 98b056487..c19f9821a 100644
--- a/app/views/courses/search.html.erb
+++ b/app/views/courses/search.html.erb
@@ -39,17 +39,17 @@
<% end %>
-<% if @courses.size == 0 %>
-<%= render :partial => 'layouts/no_content'%>
+<% if @courses && !@courses.empty? %>
+
+ <%= render_course_hierarchy(@courses)%>
+
<% else %>
-
- <%= render_course_hierarchy(@courses)%>
-
+ <%= render :partial => 'layouts/no_content'%>
<% end %>
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 09/16] =?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 10/16] =?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 @@