From 51a783c9a912c52ee1df752261071938f6a0d057 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 16 Sep 2014 15:38:21 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=202.=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=AB=9E=E8=B5=9B=E9=A6=96=E9=A1=B5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B8=83=E5=B1=80=20=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= =?UTF-8?q?=EF=BC=9A=E6=9F=A5=E6=89=BE=E7=B3=BB=E7=BB=9F=E4=B8=AD=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=9C=80=E5=A4=9A5=E6=9D=A1=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=85=AC=E5=91=8A=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=9C=A8?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=EF=BC=8C=E7=94=A8=E6=88=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=9B=B8=E5=BA=94=E5=85=AC=E5=91=8A=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E5=85=AC=E5=91=8A=E8=AF=A6=E7=BB=86=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/welcome_controller.rb | 2 +- app/views/welcome/contest.html.erb | 26 +++++++++++++++----------- config/locales/zh.yml | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index ca168ccb8..dee79bc31 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -110,7 +110,7 @@ class WelcomeController < ApplicationController def contest @contest_page = FirstPage.where("page_type = 'contest'").first - @contest_notifications = ContestNotification.order("id desc") + @contest_notifications = Contestnotification.order("created_at desc").limit(5) end def search diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 251ade0b3..b6fcdf8c9 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -166,14 +166,12 @@
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %> -
  • <%= image_tag('/images/contest1.png')%>
    -
    - <%= link_to(contest.name, contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> + <%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> <% if contest.id == 2 or contest.id == 3 or contest.id == 6 %> (<%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %>) <% else %> @@ -186,29 +184,35 @@

    - <%=l(:label_release_time)%>: <%=format_time contest.created_on %>
    -
  • <% end; reset_cycle %> -
    -

    +

    <%=l(:label_notification)%>

    @@ -223,7 +227,7 @@ <%= link_to l(:label_more_information), forums_path %>