From 8b121c3e5053c9dcbc3f158297b9335a170a8dcb Mon Sep 17 00:00:00 2001 From: hhuai <8863824@gmail.com> Date: Sun, 17 Aug 2014 20:56:58 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20issue=20#998,=20=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contest_notification_controller.rb | 6 +- app/controllers/welcome_controller.rb | 2 +- app/views/contest_notification/show.html.erb | 24 +++++++ app/views/welcome/contest.html.erb | 71 +++---------------- public/stylesheets/nyan.css | 44 ++++++++++++ 5 files changed, 83 insertions(+), 64 deletions(-) diff --git a/app/controllers/contest_notification_controller.rb b/app/controllers/contest_notification_controller.rb index 143941cc0..8c6e51bd5 100644 --- a/app/controllers/contest_notification_controller.rb +++ b/app/controllers/contest_notification_controller.rb @@ -1,5 +1,5 @@ -class ContestNotificationController +class ContestNotificationController < ApplicationController def show - + @notification = ContestNotification.find(params[:id]) end -end \ No newline at end of file +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 4e7cf0ce9..509e5ee1d 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 - @contestNotification = ContestNotification.all.first + @contest_notifications = ContestNotification.order("id desc") end def search diff --git a/app/views/contest_notification/show.html.erb b/app/views/contest_notification/show.html.erb index e69de29bb..93fa1f4af 100644 --- a/app/views/contest_notification/show.html.erb +++ b/app/views/contest_notification/show.html.erb @@ -0,0 +1,24 @@ +
<%= l(:label_contest_innovate ) %> | +<%= l(:label_user_location) %> : | ++ | ++ | +
contest.trustie.net | +<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情 | +
<%= @notification.title %>
+<%= @notification.content.html_safe %>
+