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}" %>