修改了fork页面,增加了教师超链接
This commit is contained in:
parent
3ff443b7b6
commit
13a2cfe644
|
@ -6,7 +6,7 @@ class BidsController < ApplicationController
|
|||
menu_item :homework_respond, :only => :homework_respond
|
||||
menu_item :homework_statistics, :only => :homework_statistics
|
||||
#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]
|
||||
|
||||
helper :watchers
|
||||
|
@ -206,6 +206,28 @@ class BidsController < ApplicationController
|
|||
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
|
||||
# flash[:notice] = ""
|
||||
@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
|
|
|
@ -77,6 +77,7 @@ class UsersController < ApplicationController
|
|||
|
||||
##added by fq
|
||||
def watch_bids
|
||||
cond = 'bids.reward_type <> 1'
|
||||
@bids = Bid.watched_by(@user)
|
||||
@bids = Bid.visible.where('reward_type = ?', 1) # modified by huang
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
|
|
|
@ -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>)
|
||||
|
||||
<%= 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>
|
|
@ -64,7 +64,9 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td><%= l(:label_investment_time_limit) %><%= @bid.deadline%></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div style="color: rgb(255, 0, 0); font-size: 14px">该需求已经被 <%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid), :class => 'reference') %> 个课程引用为作业</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div>
|
||||
|
@ -73,6 +75,7 @@
|
|||
<%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--tags-->
|
||||
<div class="user_fans">
|
||||
<div class="font_title_left">
|
||||
|
|
|
@ -95,10 +95,11 @@
|
|||
<div class="inf_user_context">
|
||||
<table style="font-family:微软雅黑" >
|
||||
|
||||
<!-- modified by bai 加超链接 -->
|
||||
<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>
|
||||
|
||||
<!-- end -->
|
||||
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %></td><td class="font_lighter_sidebar"><%= @course.time %> -- <%= @course.term %></td>
|
||||
|
|
|
@ -68,8 +68,9 @@
|
|||
</tr>
|
||||
<% unless @bid.parent_id.nil?%>
|
||||
<tr>
|
||||
<td><div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; -o-text-overflow: ellipsis; width:200px">
|
||||
<%= l(:label_homework_source) %>:<%= link_to(Bid.find(@bid.parent_id).name, respond_path(Bid.find(@bid.parent_id))) %></div></td>
|
||||
<td><div style=" color: rgb(255, 0, 0); width:200px">
|
||||
<% 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>
|
||||
<% end %>
|
||||
</table>
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
<% end %>
|
||||
<%= 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" %>
|
||||
<!-- added by huang -->
|
||||
<!-- added by huang modified by bai-->
|
||||
<% if @project.project_type == 1 %>
|
||||
<div class ="clear avatar_name"> <p>
|
||||
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
老师
|
||||
<%= l(:label_teacher) %>
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
学生
|
||||
<%= l(:label_student) %>
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
|
||||
助教
|
||||
<%= l(:label_TA) %>
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
<% elsif bid.reward_type == 2%>
|
||||
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
|
||||
<% else %>
|
||||
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %></span></strong>
|
||||
<% end %>
|
||||
|
||||
<!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> -->
|
||||
|
|
|
@ -1518,6 +1518,7 @@ zh:
|
|||
label_teacher: 教师
|
||||
label_teacher_homework: 教师姓名
|
||||
label_student: 学生
|
||||
label_TA: 助教
|
||||
label_other: 其他
|
||||
label_enterprise: 企业
|
||||
label_developer: 用户
|
||||
|
@ -1537,6 +1538,7 @@ zh:
|
|||
button_submit_homework: 提交作业
|
||||
label_my_course: 我的课程
|
||||
button_submit_bid: 参与竞标
|
||||
label_requirement_from: 需求来源
|
||||
|
||||
#end
|
||||
|
||||
|
|
|
@ -453,6 +453,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'calls/:id/create_fork', :to => 'bids#create_fork'
|
||||
match 'project/enterprise_course', :to => 'projects#enterprise_course'
|
||||
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'
|
||||
delete 'join_in/join', :to => 'courses#unjoin'
|
||||
|
|
|
@ -1807,6 +1807,9 @@ input[type='text'].noline {
|
|||
cursor: text;
|
||||
border-radius: 4px; # added by bai (边框变圆润)
|
||||
}
|
||||
a.reference {
|
||||
font-size: 22px;
|
||||
}
|
||||
.grayline{
|
||||
border: #d5dee9 1px solid;
|
||||
font-size: 12px;
|
||||
|
|
Loading…
Reference in New Issue