From cf4451e998e470758fc4b247de2442dc1544b9c7 Mon Sep 17 00:00:00 2001 From: whimlex Date: Mon, 13 Apr 2015 18:34:44 +0800 Subject: [PATCH 1/6] =?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 %>
diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb index bf6d3d8e0..d2121c85f 100644 --- a/app/views/homework_attach/_homeworks_list.html.erb +++ b/app/views/homework_attach/_homeworks_list.html.erb @@ -11,11 +11,17 @@ ( <%= homework_count%> ) + <% + url= get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id) if is_batch_homeworks + url= get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id) if not_batch_homework + url= get_homeworks_homework_attach_index_path(:bid_id => @bid.id) if is_all_homeworks + %> + <%= link_to l(:label_export_excel), get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_batch_homeworks%> <%= link_to l(:label_export_excel), get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if not_batch_homework%> <%= link_to l(:label_export_excel), get_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_all_homeworks%> - - + + 搜索 按  diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 87b17823e..6d2113d4b 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -169,11 +169,20 @@ a:hover.tijiao{ background:#0f99a9 !important;} /*新增*/ .min_search { width: 150px; - height: 20px; + height: 15px; border: 1px solid #d0d0d0 !important; color: #666; - background: url(../images/course/public_icon.png) 135px -193px no-repeat; - cursor: pointer; + /*background: url(../images/course/public_icon.png) 135px -193px no-repeat;*/ + /*cursor: pointer;*/ +} +a.member_search { + width: 43px; + height: 22px; + background: #15bccf; + color: #fff; + text-align: center; + padding: 4px 6px; + text-decoration: none; } From 81cbb76d7834a06427c18054c46b3d4b654c0019 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 14 Apr 2015 19:50:17 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B/=E9=A1=B9=E7=9B=AE--?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98=EF=BC=9A=E7=94=A8=E7=9C=9F?= =?UTF-8?q?=E5=AE=9E=E5=A7=93=E5=90=8D=E6=90=9C=E7=B4=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=9C=80=E8=A6=81=E5=9C=A8=E5=A7=93=E5=92=8C?= =?UTF-8?q?=E5=90=8D=E4=B9=8B=E9=97=B4=E5=8A=A0=E4=B8=AA=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E6=89=8D=E5=8F=AF=E4=BB=A5=E6=90=9C=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/principal.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/principal.rb b/app/models/principal.rb index 5aa21768f..dfec5b911 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -42,7 +42,8 @@ class Principal < ActiveRecord::Base where({}) else pattern = "%#{q}%" - sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ") + # sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ") + sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) or LOWER(login) LIKE LOWER(:p) or LOWER(mail) LIKE LOWER(:p)" params = {:p => pattern} if q =~ /^(.+)\s+(.+)$/ a, b = "#{$1}%", "#{$2}%" From ee688281326cf000596e088663a69ccc77bb0409 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 15 Apr 2015 08:50:29 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E8=BD=ACURL=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 1c2419305..8710b624e 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -429,7 +429,7 @@ class CoursesController < ApplicationController else respond_to do |format| format.html { - render :layout => 'base_courses' + # render :layout => 'base_courses' flash[:notice] = l(:notice_successful_create) if params[:continue] redirect_to new_course_url(attrs, :course => '0')