diff --git a/app/models/course.rb b/app/models/course.rb index 248f80e0b..dc31485f8 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -108,6 +108,11 @@ class Course < ActiveRecord::Base #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description end + # 课程的短名称信息 + def short_name(length = 8) + name.gsub(/<\/?.*?>/,"").html_safe if name + end + def strip_html(html) return html if html.empty? || !html.include?('<') output = "" diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 9b03fd776..bd21c4fff 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -45,7 +45,7 @@ @@ -54,7 +54,7 @@
  • <%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
  • diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index f1726426d..c9b14bdbb 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -2170,7 +2170,7 @@ ul.messages-for-user-reply li { left: 115px; padding-bottom: 5px; position: absolute; - top: 40px; + top: 0px; font-size: 1.1em; margin: 0px auto; padding: 0px 0px;