Skip to content

Commit

Permalink
Merge branch 'rails5/update-routes' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lizconlan committed Apr 11, 2019
2 parents 84725c6 + d696754 commit f014546
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/helpers/link_to_helper.rb
Expand Up @@ -270,14 +270,14 @@ def search_link(query)

# About page URLs
def about_url(options = {})
help_general_url(options.merge(:action => 'about'))
help_general_url(options.merge(template: 'about'))
end

def unhappy_url(info_request = nil, options = {})
if info_request.nil?
return help_general_url(options.merge(:action => 'unhappy'))
return help_general_url(options.merge(template: 'unhappy'))
else
return help_unhappy_url(options.merge(:url_title => info_request.url_title))
return help_unhappy_url(options.merge(url_title: info_request.url_title))
end
end

Expand Down
12 changes: 8 additions & 4 deletions app/views/public_body/_list_sidebar_extra.html.erb
@@ -1,20 +1,24 @@
<div class="list-sidebar-extra">
<% if AlaveteliConfiguration::public_body_statistics_page %>
<p>
<%= link_to _('Public authority statistics'), statistics_path(:anchor => 'public_bodies') %>
<%= link_to _('Public authority statistics'),
statistics_path(anchor: 'public_bodies') %>
</p>
<% end %>
<p>
<%= link_to _('Are we missing a public authority?'), help_requesting_path(:anchor => 'missing_body') %>
<%= link_to _('Are we missing a public authority?'),
help_requesting_path(anchor: 'missing_body') %>
</p>
<p>
<%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_path %>
<%= link_to _('List of all authorities (CSV)'),
all_public_bodies_csv_path %>
</p>

<% if can_ask_the_eu?(country_code) %>
<p>
<%= link_to _('Ask EU Authorities'), 'http://www.asktheeu.org' %>
<%= link_to _('?'), help_general_url(:action => 'unhappy', :anchor => 'other_means') %>
<%= link_to _('?'),
help_general_url(template: 'unhappy', anchor: 'other_means') %>
<p>
<% end %>
</div>
9 changes: 5 additions & 4 deletions config/routes.rb
Expand Up @@ -365,7 +365,7 @@
####

#### Help controller
match '/help/unhappy/:url_title' => 'help#unhappy',
match '/help/unhappy(/:url_title)' => 'help#unhappy',
:as => :help_unhappy,
:via => :get
match '/help/about' => 'help#about',
Expand All @@ -392,9 +392,10 @@
match '/help/credits' => 'help#credits',
:as => :help_credits,
:via => :get
match '/help/:action' => 'help#action',
match '/help/:template' => 'help#action',
:as => :help_general,
:via => :get
:via => :get,
:template => /[-_a-z]+/
match '/help' => 'help#index',
:via => :get
####
Expand Down Expand Up @@ -685,7 +686,7 @@
end
resources :embargoes, :only => [:destroy, :create] do
collection do
post :destroy_batch, :only => [:destroy]
post :destroy_batch
end
end
resources :embargo_extensions, :only => [:create] do
Expand Down
3 changes: 3 additions & 0 deletions doc/CHANGES.md
Expand Up @@ -58,6 +58,9 @@
for more information on traits.
* We no longer support Debian Jessie. Please upgrade to Debian Stretch at the
earliest opportinuity.
* The changes to the way dynamic routes work means that any themes that use
the `help_general_url` helper will need to pass in `:template` instead of
`:action`

# 0.32.0.1

Expand Down

0 comments on commit f014546

Please sign in to comment.