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

+
+
diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 8df19a280..a213579a5 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -190,69 +190,20 @@ -
+

<%=l(:label_notification)%>

- <%#= link_to l(:label_more_information), forums_path %> -
-
-
<%= @contestNotification.title %>
-
-
-
- - <%= @contestNotification.content.html_safe %> -
-
- - - -
-
+ +
diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 2467af7a0..25dd8a5cf 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -1377,3 +1377,47 @@ div.pagination { right: 5%; } + +/*** + * contest notifications + */ +ul.contest-notification-list { + clear: both; +} +ul.contest-notification-list li{ + padding: 10px; + border-bottom: 1px solid rgb(245,245,245); + display: block; +} +ul.contest-notification-list li span.time { + color: rgb(172, 174, 177); + font-size: 13px; + line-height: 25px; +} + +ul.contest-notification-list li span.title { + font-size: 14px; +} +ul.contest-notification-list li span.content { + padding-top: 5px; + padding-bottom: 10px; +} +ul.contest-notification-list li span{ + display: block; +} + +.notification-content{ + margin: 0 auto; + width: 80%; +} +.notification-content hr{ + background: #eee; +} +.notification-content .title{ + font-size: 15px; +} + +.notification-content .content{ + font-size: 13px; +} +