diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d916b8595..ce5d2040f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 66a83f1d8..ff7b507da 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -7,7 +7,11 @@ - + - +
<%= 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') %> + <%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %> + <%= l(:label_user_create_project_homework) %>:   + <%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %> + <%= l(:field_deadline) %> : <%=bid.deadline %> + <% if (User.current.admin?||User.current.id==bid.author_id)&&(bid.homework_type == 1)%> <%= link_to( @@ -25,6 +29,18 @@ <% end %>
+ + + <% if betweentime(bid.deadline) < 0 %> + <%= l(:label_commit_limit)%> + <% else %> + <% if betweentime(bid.deadline) < 3 %> + <%= l(:label_commit_ar) %> + <% else %> + <% end %> + <% end %> +
@@ -46,7 +62,7 @@ <%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>)
<%= format_time bid.created_on %><%= l(:label_create_time) %> : <%=format_time bid.created_on %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4c629d6f1..9753455ae 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -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: 教师