diff --git a/app/views/bids/_bid_show.html.erb b/app/views/bids/_bid_show.html.erb
index 8d3ffec18..47f1560dd 100644
--- a/app/views/bids/_bid_show.html.erb
+++ b/app/views/bids/_bid_show.html.erb
@@ -13,7 +13,34 @@
|
- <% if bid.reward_type.nil? or bid.reward_type == 1%> <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%> <% elsif bid.reward_type == 2%> <%= l(:label_bids_reward_method) %><%= bid.budget%> <% else %> <% end %> |
+
+ <% if bid.reward_type.nil? or bid.reward_type == 1%>
+
+ <%= l(:label_bids_reward_method) %>
+
+ <%= l(:label_call_bonus) %>
+ <%= l(:label_RMB_sign) %>
+ <%= bid.budget%>
+
+
+ <% elsif bid.reward_type == 2%>
+
+ <%= l(:label_bids_reward_method) %>
+ <%= bid.budget%>
+
+ <% else %>
+ <% end %>
+ |
<% if bid.reward_type == 3 %>
@@ -60,6 +87,6 @@
diff --git a/app/views/bids/contest.html.erb b/app/views/bids/contest.html.erb
index dd10f7b1b..bd069c8c8 100644
--- a/app/views/bids/contest.html.erb
+++ b/app/views/bids/contest.html.erb
@@ -32,13 +32,13 @@
From 108866b8baf2436b2745f6c2a3a8874265e037f7 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 4 Jul 2014 10:29:31 +0800
Subject: [PATCH 3/8] 1
---
app/views/users/index.html.erb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 2736ec37e..27e601a5f 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -28,13 +28,13 @@
From d54f37e6306bc3966bacf71e9503a542410411ac Mon Sep 17 00:00:00 2001
From: yanxd
Date: Fri, 4 Jul 2014 11:15:58 +0800
Subject: [PATCH 4/8] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=EF=BC=8C=E5=88=A4=E6=96=AD=E7=95=99=E8=A8=80=E4=BA=BA=E9=80=BB?=
=?UTF-8?q?=E8=BE=91=E6=9C=89=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 58974aad2..ec469a5b9 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -50,7 +50,7 @@
<% case e.act_type %>
<% when 'JournalsForMessage' %>
- <% if User.current.login == @user.login %>
+ <% if User.current.login == e.user.try(:login) %>
<%# if e.user_id == act.jour.id %>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%=
link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> |
From 1e6693cdcfafd72048e635ecfa2e7a6474cc2249 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 4 Jul 2014 11:26:37 +0800
Subject: [PATCH 5/8] =?UTF-8?q?1.=E5=8F=96=E6=B6=88=E8=BD=AF=E4=BB=B6?=
=?UTF-8?q?=E5=88=9B=E5=AE=A2=E7=95=8C=E9=9D=A22=E4=B8=AA=E4=B8=AA?=
=?UTF-8?q?=E4=BA=BA=E5=BE=97=E5=88=86=E6=98=BE=E7=A4=BA=202.=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=E8=BD=AF=E4=BB=B6=E5=88=9B=E5=AE=A2=E7=95=8C=E9=9D=A2?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=82=E4=B8=8E=E8=AF=BE=E7=A8=8B=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84BUG=203.=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E5=8F=82=E4=B8=8E?=
=?UTF-8?q?=E7=9A=84=E6=9C=AA=E8=BF=87=E6=9C=9F=E7=9A=84=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/users_helper.rb | 11 +++++++++++
app/views/users/_user_show.html.erb | 19 +++++++++++--------
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 87b495f00..e65fe174e 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -247,4 +247,15 @@ module UsersHelper
displayed_flag = %w|index|
!displayed_flag.include?(params['action'])
end
+
+ #获取指定用户的未过期的课程列表
+ def user_courses_list user
+ result = []
+ user.coursememberships.map(&:course).each do |course|
+ if !course_endTime_timeout?(course)
+ result << course
+ end
+ end
+ return result
+ end
end
diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb
index bf97ad298..0873f2713 100644
--- a/app/views/users/_user_show.html.erb
+++ b/app/views/users/_user_show.html.erb
@@ -39,7 +39,7 @@
- <%= l(:label_user_grade) %>:
+
<%= render :partial => 'users/user_score', :locals => {:user => user}%>
@@ -61,14 +61,17 @@
<% end %>
- <% unless user.memberships.empty? %>
- <% cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
- <% memberships = user.memberships.all(:conditions => cond) %>
- <%= l(:label_x_course_contribute_to, :count => memberships.count) %>
- <% for member in memberships %>
- <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
- <% end %>
+ <%# unless user.memberships.empty? %>
+ <%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
+ <%# memberships = user.memberships.all(:conditions => cond) %>
+ <% user_courses = user.coursememberships.map(&:course) %>
+ <%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
+ <% for course in user_courses %>
+ <%# if course.name != nil %>
+ <%= link_to course.name,course_path(course) %><%= (user_courses.last == course) ? '' : ',' %>
+ <%# end %>
<% end %>
+ <%# end %>
<%= user.changesets.count == 0 ? '' : "#{l(:label_x_total_commit, :count => user.changesets.count)}" %>
From 0e0b8fb8d8116670decb896b50edb5d2c93a66c7 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 4 Jul 2014 11:30:22 +0800
Subject: [PATCH 6/8] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E4=B8=AD=E5=BD=93=E8=AF=BE=E7=A8=8B=E5=90=8D=E7=A7=B0=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=BB=8E=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E9=87=8C=E8=8E=B7=E5=8F=96=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/course.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/models/course.rb b/app/models/course.rb
index ff5e4fbd8..4675be899 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -275,4 +275,7 @@ class Course < ActiveRecord::Base
end
end
+ def name
+ read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
+ end
end
From 36c90f1dfd2123cf7dfbea7a9699bfcacb4e0aeb Mon Sep 17 00:00:00 2001
From: yanxd
Date: Fri, 4 Jul 2014 11:30:41 +0800
Subject: [PATCH 7/8] =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E5=AD=A6?=
=?UTF-8?q?=E6=A0=A1=EF=BC=8C=E5=86=8D=E6=8B=BFid=E7=9B=B4=E6=8E=A5?=
=?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/welcome_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb
index 7c60e2dc3..9c72d301f 100644
--- a/app/controllers/welcome_controller.rb
+++ b/app/controllers/welcome_controller.rb
@@ -33,7 +33,7 @@ class WelcomeController < ApplicationController
if params[:school_id]
@school_id = params[:school_id]
elsif User.current.logged? && User.current.user_extensions.school
- @school_id = User.current.user_extensions.school.id
+ @school_id = User.current.user_extensions.school.try(:id)
end
@logoLink ||= logolink()
end
From 864ef179418e2ab4635adc2179848cde8ecf509b Mon Sep 17 00:00:00 2001
From: nwb
Date: Fri, 4 Jul 2014 13:38:34 +0800
Subject: [PATCH 8/8] =?UTF-8?q?=E6=B8=85=E7=90=86=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E7=8A=B6=E6=80=81=E8=A1=A8=EF=BC=8C=E4=BF=AE=E6=AD=A3=E5=90=8C?=
=?UTF-8?q?=E4=B8=80=E8=AF=BE=E7=A8=8B=E5=87=BA=E7=8E=B0=E5=A4=9A=E6=AC=A1?=
=?UTF-8?q?=E7=9A=84BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/course_status.rb | 4 ++++
.../20140603042015_stored_course_procedure.rb | 2 +-
.../20140704034832_clear_course_status.rb | 16 +++++++++++++
db/schema.rb | 24 +++++++++----------
4 files changed, 33 insertions(+), 13 deletions(-)
create mode 100644 db/migrate/20140704034832_clear_course_status.rb
diff --git a/app/models/course_status.rb b/app/models/course_status.rb
index d5a01ac4b..b36661ebe 100644
--- a/app/models/course_status.rb
+++ b/app/models/course_status.rb
@@ -1,3 +1,7 @@
class CourseStatus < ActiveRecord::Base
attr_accessible :changesets_count, :course_ac_para, :course_id, :grade, :watchers_count
+
+ belongs_to :course
+ validates_presence_of :course_id
+ validates_uniqueness_of :course_id
end
diff --git a/db/migrate/20140603042015_stored_course_procedure.rb b/db/migrate/20140603042015_stored_course_procedure.rb
index 2f5faf5c7..426567cac 100644
--- a/db/migrate/20140603042015_stored_course_procedure.rb
+++ b/db/migrate/20140603042015_stored_course_procedure.rb
@@ -31,7 +31,7 @@ class StoredCourseProcedure < ActiveRecord::Migration
courseStatus.watchers_count = projectstatus.watchers_count
courseStatus.grade = projectstatus.grade
courseStatus.course_ac_para = projectstatus.course_ac_para
- courseStatus.save(:validate => false)
+ courseStatus.save()
end
end
end
diff --git a/db/migrate/20140704034832_clear_course_status.rb b/db/migrate/20140704034832_clear_course_status.rb
new file mode 100644
index 000000000..527bfd412
--- /dev/null
+++ b/db/migrate/20140704034832_clear_course_status.rb
@@ -0,0 +1,16 @@
+class ClearCourseStatus < ActiveRecord::Migration
+ def up
+ # 删除重复的课程状态
+ # 之前做迁移的时候未加验证可能引起此问题
+ courseidlist = "(-1"
+ CourseStatus.all.each do |status|
+ sql = "delete from course_statuses where course_id=" + status.course_id.to_s + " and id<>" + status.id.to_s +
+ " and course_id not in " +courseidlist + ")"
+ courseidlist += "," + status.course_id.to_s;
+ execute(sql)
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 371883051..32a903aa8 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 => 20140703085204) do
+ActiveRecord::Schema.define(:version => 20140704034832) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -794,20 +794,20 @@ ActiveRecord::Schema.define(:version => 20140703085204) do
end
create_table "relative_memos", :force => true do |t|
- t.integer "osp_id", :null => false
+ 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"
|