From 6003c8dd7177a00470022063f49268acf3909550 Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 13 Jul 2014 14:03:59 +0200 Subject: [PATCH] =?UTF-8?q?La=20saisie=20de=20date=20et=20heure=20est=20si?= =?UTF-8?q?mplifi=C3=A9e=20techniquement,=20en=20html5=20l'affichage=20est?= =?UTF-8?q?=20sympa=20mais=20n=C3=A9cessitera=20un=20shim=20pour=20les=20n?= =?UTF-8?q?avigateurs=20ne=20le=20supportant=20pas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 9 ++++++--- Gemfile.lock | 4 ++-- app/views/events/_form.html.haml | 10 +++++++--- app/views/layouts/application.html.haml | 6 ------ config/locales/fr.yml | 1 + 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 0aa254fe..c832863a 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,8 @@ gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' -# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks +# Turbolinks makes following links in your web application faster. Read more: +# https://github.com/rails/turbolinks gem 'turbolinks' gem 'jquery-turbolinks' @@ -29,7 +30,8 @@ gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc -# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring +# Spring speeds up development by keeping your application running in the +# background. Read more: https://github.com/rails/spring gem 'spring', group: :development # Use ActiveModel has_secure_password @@ -52,7 +54,7 @@ gem 'activeadmin', github: 'gregbell/active_admin' gem 'devise' gem 'devise-i18n' gem 'rails-i18n' -# Store some specific content, like application name and some important documentation +# Store some specific content, like application name and static pages contents gem 'i18n-active_record', git: 'git://github.com/svenfuchs/i18n-active_record.git', require: 'i18n/active_record' @@ -61,6 +63,7 @@ gem 'email_validator' # To display a patched diff for event descriptions gem 'differ' +# The central piece of this application: the month calendar view gem 'simple_calendar' # Markdown display diff --git a/Gemfile.lock b/Gemfile.lock index 7787315b..7b2a690a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/gregbell/active_admin.git - revision: 063e00b533d4d6c83052b04e7f9cfd86fb68f8fe + revision: 168d72e7f5d705cd25373775db2c9efd910b7a95 specs: activeadmin (1.0.0.pre) arbre (~> 1.0) @@ -243,7 +243,7 @@ GEM json (~> 1.8) rdoc (~> 4.0, < 5.0) sexp_processor (4.4.3) - simple_calendar (1.1.4) + simple_calendar (1.1.5) rails (>= 3.0) slim (2.0.3) temple (~> 0.6.6) diff --git a/app/views/events/_form.html.haml b/app/views/events/_form.html.haml index 5821ddf3..0f9ac0e9 100644 --- a/app/views/events/_form.html.haml +++ b/app/views/events/_form.html.haml @@ -21,13 +21,17 @@ :markdown #{t '.title_helper'} = f.label :title - = f.text_field :title, required: true ,size: 70 + = f.text_field :title, required: true, size: 70 .field = f.label :start_time - %span#event_start_time= f.datetime_select :start_time, required: true + = f.datetime_local_field :start_time, required: true, size: 14, + value: l(@event.start_time || Time.now + 1.day + 1.hour - Time.now.min.minutes, format: :manual), + placeholder: t('time.formats.manual') .field = f.label :end_time - %span#event_end_time= f.datetime_select :end_time, required: true + = f.datetime_local_field :end_time, required: true, size: 14, + value: l(@event.end_time || Time.now + 1.day + 2.hour - Time.now.min.minutes, format: :manual), + placeholder: t('time.formats.manual') .field .helper :markdown diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 8e7207f4..8a10bae7 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -21,14 +21,8 @@ = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true - /[if lt IE 9] - %script(src='http://html5shiv.googlecode.com/svn/trunk/html5.js') = csrf_meta_tags - // = javascript_include_tag 'html5' - // = javascript_include_tag 'PIE' - // /https://github.com/aFarkas/iepp/wiki - %body(class = "#{controller.controller_name} #{controller.action_name}") %header.top = image_tag 'baby_gnu_adl.png', alt: 'Baby GNU', class: :logo diff --git a/config/locales/fr.yml b/config/locales/fr.yml index dd3421d6..28a6121b 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -91,6 +91,7 @@ fr: formats: at: "%A %d %B %Y à %Hh%M" hours: "%Hh%M" + manual: "%d/%m/%Y %H:%M" # Traductions des écrans layouts: