-<%= image_tag(url_for(:controller => :traces, :action => :icon, :id => description.id, :display_name => description.user.display_name)) %>
+<%= image_tag trace_icon_path(description.user, description.id) %>
<% if description.size -%>
<%= t ".description_with_count", :count => description.size, :user => description.user.display_name %>
<% else -%>
<td>
<% if Settings.status != "gpx_offline" %>
<% if trace.inserted %>
- <a href="<%= url_for :controller => "traces", :action => "show", :id => trace.id, :display_name => trace.user.display_name %>"><img src="<%= url_for :controller => "traces", :action => "icon", :id => trace.id, :display_name => trace.user.display_name %>" border="0" alt="" /></a>
+ <%= link_to image_tag(trace_icon_path(trace.user, trace), :alt => ""), show_trace_path(trace.user, trace) %>
<% else %>
<span class="text-danger"><%= t ".pending" %></span>
<% end %>
<td>
<ul class="list-inline mb-0">
<li class="list-inline-item">
- <%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
+ <%= link_to trace.name, show_trace_path(trace.user, trace) %>
</li>
<% if trace.inserted? %>
</ul>
<p class="text-muted mb-0">
<%= friendly_date_ago(trace.timestamp) %>
- <%= t ".by" %> <%= link_to trace.user.display_name, user_path(trace.user) %>
+ <%= t ".by" %> <%= link_to trace.user.display_name, trace.user %>
<% if !trace.tags.empty? %>
<%= t ".in" %>
<%= safe_join(trace.tags.collect { |tag| link_to_tag tag.tag }, ", ") %>
<nav class="secondary-actions">
<ul>
<li>
- <%= link_to t(".view_map"), { :controller => "site", :action => "index", :mlat => trace.latitude, :mlon => trace.longitude, :anchor => "map=14/#{trace.latitude}/#{trace.longitude}" } %>
+ <%= link_to t(".view_map"), root_path(:mlat => trace.latitude, :mlon => trace.longitude, :anchor => "map=14/#{trace.latitude}/#{trace.longitude}") %>
</li>
<li>
- <%= link_to t(".edit_map"), { :controller => "site", :action => "edit", :gpx => trace.id } %>
+ <%= link_to t(".edit_map"), edit_path(:gpx => trace.id) %>
</li>
</ul>
</nav>
<h1><%= t ".heading", :name => @trace.name %></h1>
<% end %>
-<img src="<%= url_for :controller => "traces", :action => "picture", :id => @trace.id, :display_name => @trace.user.display_name %>">
+<%= image_tag trace_picture_path(@trace.user, @trace) %>
<%= bootstrap_form_for @trace do |f| %>
<%= f.text_field :name, :disabled => true %>
xml.item do
xml.title trace.name
- xml.link url_for(:controller => :traces, :action => :show, :id => trace.id, :display_name => trace.user.display_name, :only_path => false)
- xml.guid url_for(:controller => :traces, :action => :show, :id => trace.id, :display_name => trace.user.display_name, :only_path => false)
+ xml.link show_trace_url(trace.user, trace)
+ xml.guid show_trace_url(trace.user, trace)
xml.description do
xml.cdata! render(:partial => "description", :object => trace, :formats => [:html])
<% if Settings.status != "gpx_offline" %>
<% if @trace.inserted %>
- <img src="<%= url_for :controller => "traces", :action => "picture", :id => @trace.id, :display_name => @trace.user.display_name %>">
+ <%= image_tag trace_picture_path(@trace.user, @trace) %>
<% else %>
<span class="text-danger"><%= t ".pending" %></span>
<% end %>
:latitude => tag.span(number_with_delimiter(@trace.latitude), :class => "latitude"),
:longitude => tag.span(number_with_delimiter(@trace.longitude), :class => "longitude") %>
</div>
- (<%= link_to t(".map"), :controller => "site", :action => "index", :mlat => @trace.latitude, :mlon => @trace.longitude, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %> / <%= link_to t(".edit"), :controller => "site", :action => "edit", :gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %>)</td>
+ (<%= link_to t(".map"), root_path(:mlat => @trace.latitude, :mlon => @trace.longitude, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}") %> / <%= link_to t(".edit"), edit_path(:gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}") %>)</td>
</tr>
<% end %>
<tr>
<th><%= t ".owner" %></th>
- <td><%= link_to @trace.user.display_name, user_path(@trace.user) %></td>
+ <td><%= link_to @trace.user.display_name, @trace.user %></td>
</tr>
<tr>
<th><%= t ".description" %></th>
<% if current_user == @trace.user %>
<%= link_to t(".edit_trace"), edit_trace_path(@trace), :class => "btn btn-outline-primary" %>
<% end %>
- <%= link_to t(".delete_trace"), { :controller => "traces", :action => "destroy", :id => @trace.id }, { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_delete") } } %>
+ <%= link_to t(".delete_trace"), @trace, { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_delete") } } %>
</div>
<% end %>
assert_select row, "li", Regexp.new(Regexp.escape("#{trace.size} points")) if trace.inserted?
assert_select row, "td", Regexp.new(Regexp.escape(trace.description))
assert_select row, "td", Regexp.new(Regexp.escape("by #{trace.user.display_name}"))
+ assert_select row, "a[href='#{user_path trace.user}']", :text => trace.user.display_name
end
end
end
assert_select "table", :count => 1 do
assert_select "td", /^#{Regexp.quote(trace.name)} /
- assert_select "td", trace.user.display_name
+ assert_select "td a[href='#{user_path trace.user}']", :text => trace.user.display_name
assert_select "td", trace.description
end
end