添加了作业截止时间提醒功能!
This commit is contained in:
parent
0b61b4ef5b
commit
c93ca4d2ed
|
@ -438,6 +438,12 @@ module ApplicationHelper
|
|||
l(options[:label] || :label_added_time_by, :author => link_to_user(author), :age => time_tag(created)).html_safe
|
||||
end
|
||||
|
||||
#huang
|
||||
def betweentime(enddate)
|
||||
ss=(DateTime.parse("#{enddate.to_date}")-DateTime.parse("#{DateTime.now.to_date}")).to_i
|
||||
return ss
|
||||
end
|
||||
|
||||
def time_tag(time)
|
||||
text = distance_of_time_in_words(Time.now, time)
|
||||
if @project
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
<td>
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><span><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author), :class => 'bid_user') %>: <%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span>
|
||||
<td colspan="2" valign="top"><span class="font-lighter"><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %></span>
|
||||
<span class="font-lighter"><%= l(:label_user_create_project_homework) %></span>:
|
||||
<span><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span>
|
||||
<span style="float: right"><%= l(:field_deadline) %> : <%=bid.deadline %></span>
|
||||
|
||||
<span style="float: right">
|
||||
<% if (User.current.admin?||User.current.id==bid.author_id)&&(bid.homework_type == 1)%>
|
||||
<%= link_to(
|
||||
|
@ -25,6 +29,18 @@
|
|||
<% end %>
|
||||
</strong></td>
|
||||
</tr>
|
||||
<tr><td colspan="2">
|
||||
<!-- tishi -->
|
||||
<span style="float: right">
|
||||
<% if betweentime(bid.deadline) < 0 %>
|
||||
<span style="color: red; float: right"><%= l(:label_commit_limit)%></span>
|
||||
<% else %>
|
||||
<% if betweentime(bid.deadline) < 3 %>
|
||||
<span style="color: red"><%= l(:label_commit_ar) %></span>
|
||||
<% else %>
|
||||
<% end %>
|
||||
<% end %> </span>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td width="500">
|
||||
<table border="0">
|
||||
|
@ -46,7 +62,7 @@
|
|||
</span><span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
|
||||
<td width="200" align="right" class="a"><span class="font_lighter"><%= l(:label_create_time) %> : <%=format_time bid.created_on %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
|
|
@ -1209,6 +1209,8 @@ zh:
|
|||
label_total_time: 合计
|
||||
label_create_time: 创建时间 #Customer added!Added by nie
|
||||
label_current_contributors: 位当前贡献者
|
||||
label_commit_limit: 作业提交时间已过!
|
||||
label_commit_ar: 作业提交截止时间快到了!
|
||||
#modify by men
|
||||
label_x_current_contributors:
|
||||
zero: 位当前贡献者
|
||||
|
@ -1519,6 +1521,7 @@ zh:
|
|||
button_projects_feedback_respond: 回复
|
||||
label_projects_feedback_respond_content: 请输入回复内容
|
||||
label_user_create_project: 创建了
|
||||
label_user_create_project_homework: 创建了作业
|
||||
#added by bai
|
||||
label_identity: 身份
|
||||
label_teacher: 教师
|
||||
|
|
Loading…
Reference in New Issue