From 520c5843cec6b9ebd10212e988d2731637c34fd2 Mon Sep 17 00:00:00 2001 From: xianbo Date: Wed, 16 Oct 2013 17:02:02 +0800 Subject: [PATCH] modify homework show and the link of style --- app/views/layouts/base_bids.html.erb | 8 ++++++-- app/views/users/_my_create_homework.html.erb | 18 ++++++++++++------ app/views/users/_my_homework.html.erb | 3 ++- config/locales/zh.yml | 3 +++ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/views/layouts/base_bids.html.erb b/app/views/layouts/base_bids.html.erb index 0c1246090..a3ef98175 100644 --- a/app/views/layouts/base_bids.html.erb +++ b/app/views/layouts/base_bids.html.erb @@ -44,7 +44,10 @@ <%= h @bid.name %> - <%= watcher_link(@bid, User.current) %> <%= link_to("选为作业", fork_path(@bid)) %> + <%= watcher_link(@bid, User.current) %> + + + <%= link_to(l(:label_fork_homework_new), fork_path(@bid)) %> @@ -66,7 +69,8 @@ <%= l(:label_investment_time_limit) %><%= @bid.deadline%> -
该需求已经被 <%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid), :class => 'reference') %> 个课程引用为作业
+
<%= l(:label_has_been)%> <%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid), :class => 'reference') %>  + <%= l(:label_course_userd_by)%>
diff --git a/app/views/users/_my_create_homework.html.erb b/app/views/users/_my_create_homework.html.erb index 672428c2b..d5652fe0a 100644 --- a/app/views/users/_my_create_homework.html.erb +++ b/app/views/users/_my_create_homework.html.erb @@ -11,9 +11,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') %>    - <%= l(:label_course_homework) %> : <%= link_to(bid.courses.first.name, project_path(bid.courses.first)) %> <%= link_to( + <%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author), :class => 'bid_user') %> + 在课程: <%= link_to(bid.courses.first.name, project_path(bid.courses.first)) %> + 中布置了作业: <%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %> + + <%= link_to( l(:button_delete), {:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id}, :method => :post, @@ -30,9 +32,13 @@ <% 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 %>
<% if bid.homework_type == 1%> - <%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %>) - <% else %><%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %>)<% end %> <%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>) + <% if bid.homework_type == 1%> + <%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %>) + <% else %> + <%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %>) + <% end %> + <%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>)
<%= format_time bid.created_on %> diff --git a/app/views/users/_my_homework.html.erb b/app/views/users/_my_homework.html.erb index b471e3dfe..cb6280012 100644 --- a/app/views/users/_my_homework.html.erb +++ b/app/views/users/_my_homework.html.erb @@ -11,7 +11,8 @@ - diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4cef2019b..7e03fb1ea 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -504,6 +504,7 @@ zh: label_requirement: 需求 label_new_course: 课程 label_new_homework: 作业 + label_create_homework: 布置了作业: label_new_contest: 竞赛 label_requirement_focus: 关注需求 label_developer: 用户 @@ -1629,3 +1630,5 @@ zh: label_new_join_order: 请输入课程密码 label_task_submit_form_accessory: 作业最终以附件形式提交 label_task_submit_form_project: 作业最终以项目形式提交 + label_has_been: 已经被 + label_course_userd_by: 个课程引用 \ No newline at end of file
<%= 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), :class => 'bid_user') %> + <%= l(:label_create_homework)%><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %>     <%= l(:label_course_homework) %> : <%= link_to(bid.courses.first.name, project_path(bid.courses.first)) %>