恢复respond_path路由并修改部分respond_path

恢复homework_list.html.erb文件
This commit is contained in:
z9hang 2014-11-02 10:20:28 +08:00
parent c3bfbf7a97
commit 96626eeb6b
6 changed files with 11 additions and 80 deletions

View File

@ -200,7 +200,7 @@ class BidsController < ApplicationController
flash[:notice] = l(:label_bid_succeed)
end
end
redirect_to respond_path(@homework)
redirect_to course_for_bid_path(@homework)
else
@bid.safe_attributes = params[:bid]
@courses = []

View File

@ -138,7 +138,7 @@ module StoresHelper
return [link_to('unkown', '#')]
end
bid_list = link_to l(:label_homework), homework_course_path(bid.courses.first)
bid_item = link_to bid.name, respond_path(bid)
bid_item = link_to bid.name, course_for_bid_path(bid)
return project_link(bid.courses.first).push(bid_list, bid_item)
else
xxx

View File

@ -11,10 +11,10 @@
</font>)
</span><span class="fr">
按&nbsp;
<%= link_to l(:label_work_rating), sort_homework_path(@bid, 'socre', @direction), {:remote => true}%>
&nbsp;/&nbsp;
<%= link_to l(:label_time), sort_homework_path(@bid, 'time', @direction), {:remote => true}%>
&nbsp;<%= l(:label_sort) %>
<%= link_to l(:label_work_rating), sort_homework_path(@bid, 'socre', @direction), {:remote => true}%>
&nbsp;/&nbsp;
<%= link_to l(:label_time), sort_homework_path(@bid, 'time', @direction), {:remote => true}%>
&nbsp;<%= l(:label_sort) %>
</span>
</div>
<% end %>
@ -43,76 +43,7 @@
<ul id="homework_li_<%= homework.id%>">
<%= render :partial => 'homework_attach/homework',
:locals => {:homework => homework, :is_student_batch_homework => is_student_batch_homework,
:is_my_homework => is_my_homework, :is_teacher => is_teacher}%>
<ul>
<li class="pic_head">
<%= link_to image_tag(url_to_avatar(homework.user), :width => "40", :height => "40"), user_path(homework.user) %>
<span>
<% user_realname = homework.user.lastname.to_s + homework.user.firstname.to_s %>
<% user_name = is_teacher ? (user_realname.empty? ? homework.user.login : user_realname) : homework.user.login %>
<%= link_to user_name, user_path(homework.user), :title => user_name %>
</span>
</li>
<li class="wname">
<% if homework.name == nil || homework.name == "" %>
<% homework_filename = homework.user.name + "提交的作业" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
<%= link_to homework_filename , homework_attach_path(homework), :title => homework_filename, :remote => true%>
</li>
<li class="wdown">
评分:
<%= rating_for @homework, dimension: :quality, class: 'rateable div_inline' %>
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
</li>
<li class="wscore">
<%= l(:label_teacher_score)%>:
<span class="c_red">
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
</span>
&nbsp;&nbsp;
</li>
<li class="wscore">
<%= l(:label_student_score)%>:
<span class="c_red">
<%= homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score) %>
</span>
</li>
<% if is_teacher %>
<!-- 是老师,所有列表正常显示 -->
<li class="wping">
<%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %>
<% if Time.parse(bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% else %>
<!-- 是学生 -->
<% if is_my_homework %>
<!-- 我的作品,显示为编辑和删除 -->
<li class="wmine">
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), homework,
method: :delete, :confirm => l(:text_are_you_sure), :remote => true ) %>
<% end %>
</li>
<% elsif is_student_batch_homework%>
<!-- 学生匿评列表,正常显示 -->
<li class="wping">
<%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %>
<% if Time.parse(bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% else %>
<!-- 学生众评列表,显示为点赞 -->
<li class="wping">
<a href="#" target="_blank" >点赞</a>
</li>
<% end %>
<% end %>
:is_my_homework => is_my_homework, :is_teacher => is_teacher}%>
</ul>
<div class="cl"></div>
<% end %>
@ -123,4 +54,4 @@
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => remote, :flag => true%>
</ul>
<% end %>
<% end %>

View File

@ -19,7 +19,7 @@
<div class="homeworks panel panel-default ">
<div class="homeworks panel-heading">
<div class="panel-title">
<%= link_to homework.name, respond_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
<%= link_to homework.name, course_for_bid_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
<%#= link_to "打包下载", zipdown_assort_path(obj_class: homework.class, obj_id: homework.id), :class => "btn btn-primary btn-sm" %><br/>
</div>
</div>

View File

@ -34,7 +34,7 @@
<table border="0">
<tr>
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% 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) %>&nbsp;<%= bid.budget%>&nbsp;<%= 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> --></td>
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑;"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% 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) %>&nbsp;<%= bid.budget%>&nbsp;<%= 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> --></td>
</tr>
<tr>
<td><span class="font_lighter">

View File

@ -748,7 +748,7 @@ RedmineApp::Application.routes.draw do
# added by young
match 'calls', :to => 'bids#index'
#match 'calls/:id', :to => 'bids#show', :as => 'respond'
match 'calls/:id', :to => 'bids#show', :as => 'respond'
# modified by longjun
# bids#contests is not exist
# match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403