From 52dabc6b984c5f70ced86f5209bac77d4f4bac06 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Oct 2014 17:47:39 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8F=96=E6=B6=88=E6=96=B0=E5=BB=BA=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E6=97=B6=E4=BA=92=E8=AF=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=9A=84=E6=B7=BB=E5=8A=A0=202.=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=E3=80=81?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=88=A0=E9=99=A4=E8=80=81=E5=B8=88=E5=B8=83?= =?UTF-8?q?=E7=BD=AE=E4=BD=9C=E4=B8=9A=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_bid_homework_show.html.erb | 217 +++++++++++++-------- app/views/courses/_homework_form.html.erb | 2 +- 2 files changed, 136 insertions(+), 83 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index d452b6d53..469a9e85d 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -5,94 +5,147 @@ <% else %> <% bids.each do |bid|%> - -
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %> - - - - - - - - - - - - - - + + + +
<%= 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') %> - - <% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %> - <%# 提交作业按钮 %> - - <% cur_user_homework = cur_user_homework_for_bid(bid) %> - <% if cur_user_homework!= nil && cur_user_homework.count == 0 %> - <%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %> - <% else %> - <%= l(:lable_has_commit_homework)%> - <% end %> - <% end %> - <% if (User.current.admin?||User.current.id==bid.author_id) %> - <%= link_to( - l(:button_edit), - {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}, - :class => 'icon icon-edit' - ) %> - <%= link_to( - l(:button_delete), - {:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :class => 'icon icon-del' - ) %> - <% end %> -
- <% bidding_project = bid.biding_projects.all - temp = [] - bidding_project.each do |pro| - if pro.project && pro.project.project_status - temp << pro - end - 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) %>) - <% end %> - <%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>) - - <% if betweentime(bid.deadline) < 0 %> - <%= l(:label_commit_limit)%> - <% else %> - <% if betweentime(bid.deadline) < 3 %> - <%= l(:label_commit_ar) %> - <% else %> - <% end %> - - - <% 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 %>
- <%#= bid.description %> - <%= textilizable bid, :description %> -
+ <%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %> + + + + + + + + + + + + + + + + <%= l(:label_create_time) %> + :  + <%=format_time bid.created_on %> + + + <%= l(:field_deadline) %> + :  + <%=bid.deadline %> + + -
+ + <%= 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') %> + + + <% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %> + <% cur_user_homework = cur_user_homework_for_bid(bid) %> + <% if cur_user_homework!= nil && cur_user_homework.count == 0 %> + <%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %> + <% else %> + + <%= l(:lable_has_commit_homework)%> + + <% end %> + <% end %> + <% if (User.current.admin?||User.current.id==bid.author_id) %> + <%= link_to( + l(:button_edit), + {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}, + :class => 'icon icon-edit' + ) %> + <%#= link_to( + l(:button_delete), + {:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id}, + :method => :post, + :data => {:confirm => l(:text_are_you_sure)}, + :class => 'icon icon-del' + ) %> + <% end %> + +
+ + <% bidding_project = bid.biding_projects.all + temp = [] + bidding_project.each do |pro| + if pro.project && pro.project.project_status + temp << pro + end + 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) %> + ) + <% end %> + + + <%= l(:label_x_responses, :count => bid.commit) %> + ( + + <%= link_to bid.commit, respond_path(bid) %> + + ) + + + <% if betweentime(bid.deadline) < 0 %> + + <%= l(:label_commit_limit)%> + + <% else %> + <% if betweentime(bid.deadline) < 3 %> + + <%= l(:label_commit_ar) %> + + <% end %> + <% 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%> + + + <% end %> +
+ + <%= textilizable bid, :description %> + +
- <%= l(:label_create_time) %> :  <%=format_time bid.created_on %> <%= l(:field_deadline) %> :  <%=bid.deadline %> -
- <% end %> <% end %>