From b4ee106ce92bf42af4feef77b35f4c3c8d0b0a67 Mon Sep 17 00:00:00 2001 From: nwb Date: Mon, 7 Jul 2014 14:31:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E6=90=9C=E7=B4=A2=E9=A1=B9?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 3 +++ app/views/contests/index.html.erb | 2 +- app/views/messages/_form.html.erb | 14 ++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 1b172e0c..987881a8 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -28,6 +28,9 @@ class ContestsController < ApplicationController @offset, @limit = api_offset_and_limit({:limit => 10}) @contests = Contest.visible @contests = @contests.like(params[:name]) if params[:name].present? + if params[:contests_search] + (redirect_to contests_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank? + end @contest_count = @contests.count @contest_pages = Paginator.new @contest_count, @limit, params['page'] diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb index 670ba27c..8c999f94 100644 --- a/app/views/contests/index.html.erb +++ b/app/views/contests/index.html.erb @@ -15,7 +15,7 @@ diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index b3ffbe3e..c7c557f9 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -3,10 +3,16 @@
-


-<%= f.text_field :subject,:size => 60, :style => "width: 99%;", :id => "message_subject",:readonly=>true %> -

-

+ <% unless replying %> +


+ <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %> +

+ <% else %> +


+ <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %> +

+ <% end %> +

<% unless replying %> <% if @message.safe_attribute? 'sticky' %> <%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %>