Present "too many pending traces" message as a warning box
This commit is contained in:
parent
5a2ffa227c
commit
b551fef0b7
2 changed files with 4 additions and 4 deletions
|
@ -143,6 +143,10 @@ class TraceController < ApplicationController
|
|||
logger.info("id is #{@trace.id}")
|
||||
flash[:notice] = t 'trace.create.trace_uploaded'
|
||||
|
||||
if @user.traces.count(:conditions => { :inserted => false }) > 4
|
||||
flash[:warning] = t 'trace.trace_header.traces_waiting', :count => @user.traces.count(:conditions => { :inserted => false })
|
||||
end
|
||||
|
||||
redirect_to :action => 'mine'
|
||||
end
|
||||
else
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
<% if @target_user.traces.count(:conditions => ["inserted=?", false]) > 4 %>
|
||||
<p><%= t'trace.trace_header.traces_waiting', :count => @target_user.traces.count(:conditions => ["inserted=?", false]) %></p>
|
||||
<% end %>
|
||||
|
||||
<% form_for :trace, @trace, :url => { :action => "create" }, :html => { :multipart => true } do |f| %>
|
||||
<table>
|
||||
<tr><td align="right"><%= t'trace.trace_form.upload_gpx' %></td><td><%= f.file_field :gpx_file, :size => 50, :maxlength => 255 %></td></tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue