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