Browse Source

Le sélectionneur de région est en place

recurrent
echarp 9 years ago
parent
commit
de7c7ec246
  1. 4
      app/assets/javascripts/events.js.coffee
  2. 17
      app/assets/stylesheets/events.css.sass
  3. 5
      app/views/events/index.html.haml
  4. 2
      app/views/layouts/application.html.haml
  5. 1
      config/locales/fr.yml

4
app/assets/javascripts/events.js.coffee

@ -1,3 +1,7 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
#
$(document).ready ->
$('form.region_selector select').change ->
window.location='?year=2013&month=12&region=' + this.options[this.selectedIndex].value

17
app/assets/stylesheets/events.css.sass

@ -1,4 +1,9 @@
main h2:first-child
form.region_selector
width: 98.3%
position: absolute
margin-top: 2.6em
main form.region_selector + h2
margin-top: 1.1em
a
font-weight: normal
@ -18,7 +23,7 @@ table.calendar
text-transform: capitalize
td
width: 14% !important
height: 6em
height: 4.8em
border: 1px solid #89B7E5
vertical-align: top
background-color: #A1C3E7
@ -30,6 +35,12 @@ table.calendar
.event
a:link, a:visited
color: #888
&.today
border: 1px solid #FFB578
background-color: #ffe0c7
.day_number
color: #544f32
font-size: 0.8em
.day_number
float: left
@ -60,7 +71,7 @@ table.calendar
color: black
.formats
width: 99%
width: 95%
font-size: smaller
margin-top: 10px
text-align: right

5
app/views/events/index.html.haml

@ -1,3 +1,8 @@
%form.region_selector
= select_tag :region,
options_from_collection_for_select(Region.all, 'id', 'name', params[:region]),
prompt: t('region_selector')
= calendar @events, { prev_text: '<<', next_text: '>>', start_day: :monday,
params: { region: params[:region] } } do |event|
%ul.events

2
app/views/layouts/application.html.haml

@ -15,7 +15,7 @@
%meta(name='dcterms.title' content='Agenda du Libre' lang='fr')
%meta(name='dcterms.subject' content='agenda')
= favicon_link_tag
%link(rel='shortcut icon' href='/favicon.ico')
= auto_discovery_link_tag :atom, { format: :atom }
= stylesheet_link_tag 'application', media: "all", "data-turbolinks-track" => true

1
config/locales/fr.yml

@ -2,6 +2,7 @@ fr:
show: Voir
edit: Éditer
destroy: Supprimer
region_selector: Toutes les régions
attributes:
id: ID

Loading…
Cancel
Save