Bladeren bron

filter ok

kevin tessier 5 jaren geleden
bovenliggende
commit
f988fe8ae1
24 gewijzigde bestanden met toevoegingen van 383 en 92 verwijderingen
  1. 16 0
      user/config/plugins/email.yaml
  2. 15 0
      user/config/plugins/form.yaml
  3. 2 2
      user/config/site.yaml
  4. 9 0
      user/pages/01.home/default.md
  5. 1 1
      user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/01.location-salle-de-reunion/item.md
  6. 2 1
      user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/02.location-salle-de-seminaire/item.md
  7. 1 0
      user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/03.location-salle-de-formation/item.md
  8. 0 15
      user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/blog.md
  9. BIN
      user/pages/04.organisez-vos-evenements/02.nos-equipements/imgtest.jpg
  10. 0 7
      user/pages/04.organisez-vos-evenements/02.nos-equipements/item.md
  11. BIN
      user/pages/04.organisez-vos-evenements/03.toursime-daffaire/imgtest.jpg
  12. 0 8
      user/pages/04.organisez-vos-evenements/03.toursime-daffaire/item.md
  13. 37 7
      user/pages/05.demande-de-devis/form.md
  14. 0 8
      user/pages/05.demande-de-devis/thankyou/formdata.md
  15. 80 0
      user/themes/lecampus/images/Logo Le Campus VD Quadri.svg
  16. 104 0
      user/themes/lecampus/images/mappoint.svg
  17. 10 0
      user/themes/lecampus/js/isotope.pkgd.min.js
  18. 51 0
      user/themes/lecampus/js/masonry.filter.js
  19. 2 2
      user/themes/lecampus/js/masonry.pkgd.min.js
  20. 42 20
      user/themes/lecampus/js/site.js
  21. 0 1
      user/themes/lecampus/templates/archive.html.twig
  22. 2 2
      user/themes/lecampus/templates/partials/base.html.twig
  23. 2 4
      user/themes/lecampus/templates/partials/cal-list-event.html.twig
  24. 7 14
      user/themes/lecampus/templates/partials/taxonomylist.html.twig

+ 16 - 0
user/config/plugins/email.yaml

@@ -0,0 +1,16 @@
+enabled: true
+from: kevin@figureslibres.io
+from_name: kevin
+to: kvntssr@gmail.com
+mailer:
+  engine: smtp
+  smtp:
+    server: smtp.mailtrap.io
+    port: 2525
+    encryption: none
+    user: 5d9e29d57426c3
+    password: a207c1682777ef
+  sendmail:
+    bin: '/usr/sbin/sendmail -bs'
+content_type: text/html
+debug: false

+ 15 - 0
user/config/plugins/form.yaml

