讨论区增加“添加子栏目”按钮跳到设置页面的添加子栏目
This commit is contained in:
parent
3d29eb2be0
commit
4da113dc19
|
@ -564,6 +564,7 @@ class CoursesController < ApplicationController
|
|||
#添加成员消息状态
|
||||
join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
|
||||
join_course_messages.update_all(:viewed => true)
|
||||
@tab = params[:tab].to_i || 0
|
||||
if User.current.allowed_to?(:as_teacher,@course)
|
||||
@select_tab = params[:tab]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
|
|
|
@ -24,6 +24,11 @@
|
|||
<div class="NewsBannerName">
|
||||
<%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %>
|
||||
</div>
|
||||
|
||||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@board.course)) %>
|
||||
<% if is_teacher %>
|
||||
<%= link_to "添加子栏目", settings_course_path(@board.course.id,4), :class => "link-blue fr mt5" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div nhname="topic_form">
|
||||
<% if User.current.logged? %>
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
var tab = <%= @tab %>;
|
||||
if(tab != 0){
|
||||
course_setting(tab);
|
||||
}
|
||||
<% if @select_tab == 'member'%>
|
||||
$("#tb_2").click();
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue