修改了fork页面,增加了教师超链接

This commit is contained in:
baiyu 2013-10-10 23:02:15 +08:00
parent 3ff443b7b6
commit 13a2cfe644
11 changed files with 89 additions and 21 deletions

View File

@ -6,7 +6,7 @@ class BidsController < ApplicationController
menu_item :homework_respond, :only => :homework_respond menu_item :homework_respond, :only => :homework_respond
menu_item :homework_statistics, :only => :homework_statistics menu_item :homework_statistics, :only => :homework_statistics
#Ended by young #Ended by young
before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork] before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork, :show_course]
before_filter :require_login,:only => [:set_reward] before_filter :require_login,:only => [:set_reward]
helper :watchers helper :watchers
@ -205,6 +205,28 @@ class BidsController < ApplicationController
end end
end end
def show_course
bids = Bid.where('parent_id = ?', @bid.id)
@courses = []
for bid in bids
@courses << bid.courses.first
end
respond_to do |format|
if @bid.reward_type == 3
format.html {
render :layout => 'base_homework'
}
else
format.html {
render :layout => 'base_bids'
}
end
format.api
end
end
def show_project def show_project
# flash[:notice] = "" # flash[:notice] = ""

View File

@ -77,6 +77,7 @@ class UsersController < ApplicationController
##added by fq ##added by fq
def watch_bids def watch_bids
cond = 'bids.reward_type <> 1'
@bids = Bid.watched_by(@user) @bids = Bid.watched_by(@user)
@bids = Bid.visible.where('reward_type = ?', 1) # modified by huang @bids = Bid.visible.where('reward_type = ?', 1) # modified by huang
@offset, @limit = api_offset_and_limit({:limit => 10}) @offset, @limit = api_offset_and_limit({:limit => 10})

View File

@ -0,0 +1,35 @@
<ul class="user_project_sort">
<% for course in @courses %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(course), :class => 'avatar'), project_path(course) %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><span><%= link_to_project(course) %></span>
<span style="float: right"><%= l(:label_homework) %> (<span class=""><%= link_to (course.homeworks.count), {:controller => 'projects', :action => 'homework', :id => course.identifier} %></span>)
&nbsp;&nbsp;&nbsp;
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (course.news.count), {:controller => 'news', :action => 'index', :project_id => course.identifier} %></span>)
</td>
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= course.description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(course.created_on) %></span></td><!-- modified by ming -->
<td align="right" >
<% t_course = Course.find_by_extra(course.identifier) %>
教师:<%= link_to(t_course.teacher.lastname+t_course.teacher.firstname, user_path(t_course.teacher)) %>
</td>
</tr>
</table></td>
</tr>
</table><% end %>
</li>
</ul>

View File

@ -55,16 +55,18 @@
</tr> </tr>
<tr> <tr>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%> <% if @bid.reward_type.nil? or @bid.reward_type == 1%>
<td><%= l(:label_bids_reward_method) %><span style="color: #ed8924; font-weight: bold"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= @bid.budget%></span></td> <td><%= l(:label_bids_reward_method) %><span style="color: #ed8924; font-weight: bold"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= @bid.budget%></span></td>
<% elsif @bid.reward_type == 2%> <% elsif @bid.reward_type == 2%>
<td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td> <td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td>
<% else %> <% else %>
<td><%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %>&nbsp;<%= @bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></td> <td><%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %>&nbsp;<%= @bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></td>
<% end %> <% end %>
</tr> </tr>
<tr> <tr>
<td><%= l(:label_investment_time_limit) %><%= @bid.deadline%></td> <td><%= l(:label_investment_time_limit) %><%= @bid.deadline%></td>
</tr>
<tr>
<td><div style="color: rgb(255, 0, 0); font-size: 14px">该需求已经被&nbsp;<%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid), :class => 'reference') %>&nbsp;个课程引用为作业</div></td>
</tr> </tr>
</table> </table>
<div> <div>
@ -73,6 +75,7 @@
<%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%> <%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
</div> </div>
</div> </div>
<!--tags--> <!--tags-->
<div class="user_fans"> <div class="user_fans">
<div class="font_title_left"> <div class="font_title_left">

View File

@ -94,11 +94,12 @@
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:微软雅黑" > <table style="font-family:微软雅黑" >
<!-- modified by bai 加超链接 -->
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_teacher) %></td><td class="font_lighter_sidebar"><%=link_to (@course.teacher.lastname+@course.teacher.firstname) %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_main_teacher) %></td><td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td>
</tr> </tr>
<!-- end -->
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %></td><td class="font_lighter_sidebar"><%= @course.time %> -- <%= @course.term %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %></td><td class="font_lighter_sidebar"><%= @course.time %> -- <%= @course.term %></td>

