From cf4451e998e470758fc4b247de2442dc1544b9c7 Mon Sep 17 00:00:00 2001 From: whimlex Date: Mon, 13 Apr 2015 18:34:44 +0800 Subject: [PATCH] =?UTF-8?q?pre=E6=A0=87=E7=AD=BE=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=EF=BC=9Bcontest=E4=B8=BB=E9=A1=B5=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/comment.rb | 2 +- app/views/welcome/contest.html.erb | 82 +++++++++++++++--------------- app/views/welcome/course.html.erb | 27 ++++------ config/locales/en.yml | 9 ---- config/locales/users/zh.yml | 3 +- config/locales/zh.yml | 10 +--- public/javascripts/application.js | 19 +++++++ public/javascripts/course.js | 15 ++++++ public/stylesheets/application.css | 5 ++ public/stylesheets/public.css | 1 + 10 files changed, 95 insertions(+), 78 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index 1f6655bc4..bdb642d3c 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -27,7 +27,7 @@ class Comment < ActiveRecord::Base def send_mail if self.commented.is_a?(News) && Setting.notified_events.include?('news_comment_added') - Mailer.news_comment_added(self) + Mailer.run.news_comment_added(self) end end after_destroy :delete_kindeditor_assets diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 6233063a3..fa23f3843 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -257,48 +257,6 @@ -
-

- <%=l(:label_issue_feedback_activities)%> - <%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> - <%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> -

- <%= link_to l(:label_more_information), forums_path %> -
-
    - <% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%> -
  • -
    -       - <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %> - <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %> - -
    - - <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> - - - <%=l(:label_question_sponsor)%> <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> - - - <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %> - <%=l(:label_final_reply)%>  - <%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%> - <% end %> - - - <%=l(:label_reply)%> - (<%= link_to topic.try(:replies_count), topic.event_url %>) - -
    -
    -
  • - <% end %> -
-
-
- -

<%=l(:label_current_attendingcontest_work)%>

@@ -340,6 +298,46 @@
+
+

+ <%=l(:label_issue_feedback_activities)%> + <%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> + <%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> +

+ <%= link_to l(:label_more_information), forums_path %> +
+
    + <% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%> +
  • +
    +       + <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %> + <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %> + +
    + + <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> + + + <%=l(:label_question_sponsor)%> <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> + + + <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %> + <%=l(:label_final_reply)%>  + <%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%> + <% end %> + + + <%=l(:label_reply)%> + (<%= link_to topic.try(:replies_count), topic.event_url %>) + +
    +
    +
  • + <% end %> +
+
+
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 91fa2110c..a764c6eb8 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -41,8 +41,18 @@
<% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> + , + + <%= l(:label_welcome_trustie_course_description) %> + <% else %> <% if @school_id == "0" %> + <% else %> <% if @school_id.nil? %> <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> @@ -65,23 +75,6 @@ <%= l(:label_welcome_trustie_course) %> - <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> - , - - <%= l(:label_welcome_trustie_course_description) %> - - <% else %> - <% if @school_id == "0" %> - , - <%= @course_page.description %> - - <% end %> - <% end %> <% end %>