From 3254c4a237e57c7da22d367c8de26af8b2249e90 Mon Sep 17 00:00:00 2001 From: nwb Date: Wed, 16 Jul 2014 09:45:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=8C=E7=BA=A7=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 5 +++++ app/views/layouts/_base_header.html.erb | 4 ++-- public/themes/redpenny-master/stylesheets/application.css | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) 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;