Add Luxembourg and Tunisia

This commit is contained in:
echarp 2017-07-01 19:02:46 +02:00
parent 1a1dd9306e
commit 61fe1dd547
7 changed files with 31 additions and 12 deletions

View File

@ -25,7 +25,7 @@ html
padding: 0 padding: 0
background-color: transparent background-color: transparent
& > header, & > footer, & > header, & > footer,
h2, nav, .region_selector, .orga_search, .formats, #banner h2, nav, .region_filter, .orga_search, .formats, #banner
display: none display: none
ul ul
margin: 0 margin: 0

View File

@ -1,4 +1,4 @@
.region_selector .region_filter
float: right float: right
font-size: smaller font-size: smaller
& > ul > li & > ul > li
@ -40,7 +40,7 @@
input:checked + label input:checked + label
display: inline display: inline
padding: 0.5em padding: 0.5em
&:hover .radios .region:hover .radios
z-index: 1000 z-index: 1000
position: absolute position: absolute
box-shadow: 0 4px 4px gray box-shadow: 0 4px 4px gray

View File

@ -1,4 +1,4 @@
-# Choose a region to filter events with -# Choose a region to filter events with
%nav.region_selector %nav.region_filter
%ul= render partial: '/regions/filter_region', %ul= render partial: '/regions/filter_region',
collection: Region.where(region: nil) collection: Region.where(region: nil)

View File

@ -14,7 +14,10 @@
start_date: params[:start_date], start_date: params[:start_date],
year: params[:year], year: params[:year],
tag: params[:tag] do tag: params[:tag] do
%em.fa.fa-shield - if filter_region.region.nil?
= flag_icon filter_region.code.try :downcase
- else
%em.fa.fa-shield
= filter_region.name = filter_region.name
%ul %ul
= render partial: '/regions/filter_region', = render partial: '/regions/filter_region',

View File

@ -1,6 +1,11 @@
- if selector_region.regions.present? || selector_region.url.nil? - if selector_region.regions.present? || selector_region.url.blank?
= flag_icon selector_region.code.try :downcase %span.region
= selector_region = f.radio_button :region_id, selector_region.id
%em.fa.fa-chevron-right = f.label "region_id_#{selector_region.id}" do
.radios= f.collection_radio_buttons :region_id, = flag_icon selector_region.code.try :downcase
Region.where(region: selector_region), :id, :name = selector_region
- if selector_region.regions.present?
%em.fa.fa-chevron-right
.radios
= f.collection_radio_buttons :region_id,
Region.where(region: selector_region), :id, :name

View File

@ -0,0 +1,11 @@
# Add the new countries Luxembourg and Tunisia
class AddLuAndTn < ActiveRecord::Migration
def self.up
say 'Creates LU and TN regions'
return if Region.exists? name: 'Luxembourg'
[
{ name: 'Luxembourg', code: :LU, url: '//www.agendadulibre.org' },
{ name: 'Tunisie', code: :TN, url: '//www.agendadulibre.org' }
].each { |country| Region.create country }
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170508142601) do ActiveRecord::Schema.define(version: 20170701161358) do
create_table "active_admin_comments", force: :cascade do |t| create_table "active_admin_comments", force: :cascade do |t|
t.string "namespace" t.string "namespace"