@@ -0,0 +1,15 @@
+enabled: true
+built_in_css: true
+inline_css: true
+refresh_prevention: false
+client_side_validation: true
+inline_errors: false
+files:
+  multiple: false          # To allow multiple files, default is single
+  limit: 10                # Number of allowed files per field (multiple required)
+  destination: 'self@'     # Where to upload the files (path and self@, page@, theme@)
+  avoid_overwriting: false # Prevent files with the same name to be overridden. Date prefix will be added
+  random_name: false       # Generate a random 15 long string name for the uploaded files
+  filesize: 0              # Maximum file size allowed (in MB)
+  accept:                  # List of mime/types or file extensions allowed (ie, image/*,.zip,.mp4)
+    - image/*

+ 2 - 2
user/config/site.yaml

@@ -1,8 +1,8 @@
 title: 'Le campus'
 default_lang: fr
 author:
-  name: 'Joe Bloggs'
-  email: joe@example.com
+  name: 'kevin tessier'
+  email: kevin@figureslibres.io
 taxonomies:
   - category
   - tag

+ 9 - 0
user/pages/01.home/default.md

@@ -1,6 +1,15 @@
 ---
 title: Home
 media_order: 'imgtest.jpg,imgtest2.jpg'
+buttons:
+    -
+        text: 'Un lieu de partage des savoirs au cœur d''un éco territoire'
+        header:
+            a_file: imgtest.jpg
+    -
+        text: 'Un lieu de partage des savoirs au cœur d''un éco territoire'
+        header:
+            a_file: imgtest2.jpg
 body_classes: 'title-center title-h1h2'
 content:
     items:

File diff suppressed because it is too large
+ 1 - 1
user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/01.location-salle-de-reunion/item.md


File diff suppressed because it is too large
+ 2 - 1
user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/02.location-salle-de-seminaire/item.md


File diff suppressed because it is too large
+ 1 - 0
user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/03.location-salle-de-formation/item.md


+ 0 - 15
user/pages/04.organisez-vos-evenements/01.location-reservation-de-salles/blog.md

@@ -1,15 +0,0 @@
----
-title: 'Location / réservation de salles'
-media_order: imgtest.jpg
-show_sidebar: false
-content:
-    items:
-        - '@self.children'
-    limit: 5
-    order:
-        by: folder
-        dir: asc
-    pagination: true
-    url_taxonomy_filters: true
----
-

BIN
user/pages/04.organisez-vos-evenements/02.nos-equipements/imgtest.jpg


File diff suppressed because it is too large
+ 0 - 7
user/pages/04.organisez-vos-evenements/02.nos-equipements/item.md


BIN
user/pages/04.organisez-vos-evenements/03.toursime-daffaire/imgtest.jpg


File diff suppressed because it is too large
+ 0 - 8
user/pages/04.organisez-vos-evenements/03.toursime-daffaire/item.md


+ 37 - 7
user/pages/05.demande-de-devis/form.md

@@ -1,9 +1,11 @@
 ---
 title: 'Demande de devis'
-published: true
 visible: false
 form:
     name: ajax-test-form
+    action: /demande-de-devis
+    template: form-messages
+    refresh_prevention: true
     fields:
         -
             name: '1 Quelle est la nature de votre évènement ?'
@@ -23,6 +25,8 @@ form:
                 conference: Conférence
                 evenement_culturel: 'Evènement culturel'
                 autre: Autres
+            validate:
+                required: true
         -
             name: '2 Quelle sera l''envergure de votre évènement ?'
             placeholder: 'Nombre de personnes'
@@ -36,6 +40,8 @@ form:
                 50: '<= 50 personnes'
                 100: '<= 100 personnes'
                 150: 'Plus de 150 personnes'
+            validate:
+                required: true
         -
             name: '3 Quand se déroulera votre évènement ?'
             placeholder: 'Choisissez vos date ?'
@@ -51,42 +57,56 @@ form:
                 2j: '2 jours'
                 3j: '3 jours'
                 +3j: 'Plus de 3 jours'
+            validate:
+                required: true
         -
             name: Prenom
             placeholder: prenom
             type: text
             size: long
             classes: fancy
+            validate:
+                required: true
         -
             name: Nom
             placeholder: nom
             type: text
             size: long
             classes: fancy
+            validate:
+                required: true
         -
             name: Email
             placeholder: Email
             type: email
             size: long
             classes: fancy
+            validate:
+                required: true
         -
             name: phone
             placeholder: Télphone
             type: text
             size: long
             classes: fancy
+            validate:
+                required: true
         -
             name: fonction
             placeholder: fonction
             type: text
             size: long
             classes: fancy
+            validate:
+                required: true
         -
             name: société
             placeholder: Société
             type: text
             size: long
             classes: fancy
+            validate:
+                required: true
         -
             name: 'Votre profil'
             placeholder: 'quel est votre profil'
@@ -100,19 +120,29 @@ form:
                 associations: 'Associations (sociétés savantes, fédérations, syndicats) '
                 societes_entreprises: 'Sociétés / Entreprises'
                 Organismes_professionnels: 'Orgaismes Professionnels'
+            validate:
+                required: true
     buttons:
         -
             type: submit
             value: Envoyer
     process:
-        -
-            message: 'Thank you for your feedback!'
         -
             email:
-                from: kvntssr@gmail.com
-                to: kevin@figureslibres.io
-                subject: 'demande de devis'
-                body: '{% include ''forms/default/data.html.twig'' %}'
+                from: '{{ config.plugins.email.from }}'
+                to:
+                    - '{{ config.plugins.email.to }}'
+                    - '{{ form.value.email }}'
+                subject: '[Feedback] {{ form.value.name|e }}'
+                body: '{% include ''forms/data.html.twig'' %}'
+        -
+            save:
+                fileprefix: feedback-
+                dateformat: Ymd-His-u
+                extension: txt
+                body: '{% include ''forms/data.txt.twig'' %}'
+        -
+            message: 'Merci, votre demande de devis à bien été envoyé ! Elle sera traité dans les prochains jours.'
 ---
 
 ####  Je fais ma demande de devis 

+ 0 - 8
user/pages/05.demande-de-devis/thankyou/formdata.md

@@ -1,8 +0,0 @@
----
-title: 'Email sent'
-cache_enable: false
-process:
-    twig: true
----
-
-## Email sent!

File diff suppressed because it is too large
+ 80 - 0
user/themes/lecampus/images/Logo Le Campus VD Quadri.svg


+ 104 - 0
user/themes/lecampus/images/mappoint.svg

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   id="Capa_1"
+   x="0px"
+   y="0px"
+   width="97.713px"
+   height="97.713px"
+   viewBox="0 0 97.713 97.713"
+   style="enable-background:new 0 0 97.713 97.713;"
+   xml:space="preserve"
+   sodipodi:docname="placeholder-filled-point.svg"
+   inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
+   id="metadata41"><rdf:RDF><cc:Work
+       rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+         rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+   id="defs39"><clipPath
+     clipPathUnits="userSpaceOnUse"
+     id="clipPath18"><path
+       d="M 0,167.667 H 302.667 V 0 H 0 Z"
+       id="path16"
+       inkscape:connector-curvature="0" /></clipPath></defs><sodipodi:namedview
+   pagecolor="#ffffff"
+   bordercolor="#666666"
+   borderopacity="1"
+   objecttolerance="10"
+   gridtolerance="10"
+   guidetolerance="10"
+   inkscape:pageopacity="0"
+   inkscape:pageshadow="2"
+   inkscape:window-width="956"
+   inkscape:window-height="1029"
+   id="namedview37"
+   showgrid="false"
+   inkscape:zoom="2.4152365"
+   inkscape:cx="83.053405"
+   inkscape:cy="150.50186"
+   inkscape:window-x="960"
+   inkscape:window-y="22"
+   inkscape:window-maximized="0"
+   inkscape:current-layer="Capa_1" />
+<g
+   id="g4"
+   style="fill:#0090a3;fill-opacity:1">
+	<path
+   d="M48.855,0C29.021,0,12.883,16.138,12.883,35.974c0,5.174,1.059,10.114,3.146,14.684   c8.994,19.681,26.238,40.46,31.31,46.359c0.38,0.441,0.934,0.695,1.517,0.695s1.137-0.254,1.517-0.695   c5.07-5.898,22.314-26.676,31.311-46.359c2.088-4.57,3.146-9.51,3.146-14.684C84.828,16.138,68.69,0,48.855,0z M48.855,54.659   c-10.303,0-18.686-8.383-18.686-18.686c0-10.304,8.383-18.687,18.686-18.687s18.686,8.383,18.686,18.687   C67.542,46.276,59.159,54.659,48.855,54.659z"
+   id="path2"
+   style="fill:#0090a3;fill-opacity:1" />
+</g>
+<g
+   id="g6">
+</g>
+<g
+   id="g8">
+</g>
+<g
+   id="g10">
+</g>
+<g
+   id="g12">
+</g>
+<g
+   id="g14">
+</g>
+<g
+   id="g16">
+</g>
+<g
+   id="g18">
+</g>
+<g
+   id="g20">
+</g>
+<g
+   id="g22">
+</g>
+<g
+   id="g24">
+</g>
+<g
+   id="g26">
+</g>
+<g
+   id="g28">
+</g>
+<g
+   id="g30">
+</g>
+<g
+   id="g32">
+</g>
+<g
+   id="g34">
+</g>
+</svg>

File diff suppressed because it is too large
+ 10 - 0
user/themes/lecampus/js/isotope.pkgd.min.js


+ 51 - 0
user/themes/lecampus/js/masonry.filter.js

@@ -0,0 +1,51 @@
+/* -- Filter Plugin -- */
+(function ($) {
+    'use strict';
+    $.fn.masonryFilter = function (options) {
+        //reload masonry
+        var reload = function ($container) {
+            setTimeout(function () {
+                $container.masonry("layout");
+            }, 100);
+        };
+
+        var process = function ($container) {
+            var items = $container.masonry("getAllItems"),
+                revealItems = [],
+                hideItems = [];
+
+            $.each(items, function(i) {
+                var item = items[i];
+                var elm = $(item.element),
+                    shouldShow = options.filter && options.filter.call(elm);
+
+                if (shouldShow) {
+                    if (item.isHidden) {
+                        // -- Have to set this property so masonry does
+                        //    not include hidden items when calling "layout"
+                        item.isIgnored = false;
+                        revealItems.push(item);
+                    }
+                } else {
+                    if (!item.isHidden) {                        
+                        // -- Easier to set this property directy rather than
+                        //    using the "ignore" method, as it takes in a DOM
+                        //    element rather than the masonry item object.
+                        item.isIgnored = true;
+                        hideItems.push(item);
+                    }
+                }
+            });
+
+            $container.masonry('hide', hideItems);
+            $container.masonry('reveal', revealItems);
+
+            reload($container);
+        };
+
+        return this.each(function () {
+            var self = $(this);
+            process(self);
+        });
+    };
+}(window.jQuery));

File diff suppressed because it is too large
+ 2 - 2
user/themes/lecampus/js/masonry.pkgd.min.js


+ 42 - 20
user/themes/lecampus/js/site.js

@@ -1,24 +1,35 @@
 function map() {
+  var $carte = $('#carte');
+  if ( $carte.length ) {
 
-  var mymap = L.map('carte').setView([44.7365818, 4.9776488], 13);
+    var mymap = L.map('carte').setView([44.7365818, 4.9776488], 13);
 
-	L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
-		maxZoom: 18,
-		id: 'mapbox.streets'
-	}).addTo(mymap);
+    var greenIcon = L.icon({
+        iconUrl: '/user/themes/lecampus/images/mappoint.svg',
 
-	L.marker([44.7365818, 4.9776488]).addTo(mymap)
-		.bindPopup("<b>Hello world!</b><br />I am le campus.").openPopup();
+        iconSize:     [38, 95], // size of the icon
+        iconAnchor:   [22, 94], // point of the icon which will correspond to marker's location
+        popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor
+    });
 
-	function onMapClick(e) {
-		popup
-			.setLatLng(e.latlng)
-			.setContent("You clicked the map at " + e.latlng.toString())
-			.openOn(mymap);
-	}
+  	L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
+  		maxZoom: 18,
+  		id: 'mapbox.streets'
+  	}).addTo(mymap);
 
-	mymap.on('click', onMapClick);
+  	L.marker([44.7365818, 4.9776488], {icon: greenIcon}).addTo(mymap)
+  		.bindPopup("<b>Hello world!</b><br />I am le campus.").openPopup();
 
+  	function onMapClick(e) {
+  		popup
+  			.setLatLng(e.latlng)
+  			.setContent("You clicked the map at " + e.latlng.toString())
+  			.openOn(mymap);
+  	}
+
+  	mymap.on('click', onMapClick);
+
+  }
 }
 
 function filteritem() {
@@ -26,6 +37,20 @@ function filteritem() {
   var $cat = $('.cat a');
   var $img = $('#item .img');
 
+  $(".filters .btn").click(function(e) {
+    e.preventDefault();
+
+    var filter = $(this).attr("data-filter");
+    var self = $('.container #item');
+
+    self.masonryFilter({
+        filter: function () {
+            if (!filter) return true;
+            return $(this).attr("data-filter") == filter;
+        }
+    });
+});
+
   var $grid = $('#archive #item, #calendrier #item').masonry({
     // columnWidth: 200,
     itemSelector: '.card',
@@ -33,14 +58,11 @@ function filteritem() {
     transitionDuration: '0.2s'
   });
 
+// $( "a[hreflang|='en']" ).css( "border", "3px dotted green" );
   $grid.imagesLoaded().progress(function() {
       $grid.masonry();
   });
 
-  $grid.multipleFilterMasonry({
-    itemSelector: '.card',
-    filtersGroupSelector:'.filters'
-  });
 }
 
 function slide() {
@@ -67,9 +89,9 @@ function links() {
 
 }
 
-jQuery(document).ready(function($){
+jQuery(document).ready(function(){
   links();
   slide();
   filteritem();
-  // map();
+  map();
 });

+ 0 - 1
user/themes/lecampus/templates/archive.html.twig

@@ -26,7 +26,6 @@
             {% for child in page.find('/agenda').children %}
 
               {% if child.header.date_end|date("d/m/y") <= "now"|date("d/m/y") %}
-              {{child.title}}
                 {% include 'partials/cal-list-event.html.twig' with {blog: page, page: child} %}
               {% endif %}
 

+ 2 - 2
user/themes/lecampus/templates/partials/base.html.twig

@@ -25,9 +25,9 @@
 
         {% do assets.addJs('jquery', 101) %}
         {% do assets.addJs('theme://js/leaflet.js', {group:'bottom'}) %}
-        {% do assets.addJs('theme://js/masonry.pkgd.min.js', {group:'bottom'}) %}
-        {% do assets.addJs('theme://js/multipleFilterMasonry.js', {group:'bottom'}) %}
         {% do assets.addJs('theme://js/imagesloaded.pkgd.min.js', {group:'bottom'}) %}
+        {% do assets.addJs('theme://js/masonry.filter.js', {group:'bottom'}) %}
+        {% do assets.addJs('theme://js/masonry.pkgd.min.js', {group:'bottom'}) %}
         {% do assets.addJs('theme://js/jquery.slides.min.js', {group:'bottom'}) %}
         {% do assets.addJs('theme://js/site.js', {group:'bottom'}) %}
 

+ 2 - 4
user/themes/lecampus/templates/partials/cal-list-event.html.twig

@@ -1,5 +1,5 @@
   {% for tag in page.taxonomy.tag %}
-  <div class="card {{tag}} Tous">
+  <div class="card" data-filter="{{tag}}">
   {% endfor %}
     <div class="card-header">
       {% include 'partials/blog/public.html.twig' %}
@@ -18,9 +18,7 @@
     <div class="card-summary">
       <a href="{{ page.url }}">
       {% if page.summary != page.content %}
-          {{ page.summary|raw }}
-      {% else %}
-          {{ page.content|raw }}
+          {{ page.summary(100)|raw }}
       {% endif %}
       </a>
     </div>

+ 7 - 14
user/themes/lecampus/templates/partials/taxonomylist.html.twig

@@ -1,32 +1,25 @@
 {% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
 
 {% if taxlist %}
-<div class="tags">
-  <div class="btn-toolbar filters">
+<div class="btn-toolbar filters">
     <div data-toggle="buttons" class="btn-group">
-      <label class="btn btn-default">
-        <input type="checkbox" value=Tous >
+      <label class="btn btn-default" data-filter="">
+        <input type="radio" name="options">
         Tous
       </label>
-    </div>
-  </div>
     {% for tax,value in taxlist[taxonomy] %}
         {% set label_class = uri.param(taxonomy) == tax ? 'label-primary' : 'label-secondary' %}
-        <div class="btn-toolbar filters">
-          <div data-toggle="buttons" class="btn-group">
-            <label class="btn btn-default">
-              <input type="checkbox" value={{tax}} >
+            <label class="btn btn-default" data-filter="{{tax}}">
+              <input type="radio" name="options" >
               {{tax}}
             </label>
-          </div>
-        </div>
     {% endfor %}
-    <div class="btn-toolbar filters">
       <div data-toggle="buttons" class="btn-group">
         <label class="btn btn-default">
           <a href="/archive">archive</a>
         </label>
       </div>
-    </div>
 </div>
+</div>
+
 {% endif %}

Some files were not shown because too many files changed in this diff