Browse Source

WIP - first draft

loconox 7 years ago
parent
commit
e21da209d2
43 changed files with 37576 additions and 368 deletions
  1. 5 0
      .bowerrc
  2. 2 0
      .gitignore
  3. 81 0
      Gruntfile.js
  4. 41 0
      app/Resources/assets/sass/_bootstrap_config.scss
  5. 3 0
      app/Resources/assets/sass/_style.scss
  6. 6 0
      app/Resources/assets/sass/main.scss
  7. 16 10
      app/Resources/views/base.html.twig
  8. 35 68
      app/Resources/views/default/index.html.twig
  9. 3 1
      app/config/config.yml
  10. 12 0
      app/config/services.yml
  11. 405 0
      app/data/french-legal-cedh.csl
  12. 401 0
      app/data/french-legal-empty.csl
  13. 662 0
      app/data/french-legal.csl
  14. 22 0
      bower.json
  15. 19 4
      composer.json
  16. 746 147
      composer.lock
  17. 27 0
      package.json
  18. 26 29
      src/AppBundle/CSL/CiteProc.php
  19. 71 9
      src/AppBundle/Command/TestCommand.php
  20. 22 4
      src/AppBundle/Controller/DefaultController.php
  21. 2 2
      src/AppBundle/Entity/Date.php
  22. 9 9
      src/AppBundle/Entity/Name.php
  23. 133 78
      src/AppBundle/Entity/Reference.php
  24. 77 0
      src/AppBundle/Entity/ReferenceManger.php
  25. 18 0
      src/AppBundle/Entity/References.php
  26. 60 0
      src/AppBundle/Form/ReferenceType.php
  27. 92 0
      src/AppBundle/Serializer/DateDenormalizer.php
  28. 0 6
      var/SymfonyRequirements.php
  29. 6314 0
      web/assets/css/main.css
  30. BIN
      web/assets/fonts/bootstrap/glyphicons-halflings-regular.eot
  31. 288 0
      web/assets/fonts/bootstrap/glyphicons-halflings-regular.svg
  32. BIN
      web/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf
  33. BIN
      web/assets/fonts/bootstrap/glyphicons-halflings-regular.woff
  34. BIN
      web/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2
  35. BIN
      web/assets/images/Sorting icons.psd
  36. BIN
      web/assets/images/favicon.ico
  37. BIN
      web/assets/images/sort_asc.png
  38. BIN
      web/assets/images/sort_asc_disabled.png
  39. BIN
      web/assets/images/sort_both.png
  40. BIN
      web/assets/images/sort_desc.png
  41. BIN
      web/assets/images/sort_desc_disabled.png
  42. 27977 0
      web/assets/js/main.js
  43. 1 1
      web/config.php

+ 5 - 0
.bowerrc

@@ -0,0 +1,5 @@
+{
+  "directory": "app/Resources/lib/",
+  "json" : "bower.json"
+}
+

+ 2 - 0
.gitignore

@@ -14,3 +14,5 @@
 !var/SymfonyRequirements.php
 /vendor/
 /web/bundles/
+/app/Resources/lib/
+/node_modules/

+ 81 - 0
Gruntfile.js

@@ -0,0 +1,81 @@
+module.exports = function (grunt) {
+
+
+    grunt.initConfig({
+        pkg: grunt.file.readJSON('package.json'),
+        clean: {
+            js: [
+                'web/assets/js'
+            ]
+        },
+        sass: {
+            build: {
+                options: {
+                    sourcemap: 'none',
+                    style: 'expanded'
+                },
+                files: [{
+                    expand: true,
+                    cwd: 'app/Resources/assets/sass',
+                    src: ['**/*.scss'],
+                    dest: 'web/assets/css',
+                    ext: '.css'
+                }]
+            }
+        },
+        copy: {
+            dt: {
+                files: [{
+                    expand: true,
+                    cwd: 'app/Resources/lib/datatables/media/images',
+                    src: ['**/*'],
+                    dest: 'web/assets/images'
+                }]
+            },
+            fonts: {
+                files: [{
+                    expand: true,
+                    cwd: 'app/Resources/lib/bootstrap-sass/assets/fonts',
+                    src: ['**/*'],
+                    dest: 'web/assets/fonts'
+                }]
+            }
+        },
+        concat: {
+            js: {
+                options: {
+                    separator: ';\n'
+                },
+                files: {
+                    'web/assets/js/main.js': [
+                        'app/Resources/lib/jquery/dist/jquery.js',
+                        'app/Resources/lib/bootstrap-sass/assets/javascripts/bootstrap.js',
+                        'app/Resources/lib/datatables/media/js/jquery.dataTables.js',
+                        'app/Resources/lib/datatables/media/js/dataTables.boostrap.js'
+                    ]
+                }
+            }
+        },
+        watch: {
+            options: {
+                livereload: true,
+                spawn: false
+            },
+            ts: {
+                files: ['app/Resources/assets/ts/**/*.ts'],
+                tasks: ['typescript']
+            }
+        }
+    });
+
+
+    grunt.loadNpmTasks('grunt-sass');
+    grunt.loadNpmTasks('grunt-symfony2');
+    grunt.loadNpmTasks('grunt-contrib-concat');
+    grunt.loadNpmTasks('grunt-contrib-copy');
+    grunt.loadNpmTasks('grunt-contrib-clean');
+    grunt.loadNpmTasks('grunt-contrib-watch');
+
+    grunt.registerTask('default', ['clean:js', 'sass', 'copy:dt', 'copy:fonts', 'concat:js']);
+
+};

+ 41 - 0
app/Resources/assets/sass/_bootstrap_config.scss

@@ -0,0 +1,41 @@
+// TYPOGRAPHY
+
+$font-family-sans-serif:  "Helvetica Neue", Helvetica, Arial, sans-serif;
+$font-family-serif:       Georgia, "Times New Roman", Times, serif;
+$font-family-monospace:   Menlo, Monaco, Consolas, "Courier New", monospace;
+$font-family-base:        $font-family-sans-serif;
+
+$font-size-base:          14px;
+$font-size-large:         ceil(($font-size-base * 1.25)); // ~18px
+$font-size-small:         ceil(($font-size-base * 0.85)); // ~12px
+
+$font-size-h1:            floor(($font-size-base * 2.6)); // ~36px
+$font-size-h2:            floor(($font-size-base * 2.15)); // ~30px
+$font-size-h3:            ceil(($font-size-base * 1.7)); // ~24px
+$font-size-h4:            ceil(($font-size-base * 1.25)); // ~18px
+$font-size-h5:            $font-size-base;
+$font-size-h6:            ceil(($font-size-base * 0.85)); // ~12px
+
+$line-height-base:        1.428571429; // 20/14
+$line-height-computed:    floor(($font-size-base * $line-height-base)); // ~20px
+
+$headings-font-family:    inherit;
+$headings-font-weight:    500;
+$headings-line-height:    1.1;
+$headings-color:          inherit;
+
+//== Iconography
+//
+//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
+
+//** Load fonts from this directory.
+
+// [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
+// [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
+
+
+//== Jumbotron
+//
+//##
+
+$jumbotron-padding:              10px !default;

+ 3 - 0
app/Resources/assets/sass/_style.scss

@@ -0,0 +1,3 @@
+.date-field {
+    white-space: nowrap;
+}

+ 6 - 0
app/Resources/assets/sass/main.scss

@@ -0,0 +1,6 @@
+// Variables
+@import "bootstrap_config";
+@import "../../lib/bootstrap-sass/assets/stylesheets/bootstrap"; // bootstrap
+@import "../../lib/datatables/media/css/jquery.dataTables.min";
+@import "../../lib/datatables/media/css/dataTables.bootstrap.min";
+@import "style";

+ 16 - 10
app/Resources/views/base.html.twig

@@ -1,13 +1,19 @@
 <!DOCTYPE html>
 <html>
-    <head>
-        <meta charset="UTF-8" />
-        <title>{% block title %}Welcome!{% endblock %}</title>
-        {% block stylesheets %}{% endblock %}
-        <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
-    </head>
-    <body>
-        {% block body %}{% endblock %}
-        {% block javascripts %}{% endblock %}
-    </body>
+<head>
+    <meta charset="UTF-8" />
+    <title>{% block title %}Welcome!{% endblock %}</title>
+    <link href="{{ asset('assets/css/main.css') }}" rel="stylesheet" type="text/css"/>
+    {% block stylesheets %}{% endblock %}
+    <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
+
+    <script src="{{ asset("assets/js/main.js") }}" type="application/javascript"></script>
+</head>
+<body>
+
+<div class="container">
+    {% block body %}{% endblock %}
+</div>
+{% block javascripts %}{% endblock %}
+</body>
 </html>

+ 35 - 68
app/Resources/views/default/index.html.twig

@@ -1,76 +1,43 @@
 {% extends 'base.html.twig' %}
 
 {% block body %}
-    <div id="wrapper">
-        <div id="container">
-            <div id="welcome">
-                <h1><span>Welcome to</span> Symfony {{ constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION') }}</h1>
-            </div>
-
-            <div id="status">
-                <p>
-                    <svg id="icon-status" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z" fill="#759E1A"/></svg>
-
-                    Your application is now ready. You can start working on it at:
-                    <code>{{ base_dir }}</code>
-                </p>
-            </div>
-
-            <div id="next">
-                <h2>What's next?</h2>
-                <p>
-                    <svg id="icon-book" version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="-12.5 9 64 64" enable-background="new -12.5 9 64 64" xml:space="preserve">
-                        <path fill="#AAA" d="M6.8,40.8c2.4,0.8,4.5-0.7,4.9-2.5c0.2-1.2-0.3-2.1-1.3-3.2l-0.8-0.8c-0.4-0.5-0.6-1.3-0.2-1.9
-                            c0.4-0.5,0.9-0.8,1.8-0.5c1.3,0.4,1.9,1.3,2.9,2.2c-0.4,1.4-0.7,2.9-0.9,4.2l-0.2,1c-0.7,4-1.3,6.2-2.7,7.5
-                            c-0.3,0.3-0.7,0.5-1.3,0.6c-0.3,0-0.4-0.3-0.4-0.3c0-0.3,0.2-0.3,0.3-0.4c0.2-0.1,0.5-0.3,0.4-0.8c0-0.7-0.6-1.3-1.3-1.3
-                            c-0.6,0-1.4,0.6-1.4,1.7s1,1.9,2.4,1.8c0.8,0,2.5-0.3,4.2-2.5c2-2.5,2.5-5.4,2.9-7.4l0.5-2.8c0.3,0,0.5,0.1,0.8,0.1
-                            c2.4,0.1,3.7-1.3,3.7-2.3c0-0.6-0.3-1.2-0.9-1.2c-0.4,0-0.8,0.3-1,0.8c-0.1,0.6,0.8,1.1,0.1,1.5c-0.5,0.3-1.4,0.6-2.7,0.4l0.3-1.3
-                            c0.5-2.6,1-5.7,3.2-5.8c0.2,0,0.8,0,0.8,0.4c0,0.2,0,0.2-0.2,0.5c-0.2,0.3-0.3,0.4-0.2,0.7c0,0.7,0.5,1.1,1.2,1.1
-                            c0.9,0,1.2-1,1.2-1.4c0-1.2-1.2-1.8-2.6-1.8c-1.5,0.1-2.8,0.9-3.7,2.1c-1.1,1.3-1.8,2.9-2.3,4.5c-0.9-0.8-1.6-1.8-3.1-2.3
-                            c-1.1-0.7-2.3-0.5-3.4,0.3c-0.5,0.4-0.8,1-1,1.6c-0.4,1.5,0.4,2.9,0.8,3.4l0.9,1c0.2,0.2,0.6,0.8,0.4,1.5c-0.3,0.8-1.2,1.3-2.1,1
-                            c-0.4-0.2-1-0.5-0.9-0.9c0.1-0.2,0.2-0.3,0.3-0.5s0.1-0.3,0.1-0.3c0.2-0.6-0.1-1.4-0.7-1.6c-0.6-0.2-1.2,0-1.3,0.8
-                            C4.3,38.4,4.7,40,6.8,40.8z M46.1,20.9c0-4.2-3.2-7.5-7.1-7.5h-3.8C34.8,10.8,32.7,9,30.2,9L-2.3,9.1c-2.8,0.1-4.9,2.4-4.9,5.4
-                            L-7,58.6c0,4.8,8.1,13.9,11.6,14.1l34.7-0.1c3.9,0,7-3.4,7-7.6L46.1,20.9z M-0.3,36.4c0-8.6,6.5-15.6,14.5-15.6
-                            c8,0,14.5,7,14.5,15.6S22.1,52,14.2,52C6.1,52-0.3,45-0.3,36.4z M42.1,65.1c0,1.8-1.5,3.1-3.1,3.1H4.6c-0.7,0-3-1.8-4.5-4.4h30.4
-                            c2.8,0,5-2.4,5-5.4V17.9h3.7c1.6,0,2.9,1.4,2.9,3.1V65.1L42.1,65.1z"/>
-                    </svg>
-
-                    Read the documentation to learn
-                    <a href="http://symfony.com/doc/{{ constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION')[:3] }}/page_creation.html">
-                        How to create your first page in Symfony
-                    </a>
-                </p>
-            </div>
-
+    <div class="row">
+        <div class="col-md-6">
+            {{ form(form) }}
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-12">
+            <table class="table table-striped table-references">
+                <thead>
+                <tr>
+                    <th>Type</th>
+                    <th>Id</th>
+                    <th>Authority</th>
+                    <th>Title</th>
+                    <th>Issued</th>
+                </tr>
+                </thead>
+                <tbody>
+                {% for reference in references %}
+                    <tr>
+                        <td>{{ reference.type }}</td>
+                        <td>{{ reference.id }}</td>
+                        <td>{{ reference.authority }}</td>
+                        <td>{{ reference.title }}</td>
+                        <td class="date-field">{{ reference.issued|localizeddate('medium', 'none') }}</td>
+                    </tr>
+                {% endfor %}
+                </tbody>
+            </table>
         </div>
     </div>
 {% endblock %}
 
-{% block stylesheets %}
-<style>
-    body { background: #F5F5F5; font: 18px/1.5 sans-serif; }
-    h1, h2 { line-height: 1.2; margin: 0 0 .5em; }
-    h1 { font-size: 36px; }
-    h2 { font-size: 21px; margin-bottom: 1em; }
-    p { margin: 0 0 1em 0; }
-    a { color: #0000F0; }
-    a:hover { text-decoration: none; }
-    code { background: #F5F5F5; max-width: 100px; padding: 2px 6px; word-wrap: break-word; }
-    #wrapper { background: #FFF; margin: 1em auto; max-width: 800px; width: 95%; }
-    #container { padding: 2em; }
-    #welcome, #status { margin-bottom: 2em; }
-    #welcome h1 span { display: block; font-size: 75%; }
-    #icon-status, #icon-book { float: left; height: 64px; margin-right: 1em; margin-top: -4px; width: 64px; }
-    #icon-book { display: none; }
-
-    @media (min-width: 768px) {
-        #wrapper { width: 80%; margin: 2em auto; }
-        #icon-book { display: inline-block; }
-        #status a, #next a { display: block; }
-
-        @-webkit-keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
-        @keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
-        .sf-toolbar { opacity: 0; -webkit-animation: fade-in 1s .2s forwards; animation: fade-in 1s .2s forwards;}
-    }
-</style>
+{% block javascripts %}
+    <script type="text/javascript">
+        $(document).ready( function () {
+            $('.table-references').DataTable();
+        } );
+    </script>
 {% endblock %}

+ 3 - 1
app/config/config.yml

@@ -18,7 +18,7 @@ framework:
     form:            ~
     csrf_protection: ~
     validation:      { enable_annotations: true }
-    #serializer:      { enable_annotations: true }
+    serializer:      { enable_annotations: true }
     templating:
         engines: ['twig']
     default_locale:  "%locale%"
@@ -38,6 +38,8 @@ framework:
 twig:
     debug:            "%kernel.debug%"
     strict_variables: "%kernel.debug%"
+    form_themes:
+        - 'bootstrap_3_horizontal_layout.html.twig'
 
 # Doctrine Configuration
 doctrine:

+ 12 - 0
app/config/services.yml

@@ -7,3 +7,15 @@ services:
 #    service_name:
 #        class: AppBundle\Directory\ClassName
 #        arguments: ["@another_service_name", "plain_value", "%parameter_name%"]
+    twig.extension.intl:
+        class: Twig_Extensions_Extension_Intl
+        tags:
+            - { name: twig.extension }
+    twig.extension.text:
+        class: Twig_Extensions_Extension_Text
+        tags:
+            - { name: twig.extension }
+    app.manager.reference:
+        class: AppBundle\Entity\ReferenceManger
+        arguments:
+            - "%kernel.root_dir%/data/references.yaml"

+ 405 - 0
app/data/french-legal-cedh.csl

@@ -0,0 +1,405 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="author-date" default-locale="fr-FR">
+  <!-- This style was forked from https://github.com/citation-style-language/styles/blo/master/austrian-legal.csl by andreas.geyrecker@lexisnexis.at -->
+  <info>
+    <title>Style de citation juridique français</title>
+    <id>https://exegetes.eu.org/outils/csl/</id>
+    <link href="https://exegetes.eu.org/outils/csl/" rel="documentation"/>
+    <author>
+      <name>Hugo Roy</name>
+      <email>hugo+github-french-legal-dot-csl@ampoliros.net</email>
+    </author>
+    <category citation-format="author-date"/>
+    <category field="legislation"/>
+    <summary>French legal citation style for writing court briefs, mainly</summary>
+    <published>2016-04-12T00:00:00+02:00</published>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="fr-FR">
+    <terms>
+      <term name="et-al">et a.</term>
+      <term name="month-01" gender="masculine" form="short">jan.</term>
+      <term name="month-02" gender="masculine" form="short">fév.</term>
+      <term name="month-03" gender="masculine" form="short">mars</term>
+      <term name="month-04" gender="masculine" form="short">avr.</term>
+      <term name="month-05" gender="masculine" form="short">mai</term>
+      <term name="month-06" gender="masculine" form="short">juin</term>
+      <term name="month-07" gender="masculine" form="short">juil.</term>
+      <term name="month-08" gender="masculine" form="short">août</term>
+      <term name="month-09" gender="masculine" form="short">sept.</term>
+      <term name="month-10" gender="masculine" form="short">oct.</term>
+      <term name="month-11" gender="masculine" form="short">nov.</term>
+      <term name="month-12" gender="masculine" form="short">déc.</term>
+      <term name="ordinal">e</term>
+      <term name="ordinal-01" gender-form="feminine" match="whole-number">re</term>
+      <term name="ordinal-01" gender-form="masculine" match="whole-number">er</term>
+      <term name="ordinal-02" gender-form="feminine" match="whole-number">nd</term>
+      <term name="ordinal-02" gender-form="masculine" match="whole-number">nde</term>
+    </terms>
+  </locale>
+  <macro name="authority-sort">
+    <choose>
+      <if type="legal_case">
+        <choose>
+          <if variable="authority">
+            <text variable="authority"/>
+          </if>
+          <else>
+            <text variable="title"/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="legislation">
+        <!-- move statutes to the top -->
+        <text value="AAAAA"/>
+      </else-if>
+      <else>
+        <!-- move all but cases to the bottom -->
+        <text value="ZZZZZ"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="contributors-sort">
+    <!-- CHECK what this is -->
+    <names variable="editor">
+      <name name-as-sort-order="all" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="verb-short" prefix=", "/>
+      <substitute>
+        <names variable="author"/>
+        <text macro="noauthor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="sort-key">
+    <text macro="authority-sort"/>
+    <text macro="contributors-sort" suffix=" "/>
+  </macro>
+  <macro name="noauthor">
+    <text value="OV"/>
+  </macro>
+  <macro name="authors"><!-- CHECK what this is -->
+    <names variable="author" font-style="italic">
+      <name delimiter="/" name-as-sort-order="all" form="short" delimiter-precedes-last="always" initialize-with="."/>
+      <et-al term="et-al" font-style="italic"/>
+      <substitute>
+        <names variable="editor" font-style="italic"/>
+        <names variable="translator" font-style="italic"/>
+        <text macro="noauthor" font-style="italic"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editors"><!-- CHECK what this is -->
+    <names variable="editor" font-style="italic">
+      <name delimiter="/" name-as-sort-order="all" form="short" delimiter-precedes-last="always" initialize-with="."/>
+      <et-al term="et-al" font-style="italic"/>
+    </names>
+    <text value=" (Hrsg)" font-style="normal"/>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true" givenname-disambiguation-rule="all-names-with-initials" disambiguate-add-givenname="true">
+    <layout suffix="" delimiter="; ">
+      <choose>
+        <if type="legal_case">
+          <choose>
+            <if variable="authority section title-short issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="section" suffix= ", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1"  suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </if>
+            <else-if variable="authority title-short issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title-short issued" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+            </else-if>
+            <else-if variable="authority issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title-short number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority section title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="section" suffix= ", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title issued" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+            </else-if>
+            <else-if variable="authority issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+          </choose>
+        </if>
+        <else-if type="legislation">
+          <!-- <choose> -->
+          <!--   <if variable="container-title section" match="all"> -->
+          <!--     <text variable="section" suffix=" "/> -->
+          <!--     <text variable="container-title"/> -->
+          <!--     <choose> -->
+          <!--       <if position="first"> -->
+          <!--         <choose> -->
+          <!--           <if variable="references"> -->
+          <!--             <text variable="references" prefix=" "/> -->
+          <!--           </if> -->
+          <!--         </choose> -->
+          <!--       </if> -->
+          <!--     </choose> -->
+          <!--   </if> -->
+          <!--   <else> -->
+            <choose>
+              <if variable="title-short" match="all">
+                <text variable="title"/>
+              </if>
+              <else-if>
+                <text variable="title" />
+                <text variable="container-title-short" prefix=" ("
+                      suffix=") " />
+              </else-if>
+            </choose>
+          <!--   </else> -->
+          <!-- </choose> -->
+        </else-if>
+        <else-if type="legal_case-journal">
+          <text macro="authors" suffix=", "/>
+          <choose>
+            <if position="first">
+              <text variable="title" suffix=", "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="page issued" match="all">
+              <text variable="container-title" suffix=" "/>
+              <date variable="issued" suffix=", ">
+                <date-part name="year" form="long"/>
+              </date>
+              <text variable="page"/>
+              <text variable="locator" prefix=" (" suffix=")"/>
+            </if>
+            <else>
+              <text variable="container-title"/>
+              <!-- if no page info is available, assume container-title (publication) holds legal_case number citation -->
+              <text variable="locator" prefix=", "/>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="book">
+          <text macro="authors" font-style="italic" suffix=", "/>
+          <text variable="title"/>
+          <text variable="volume" prefix=" "/>
+          <choose>
+            <if variable="edition note" match="any">
+              <choose>
+                <if variable="edition">
+                  <text variable="edition" vertical-align="sup"/>
+                </if>
+                <else-if variable="note">
+                  <!-- RIS workaround -->
+                  <text variable="note" vertical-align="sup"/>
+                </else-if>
+              </choose>
+            </if>
+          </choose>
+          <group delimiter=" " prefix=" (" suffix=")">
+            <text variable="collection-title"/>
+            <date variable="issued">
+              <date-part name="year" form="long"/>
+            </date>
+          </group>
+          <text variable="locator" prefix=" "/>
+        </else-if>
+        <else-if type="chapter">
+          <text macro="authors" font-style="italic"/>
+          <choose>
+            <if variable="page">
+              <text variable="title" prefix=", "/>
+              <choose>
+                <if position="first">
+                  <choose>
+                    <if variable="editor">
+                      <text macro="editors" prefix=", in " suffix=", "/>
+                    </if>
+                    <else>
+                      <text value=", "/>
+                    </else>
+                  </choose>
+                  <text variable="container-title"/>
+                  <text variable="volume" prefix=" "/>
+                  <choose>
+                    <if variable="edition">
+                      <text variable="edition" vertical-align="sup"/>
+                    </if>
+                    <else-if variable="note">
+                      <text variable="note" vertical-align="sup"/>
+                    </else-if>
+                  </choose>
+                  <group delimiter=" " prefix=" (" suffix=")">
+                    <text variable="collection-title"/>
+                    <date variable="issued">
+                      <date-part name="year" form="long"/>
+                    </date>
+                  </group>
+                </if>
+              </choose>
+              <text variable="page" prefix=" "/>
+              <text variable="locator" prefix=" (" suffix=")"/>
+            </if>
+            <else>
+              <!-- no page info, classic legal commentary -->
+              <choose>
+                <if position="first">
+                  <choose>
+                    <if variable="editor">
+                      <text macro="editors" prefix=" in " suffix=", "/>
+                    </if>
+                    <else>
+                      <text value=", "/>
+                    </else>
+                  </choose>
+                  <text variable="container-title"/>
+                  <text variable="volume" prefix=" "/>
+                  <choose>
+                    <if variable="edition">
+                      <text variable="edition" vertical-align="sup"/>
+                    </if>
+                    <else-if variable="note">
+                      <!-- RIS workaround -->
+                      <text variable="note" vertical-align="sup"/>
+                    </else-if>
+                  </choose>
+                  <group delimiter=" " prefix=" (" suffix=") ">
+                    <text variable="collection-title"/>
+                    <date variable="issued">
+                      <date-part name="year" form="long"/>
+                    </date>
+                  </group>
+                </if>
+                <else>
+                  <text value=","/>
+                </else>
+              </choose>
+              <text variable="title" prefix=" "/>
+              <text variable="locator" prefix=" "/>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="thesis">
+          <text macro="authors" suffix=", "/>
+          <text variable="title"/>
+          <choose>
+            <if position="first">
+              <text variable="genre" prefix=". "/>
+              <text variable="publisher" prefix=", "/>
+              <date variable="issued" prefix=" (" suffix=")">
+                <date-part name="year" form="long"/>
+              </date>
+            </if>
+          </choose>
+          <text variable="locator" prefix=" "/>
+        </else-if>
+        <else-if type="webpage">
+          <group delimiter=", ">
+            <text macro="authors"/>
+            <text variable="title"/>
+            <group delimiter=" ">
+              <date form="numeric" variable="issued"/>
+              <text variable="URL" prefix="&lt;" suffix="&gt;"/>
+            </group>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <text macro="authors" font-style="italic"/>
+            <text variable="title"/>
+            <choose>
+              <if variable="container-title">
+                <text variable="container-title"/>
+              </if>
+            </choose>
+            <date form="numeric" variable="issued"/>
+            <text variable="locator" prefix=" "/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography subsequent-author-substitute="&#8212;&#8212;" hanging-indent="true" entry-spacing="1">
+    <sort>
+      <key macro="sort-key"/>
+      <key variable="issued" sort="ascending"/>
+    </sort>
+    <layout>
+      <choose>
+        <if type="legal_case">
+        </if>
+      </choose>
+    </layout>
+  </bibliography>
+</style>

+ 401 - 0
app/data/french-legal-empty.csl

@@ -0,0 +1,401 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="author-date" default-locale="fr-FR">
+  <!-- This style was forked from https://github.com/citation-style-language/styles/blo/master/austrian-legal.csl by andreas.geyrecker@lexisnexis.at -->
+  <info>
+    <title>Style de citation juridique français</title>
+    <id>https://exegetes.eu.org/outils/csl/</id>
+    <link href="https://exegetes.eu.org/outils/csl/" rel="documentation"/>
+    <author>
+      <name>Hugo Roy</name>
+      <email>hugo+github-french-legal-dot-csl@ampoliros.net</email>
+    </author>
+    <category citation-format="author-date"/>
+    <category field="legislation"/>
+    <summary>French legal citation style for writing court briefs, mainly</summary>
+    <published>2016-04-12T00:00:00+02:00</published>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="fr-FR">
+    <terms>
+      <term name="et-al">et a.</term>
+      <term name="month-01" gender="masculine" form="short">jan.</term>
+      <term name="month-02" gender="masculine" form="short">fév.</term>
+      <term name="month-03" gender="masculine" form="short">mars</term>
+      <term name="month-04" gender="masculine" form="short">avr.</term>
+      <term name="month-05" gender="masculine" form="short">mai</term>
+      <term name="month-06" gender="masculine" form="short">juin</term>
+      <term name="month-07" gender="masculine" form="short">juil.</term>
+      <term name="month-08" gender="masculine" form="short">août</term>
+      <term name="month-09" gender="masculine" form="short">sept.</term>
+      <term name="month-10" gender="masculine" form="short">oct.</term>
+      <term name="month-11" gender="masculine" form="short">nov.</term>
+      <term name="month-12" gender="masculine" form="short">déc.</term>
+      <term name="ordinal">e</term>
+      <term name="ordinal-01" gender-form="feminine" match="whole-number">re</term>
+      <term name="ordinal-01" gender-form="masculine" match="whole-number">er</term>
+      <term name="ordinal-02" gender-form="feminine" match="whole-number">nd</term>
+      <term name="ordinal-02" gender-form="masculine" match="whole-number">nde</term>
+    </terms>
+  </locale>
+  <macro name="authority-sort">
+    <choose>
+      <if type="legal_case">
+        <choose>
+          <if variable="authority">
+            <text variable="authority"/>
+          </if>
+          <else>
+            <text variable="title"/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="legislation">
+        <!-- move statutes to the top -->
+        <text value="AAAAA"/>
+      </else-if>
+      <else>
+        <!-- move all but cases to the bottom -->
+        <text value="ZZZZZ"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="contributors-sort">
+    <!-- CHECK what this is -->
+    <names variable="editor">
+      <name name-as-sort-order="all" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="verb-short" prefix=", "/>
+      <substitute>
+        <names variable="author"/>
+        <text macro="noauthor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="sort-key">
+    <text macro="authority-sort"/>
+    <text macro="contributors-sort" suffix=" "/>
+  </macro>
+  <macro name="noauthor">
+    <text value="OV"/>
+  </macro>
+  <macro name="authors"><!-- CHECK what this is -->
+    <names variable="author" font-style="italic">
+      <name delimiter="/" name-as-sort-order="all" form="short" delimiter-precedes-last="always" initialize-with="."/>
+      <et-al term="et-al" font-style="italic"/>
+      <substitute>
+        <names variable="editor" font-style="italic"/>
+        <names variable="translator" font-style="italic"/>
+        <text macro="noauthor" font-style="italic"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editors"><!-- CHECK what this is -->
+    <names variable="editor" font-style="italic">
+      <name delimiter="/" name-as-sort-order="all" form="short" delimiter-precedes-last="always" initialize-with="."/>
+      <et-al term="et-al" font-style="italic"/>
+    </names>
+    <text value=" (Hrsg)" font-style="normal"/>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true" givenname-disambiguation-rule="all-names-with-initials" disambiguate-add-givenname="true">
+    <layout suffix="" delimiter="; ">
+      <choose>
+        <if type="legal_case">
+          <choose>
+            <if variable="authority section title-short issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="section" suffix= ", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1"  suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </if>
+            <else-if variable="authority title-short issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title-short issued" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+            </else-if>
+            <else-if variable="authority issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title-short number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority section title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="section" suffix= ", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title issued" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+            </else-if>
+            <else-if variable="authority issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+          </choose>
+        </if>
+        <else-if type="legislation">
+          <!-- <choose> -->
+          <!--   <if variable="container-title section" match="all"> -->
+          <!--     <text variable="section" suffix=" "/> -->
+          <!--     <text variable="container-title"/> -->
+          <!--     <choose> -->
+          <!--       <if position="first"> -->
+          <!--         <choose> -->
+          <!--           <if variable="references"> -->
+          <!--             <text variable="references" prefix=" "/> -->
+          <!--           </if> -->
+          <!--         </choose> -->
+          <!--       </if> -->
+          <!--     </choose> -->
+          <!--   </if> -->
+          <!--   <else> -->
+            <choose>
+              <if variable="title-short" match="all">
+                <text variable="title"/>
+              </if>
+              <else-if>
+                <text variable="title" />
+                <text variable="container-title-short" prefix=" ("
+                      suffix=") " />
+              </else-if>
+            </choose>
+          <!--   </else> -->
+          <!-- </choose> -->
+        </else-if>
+        <else-if type="legal_case-journal">
+          <text macro="authors" suffix=", "/>
+          <choose>
+            <if position="first">
+              <text variable="title" suffix=", "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="page issued" match="all">
+              <text variable="container-title" suffix=" "/>
+              <date variable="issued" suffix=", ">
+                <date-part name="year" form="long"/>
+              </date>
+              <text variable="page"/>
+              <text variable="locator" prefix=" (" suffix=")"/>
+            </if>
+            <else>
+              <text variable="container-title"/>
+              <!-- if no page info is available, assume container-title (publication) holds legal_case number citation -->
+              <text variable="locator" prefix=", "/>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="book">
+          <text macro="authors" font-style="italic" suffix=", "/>
+          <text variable="title"/>
+          <text variable="volume" prefix=" "/>
+          <choose>
+            <if variable="edition note" match="any">
+              <choose>
+                <if variable="edition">
+                  <text variable="edition" vertical-align="sup"/>
+                </if>
+                <else-if variable="note">
+                  <!-- RIS workaround -->
+                  <text variable="note" vertical-align="sup"/>
+                </else-if>
+              </choose>
+            </if>
+          </choose>
+          <group delimiter=" " prefix=" (" suffix=")">
+            <text variable="collection-title"/>
+            <date variable="issued">
+              <date-part name="year" form="long"/>
+            </date>
+          </group>
+          <text variable="locator" prefix=" "/>
+        </else-if>
+        <else-if type="chapter">
+          <text macro="authors" font-style="italic"/>
+          <choose>
+            <if variable="page">
+              <text variable="title" prefix=", "/>
+              <choose>
+                <if position="first">
+                  <choose>
+                    <if variable="editor">
+                      <text macro="editors" prefix=", in " suffix=", "/>
+                    </if>
+                    <else>
+                      <text value=", "/>
+                    </else>
+                  </choose>
+                  <text variable="container-title"/>
+                  <text variable="volume" prefix=" "/>
+                  <choose>
+                    <if variable="edition">
+                      <text variable="edition" vertical-align="sup"/>
+                    </if>
+                    <else-if variable="note">
+                      <text variable="note" vertical-align="sup"/>
+                    </else-if>
+                  </choose>
+                  <group delimiter=" " prefix=" (" suffix=")">
+                    <text variable="collection-title"/>
+                    <date variable="issued">
+                      <date-part name="year" form="long"/>
+                    </date>
+                  </group>
+                </if>
+              </choose>
+              <text variable="page" prefix=" "/>
+              <text variable="locator" prefix=" (" suffix=")"/>
+            </if>
+            <else>
+              <!-- no page info, classic legal commentary -->
+              <choose>
+                <if position="first">
+                  <choose>
+                    <if variable="editor">
+                      <text macro="editors" prefix=" in " suffix=", "/>
+                    </if>
+                    <else>
+                      <text value=", "/>
+                    </else>
+                  </choose>
+                  <text variable="container-title"/>
+                  <text variable="volume" prefix=" "/>
+                  <choose>
+                    <if variable="edition">
+                      <text variable="edition" vertical-align="sup"/>
+                    </if>
+                    <else-if variable="note">
+                      <!-- RIS workaround -->
+                      <text variable="note" vertical-align="sup"/>
+                    </else-if>
+                  </choose>
+                  <group delimiter=" " prefix=" (" suffix=") ">
+                    <text variable="collection-title"/>
+                    <date variable="issued">
+                      <date-part name="year" form="long"/>
+                    </date>
+                  </group>
+                </if>
+                <else>
+                  <text value=","/>
+                </else>
+              </choose>
+              <text variable="title" prefix=" "/>
+              <text variable="locator" prefix=" "/>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="thesis">
+          <text macro="authors" suffix=", "/>
+          <text variable="title"/>
+          <choose>
+            <if position="first">
+              <text variable="genre" prefix=". "/>
+              <text variable="publisher" prefix=", "/>
+              <date variable="issued" prefix=" (" suffix=")">
+                <date-part name="year" form="long"/>
+              </date>
+            </if>
+          </choose>
+          <text variable="locator" prefix=" "/>
+        </else-if>
+        <else-if type="webpage">
+          <group delimiter=", ">
+            <text macro="authors"/>
+            <text variable="title"/>
+            <group delimiter=" ">
+              <date form="numeric" variable="issued"/>
+              <text variable="URL" prefix="&lt;" suffix="&gt;"/>
+            </group>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <text macro="authors" font-style="italic"/>
+            <text variable="title"/>
+            <choose>
+              <if variable="container-title">
+                <text variable="container-title"/>
+              </if>
+            </choose>
+            <date form="numeric" variable="issued"/>
+            <text variable="locator" prefix=" "/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography subsequent-author-substitute="&#8212;&#8212;" hanging-indent="true" entry-spacing="1">
+    <sort>
+      <key macro="sort-key"/>
+      <key variable="issued" sort="ascending"/>
+    </sort>
+    <layout>
+    </layout>
+  </bibliography>
+</style>

+ 662 - 0
app/data/french-legal.csl

@@ -0,0 +1,662 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="author-date" default-locale="fr-FR">
+  <!-- This style was forked from https://github.com/citation-style-language/styles/blo/master/austrian-legal.csl by andreas.geyrecker@lexisnexis.at -->
+  <info>
+    <title>Style de citation juridique français</title>
+    <id>https://exegetes.eu.org/outils/csl/</id>
+    <link href="https://exegetes.eu.org/outils/csl/" rel="documentation"/>
+    <author>
+      <name>Hugo Roy</name>
+      <email>hugo+github-french-legal-dot-csl@ampoliros.net</email>
+    </author>
+    <category citation-format="author-date"/>
+    <category field="legislation"/>
+    <summary>French legal citation style for writing court briefs, mainly</summary>
+    <published>2016-04-12T00:00:00+02:00</published>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="fr-FR">
+    <terms>
+      <term name="et-al">et a.</term>
+      <term name="month-01" gender="masculine" form="short">jan.</term>
+      <term name="month-02" gender="masculine" form="short">fév.</term>
+      <term name="month-03" gender="masculine" form="short">mars</term>
+      <term name="month-04" gender="masculine" form="short">avr.</term>
+      <term name="month-05" gender="masculine" form="short">mai</term>
+      <term name="month-06" gender="masculine" form="short">juin</term>
+      <term name="month-07" gender="masculine" form="short">juil.</term>
+      <term name="month-08" gender="masculine" form="short">août</term>
+      <term name="month-09" gender="masculine" form="short">sept.</term>
+      <term name="month-10" gender="masculine" form="short">oct.</term>
+      <term name="month-11" gender="masculine" form="short">nov.</term>
+      <term name="month-12" gender="masculine" form="short">déc.</term>
+      <term name="ordinal">e</term>
+      <term name="ordinal-01" gender-form="feminine" match="whole-number">re</term>
+      <term name="ordinal-01" gender-form="masculine" match="whole-number">er</term>
+      <term name="ordinal-02" gender-form="feminine" match="whole-number">nd</term>
+      <term name="ordinal-02" gender-form="masculine" match="whole-number">nde</term>
+    </terms>
+  </locale>
+  <macro name="authority-sort">
+    <choose>
+      <if type="legal_case">
+        <choose>
+          <if variable="authority">
+            <text variable="authority"/>
+          </if>
+          <else>
+            <text variable="title"/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="legislation">
+        <!-- move statutes to the top -->
+        <text value="AAAAA"/>
+      </else-if>
+      <else>
+        <!-- move all but cases to the bottom -->
+        <text value="ZZZZZ"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="contributors-sort">
+    <!-- CHECK what this is -->
+    <names variable="editor">
+      <name name-as-sort-order="all" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="verb-short" prefix=", "/>
+      <substitute>
+        <names variable="author"/>
+        <text macro="noauthor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="sort-key">
+    <text macro="authority-sort"/>
+    <text macro="contributors-sort" suffix=" "/>
+  </macro>
+  <macro name="noauthor">
+    <text value="OV"/>
+  </macro>
+  <macro name="authors"><!-- CHECK what this is -->
+    <names variable="author" font-style="italic">
+      <name delimiter="/" name-as-sort-order="all" form="short" delimiter-precedes-last="always" initialize-with="."/>
+      <et-al term="et-al" font-style="italic"/>
+      <substitute>
+        <names variable="editor" font-style="italic"/>
+        <names variable="translator" font-style="italic"/>
+        <text macro="noauthor" font-style="italic"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editors"><!-- CHECK what this is -->
+    <names variable="editor" font-style="italic">
+      <name delimiter="/" name-as-sort-order="all" form="short" delimiter-precedes-last="always" initialize-with="."/>
+      <et-al term="et-al" font-style="italic"/>
+    </names>
+    <text value=" (Hrsg)" font-style="normal"/>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true" givenname-disambiguation-rule="all-names-with-initials" disambiguate-add-givenname="true">
+    <layout suffix="" delimiter="; ">
+      <choose>
+        <if type="legal_case">
+          <choose>
+            <if variable="authority section title-short issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="section" suffix= ", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1"  suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </if>
+            <else-if variable="authority title-short issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title-short issued" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+            </else-if>
+            <else-if variable="authority issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title-short number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="title-short" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority section title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="section" suffix= ", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title issued" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+            </else-if>
+            <else-if variable="authority issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority title number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+            <else-if variable="authority number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="number"/>
+            </else-if>
+          </choose>
+        </if>
+        <else-if type="legislation">
+          <!-- <choose> -->
+          <!--   <if variable="container-title section" match="all"> -->
+          <!--     <text variable="section" suffix=" "/> -->
+          <!--     <text variable="container-title"/> -->
+          <!--     <choose> -->
+          <!--       <if position="first"> -->
+          <!--         <choose> -->
+          <!--           <if variable="references"> -->
+          <!--             <text variable="references" prefix=" "/> -->
+          <!--           </if> -->
+          <!--         </choose> -->
+          <!--       </if> -->
+          <!--     </choose> -->
+          <!--   </if> -->
+          <!--   <else> -->
+            <choose>
+              <if variable="title-short" match="all">
+                <text variable="title-short"/>
+              </if>
+              <else-if>
+                <text variable="title" />
+                <text variable="container-title-short" prefix=" ("
+                      suffix=") " />
+              </else-if>
+            </choose>
+          <!--   </else> -->
+          <!-- </choose> -->
+        </else-if>
+        <else-if type="legal_case-journal">
+          <text macro="authors" suffix=", "/>
+          <choose>
+            <if position="first">
+              <text variable="title" suffix=", "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="page issued" match="all">
+              <text variable="container-title" suffix=" "/>
+              <date variable="issued" suffix=", ">
+                <date-part name="year" form="long"/>
+              </date>
+              <text variable="page"/>
+              <text variable="locator" prefix=" (" suffix=")"/>
+            </if>
+            <else>
+              <text variable="container-title"/>
+              <!-- if no page info is available, assume container-title (publication) holds legal_case number citation -->
+              <text variable="locator" prefix=", "/>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="book">
+          <text macro="authors" font-style="italic" suffix=", "/>
+          <text variable="title"/>
+          <text variable="volume" prefix=" "/>
+          <choose>
+            <if variable="edition note" match="any">
+              <choose>
+                <if variable="edition">
+                  <text variable="edition" vertical-align="sup"/>
+                </if>
+                <else-if variable="note">
+                  <!-- RIS workaround -->
+                  <text variable="note" vertical-align="sup"/>
+                </else-if>
+              </choose>
+            </if>
+          </choose>
+          <group delimiter=" " prefix=" (" suffix=")">
+            <text variable="collection-title"/>
+            <date variable="issued">
+              <date-part name="year" form="long"/>
+            </date>
+          </group>
+          <text variable="locator" prefix=" "/>
+        </else-if>
+        <else-if type="chapter">
+          <text macro="authors" font-style="italic"/>
+          <choose>
+            <if variable="page">
+              <text variable="title" prefix=", "/>
+              <choose>
+                <if position="first">
+                  <choose>
+                    <if variable="editor">
+                      <text macro="editors" prefix=", in " suffix=", "/>
+                    </if>
+                    <else>
+                      <text value=", "/>
+                    </else>
+                  </choose>
+                  <text variable="container-title"/>
+                  <text variable="volume" prefix=" "/>
+                  <choose>
+                    <if variable="edition">
+                      <text variable="edition" vertical-align="sup"/>
+                    </if>
+                    <else-if variable="note">
+                      <text variable="note" vertical-align="sup"/>
+                    </else-if>
+                  </choose>
+                  <group delimiter=" " prefix=" (" suffix=")">
+                    <text variable="collection-title"/>
+                    <date variable="issued">
+                      <date-part name="year" form="long"/>
+                    </date>
+                  </group>
+                </if>
+              </choose>
+              <text variable="page" prefix=" "/>
+              <text variable="locator" prefix=" (" suffix=")"/>
+            </if>
+            <else>
+              <!-- no page info, classic legal commentary -->
+              <choose>
+                <if position="first">
+                  <choose>
+                    <if variable="editor">
+                      <text macro="editors" prefix=" in " suffix=", "/>
+                    </if>
+                    <else>
+                      <text value=", "/>
+                    </else>
+                  </choose>
+                  <text variable="container-title"/>
+                  <text variable="volume" prefix=" "/>
+                  <choose>
+                    <if variable="edition">
+                      <text variable="edition" vertical-align="sup"/>
+                    </if>
+                    <else-if variable="note">
+                      <!-- RIS workaround -->
+                      <text variable="note" vertical-align="sup"/>
+                    </else-if>
+                  </choose>
+                  <group delimiter=" " prefix=" (" suffix=") ">
+                    <text variable="collection-title"/>
+                    <date variable="issued">
+                      <date-part name="year" form="long"/>
+                    </date>
+                  </group>
+                </if>
+                <else>
+                  <text value=","/>
+                </else>
+              </choose>
+              <text variable="title" prefix=" "/>
+              <text variable="locator" prefix=" "/>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="thesis">
+          <text macro="authors" suffix=", "/>
+          <text variable="title"/>
+          <choose>
+            <if position="first">
+              <text variable="genre" prefix=". "/>
+              <text variable="publisher" prefix=", "/>
+              <date variable="issued" prefix=" (" suffix=")">
+                <date-part name="year" form="long"/>
+              </date>
+            </if>
+          </choose>
+          <text variable="locator" prefix=" "/>
+        </else-if>
+        <else-if type="webpage">
+          <group delimiter=", ">
+            <text macro="authors"/>
+            <text variable="title"/>
+            <group delimiter=" ">
+              <date form="numeric" variable="issued"/>
+              <text variable="URL" prefix="&lt;" suffix="&gt;"/>
+            </group>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <text macro="authors" font-style="italic"/>
+            <text variable="title"/>
+            <choose>
+              <if variable="container-title">
+                <text variable="container-title"/>
+              </if>
+            </choose>
+            <date form="numeric" variable="issued"/>
+            <text variable="locator" prefix=" "/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography subsequent-author-substitute="&#8212;&#8212;" hanging-indent="true" entry-spacing="1">
+    <sort>
+      <key macro="sort-key"/>
+      <key variable="issued" sort="ascending"/>
+    </sort>
+    <layout>
+      <choose>
+        <if type="legal_case">
+          <choose>
+            <if variable="authority section title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="section" suffix= ", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number" suffix=""/>
+              <choose>
+                <if variable="ECLI" match="all">
+                    <text variable="ECLI" prefix=", " font-family="monospace"/>
+                </if>
+              </choose>
+              <!-- TODO make this a link instead of displaying the URL -->
+              <!-- <choose> -->
+              <!--   <if variable="URL" match="all"> -->
+              <!--       <text variable="URL" prefix=" &lt;" suffix="&gt;"/> -->
+              <!--   </if> -->
+              <!-- </choose> -->
+            </if>
+            <else-if variable="authority title issued number" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number" suffix=""/>
+              <choose>
+                <if variable="ECLI" match="all">
+                    <text variable="ECLI" prefix=", " font-family="monospace"/>
+                </if>
+              </choose>
+              <!-- TODO make this a link instead of displaying the URL -->
+              <!-- <choose> -->
+              <!--   <if variable="URL" match="all"> -->
+              <!--       <text variable="URL" prefix=" &lt;" suffix="&gt;"/> -->
+              <!--   </if> -->
+              <!-- </choose> -->
+            </else-if>
+            <else-if variable="authority title issued" match="all">
+              <text variable="authority" suffix=", "/>
+              <date variable="issued" form="text" suffix=", ">
+                <date-part name="day" form="limit-day-ordinals-to-day-1" suffix=" "/>
+                <date-part name="month" form="short" suffix=" "/>
+                <date-part name="year" form="long" suffix=""/>
+              </date>
+              <text variable="title" font-style="italic" suffix=""/>
+              <choose>
+                <if variable="ECLI" match="all">
+                    <text variable="ECLI" prefix=", " font-family="monospace"/>
+                </if>
+              </choose>
+              <choose>
+                <if variable="URL" match="all">
+                    <text variable="URL" prefix=" &lt;" suffix="&gt;"/>
+                </if>
+              </choose>
+            </else-if>
+            <else-if variable="authority title number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="title" font-style="italic" suffix=", "/>
+              <text variable="number" suffix=""/>
+              <choose>
+                <if variable="ECLI" match="all">
+                    <text variable="ECLI" prefix=", " font-family="monospace"/>
+                </if>
+              </choose>
+              <!-- TODO make this a link instead of displaying the URL -->
+              <!-- <choose> -->
+              <!--   <if variable="URL" match="all"> -->
+              <!--       <text variable="URL" prefix=" &lt;" suffix="&gt;"/> -->
+              <!--   </if> -->
+              <!-- </choose> -->
+            </else-if>
+            <else-if variable="authority number" match="all">
+              <text variable="authority" suffix=", "/>
+              <text variable="number" suffix=""/>
+              <choose>
+                <if variable="ECLI" match="all">
+                    <text variable="ECLI" prefix=", " font-family="monospace"/>
+                </if>
+              </choose>
+              <!-- TODO make this a link instead of displaying the URL -->
+              <!-- <choose> -->
+              <!--   <if variable="URL" match="all"> -->
+              <!--       <text variable="URL" prefix=" &lt;" suffix="&gt;"/> -->
+              <!--   </if> -->
+              <!-- </choose> -->
+            </else-if>
+          </choose>
+        </if>
+        <else-if type="legislation">
+          <choose>
+            <if variable="title" match="all">
+              <text variable="title" />
+            </if>
+            <else-if>
+              <text variable="container-title" suffix=", " />
+              <text variable="title" />
+            </else-if>
+          </choose>
+        </else-if>
+        <else-if type="legal_case-journal">
+          <text macro="authors"/>
+          <text variable="title" prefix=", " suffix=", "/>
+          <choose>
+            <if variable="page issued" match="all">
+              <text variable="container-title" suffix=" "/>
+              <date variable="issued" suffix=", ">
+                <date-part name="year" form="long"/>
+              </date>
+              <text variable="page"/>
+            </if>
+            <else>
+              <!-- if no page info is available, assume container-title (publication) holds legal_case number citation -->
+              <text variable="container-title" suffix=" "/>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="book">
+          <choose>
+            <if variable="editor">
+              <text macro="editors" suffix=", " font-style="italic"/>
+            </if>
+            <else>
+              <text macro="authors" suffix=", "/>
+            </else>
+          </choose>
+          <text variable="title"/>
+          <choose>
+            <if variable="volume">
+              <text variable="volume" prefix=" "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="edition note" match="any">
+              <choose>
+                <if variable="edition">
+                  <text variable="edition" vertical-align="sup"/>
+                </if>
+                <else-if variable="note">
+                  <!-- RIS workaround -->
+                  <text variable="note" vertical-align="sup"/>
+                </else-if>
+              </choose>
+            </if>
+          </choose>
+          <choose>
+            <if variable="publisher">
+              <text variable="publisher" prefix=", "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="publisher-place">
+              <text variable="publisher-place" prefix=", "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="publisher publisher-place" match="any">
+              <date variable="issued" prefix=" ">
+                <date-part name="year" form="long"/>
+              </date>
+            </if>
+            <else>
+              <date variable="issued" prefix=" (" suffix=")">
+                <date-part name="year" form="long"/>
+              </date>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="chapter">
+          <choose>
+            <if variable="editor">
+              <text macro="editors" suffix=", " font-style="italic"/>
+            </if>
+            <else>
+              <text macro="authors" suffix=", "/>
+            </else>
+          </choose>
+          <text variable="container-title"/>
+          <choose>
+            <if variable="volume">
+              <text variable="volume" prefix=" "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="edition note" match="any">
+              <choose>
+                <if variable="edition">
+                  <text variable="edition" vertical-align="sup"/>
+                </if>
+                <else-if variable="note">
+                  <!-- RIS workaround -->
+                  <text variable="note" vertical-align="sup"/>
+                </else-if>
+              </choose>
+            </if>
+          </choose>
+          <choose>
+            <if variable="publisher">
+              <text variable="publisher" prefix=", "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="publisher-place">
+              <text variable="publisher-place" prefix=", "/>
+            </if>
+          </choose>
+          <choose>
+            <if variable="publisher publisher-place" match="any">
+              <date variable="issued" prefix=" ">
+                <date-part name="year" form="long"/>
+              </date>
+            </if>
+            <else>
+              <date variable="issued" prefix=" (" suffix=")">
+                <date-part name="year" form="long"/>
+              </date>
+            </else>
+          </choose>
+        </else-if>
+        <else-if type="thesis">
+          <text macro="authors" suffix=", "/>
+          <text variable="title" suffix="."/>
+          <text variable="genre" prefix=" "/>
+          <text variable="publisher" prefix=", "/>
+          <date variable="issued" prefix=" (" suffix=")">
+            <date-part name="year" form="long"/>
+          </date>
+        </else-if>
+        <else-if type="webpage">
+          <text macro="authors"/>
+          <text value=", "/>
+          <text variable="title" suffix=", "/>
+          <date variable="issued" suffix=" " form="numeric"/>
+          <text variable="URL" prefix="&lt;" suffix="&gt;"/>
+          <choose>
+            <if variable="accessed">
+              <text value="accédé le "/>
+              <date variable="accessed" suffix=" " form="numeric"/>
+            </if>
+          </choose>
+        </else-if>
+        <else>
+          <text macro="authors" font-style="italic"/>
+          <text variable="title" prefix=", "/>
+          <choose>
+            <if variable="container-title">
+              <text variable="container-title" prefix=", "/>
+            </if>
+          </choose>
+          <date variable="issued" prefix=", " form="numeric"/>
+        </else>
+      </choose>
+    </layout>
+  </bibliography>
+</style>

+ 22 - 0
bower.json

@@ -0,0 +1,22 @@
+{
+  "name": "exegetes-doc-web",
+  "authors": [
+    "loconox <contact@jeremielibeau.fr>"
+  ],
+  "description": "",
+  "main": "",
+  "license": "MIT",
+  "homepage": "",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "app/Resources/lib/",
+    "test",
+    "tests"
+  ],
+  "dependencies": {
+    "bootstrap-sass": "^3.3.7",
+    "datatables": "^1.10.15"
+  }
+}

+ 19 - 4
composer.json

@@ -29,7 +29,10 @@
         "sensio/framework-extra-bundle": "^3.0.2",
         "incenteev/composer-parameter-handler": "^2.0",
         "twig/twig": "^1.0||^2.0",
-        "hasbridge/json-schema-validator": "^0.2.0"
+        "hasbridge/json-schema-validator": "^0.2.0",
+        "seboettg/citeproc-php": "^2.0",
+        "phpdocumentor/reflection-docblock": "^3.1",
+        "twig/extensions": "^1.5"
     },
     "require-dev": {
         "sensio/generator-bundle": "^3.0",
@@ -44,11 +47,17 @@
             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
         ],
+        "csl-vendors": [
+            "vendor/seboettg/citeproc-php/install.sh styles-distribution",
+            "vendor/seboettg/citeproc-php/install.sh locales"
+        ],
         "post-install-cmd": [
-            "@symfony-scripts"
+            "@symfony-scripts",
+            "@csl-vendors"
         ],
         "post-update-cmd": [
-            "@symfony-scripts"
+            "@symfony-scripts",
+            "@csl-vendors"
         ]
     },
     "extra": {
@@ -62,5 +71,11 @@
             "file": "app/config/parameters.yml"
         },
         "branch-alias": null
-    }
+    },
+    "repository": [
+        {
+            "type": "cvs",
+            "url": "/Users/loconox/PhpstormProjects/citeproc-php"
+        }
+    ]
 }

File diff suppressed because it is too large
+ 746 - 147
composer.lock


+ 27 - 0
package.json

@@ -0,0 +1,27 @@
+{
+  "name": "cidex",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git@antrain.avenueduweb.fr:matchlive.git"
+  },
+  "author": "contact@jeremielibeau.fr",
+  "license": "ISC",
+  "dependencies": {
+  },
+  "devDependencies": {
+    "grunt-contrib-clean": "^1.0.0",
+    "grunt-contrib-concat": "^1.0.1",
+    "grunt-contrib-copy": "^1.0.0",
+    "grunt-contrib-watch": "^1.0.0",
+    "grunt-sass": "^1.2.1",
+    "grunt-symfony2": "^0.5.0",
+    "grunt": "^0.4.5",
+    "load-grunt-tasks": "^3.4.1"
+  }
+}

+ 26 - 29
src/AppBundle/CSL/CiteProc.php

@@ -72,49 +72,46 @@ class CiteProc
         }
     }
 
-    function init($csl, $lang)
+    function init($csl_doc, $lang)
     {
         // define field values appropriate to your data in the Mapper class and un-comment the next line.
         $this->mapper = new Mapper();
-        $this->quash = array();
+        $this->quash  = array();
 
-        $csl_doc = new \DOMDocument();
 
-        if ($csl_doc->loadXML($csl)) {
-
-            $style_nodes = $csl_doc->getElementsByTagName('style');
-            if ($style_nodes) {
-                foreach ($style_nodes as $style) {
-                    $this->style = new Style($style);
-                }
+        $style_nodes = $csl_doc['style'];
+        if ($style_nodes) {
+            foreach ($style_nodes as $style) {
+                $this->style = new Style($style);
             }
+        }
 
-            $info_nodes = $csl_doc->getElementsByTagName('info');
-            if ($info_nodes) {
-                foreach ($info_nodes as $info) {
-                    $this->info = new Info($info);
-                }
+        $info_nodes = $csl_doc['info'];
+        if ($info_nodes) {
+            foreach ($info_nodes as $info) {
+                $this->info = new Info($info);
             }
+        }
 
-            $this->locale = new Locale($lang);
-            $this->locale->set_style_locale($csl_doc);
+        $this->locale = new Locale($lang);
+        $this->locale->set_style_locale($csl_doc);
 
 
-            $macro_nodes = $csl_doc->getElementsByTagName('macro');
-            if ($macro_nodes) {
-                $this->macros = new Macros($macro_nodes, $this);
-            }
+        $macro_nodes = $csl_doc['macro'];
+        if ($macro_nodes) {
+            $this->macros = new Macros($macro_nodes, $this);
+        }
 
-            $citation_nodes = $csl_doc->getElementsByTagName('citation');
-            foreach ($citation_nodes as $citation) {
-                $this->citation = new Citation($citation, $this);
-            }
+        $citation_nodes = $csl_doc['citation'];
+        foreach ($citation_nodes as $citation) {
+            $this->citation = new Citation($citation, $this);
+        }
 
-            $bibliography_nodes = $csl_doc->getElementsByTagName('bibliography');
-            foreach ($bibliography_nodes as $bibliography) {
-                $this->bibliography = new Bibliography($bibliography, $this);
-            }
+        $bibliography_nodes = $csl_doc['bibliography'];
+        foreach ($bibliography_nodes as $bibliography) {
+            $this->bibliography = new Bibliography($bibliography, $this);
         }
+
     }
 
     function render($data, $mode = null)

+ 71 - 9
src/AppBundle/Command/TestCommand.php

@@ -2,10 +2,16 @@
 
 namespace AppBundle\Command;
 
-use Json\Validator;
+use AppBundle\Serializer\DateDenormalizer;
+use Seboettg\CiteProc\CiteProc;
 use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
+use Symfony\Component\Serializer\Encoder\YamlEncoder;
+use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
+use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
+use Symfony\Component\Serializer\Serializer;
 use Symfony\Component\Yaml\Yaml;
 
 class TestCommand extends ContainerAwareCommand
@@ -25,12 +31,37 @@ class TestCommand extends ContainerAwareCommand
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $container = $this->getContainer();
-        $root = $container->get('kernel')->getRootDir();
-        $schema = $root . '/Resources/schema/csl/csl-data-custom.json';
-        $filename = $root . '/data/references.yaml';
-        $data = Yaml::parse(file_get_contents($filename));
-        $refs = [];
+        $container   = $this->getContainer();
+        $root        = $container->get('kernel')->getRootDir();
+        $schema      = $root.'/Resources/schema/csl/csl-data-custom.json';
+        $filename    = $root.'/data/references.yaml';
+        $in          = file_get_contents($filename);
+        $normalizers = [
+            new DateDenormalizer(),
+            new ObjectNormalizer(null, null, null, new PhpDocExtractor()),
+            new ArrayDenormalizer(),
+        ];
+        $encoders    = [
+            new YamlEncoder(
+                null,
+                null,
+                ['yaml_flags'  => Yaml::PARSE_OBJECT_FOR_MAP,
+                 'yaml_inline' => 2,
+                ]
+            ),
+        ];
+
+        $serializer = new Serializer($normalizers, $encoders);
+        $data       = $serializer->deserialize($in, 'AppBundle\\Entity\\References', 'yaml');
+        $out        = $serializer->serialize($data, 'yaml');
+        file_put_contents($root.'/../result.yml', $out);
+        var_dump($out === $in);
+
+        return;
+        $data = Yaml::parse(file_get_contents($filename), Yaml::PARSE_OBJECT_FOR_MAP);
+        $data = $data->references;
+        $this->fixIssued($data);
+        /*$refs = [];
         $refs['root'] = [];
         $validator = new Validator($schema);
 
@@ -38,7 +69,38 @@ class TestCommand extends ContainerAwareCommand
             $obj = (object) $ref;
             $refs['root'][] = $obj;
         }
-        dump($validator->validate($refs['root']));
+        dump($validator->validate($refs['root']));*/
 
+        $style    = file_get_contents($root.'/data/french-legal.csl');
+        $citeProc = new CiteProc($style, 'fr-FR');
+        $citeProc->init();
+        /*$sorting = $citeProc::getContext()->getMacro('sort-key');
+        $citeProc::getContext()->setSorting(new Sort());*/
+        echo $citeProc->render($data, "bibliography");
     }
-}
+
+    protected function fixIssued(&$data)
+    {
+        foreach ($data as &$d) {
+            if (isset($d->issued)) {
+                $dateValues = [];
+                $empty      = true;
+                foreach ($d->issued as $attr => $value) {
+                    if ($value !== null) {
+                        $empty = false;
+                    }
+                    $dateValues[] = [$attr, $value];
+                }
+                if ($empty) {
+                    $d->issued = null;
+                    continue;
+                }
+                $d->issued                 = new \stdClass();
+                $d->issued->{'date-parts'} = $dateValues;
+            } else {
+                $d->issued = null;
+            }
+        }
+    }
+
+}

+ 22 - 4
src/AppBundle/Controller/DefaultController.php

@@ -2,6 +2,8 @@
 
 namespace AppBundle\Controller;
 
+use AppBundle\Entity\Reference;
+use AppBundle\Form\ReferenceType;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
@@ -13,9 +15,25 @@ class DefaultController extends Controller
      */
     public function indexAction(Request $request)
     {
-        // replace this example code with whatever you need
-        return $this->render('default/index.html.twig', [
-            'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
-        ]);
+        $reference = new Reference();
+        $form = $this->createForm(ReferenceType::class, $reference);
+        $form->handleRequest($request);
+
+        if ($form->isSubmitted() && $form->isValid()) {
+            dump($reference);
+
+            $reference = new Reference();
+            $form = $this->createForm(ReferenceType::class, $reference);
+        }
+        $referenceManager = $this->get('app.manager.reference');
+        $references = $referenceManager->findAll();
+
+        return $this->render(
+            'default/index.html.twig',
+            [
+                'references' => $references,
+                'form' => $form->createView(),
+            ]
+        );
     }
 }

+ 2 - 2
src/AppBundle/Entity/Date.php

@@ -15,11 +15,11 @@ class Date
     /**
      * @var array
      */
-    protected $dateParts;
+    public $dateParts;
 
     /**
      * @var string
      */
-    protected $literal;
+    public $literal;
 
 }

+ 9 - 9
src/AppBundle/Entity/Name.php

@@ -15,45 +15,45 @@ class Name
     /**
      * @var string
      */
-    protected $family;
+    public $family;
 
     /**
      * @var string
      */
-    protected $given;
+    public $given;
 
     /**
      * @var string
      */
-    protected $doppingParticule;
+    public $doppingParticule;
 
     /**
      * @var string
      */
-    protected $nonDroppingParticule;
+    public $nonDroppingParticule;
 
     /**
      * @var string
      */
-    protected $suffix;
+    public $suffix;
 
     /**
      * @var string|int|bool
      */
-    protected $commaSuffix;
+    public $commaSuffix;
 
     /**
      * @var string|int|bool
      */
-    protected $staticOrdering;
+    public $staticOrdering;
 
     /**
      * @var string
      */
-    protected $literal;
+    public $literal;
 
     /**
      * @var string|int|bool
      */
-    protected $parseNames;
+    public $parseNames;
 }

+ 133 - 78
src/AppBundle/Entity/Reference.php

@@ -53,380 +53,435 @@ class Reference
      *     "treaty",
      *     "webpage"})
      */
-    protected $type;
+    public $type;
 
     /**
      * @var mixed
      * @Assert\NotNull()
      */
-    protected $id;
+    public $id;
 
     /**
      * @var array
      */
-    protected $categories;
+    public $categories;
 
     /**
      * @var string
      */
-    protected $language;
+    public $language;
 
     /**
      * @var string
      */
-    protected $journalAbbreviation;
+    public $journalAbbreviation;
 
     /**
      * @var string
      */
-    protected $shortTitle;
+    public $shortTitle;
 
     /**
      * @var Name[]
      */
-    protected $author;
+    public $author;
 
     /**
      * @var Name[]
      */
-    protected $collectionEditor;
+    public $collectionEditor;
     /**
      * @var Name[]
      */
-    protected $composer;
+    public $composer;
     /**
      * @var Name[]
      */
-    protected $containerAuthor;
+    public $containerAuthor;
     /**
      * @var Name[]
      */
-    protected $director;
+    public $director;
     /**
      * @var Name[]
      */
-    protected $editor;
+    public $editor;
     /**
      * @var Name[]
      */
-    protected $editorialDirector;
+    public $editorialDirector;
     /**
      * @var Name[]
      */
-    protected $interviewer;
+    public $interviewer;
     /**
      * @var Name[]
      */
-    protected $illustrator;
+    public $illustrator;
     /**
      * @var Name[]
      */
-    protected $originalAuthor;
+    public $originalAuthor;
     /**
      * @var Name[]
      */
-    protected $recipient;
+    public $recipient;
     /**
      * @var Name[]
      */
-    protected $reviewedAuthor;
+    public $reviewedAuthor;
     /**
      * @var Name[]
      */
-    protected $translator;
+    public $translator;
 
     /**
      * @var Date
      */
-    protected $accessed;
+    public $accessed;
 
     /**
      * @var Date
      */
-    protected $container;
+    public $container;
 
     /**
      * @var Date
      */
-    protected $eventDate;
+    public $eventDate;
 
     /**
      * @var Date
      */
-    protected $issued;
+    public $issued;
 
     /**
      * @var Date
      */
-    protected $originalDate;
+    public $originalDate;
 
     /**
      * @var Date
      */
-    protected $submitted;
+    public $submitted;
 
     /**
      * @var string
      */
-    protected $abstract;
+    public $abstract;
 
     /**
      * @var string
      */
-    protected $annote;
+    public $annote;
 
     /**
      * @var string
      */
-    protected $archive;
+    public $archive;
 
     /**
      * @var string
      */
-    protected $archiveLocation;
+    public $archiveLocation;
 
     /**
      * @var string
      */
-    protected $archivePlace;
+    public $archivePlace;
 
     /**
      * @var string
      */
-    protected $authority;
+    public $authority;
 
     /**
      * @var string
      */
-    protected $callNumber;
+    public $callNumber;
 
     /**
      * @var string
      */
-    protected $chapterNumber;
+    public $chapterNumber;
 
     /**
      * @var string
      */
-    protected $citationNumber;
+    public $citationNumber;
 
     /**
      * @var string
      */
-    protected $citationLabel;
+    public $citationLabel;
 
     /**
      * @var string
      */
-    protected $collectionNumber;
+    public $collectionNumber;
 
     /**
      * @var string
      */
-    protected $collectionTitle;
+    public $collectionTitle;
 
     /**
      * @var string
      */
-    protected $containerTitle;
+    public $containerTitle;
 
     /**
      * @var string
      */
-    protected $containerTitlePart;
+    public $containerTitlePart;
 
     /**
      * @var string
      */
-    protected $dimensions;
+    public $dimensions;
 
     /**
      * @var string
      */
-    protected $DOI;
+    public $DOI;
 
     /**
      * @var string
      */
-    protected $edition;
+    public $edition;
 
     /**
      * @var string
      */
-    protected $event;
+    public $event;
 
     /**
      * @var string
      */
-    protected $eventPlace;
+    public $eventPlace;
 
     /**
      * @var string
      */
-    protected $firstReferenceNoteNumber;
+    public $firstReferenceNoteNumber;
 
     /**
      * @var string
      */
-    protected $genre;
+    public $genre;
 
     /**
      * @var string
      */
-    protected $ISBN;
+    public $ISBN;
 
     /**
      * @var string
      */
-    protected $ISSN;
+    public $ISSN;
 
     /**
      * @var string
      */
-    protected $issue;
+    public $issue;
 
     /**
      * @var string
      */
-    protected $jurisdiction;
+    public $jurisdiction;
 
     /**
      * @var string
      */
-    protected $keyword;
+    public $keyword;
 
     /**
      * @var string
      */
-    protected $locator;
+    public $locator;
 
     /**
      * @var string
      */
-    protected $medium;
+    public $medium;
 
     /**
      * @var string
      */
-    protected $note;
+    public $note;
 
     /**
      * @var string
      */
-    protected $number;
+    public $number;
 
     /**
      * @var string
      */
-    protected $numberOfPages;
+    public $numberOfPages;
 
     /**
      * @var string
      */
-    protected $numberOfVolumes;
+    public $numberOfVolumes;
 
     /**
      * @var string
      */
-    protected $originalPublisher;
+    public $originalPublisher;
 
     /**
      * @var string
      */
-    protected $originalPublisherPlace;
+    public $originalPublisherPlace;
 
     /**
      * @var string
      */
-    protected $originalTitle;
+    public $originalTitle;
 
     /**
      * @var string
      */
-    protected $page;
+    public $page;
 
     /**
      * @var string
      */
-    protected $pageFirst;
+    public $pageFirst;
 
     /**
      * @var string
      */
-    protected $PMCID;
+    public $PMCID;
 
     /**
      * @var string
      */
-    protected $PMID;
+    public $PMID;
 
     /**
      * @var string
      */
-    protected $publisher;
+    public $publisher;
 
     /**
      * @var string
      */
-    protected $publisherPlace;
+    public $publisherPlace;
 
     /**
      * @var string
      */
-    protected $references;
+    public $references;
 
     /**
      * @var string
      */
-    protected $reviewedTitle;
+    public $reviewedTitle;
 
     /**
      * @var string
      */
-    protected $scale;
+    public $scale;
 
     /**
      * @var string
      */
-    protected $section;
+    public $section;
 
     /**
      * @var string
      */
-    protected $source;
+    public $source;
 
     /**
      * @var string
      */
-    protected $status;
+    public $status;
 
     /**
      * @var string
      */
-    protected $title;
+    public $title;
 
     /**
      * @var string
      */
-    protected $titleShort;
+    public $titleShort;
 
     /**
      * @var string
      */
-    protected $URL;
+    public $URL;
 
     /**
      * @var string
      */
-    protected $version;
+    public $version;
 
     /**
      * @var string
      */
-    protected $volume;
+    public $volume;
 
     /**
      * @var string
      */
-    protected $yearSuffix;
+    public $yearSuffix;
+
+    /*
+     * None CSL fields
+     */
+
+    /**
+     * @var string
+     */
+    public $ECLI;
+
+    /**
+     * @var string
+     */
+    public $comments;
+
+    public static function getTypeChoices()
+    {
+        return [
+            "article",
+            "article-journal",
+            "article-magazine",
+            "article-newspaper",
+            "bill",
+            "book",
+            "broadcast",
+            "chapter",
+            "dataset",
+            "entry",
+            "entry-dictionary",
+            "entry-encyclopedia",
+            "figure",
+            "graphic",
+            "interview",
+            "legal_case",
+            "legislation",
+            "manuscript",
+            "map",
+            "motion_picture",
+            "musical_score",
+            "pamphlet",
+            "paper-conference",
+            "patent",
+            "personal_communication",
+            "post",
+            "post-weblog",
+            "report",
+            "review",
+            "review-book",
+            "song",
+            "speech",
+            "thesis",
+            "treaty",
+            "webpage",
+        ];
+    }
 }

+ 77 - 0
src/AppBundle/Entity/ReferenceManger.php

@@ -0,0 +1,77 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: loconox
+ * Date: 14/06/2017
+ * Time: 15:17
+ */
+
+namespace AppBundle\Entity;
+
+
+use AppBundle\Serializer\DateDenormalizer;
+use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
+use Symfony\Component\Serializer\Encoder\YamlEncoder;
+use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
+use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
+use Symfony\Component\Serializer\Serializer;
+use Symfony\Component\Yaml\Yaml;
+
+class ReferenceManger
+{
+    /**
+     * @var Serializer
+     */
+    protected $serializer;
+
+    /**
+     * @var string
+     */
+    protected $storageFilename;
+
+    /**
+     * @var References
+     */
+    protected $references;
+
+    public function __construct($storageFilename)
+    {
+        $normalizers = [
+            new DateDenormalizer(),
+            new ObjectNormalizer(null, null, null, new PhpDocExtractor()),
+            new ArrayDenormalizer(),
+        ];
+        $encoders    = [
+            new YamlEncoder(
+                null,
+                null,
+                ['yaml_flags'  => Yaml::PARSE_OBJECT_FOR_MAP,
+                 'yaml_inline' => 2,
+                ]
+            ),
+        ];
+
+        $this->serializer = new Serializer($normalizers, $encoders);
+        $this->storageFilename = $storageFilename;
+    }
+
+    /**
+     * @return Reference[]
+     */
+    public function findAll()
+    {
+        $references = $this->getReferences();
+
+        return $references->references;
+    }
+
+    public function getReferences()
+    {
+        if ($this->references === null) {
+            $data = file_get_contents($this->storageFilename);
+            $this->references = $this->serializer->deserialize($data, 'AppBundle\\Entity\\References', 'yaml');
+        }
+
+        return $this->references;
+    }
+}

+ 18 - 0
src/AppBundle/Entity/References.php

@@ -0,0 +1,18 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: loconox
+ * Date: 13/06/2017
+ * Time: 11:59
+ */
+
+namespace AppBundle\Entity;
+
+
+class References
+{
+    /**
+     * @var Reference[]
+     */
+    public $references;
+}

+ 60 - 0
src/AppBundle/Form/ReferenceType.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace AppBundle\Form;
+
+use AppBundle\Entity\Reference;
+use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
+use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
+use Symfony\Component\Form\Extension\Core\Type\DateType;
+use Symfony\Component\Form\Extension\Core\Type\SubmitType;
+use Symfony\Component\Form\Extension\Core\Type\UrlType;
+use Symfony\Component\Form\FormBuilderInterface;
+use Symfony\Component\OptionsResolver\OptionsResolver;
+
+/**
+ * Created by PhpStorm.
+ * User: loconox
+ * Date: 14/06/2017
+ * Time: 12:28
+ */
+class ReferenceType extends AbstractType
+{
+
+    /**
+     * {@inheritdoc}
+     */
+    public function buildForm(FormBuilderInterface $builder, array $options)
+    {
+        $builder
+            ->add('type', ChoiceType::class, ['choices' => $this->getTypeChoices(), 'data' => 'legal_case'])
+            ->add('id')
+            ->add('authority')
+            ->add('section')
+            ->add('issued', DateType::class)
+            ->add('title')
+            ->add('titleShort')
+            ->add('number')
+            ->add('ECLI', null, ['label' => 'ECLI'])
+            ->add('URL', UrlType::class, ['label' => 'URL', 'required' => false])
+            ->add('comments')
+            ->add('Envoyer', SubmitType::class)
+        ;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function configureOptions(OptionsResolver $resolver)
+    {
+        $resolver->setDefaults(array(
+            'data_class' => 'AppBundle\Entity\Reference',
+        ));
+    }
+
+    protected function getTypeChoices()
+    {
+        return array_combine(Reference::getTypeChoices(), Reference::getTypeChoices());
+    }
+
+}

+ 92 - 0
src/AppBundle/Serializer/DateDenormalizer.php

@@ -0,0 +1,92 @@
+<?php
+
+namespace AppBundle\Serializer;
+
+use AppBundle\Entity\Date;
+use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
+use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+use Symfony\Component\Serializer\Normalizer\scalar;
+
+/**
+ * Created by PhpStorm.
+ * User: loconox
+ * Date: 13/06/2017
+ * Time: 12:38
+ */
+class DateDenormalizer implements DenormalizerInterface, NormalizerInterface
+{
+
+    /**
+     * Denormalizes data back into an object of the given class.
+     *
+     * @param mixed $data data to restore
+     * @param string $class the expected class to instantiate
+     * @param string $format format the given data was extracted from
+     * @param array $context options available to the denormalizer
+     *
+     * @return object
+     */
+    public function denormalize($data, $class, $format = null, array $context = array())
+    {
+        $dateFormatMap = ['year' => 'Y', 'month' => 'm', 'day' => 'd'];
+        $dateElements = [];
+        $formatElements = [];
+        $dateSeparator = '-';
+        foreach ($dateFormatMap as $name => $partFormat) {
+            if (isset($data->{$name})) {
+                $formatElements[] = $partFormat;
+                $dateElements[]   = $data->{$name};
+            }
+        }
+
+        return \DateTime::createFromFormat(
+            implode($dateSeparator, $formatElements).'|',
+            implode($dateSeparator, $dateElements)
+        );
+    }
+
+    /**
+     * Checks whether the given class is supported for denormalization by this normalizer.
+     *
+     * @param mixed $data Data to denormalize from
+     * @param string $type The class to which the data should be denormalized
+     * @param string $format The format being deserialized from
+     *
+     * @return bool
+     */
+    public function supportsDenormalization($data, $type, $format = null)
+    {
+        return $type === Date::class;
+    }
+
+    /**
+     * Normalizes an object into a set of arrays/scalars.
+     *
+     * @param \DateTime $object object to normalize
+     * @param string $format format the normalization result will be encoded as
+     * @param array $context Context options for the normalizer
+     *
+     * @return array|scalar
+     */
+    public function normalize($object, $format = null, array $context = array())
+    {
+        return [
+            'year' => $object->format('Y'),
+            'month' => $object->format('m'),
+            'day' => $object->format('d'),
+        ];
+    }
+
+    /**
+     * Checks whether the given class is supported for normalization by this normalizer.
+     *
+     * @param mixed $data Data to normalize
+     * @param string $format The format being (de-)serialized from or into
+     *
+     * @return bool
+     */
+    public function supportsNormalization($data, $format = null)
+    {
+        return $data instanceof \DateTime;
+    }
+}

+ 0 - 6
var/SymfonyRequirements.php

@@ -634,12 +634,6 @@ class SymfonyRequirements extends RequirementCollection
         );
 
         $this->addRecommendation(
-            function_exists('iconv'),
-            'iconv() should be available',
-            'Install and enable the <strong>iconv</strong> extension.'
-        );
-
-        $this->addRecommendation(
             function_exists('utf8_decode'),
             'utf8_decode() should be available',
             'Install and enable the <strong>XML</strong> extension.'

File diff suppressed because it is too large
+ 6314 - 0
web/assets/css/main.css


BIN
web/assets/fonts/bootstrap/glyphicons-halflings-regular.eot


File diff suppressed because it is too large
+ 288 - 0
web/assets/fonts/bootstrap/glyphicons-halflings-regular.svg


BIN
web/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf


BIN
web/assets/fonts/bootstrap/glyphicons-halflings-regular.woff


BIN
web/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2


BIN
web/assets/images/Sorting icons.psd


BIN
web/assets/images/favicon.ico


BIN
web/assets/images/sort_asc.png


BIN
web/assets/images/sort_asc_disabled.png


BIN
web/assets/images/sort_both.png


BIN
web/assets/images/sort_desc.png


BIN
web/assets/images/sort_desc_disabled.png


File diff suppressed because it is too large
+ 27977 - 0
web/assets/js/main.js


+ 1 - 1
web/config.php

@@ -11,7 +11,7 @@
  */
 
 if (!isset($_SERVER['HTTP_HOST'])) {
-    exit('This script cannot be run from the CLI. Run it from a browser.');
+    exit("This script cannot be run from the CLI. Run it from a browser.\n");
 }
 
 if (!in_array(@$_SERVER['REMOTE_ADDR'], array(