diff --git a/.gitignore b/.gitignore index 29bd2c4fd..0cd336786 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /Gemfile.lock /lib/plugins/acts_as_versioned/test/debug.log /config/configuration.yml +.rbenv-gemsets diff --git a/Gemfile b/Gemfile index 57d85e464..12729f741 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ -source 'http://ruby.taobao.org' +# source 'http://ruby.taobao.org' +source 'http://ruby.sdutlinux.org/' unless RUBY_PLATFORM =~ /w32/ # unix-like only diff --git a/Gemfile.lock b/Gemfile.lock index 34314d845..00702d7c3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,7 +19,7 @@ PATH rails GEM - remote: http://ruby.taobao.org/ + remote: http://ruby.sdutlinux.org/ remote: https://rubygems.org/ specs: actionmailer (3.2.13) 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 0d9206738..641f02af7 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/contests/_contest_list.html.erb b/app/views/contests/_contest_list.html.erb index 780b18c27..a91978079 100644 --- a/app/views/contests/_contest_list.html.erb +++ b/app/views/contests/_contest_list.html.erb @@ -21,7 +21,7 @@ diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 2863d5bfd..1410563c3 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -2,55 +2,52 @@ -
-
- <%= l(:label_contests_reward_method) %>:  <%= contest.budget%> + <%= l(:label_contests_reward_method) %>:  <%= contest.budget%>
- - - - -
<%= @softapplication.name %> - <%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>  - <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %> -
- +
+ + + + + + + + + + + + <% contest = @softapplication.contests.first %> + + + + + + + + -
-
<%= @softapplication.name %> + <%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>  + <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %> +
<%=l(:label_attendingcontestwork_belongs_type)%>:<%= @softapplication.app_type_name %><%=l(:label_attendingcontestwork_belongs_contest)%>:<%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %>
<%=l(:label_attendingcontestwork_release_person)%>:<%= @softapplication.user.name %><%=l(:label_attendingcontestwork_adaptive_system)%>:<%= @softapplication.android_min_version_available %>
+ <%=l(:label_attendingcontestwork_download)%>: + + <% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %> + +
- - - - <% contest = @softapplication.contests.first %> - - - - - - - - - - - - - - - - - - - - - - - - -
<%=l(:label_attendingcontestwork_belongs_type)%>:<%= @softapplication.app_type_name %><%=l(:label_attendingcontestwork_belongs_contest)%>:<%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %>
<%=l(:label_attendingcontestwork_release_person)%>:<%= @softapplication.user.name %><%=l(:label_attendingcontestwork_adaptive_system)%>:<%= @softapplication.android_min_version_available %>
<%=l(:label_attendingcontestwork_download)%>: - <% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %> - <%=l(:label_attendingcontestwork_developers)%>:<%= @softapplication.application_developers %>
<%=l(:label_attendingcontestwork_average_scores)%>:<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %><%=l(:label_attendingcontestwork_release_time)%>:<%=format_time @softapplication.created_at %>
- <% if @project %> - <%=l(:label_attendingcontestwork_deposit_project)%>:<%= link_to "#@project", project_path(@project) %> - <% end %> -
+ <%=l(:label_attendingcontestwork_developers)%>:<%= @softapplication.application_developers %> + + + <%=l(:label_attendingcontestwork_average_scores)%>: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %> + <%=l(:label_attendingcontestwork_release_time)%>:<%=format_time @softapplication.created_at %> + + + + <% if @project %> + <%=l(:label_attendingcontestwork_deposit_project)%>:<%= link_to "#@project", project_path(@project) %> + <% end %> + + + + +
@@ -59,7 +56,7 @@
<%=l(:label_work_description)%>:
-
<%= @softapplication.description %>
+
<%= @softapplication.description %>
@@ -82,10 +79,9 @@ <% end %> -
-
<%=l(:label_final_scores)%>
- <% score = @softapplication.average(:quality).try(:avg).try(:round, 2).to_f %> -
<%= format("%.2f" , score) %>分
+
+
<%=l(:label_final_scores)%>
+
<%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 69b272002..3554f85dd 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 %> -
-
- - -
-
+
    +<% @contest_notifications.each do |notification| %> +
  • +<%= link_to notification.title, notification %> +<%= truncate(strip_tags(notification.content).gsub( ' ',' '), length:60) %> +<%=l(:label_release_time)%>: <%=format_time notification.created_at %> +
  • +<% end %> +
diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 2467af7a0..0b5e32f2f 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -1377,3 +1377,50 @@ 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; +} + +.softapplications-div table td{ + word-break: break-all; +}