The country selector is associated with chevron, to let the user see a region can be selected

This commit is contained in:
echarp 2017-05-20 18:10:04 +02:00
parent 6924f7ec3c
commit ed797cfafb
9 changed files with 90459 additions and 6 deletions

View File

@ -14,6 +14,7 @@
background-color: white background-color: white
li li
display: none display: none
border-top: solid thin #eee
& li:hover li, li.selected & li:hover li, li.selected
display: block display: block
li li
@ -21,7 +22,6 @@
a a
padding: 0.3em 0.6em padding: 0.3em 0.6em
display: inline-block display: inline-block
border-top: solid thin #eee
white-space: nowrap white-space: nowrap
&:hover ul &:hover ul
box-shadow: 0 4px 4px gray box-shadow: 0 4px 4px gray

View File

@ -1,10 +1,14 @@
- selected = params[:region].to_i == region.id :ruby
selected = params[:region].to_i == region.id
regions = Region.where(region: region)
%li{ class: selected ? 'selected' : '' } %li{ class: selected ? 'selected' : '' }
- if region.url.present? - if region.url.present?
= link_to region.url do = link_to region.url do
= image_tag "regions/#{region.code}.png" if region.code.present? = image_tag "regions/#{region.code}.png" if region.code.present?
= region.name = region.name
- if regions.present?
%em.fa.fa-chevron-down
- else - else
= link_to region: region.id, = link_to region: region.id,
start_date: params[:start_date], start_date: params[:start_date],
@ -12,8 +16,6 @@
tag: params[:tag] do tag: params[:tag] do
%em.fa.fa-shield %em.fa.fa-shield
= region.name = region.name
- if selected
%em.fa.fa-chevron-down
%ul %ul
= render partial: '/regions/region', = render partial: '/regions/region',
collection: Region.where(region: region) collection: regions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
(function() {
$(document).on('turbolinks:load', function() {
return tinyMCE.init({
schema: 'html5',
branding: false,
language: 'fr_FR',
selector: 'textarea.description',
content_css: '/assets/application-31446b61376e114e9c8dd48e3beb3218fd819e0de7fb8bb309580ce7e688bb5d.css',
entity_encoding: 'raw',
add_unload_trigger: true,
browser_spellcheck: true,
toolbar: [' cut copy paste | undo redo | searchreplace | link image media charmap table | code visualblocks preview fullscreen', ' removeformat | bold italic strikethrough | superscript subscript | bullist numlist | alignleft aligncenter alignright alignjustify alignnone | outdent indent'],
plugins: 'lists, advlist, autolink, link, image, charmap, paste, print, preview, table, fullscreen, searchreplace, media, insertdatetime, visualblocks, wordcount, contextmenu, code'
});
});
$(document).on('turbolinks:before-cache', function() {
return tinymce.remove();
});
}).call(this);