Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
tweak unphotographed paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicho02 committed Sep 14, 2014
1 parent 83cdabf commit ee829ab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/helpers/areas_helper.rb
Expand Up @@ -21,7 +21,7 @@ def edit_area_path(area, options = {})
end

def area_unphotographed_path(area, options = {})
url_for(options.merge(:controller => :unphotographed_plaques_by_area, :action => :show, :area_id => area.slug, :country_id => area.country.alpha2))
url_for(options.merge(:controller => :area_plaques, :action => :show, :country_id => area.country.alpha2, :area_id => area.slug, :id => :unphotographed))
end

def list_of_area_links(areas)
Expand Down
1 change: 0 additions & 1 deletion app/helpers/countries_helper.rb
@@ -1,6 +1,5 @@
module CountriesHelper


def country_unphotographed_path(country, options = {})
url_for(options.merge(:controller => :country_plaques, :action => :show, :country_id => country.alpha2))
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/areas/show.html.erb
Expand Up @@ -16,10 +16,10 @@
</div>

<div class="panel clearfix">
<p>See <%= link_to "unphotographed plaques", {:controller => :area_plaques, :country_id => @area.country.alpha2, :area_id => @area.slug, :action => :show} %>
<p>See <%= link_to "unphotographed plaques", area_unphotographed_path(@area) %>
<% if current_user && current_user.is_admin? %>
or <%= link_to "ungeolocated plaques", {:controller => :area_ungeolocated_plaques, :country_id => @area.country.alpha2, :area_id => @area.slug, :action => :show} %>
<% end %>
</p>
<p class="alternate_formats">Data about <%= @area %> as <%= alternate_link_to "XML", area_plaques_path(@area, :xml), :xml %> <%= alternate_link_to "JSON", area_plaques_path(@area, :json), :json %> <%= alternate_link_to "KML", area_plaques_path(@area, :kml), :kml %> <%= alternate_link_to "GMAP", "http://maps.google.co.uk/maps?q=" + area_plaques_url(@area, :kml), :html %></p>
<p class="alternate_formats">Data about <%= @area %> plaques as <%= alternate_link_to "XML", area_plaques_path(@area, :xml), :xml %> <%= alternate_link_to "JSON", area_plaques_path(@area, :json), :json %> <%= alternate_link_to "KML", area_plaques_path(@area, :kml), :kml %> <%= alternate_link_to "GMAP", "http://maps.google.co.uk/maps?q=" + area_plaques_url(@area, :kml), :html %></p>
</div>
11 changes: 4 additions & 7 deletions app/views/countries/show.html.erb
Expand Up @@ -3,14 +3,15 @@
<div class="panel clearfix">
<% if current_user && current_user.is_admin? %>
<section class="admin_panel">
<%= link_to("Add new area in " + @country.name, new_country_area_path(@country.alpha2), {:class => :edit, :title => "Add new area in " + @country.name})%>
<%= link_to("Add a new area", new_country_area_path(@country.alpha2), {:class => :edit, :title => "Add new area to " + @country.name})%>
</section>
<% end %>

<h1>Plaques in <%= @country.name %></h1>
<h1><%= @country.name %></h1>

<%= pluralize @country.plaques.size, "plaque" %>
<p>We have <%= pluralize @country.plaques.size, "plaque record" %> in <%= @country.name %></p>

<h2>In <%= pluralize @country.areas.size, "area" %></h2>
<%= content_tag("ol", :class => "results one_destination_results", :id => "people_results") do %>
<% @areas.each do |area| %>
<%= content_tag("li") do %>
Expand All @@ -21,9 +22,5 @@
<% end %>
<% end unless @areas.size <=0 %>

<%= content_tag("p") do %>
See <%= link_to "unphotographed plaques", country_unphotographed_path(@country) %>.
<% end %>

<p class="alternate_formats">Data about <%= @country %> as <%= alternate_link_to "XML", country_path(@country, :xml), :xml %> <%= alternate_link_to "JSON", country_path(@country, :json), :json %> <%= alternate_link_to "KML", country_path(@country, :kml), :kml %> <%= alternate_link_to "GMAP", "http://maps.google.co.uk/maps?q=" + country_url(@country, :kml), :html %></p>
</div>

0 comments on commit ee829ab

Please sign in to comment.