竞赛搜索项为空时给出提示

This commit is contained in:
nwb 2014-07-07 14:31:21 +08:00
parent bc179fbc39
commit b4ee106ce9
3 changed files with 14 additions and 5 deletions

View File

@ -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']

View File

@ -15,7 +15,7 @@
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
</div>
</td>
</tr>

View File

@ -3,10 +3,16 @@
<div class="box ph10_5">
<!--[form:message]-->
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br />
<%= f.text_field :subject,:size => 60, :style => "width: 99%;", :id => "message_subject",:readonly=>true %><!--by young-->
</p>
<p>
<% unless replying %>
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %><!--by young-->
</p>
<% else %>
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %>
</p>
<% end %>
<p>
<% unless replying %>
<% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %>