- <% @bidding_project = bid.biding_projects.all
- @temp = []
- @bidding_project.each do |pro|
+ <% bidding_project = bid.biding_projects.all
+ temp = []
+ bidding_project.each do |pro|
if pro.project && pro.project.project_status
- @temp << pro
+ temp << pro
end
- @temp
+ temp
end
%>
<% if bid.homework_type == 1%>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %>)
<% else %>
- <%= l(:label_x_homework_project, :count => @temp.count) %>(<%= link_to @temp.count, course_for_bid_path(bid.id) %>)
+ <%= l(:label_x_homework_project, :count => temp.count) %>(<%= link_to temp.count, course_for_bid_path(bid.id) %>)
<% end %>
<%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>)
@@ -74,7 +74,7 @@
<%= bid.budget%> <% elsif bid.reward_type == 2 %> <%= l(:label_bids_reward_method) %><%= bid.budget%>
<% else %>
- <% end %> |
+ <% end %>
diff --git a/app/views/bids/_bid_show.html.erb b/app/views/bids/_bid_show.html.erb
index 8d3ffec1..47f1560d 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 dd10f7b1..bd069c8c 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/7] 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 2736ec37..27e601a5 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/7] =?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 58974aad..ec469a5b 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/7] =?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 87b495f0..e65fe174 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 bf97ad29..0873f271 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/7] =?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 ff5e4fbd..4675be89 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/7] =?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 7c60e2dc..9c72d301 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
|