View File

@ -68,8 +68,9 @@
</tr> </tr>
<% unless @bid.parent_id.nil?%> <% unless @bid.parent_id.nil?%>
<tr> <tr>
<td><div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; -o-text-overflow: ellipsis; width:200px"> <td><div style=" color: rgb(255, 0, 0); width:200px">
<%= l(:label_homework_source) %><%= link_to(Bid.find(@bid.parent_id).name, respond_path(Bid.find(@bid.parent_id))) %></div></td> <% author=Bid.find(@bid.parent_id).author%>
作业来源于<%= link_to(author.lastname+author.firstname, user_path(Bid.find(@bid.parent_id).author))%>的需求:<%= link_to(Bid.find(@bid.parent_id).name, respond_path(Bid.find(@bid.parent_id))) %></div></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>

View File

@ -14,16 +14,16 @@
<% end %> <% end %>
<%= member.user.nil? ? '' : (link_to image_tag(url_to_avatar(member.user), :class => 'avatar'), :class => "avatar") %> <%= member.user.nil? ? '' : (link_to image_tag(url_to_avatar(member.user), :class => 'avatar'), :class => "avatar") %>
<%= content_tag "div", link_to_user(member.principal), :class => "nomargin avatar_name" %> <%= content_tag "div", link_to_user(member.principal), :class => "nomargin avatar_name" %>
<!-- added by huang --> <!-- added by huang modified by bai-->
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<div class ="clear avatar_name"> <p> <div class ="clear avatar_name"> <p>
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %> <% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
老师 <%= l(:label_teacher) %>
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %> <% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
学生 <%= l(:label_student) %>
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %> <% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
助教 <%= l(:label_TA) %>
<% else %> <% else %>
<% end %> <% end %>
</p></div> </p></div>

View File

@ -22,7 +22,6 @@
<% elsif bid.reward_type == 2%> <% elsif bid.reward_type == 2%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
<% else %> <% else %>
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong>
<% end %> <% end %>
<!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> -->

View File

@ -1518,6 +1518,7 @@ zh:
label_teacher: 教师 label_teacher: 教师
label_teacher_homework: 教师姓名 label_teacher_homework: 教师姓名
label_student: 学生 label_student: 学生
label_TA: 助教
label_other: 其他 label_other: 其他
label_enterprise: 企业 label_enterprise: 企业
label_developer: 用户 label_developer: 用户
@ -1537,6 +1538,7 @@ zh:
button_submit_homework: 提交作业 button_submit_homework: 提交作业
label_my_course: 我的课程 label_my_course: 我的课程
button_submit_bid: 参与竞标 button_submit_bid: 参与竞标
label_requirement_from: 需求来源
#end #end
@ -1619,4 +1621,4 @@ zh:
label_new_join: 加入 label_new_join: 加入
label_new_join_order: 请输入课程密码 label_new_join_order: 请输入课程密码
label_task_submit_form_accessory: 作业最终以附件形式提交 label_task_submit_form_accessory: 作业最终以附件形式提交
label_task_submit_form_project: 作业最终以项目形式提交 label_task_submit_form_project: 作业最终以项目形式提交

View File

@ -453,6 +453,7 @@ RedmineApp::Application.routes.draw do
match 'calls/:id/create_fork', :to => 'bids#create_fork' match 'calls/:id/create_fork', :to => 'bids#create_fork'
match 'project/enterprise_course', :to => 'projects#enterprise_course' match 'project/enterprise_course', :to => 'projects#enterprise_course'
match 'project/course_enterprise', :to => 'projects#course_enterprise' match 'project/course_enterprise', :to => 'projects#course_enterprise'
match 'calls/:id/show_course', :to => 'bids#show_course', :as => 'show_course'
post 'join_in/join', :to => 'courses#join', :as => 'join' post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin' delete 'join_in/join', :to => 'courses#unjoin'

View File

@ -1807,6 +1807,9 @@ input[type='text'].noline {
cursor: text; cursor: text;
border-radius: 4px; # added by bai (边框变圆润) border-radius: 4px; # added by bai (边框变圆润)
} }
a.reference {
font-size: 22px;
}
.grayline{ .grayline{
border: #d5dee9 1px solid; border: #d5dee9 1px solid;
font-size: 12px; font-size: 12px;