Merge branch 'develop' into educoder

dev_partners
cxt 6 years ago
commit 06352bddb7

@ -1481,14 +1481,14 @@ class CoursesController < ApplicationController
def new
if User.current.login?
@course_type = params[:course_type] ||= params[:course]
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
if User.current.user_extensions.try(:identity) == 1
render_403
else
@course = Course.new
@course.safe_attributes = params[:course]
@syllabus = Syllabus.where("id = #{params[:syllabus_id].to_i}").first if params[:syllabus_id]
# month = Time.now.month
render :layout => 'base_edu'
end
else
redirect_to signin_url
end

@ -2562,7 +2562,13 @@ class UsersController < ApplicationController
# 用户访问自己主页的"我管理的"列表,且是第一页才显示新建入口
page = params[:page] ? params[:page].to_i : 1
# 学生身份没有课堂的新建入口
if @user.user_extensions.try(:identity) == 1
@new_icon = @user == User.current && ['a_shixun', 'a_project', 'a_path'].include?(@type) && page == 1
else
@new_icon = @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type) && page == 1
end
# 用户进自己主页的全部列表时有个新建入口,加一个"new"view层的第一页需要shift这样翻页就没问题啦
@objects = @objects.to_a

@ -73,7 +73,9 @@
<div class="edu-menu-list" style="top:60px;width: 240px;">
<div class="overPart"></div>
<ul class="fl with50 edu-txt-center pr ul-leftline">
<% unless User.current.user_extensions.try(:identity) == 1 %>
<li><%= link_to '新建课堂', new_course_path() %></li>
<% end %>
<li><%= link_to '新建实训', new_shixun_path() %></li>
<li><%= link_to '新建实训课程', new_subject_path() %></li>
<li><%= link_to '新建项目', new_project_path() %></li>

Loading…
Cancel
Save