Make traces/mine redirect to the user's traces page instead of rendering

it itself. Also make sure the traces page for a user includes the upload
form if the requestor is logged in as that user.
This commit is contained in:
Tom Hughes 2010-01-10 09:16:18 +00:00
parent 314b734aa5
commit e53b34b80a
5 changed files with 21 additions and 19 deletions

View file

@ -1,3 +1,7 @@
<% if @user.traces.count(:conditions => ["inserted=?", false]) > 4 %>
<p><%= t'trace.trace_header.traces_waiting', :count => @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>

View file

@ -16,7 +16,3 @@
| <%= link_to t('trace.trace_header.see_your_traces'), :controller => 'trace', :action => 'mine' %>
<% end %>
</p>
<% if @user and @user.traces.count(:conditions => ["inserted=?", false]) > 4 %>
<p><%= t'trace.trace_header.traces_waiting', :count => @user.traces.count(:conditions => ["inserted=?", false]) %></p>
<% end %>

View file

@ -1,3 +1,5 @@
<%= render :partial => 'trace_header' %>
<% if @user and @user.display_name == @display_name %>
<%= render :partial => 'trace_form' %>
<% end %>
<%= render :partial => 'trace_list' %>

View file

@ -1,3 +0,0 @@
<%= render :partial => 'trace_header' %>
<%= render :partial => 'trace_form' %>
<%= render :partial => 'trace_list' %>