From 8eac756ac79074e314626d82850656d9f7d7e9b7 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 18 Jul 2014 09:21:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=A1=B9=E7=9B=AE=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E6=9B=B4=E6=94=B9=EF=BC=8C=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=99=90=E5=88=B6=E9=A1=B9=E7=9B=AE=E6=8F=8F=E8=BF=B0=E5=AD=97?= =?UTF-8?q?=E6=95=B0=202.=E7=AB=9E=E8=B5=9B=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E6=9B=B4=E6=94=B9=EF=BC=8C=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=99=90=E5=88=B6=E7=AB=9E=E8=B5=9B=E6=8F=8F=E8=BF=B0=E5=AD=97?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 4 +++- app/models/news.rb | 4 +++- app/models/open_source_project.rb | 4 +++- app/models/project.rb | 4 +++- app/views/welcome/contest.html.erb | 6 +++--- app/views/welcome/index.html.erb | 10 +++++----- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index f47e1c6f9..4c5e77cb5 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -564,8 +564,10 @@ class Issue < ActiveRecord::Base end # 缺陷的短描述信息 def short_description(length = 255) - description.gsub(/<\/?.*?>/,"").html_safe if description + # 不再使用短描述 + #description.gsub(/<\/?.*?>/,"").html_safe if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + description end private :workflow_rule_by_attribute diff --git a/app/models/news.rb b/app/models/news.rb index 66e339291..860dd0baa 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -76,8 +76,10 @@ class News < ActiveRecord::Base # 新闻的短描述信息 def short_description(length = 255) - description.gsub(/<\/?.*?>/,"").html_safe if description + #description.gsub(/<\/?.*?>/,"").html_safe if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + # 不再使用短描述 + description end private diff --git a/app/models/open_source_project.rb b/app/models/open_source_project.rb index 2de5966bb..4a657edb4 100644 --- a/app/models/open_source_project.rb +++ b/app/models/open_source_project.rb @@ -85,7 +85,9 @@ class OpenSourceProject < ActiveRecord::Base def short_description(length = 255) #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description - description.gsub(/<\/?.*?>/,"").html_safe if description + #description.gsub(/<\/?.*?>/,"").html_safe if description + # 不再使用短描述 + description end def applied_by?(user) diff --git a/app/models/project.rb b/app/models/project.rb index b68fc6aa9..d6420dd2d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -630,7 +630,9 @@ class Project < ActiveRecord::Base # Returns a short description of the projects (first lines) def short_description(length = 255) #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description - description.gsub(/<\/?.*?>/,"").html_safe if description + # 不再使用短描述 + # description.gsub(/<\/?.*?>/,"").html_safe if description + description end def css_classes diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index c3bd120da..35ac5eda1 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -150,7 +150,7 @@
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %> -
  • +
  • <%= image_tag('/images/contest1.png')%>
    @@ -165,8 +165,8 @@ <% end %>
  • -
    - ><%=contest.description.truncate(50, omission: '...')%> +
    + ><%=contest.description.to_s%>

    diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 8ffbb0469..586817c40 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -63,7 +63,7 @@ <% #projects = find_miracle_project(10, 3) %> <% @projects.map do |project| %> -
  • +
  • <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
    @@ -72,10 +72,10 @@ <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
  • -
    - ><%=project.short_description.truncate(50, omission: '...')%> +
    + ><%=project.description%>
    -
    +
    <%# issue_count = project.issues.count %> <%# issue_journal_count = project.issue_changes.count %> <%# issue_score = issue_count * 0.2 %> @@ -103,7 +103,7 @@ <%# finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %> <%= content_tag "span", l(:label_project_score)+ ":" + project_score(project), - :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ", + :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;", :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", :class => "tooltip", :id => "tooltip-#{project.id}" %>