diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index a728ee6e2..b9f9245c8 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -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)) diff --git a/app/models/course.rb b/app/models/course.rb index 5034ab0d8..bac28e4c2 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -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? diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index ef8f37566..6b720229a 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -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%> - + <% 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 %>

- +
@@ -76,6 +76,10 @@
<%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> + <%# desc = course.short_description.nil? ? "" : course.short_description%> + <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index db94cf6c5..0586262e9 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -35,6 +35,8 @@
<%if @courses%> <%= render_course_hierarchy(@courses)%> + <%#= render :partial => 'course', :locals => {:course => @courses.first}%> + <%#= "hello".html_safe %> <%end%>