修改未批、已批、全部作业、留言action的路由
This commit is contained in:
parent
70495af3ef
commit
e6fdda1702
|
@ -4,7 +4,8 @@ class HomeworkAttachController < ApplicationController
|
||||||
###############################
|
###############################
|
||||||
before_filter :can_show_course,except: []
|
before_filter :can_show_course,except: []
|
||||||
#判断当前角色权限时需先找到当前操作的project
|
#判断当前角色权限时需先找到当前操作的project
|
||||||
before_filter :find_course_by_bid_id, :only => [:new,:get_not_batch_homework,:get_batch_homeworks,:get_homeworks,:get_homework_jours]
|
before_filter :find_course_by_bid_id, :only => [:new]
|
||||||
|
before_filter :find_bid_and_course,:only => [:get_not_batch_homework,:get_batch_homeworks,:get_homeworks,:get_homework_jours]
|
||||||
before_filter :find_course_by_hoemwork_id, :only => [:edit,:update,:destroy,:show,:add_homework_users,:destory_homework_users]
|
before_filter :find_course_by_hoemwork_id, :only => [:edit,:update,:destroy,:show,:add_homework_users,:destory_homework_users]
|
||||||
#判断当前角色是否有操作权限
|
#判断当前角色是否有操作权限
|
||||||
#勿删 before_filter :authorize, :only => [:new,:edit,:update,:destroy]
|
#勿删 before_filter :authorize, :only => [:new,:edit,:update,:destroy]
|
||||||
|
@ -383,6 +384,13 @@ class HomeworkAttachController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_bid_and_course
|
||||||
|
@bid = Bid.find(params[:bid_id])
|
||||||
|
@course = @bid.courses.first
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
render_404
|
||||||
|
end
|
||||||
|
|
||||||
def find_course_by_bid_id
|
def find_course_by_bid_id
|
||||||
@bid = Bid.find(params[:id])
|
@bid = Bid.find(params[:id])
|
||||||
@course = @bid.courses.first
|
@course = @bid.courses.first
|
||||||
|
|
|
@ -1895,13 +1895,13 @@ module ApplicationHelper
|
||||||
def sort_homework_path(bid, sort, direction)
|
def sort_homework_path(bid, sort, direction)
|
||||||
case self.action_name
|
case self.action_name
|
||||||
when 'show_courseEx'
|
when 'show_courseEx'
|
||||||
get_not_batch_homework_homework_attach_path(bid, sort: sort, direction: 'asc')
|
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: 'asc')
|
||||||
when 'get_not_batch_homework'
|
when 'get_not_batch_homework'
|
||||||
get_not_batch_homework_homework_attach_path(bid, sort: sort, direction: direction)
|
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
|
||||||
when 'get_batch_homeworks'
|
when 'get_batch_homeworks'
|
||||||
get_batch_homeworks_homework_attach_path(bid, sort: sort, direction: direction)
|
get_batch_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
|
||||||
when 'get_homeworks'
|
when 'get_homeworks'
|
||||||
get_homeworks_homework_attach_path(bid, sort: sort, direction: direction)
|
get_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
|
||||||
else
|
else
|
||||||
'#'
|
'#'
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,17 +14,17 @@
|
||||||
<div id="tb_" class="tb_">
|
<div id="tb_" class="tb_">
|
||||||
<ul>
|
<ul>
|
||||||
<li id="tb_1" class="hovertab">
|
<li id="tb_1" class="hovertab">
|
||||||
<%= link_to "未批作业", get_not_batch_homework_homework_attach_path(@bid), {:remote => true}%>
|
<%= link_to "未批作业", get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
|
||||||
</li>
|
</li>
|
||||||
<li id="tb_2" class="normaltab">
|
<li id="tb_2" class="normaltab">
|
||||||
<%= link_to "已改作业", get_batch_homeworks_homework_attach_path(@bid), {:remote => true}%>
|
<%= link_to "已改作业", get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
|
||||||
</li>
|
</li>
|
||||||
<li id="tb_3" class="normaltab">
|
<li id="tb_3" class="normaltab">
|
||||||
<%= link_to "全部作业", get_homeworks_homework_attach_path(@bid), {:remote => true}%>
|
<%= link_to "全部作业", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
|
||||||
</li>
|
</li>
|
||||||
<li id="tb_4" class="normaltab" onclick="o:HoverLi(4);"><a href="#">作业下载</a></li>
|
<li id="tb_4" class="normaltab" onclick="o:HoverLi(4);"><a href="#">作业下载</a></li>
|
||||||
<li id="tb_5" class="normaltab">
|
<li id="tb_5" class="normaltab">
|
||||||
<%= link_to "留言", get_homework_jours_homework_attach_path(@bid), {:remote => true}%>
|
<%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
|
||||||
(<span class="c_red f_12">23</span>)
|
(<span class="c_red f_12">23</span>)
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -62,3 +62,5 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div>
|
|
@ -60,7 +60,7 @@
|
||||||
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||||
<strong style="vertical-align: top">描 述 :</strong>
|
<strong style="vertical-align: top">描 述 :</strong>
|
||||||
<span style="margin-left:-10px;padding-right: 20px;">
|
<span style="margin-left:-10px;padding-right: 20px;">
|
||||||
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :maxlength => 65534, :style => "font-size:small;width:490px;margin-left:10px;" %>
|
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :maxlength => 3000, :style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p style="padding-left: 60px">
|
<p style="padding-left: 60px">
|
||||||
|
|
|
@ -44,12 +44,12 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'add_jour_reply', :via => [:get,:post]
|
match 'add_jour_reply', :via => [:get,:post]
|
||||||
match 'destroy_jour', :via => [:get,:post]
|
match 'destroy_jour', :via => [:get,:post]
|
||||||
match 'comprehensive_evaluation_jour', :via => [:get,:post]
|
match 'comprehensive_evaluation_jour', :via => [:get,:post]
|
||||||
end
|
|
||||||
member do
|
|
||||||
get 'get_not_batch_homework'
|
get 'get_not_batch_homework'
|
||||||
get 'get_batch_homeworks'
|
get 'get_batch_homeworks'
|
||||||
get 'get_homeworks'
|
get 'get_homeworks'
|
||||||
get 'get_homework_jours'
|
get 'get_homework_jours'
|
||||||
|
end
|
||||||
|
member do
|
||||||
match 'add_homework_users', :via => [:get,:post]
|
match 'add_homework_users', :via => [:get,:post]
|
||||||
match 'destory_homework_users', :via => [:get,:post]
|
match 'destory_homework_users', :via => [:get,:post]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue