Datepicker translation, minor theming improvements.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 9 Jan 2011 12:26:32 +0000 (13:26 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 9 Jan 2011 12:34:33 +0000 (13:34 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Makefile
htdocs/css/base.css
htdocs/javascript/survey.js
modules/survey.php
templates/survey/edit.tpl
templates/survey/vote.questions.tpl [moved from templates/survey/questions.tpl with 100% similarity]
templates/survey/vote.tpl

index 2418710..0041ae2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -193,7 +193,7 @@ JSTREE_PATH=htdocs/javascript/jquery.jstree.js
 # TODO: jquery.autocomplete.js should rather be downloaded from an official source. The issue
 # is that the version we use is not available anymore on the Internet, and the latest version
 # we could use is not backward compatible with our current code.
-jquery: htdocs/javascript/jquery.js $(JQUERY_PLUGINS_PATHES) $(JQUERY_UI_PATHES) $(JQUERY_TMPL_PATH) $(JSTREE_PATH)
+jquery: htdocs/javascript/jquery.js $(JQUERY_PLUGINS_PATHES) $(JQUERY_UI_PATHES) $(JQUERY_TMPL_PATH) $(JSTREE_PATH) htdocs/javascript/jquery.ui.datepicker-fr.js
 
 htdocs/javascript/jquery-$(JQUERY_VERSION).min.js: DOWNLOAD_SRC = http://jquery.com/src/$(@F)
 htdocs/javascript/jquery-$(JQUERY_VERSION).min.js:
@@ -212,7 +212,11 @@ htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).%.js: DOWNLOAD_SRC = http://jqu
 htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).%.js:
        @$(download)
 
-$(JQUERY_UI_PATHES): htdocs/javascript/jquery.ui.%.js: htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).%.js
+htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).datepicker-fr.js: DOWNLOAD_SRC = http://jquery-ui.googlecode.com/svn/tags/$(JQUERY_UI_VERSION)/ui/minified/i18n/jquery.ui.datepicker-fr.min.js
+htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).datepicker-fr.js:
+       @$(download)
+
+$(JQUERY_UI_PATHES) htdocs/javascript/jquery.ui.datepicker-fr.js: htdocs/javascript/jquery.ui.%.js: htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).%.js
        ln -snf $(<F) $@
 
 htdocs/javascript/jquery.tmpl-$(JQUERY_TMPL_VERSION).js: DOWNLOAD_SRC = https://github.com/jquery/jquery-tmpl/raw/$(JQUERY_TMPL_VERSION)/jquery.tmpl.min.js --no-check-certificate
index a38d408..10890c6 100644 (file)
     overflow: hidden;
 }
 
+.ui-datepicker-calendar {
+    border-collapse: collapse;
+    text-align: right;
+}
+
+.ui-datepicker-calendar td {
+    width: 20px;
+}
+
 .ui-datepicker-week-end {
     background-color: #eee;
 }
index abd6aca..fb944cd 100644 (file)
 })(jQuery);
 
 
+$(function() {
+    $(".datepicker").datepicker({
+        hideIfNoPrevNext: true,
+        minDate: new Date()
+    });
+});
+
+
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index c6a3914..1d0c014 100644 (file)
@@ -109,6 +109,7 @@ class SurveyModule extends PLModule
         $page->addJsLink('jquery.ui.core.js');
         $page->addJsLink('jquery.ui.widget.js');
         $page->addJsLink('jquery.ui.datepicker.js');
+        $page->addJsLink('jquery.ui.datepicker-fr.js');
         $page->addJsLink('jquery.tmpl.js');
         $page->addJsLink('survey.js');
         $page->changeTpl('survey/edit.tpl');
index 9c6145d..6a2d274 100644 (file)
 
     Titre&nbsp;: <input type="text" name="title" /><br />
     Nom&nbsp;: <input type="text" name="shortname" /><br />
+    Description&nbsp;:<br /><textarea name="description" style="width: 100%"></textarea>
+  </fieldset>
 
+  <fieldset>
+    <legend>Déroulement du sondage</legend>
     Premier jour&nbsp;: <input type="text" class="datepicker" name="begin" /><br />
     Dernier jour&nbsp;: <input type="text" class="datepicker" name="end" /><br />
   </fieldset>
 </form>
 
-{literal}
-<script type="text/javascript">
-  //<![CDATA[
-  $($(".datepicker").datepicker({
-    dateFormat: 'dd/mm/yyyy',
-    firstDay: 1,
-    hideIfNoPrevNext: true,
-    minDate: new Date()
-  }));
-  //]]>
-</script>
-{/literal}
-
 {* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}
index ad20cc7..e76065e 100644 (file)
@@ -34,7 +34,7 @@
   </div>
 </form>
 
-{include file="survey/questions.tpl"}
+{include file="survey/vote.questions.tpl"}
 
 <script type="text/javascript">
   //<![CDATA[