Links to filter on region do not use the "all" value anymore

This commit is contained in:
echarp 2017-07-06 14:45:20 +02:00
parent e2af7fbcb2
commit 1de8e3ef14
4 changed files with 6 additions and 8 deletions

View File

@ -38,8 +38,6 @@ class OrgasController < ApplicationController
end end
def show def show
@search = Orga.search params[:q]
@events_future = Event.moderated.future.tag @orga.name_as_tag @events_future = Event.moderated.future.tag @orga.name_as_tag
@events_past = Event.moderated.past.tag @orga.name_as_tag @events_past = Event.moderated.past.tag @orga.name_as_tag
end end

View File

@ -9,14 +9,13 @@
%tr %tr
%th= link_to t(:all, %th= link_to t(:all,
scope: 'activerecord.attributes.region.name_values'), root_path scope: 'activerecord.attributes.region.name_values'), root_path
%th= link_to 'RSS', events_path(format: :rss, region: :all) %th= link_to 'RSS', events_path(format: :rss)
%th= link_to :webcal, %th= link_to :webcal,
events_path(protocol: :webcal, format: :ics, region: :all, events_path(protocol: :webcal, format: :ics, only_path: false)
only_path: false)
%th= link_to :iCal, %th= link_to :iCal,
events_path(format: :ics, region: :all, only_path: false) events_path(format: :ics, only_path: false)
%th= link_to :GeoJSON, %th= link_to :GeoJSON,
maps_path(format: :json, region: :all, only_path: false) maps_path(format: :json, only_path: false)
%tbody %tbody
- @regions.find_each do |region| - @regions.find_each do |region|

View File

@ -3,7 +3,7 @@ Differ.format = Differ::Format::Patch
def gen_title def gen_title
t 'layouts.application.title' + t 'layouts.application.title' +
if params[:region].present? && params[:region] != 'all' if params[:region].present?
region = Region.find(params[:region]).name region = Region.find(params[:region]).name
" [#{region}]" " [#{region}]"
else else

View File

@ -47,6 +47,7 @@ class OrgasControllerTest < ActionController::TestCase
kind_id: @orga.kind_id, kind_id: @orga.kind_id,
name: @orga.name, name: @orga.name,
region_id: @orga.region.id, region_id: @orga.region.id,
description: @orga.description,
url: @orga.url url: @orga.url
} }