From d5ac443f90b0991bdd4f493eb6312098202ea21f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 31 Jul 2014 17:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AB=9E=E8=B5=9B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 5 +++-- app/views/repositories/_form_create.html.erb | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index f0597fafb..e2f5e3731 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -29,8 +29,9 @@ class ContestsController < ApplicationController # @contests = Contest.visible # @contests ||= [] @offset, @limit = api_offset_and_limit({:limit => 10}) - @contests = Contest.visible - @contests = @contests.like(params[:name]) if params[:name].present? + #@contests = Contest.visible + #@contests = @contests.like(params[:name]) if params[:name].present? + @contests = Contest.visible.where("name like '%#{params[:name]}%'") if params[:contests_search] (redirect_to contests_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank? end diff --git a/app/views/repositories/_form_create.html.erb b/app/views/repositories/_form_create.html.erb index 89ae6ffd0..669f47071 100644 --- a/app/views/repositories/_form_create.html.erb +++ b/app/views/repositories/_form_create.html.erb @@ -22,12 +22,12 @@ border:none <% end %>
<%= f.check_box :is_default, :label => :field_repository_is_default %>
-<%= f.text_field :identifier, :required=>true, :disabled => @repository.identifier_frozen?, :label => l(:label_repository_name) %> +
<%= f.text_field :identifier, :required=>true, :disabled => @repository.identifier_frozen?, :label => l(:label_repository_name)%> <% unless @repository.identifier_frozen? %> <%= l(:text_length_between, :min => 1, :max => Repository::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_repository_identifier_info).html_safe %> <% end %>
- +<%= f.password_field :upassword, :required =>true, :label=> :field_password %> <%= l(:label_upassword_info)%>