Navigation changes to the GPX traces page

Display a better message when no traces are present and only
display the paging links when multiple pages exist.
This commit is contained in:
Steve Singer 2012-07-22 10:41:17 -04:00 committed by Tom Hughes
parent 51079ecafb
commit 69d91bf24a
3 changed files with 29 additions and 29 deletions

View file

@ -1,15 +1,18 @@
<p>
<% if @page > 1 %>
<%= link_to t('trace.trace_paging_nav.previous'), params.merge({ :page => @page - 1 }) %>
<% else %>
<%= t('trace.trace_paging_nav.previous') %>
<% end %>
| <%= t('trace.trace_paging_nav.showing_page', :page => @page) %> |
<% if @traces.size > 1 %>
<% if @page > 1 %>
<%= link_to t('trace.trace_paging_nav.previous'), params.merge({ :page => @page - 1 }) %>
<% else %>
<%= t('trace.trace_paging_nav.previous') %>
<% end %>
<% if @traces.size < @page_size %>
<%= t('trace.trace_paging_nav.next') %>
<% else %>
<%= link_to t('trace.trace_paging_nav.next'), params.merge({ :page => @page + 1 }) %>
<% end %>
| <%= t('trace.trace_paging_nav.showing_page', :page => @page) %> |
<% if @traces.size < @page_size %>
<%= t('trace.trace_paging_nav.next') %>
<% else %>
<%= link_to t('trace.trace_paging_nav.next'), params.merge({ :page => @page + 1 }) %>
<% end %>
<% end %>
</p>

View file

@ -20,22 +20,20 @@
<% end %>
</p>
<% if @traces.size > 1 %>
<% if @traces.size > 0 %>
<%= render :partial => 'trace_paging_nav' %>
<table id="trace_list" cellpadding="3">
<tr>
<th></th>
<th></th>
</tr>
<%= render :partial => 'trace', :collection => @traces unless @traces.nil? %>
</table>
<%= render :partial => 'trace_paging_nav' %>
<% else %>
<%= t('trace.list.empty') %> <%= link_to t('trace.list.upload_new'), :controller => 'trace', :action => 'list', :display_name => nil, :tag => nil, :page => nil %> <%= raw t('trace.list.learn_more') %>
<% end %>
<table id="trace_list" cellpadding="3">
<tr>
<th></th>
<th></th>
</tr>
<%= render :partial => 'trace', :collection => @traces unless @traces.nil? %>
</table>
<% if @traces.size > 1 %>
<%= render :partial => 'trace_paging_nav' %>
<%= t 'trace.list.empty_html', :upload_link => link_to(t('trace.list.upload_new'), trace_create_path) %>
<% end %>
<%= render :partial => 'trace_optionals' %>

View file

@ -1490,8 +1490,8 @@ en:
visibility: "Visibility:"
trace_paging_nav:
showing_page: "Showing page %{page}"
next: "Next »"
previous: "« Previous"
older: "Older Traces"
newer: "Newer Traces"
trace:
pending: "PENDING"
count_points: "%{count} points"
@ -1513,9 +1513,8 @@ en:
your_traces: "Your GPS traces"
public_traces_from: "Public GPS traces from %{user}"
tagged_with: " tagged with %{tags}"
empty: "Nothing here yet."
empty_html: "Nothing here yet. %{upload_link} Or learn more about GPS tracing on the <a href='http://wiki.openstreetmap.org/wiki/Beginners_Guide_1.2'>wiki page</a>."
upload_new: "Upload a new trace"
learn_more: "Or learn more about GPS tracing on the <a href='http://wiki.openstreetmap.org/wiki/Beginners_Guide_1.2'>wiki page</a>."
delete:
scheduled_for_deletion: "Trace scheduled for deletion"
make_public: