1.修复超级管理员无法访问课程作业列表的BUG

2.修改作业描述样式
GitlabVersion
sw 11 years ago
parent a5518363c3
commit 39434766e3

@ -449,7 +449,7 @@ class BidsController < ApplicationController
# 显示作业课程
# add by nwb
def show_courseEx
if (User.current.logged? && User.current.member_of_course?(@bid.courses.first))
if (User.current.logged? && (User.current.member_of_course?(@bid.courses.first) || User.current.admin?))
# flash[:notice] = ""
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))

@ -92,7 +92,8 @@ class Course < ActiveRecord::Base
# 课程的短描述信息
def short_description(length = 255)
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
description.gsub(/<\/?.*?>/,"").strip if description
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
end
def extra_frozen?

@ -16,7 +16,7 @@
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>
<% @admin = @course.course_infos%>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
<!-- <%= @admin.first.user.user_extensions.occupation %> -->
<!-- <%#= @admin.first.user.user_extensions.occupation %> -->
<% unless @course.teacher.user_extensions.school.nil? %>
<%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %>
<% end %>
@ -28,7 +28,7 @@
<%= content_tag('a', @admin.collect{|u| link_to(u.user.lastname+u.user.firstname, user_path(u.user_id))}.join(", ").html_safe) %>
<% end %>
</p>
</div>
<div class="information_for_course" >
@ -76,6 +76,10 @@
<div class="add-info" style="margin-left: 30px; margin-top: -20px">
<%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
<%# desc = course.short_description.nil? ? "" : course.short_description%>
<!--<#div class="brief_introduction" title="<%#= desc.html_safe%>">
<%#= desc.html_safe%>
</div>-->
<%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
</div>

@ -35,6 +35,8 @@
<div id="courses-index">
<%if @courses%>
<%= render_course_hierarchy(@courses)%>
<%#= render :partial => 'course', :locals => {:course => @courses.first}%>
<%#= "<a herf = 'aaa'>hello</a>".html_safe %>
<%end%>
</div>

Loading…
Cancel
Save