Browse Source

Le sélecteur de région est plus simple

recurrent
echarp 8 years ago
parent
commit
7031620e9d
  1. 2
      app/assets/javascripts/events.js.coffee
  2. 2
      app/assets/stylesheets/all.css.sass
  3. 6
      app/assets/stylesheets/events.css.sass
  4. 5
      app/views/events/index.html.haml
  5. 18
      app/views/layouts/application.html.haml
  6. 1
      config/routes.rb

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

@ -4,4 +4,4 @@
#
$(document).ready ->
$('form.region_selector select').change ->
window.location='?year=2013&month=12&region=' + this.options[this.selectedIndex].value
this.form.submit()

2
app/assets/stylesheets/all.css.sass

@ -65,7 +65,9 @@ main h1
margin-top: 1em
footer.bottom nav
margin: 29px auto -3px
font-size: smaller
a + a:before
color: black
content: '- '
font-weight: normal

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

@ -2,6 +2,8 @@ form.region_selector
width: 98.3%
position: absolute
margin-top: 2.6em
label
display: none
main form.region_selector + h2
margin-top: 1.1em
@ -73,7 +75,7 @@ table.calendar
color: black
.formats
width: 95%
width: 90%
margin: 10px auto
font-size: smaller
margin-top: 10px
text-align: right

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

@ -1,4 +1,9 @@
%form.region_selector
- if (params[:month])
= hidden_field_tag :month, params[:month]
- if (params[:year])
= hidden_field_tag :year, params[:year]
= label_tag :region, Region.model_name.human
= select_tag :region,
options_from_collection_for_select(Region.all, 'id', 'name', params[:region]),
prompt: t('region_selector')

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

@ -59,13 +59,11 @@
%footer.bottom
%nav
= link_to t('.propose'), new_event_path
-#= link_to t('.rss'), users_url
-#= link_to t('.ical'), users_url
-#= link_to t('.map'), users_url
-#= link_to t('.tags'), users_url
-#= link_to t('.infos'), users_url
-#= link_to t('.stats'), users_url
-#= link_to t('.contact'), users_url
-#= link_to t('.moderation'), users_url
-#= link_to t('.forge'), 'http://rubyforge.org/projects/parlement'
-#= link_to t('.agpl'), 'http://www.gnu.org/licenses/agpl.html'
= link_to t('.rss'), users_url
= link_to t('.ical'), users_url
= link_to t('.map'), users_url
= link_to t('.tags'), users_url
= link_to t('.infos'), users_url
= link_to t('.stats'), users_url
= link_to t('.contact'), users_url
= link_to t('.moderation'), users_url

1
config/routes.rb

@ -1,5 +1,6 @@
AgendaDuLibreRails::Application.routes.draw do
resources :events
resources :users
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)

Loading…
Cancel
Save