Przeglądaj źródła

many misc bug fix

bach 1 miesiąc temu
rodzic
commit
68bc5527d9

+ 3 - 0
composer.json

@@ -133,6 +133,9 @@
             "drupal/login_emailusername": {
               "rest login email or user name https://www.drupal.org/project/login_emailusername/issues/2910511#comment-12564801" : "https://www.drupal.org/files/issues/2018-04-10/allow-rest-login-with-email-2910511-9.patch",
               "Flood service is undefined https://www.drupal.org/project/login_emailusername/issues/3276966" : "https://www.drupal.org/files/issues/2024-09-30/login_emailusername_issues_3276966_%2312.patch"
+            },
+            "drupal/date_range_formatter":{
+                "Passing empty value to t() when same day + time for start and end date https://www.drupal.org/project/date_range_formatter/issues/3309324":"https://www.drupal.org/files/issues/2024-10-10/date_range_formatter_3309324_%2330.patch"
             }
         },
         "old-patches": {

+ 13 - 0
patches/date_range_formatter_3309324_#30.patch

@@ -0,0 +1,13 @@
+diff --git a/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php b/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php
+index 92ec640..4e843f0 100644
+--- a/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php
++++ b/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php
+@@ -79,7 +79,7 @@ class DateRangeFormatterRangeFormatter extends DateTimeCustomFormatter {
+         }
+         if (!array_key_exists($delta, $elements)) {
+           // No end date provided or end date equals start date use single formatting.
+-          $single_format = $this->getSetting('single');
++          $single_format = $this->getSetting('one_day');
+           $elements[$delta] = ['#markup' => \Drupal::service('date.formatter')->format($start_date, 'custom', $this->t($single_format))];
+         }
+       }

+ 2 - 2
web/modules/custom/edlp_ajax/src/Controller/EdlpAjaxController.php

@@ -90,7 +90,7 @@ class EdlpAjaxController extends ControllerBase {
           '#items' => [],
         );
         foreach($future_nodes as $node){
-          $future_list['#items'][] = $node_view_builder->view($node, 'aside');
+          $future_list['#items'][] = $node_view_builder->view($node, 'aside', $this->langcode);
         }
         $aside['future_events'] = array(
           "#type"=>"container",
@@ -109,7 +109,7 @@ class EdlpAjaxController extends ControllerBase {
           '#items' => [],
         );
         foreach($past_nodes as $node){
-          $past_list['#items'][] = $node_view_builder->view($node, 'aside');
+          $past_list['#items'][] = $node_view_builder->view($node, 'aside', $this->langcode);
         }
         $aside['past_events'] = array(
           "#type"=>"container",

Plik diff jest za duży
+ 0 - 0
web/modules/custom/edlp_corpus/assets/dist/scripts/corpus.min.js


Plik diff jest za duży
+ 0 - 0
web/modules/custom/edlp_corpus/assets/dist/scripts/physics.min.js


Plik diff jest za duży
+ 0 - 0
web/modules/custom/edlp_corpus/assets/dist/styles/corpus.min.css


+ 8 - 14
web/modules/custom/edlp_corpus/assets/styles/corpus.scss

@@ -1,23 +1,16 @@
-// @Author: Bachir Soussi Chiadmi <bach>
-// @Date:   18-12-2017
-// @Email:  bachir@figureslibres.io
-// @Filename: corpus.scss
-// @Last modified by:   bach
-// @Last modified time: 20-12-2017
-// @License: GPL-V3
-
 canvas#corpus-map{
-  &.de-activated{
-    background-color: rgb(244, 244, 244);
-  }
   position: absolute;
   box-sizing: border-box;
   top:0; left:0;
   // width:100%; height:100%;
   z-index:0;
+  &.de-activated{
+    background-color: rgb(244, 244, 244);
+  }
 }
 
 
+
 //  _  _         _     ___          _   _
 // | \| |___  __| |___| _ \___ _ __| | | |_ __
 // | .` / _ \/ _` / -_)  _/ _ \ '_ \ |_| | '_ \
@@ -40,7 +33,7 @@ div.node-popup{
   }
 
   $w:60px; // diagonal length
-  $s:($w *1.4)*0.5; // side given the diagonal (1.4 is the square root of 2)
+  $s:($w * 1.4) * 0.5; // side given the diagonal (1.4 is the square root of 2)
   &:before{
     content:"";
     position: absolute;
@@ -60,7 +53,7 @@ div.node-popup{
   &[pos="bottom-left"]{
     transform: translateX(-100%) translateY($s) translateX(-$s);
     &:before{
-      top:calc(100% +1px);
+      top:calc(100% + 1px);
       left: 100%;
       transform-origin: top left;
       transform: rotateZ(-45deg);
@@ -79,9 +72,10 @@ div.node-popup{
     transform: translateY(-100%) translateY(-$s) translateX($s);
     &:before{
       top:calc(100% + 1px);
-      left: - ($w +1px);
+      left: - ($w + 1px);
       transform-origin: top right;
       transform: rotateZ(-45deg);
     }
   }
 }
+

Plik diff jest za duży
+ 0 - 0
web/modules/custom/edlp_studio/assets/dist/scripts/edlp_studio.min.js


+ 1 - 0
web/modules/custom/edlp_studio/assets/scripts/edlp_studio.js

@@ -305,6 +305,7 @@
 
   }
 
+
   //  ___                  __       ___                 _   _ ___
   // |   \ _ _ __ _ __ _  / _|___  |   \ _ _ ___ _ __  | | | |_ _|
   // | |) | '_/ _` / _` | > _|_ _| | |) | '_/ _ \ '_ \ | |_| || |

+ 3 - 3
web/modules/custom/edlp_studio/edlp_studio.libraries.yml

@@ -5,7 +5,7 @@ edlp_studio-library:
     - core/drupalSettings
     - core/once
     - core/jquery
+    - jquery_ui_draggable/draggable
+    - jquery_ui_droppable/droppable
+    - jquery_ui_sortable/sortable
     # - core/jquery.once
-    - jquery_ui_draggable/jquery_ui_draggable
-    - jquery_ui_droppable/jquery_ui_droppable
-    - jquery_ui_sortable/jquery_ui_sortable

+ 1 - 1
web/modules/custom/edlp_studio/includes/composition.inc

@@ -26,7 +26,7 @@ function template_preprocess_composition(array &$vars) {
 
   // $variables['page'] = $variables['view_mode'] == 'full' && taxonomy_term_is_page($term);
 
-  $vars['url'] = $composition->url();
+  $vars['url'] = $composition->toUrl()->toString();
 
   $vars['attributes']['cid'] = $composition->id();
   $vars['attributes']['class'] = array('composition');

+ 1 - 1
web/modules/custom/edlp_studio/src/Controller/CompositionController.php

@@ -73,7 +73,7 @@ class CompositionController extends ControllerBase {
       case 'save':
         if($cid){
           $name = $request->query->get('new_name');
-          $documents = $request->query->get('documents');
+          $documents = $request->query->all('documents');
           $this->saveComposition($cid, $name, $documents);
         }else{
           $this->error_message = t("Composition saving needs a cid as query paramater!");

+ 53 - 16
web/modules/custom/gulpfile.mjs

@@ -15,12 +15,25 @@ import minimist from 'minimist';
 
 // var es = require('event-stream');
 
-var modules = ['edlp_corpus', 'edlp_studio', 'edlp_search'];
+var modules = [
+  {
+    modname:'edlp_studio',
+    srcjs:['./edlp_studio/assets/scripts/edlp_studio.js']
+  }, 
+  {
+    modname:'edlp_search',
+    srcjs:['./edlp_search/assets/scripts/edlp_search.js']
+  },
+  {
+    modname:'edlp_corpus',
+    srcjs:['./edlp_corpus/assets/scripts/corpus.js', './edlp_corpus/assets/scripts/physics.js'],
+    srccss:['./edlp_corpus/assets/styles/corpus.scss']
+  }]; 
 
 // to get minified assets run `gulp --env=prod`
 var argv = minimist(process.argv.slice(2));
 console.dir(argv);
-var prod = argv.env == 'prod' ? true : false;
+var prod = argv.env === 'prod' ? true : false;
 
 function handleError(err) {
   console.log(err.toString());
@@ -29,46 +42,70 @@ function handleError(err) {
 function scripts() {
   return new Promise(function(resolve, reject) {
     modules.map(function(module) {
-      src('./'+module+'/assets/scripts/*.js')
+      // console.log('module', module);
+      
+      src(module.srcjs, {allowEmpty: true})
+        .on('data', function(file) {
+          console.log('File src:', file.path);
+        })
         .pipe(gulpif(prod, stripDebug()))
         .pipe(gulpif(prod, jsmin()))
         .pipe(rename({suffix: '.min'}))
-        .pipe(gulp.dest('./'+module+'/assets/dist/scripts/'));
+        .pipe(dest(`./${module.modname}/assets/dist/scripts/`));
+        // .on('data', function(file) {
+        //   console.log('File dest:', file.path);
+        // });
     });
     resolve();
   });
+  // return src(['./edlp_studio/assets/scripts/edlp_studio.js'])
+  //       .pipe(gulpif(prod, stripDebug()))
+  //       .pipe(gulpif(prod, jsmin()))
+  //       .pipe(rename({suffix: '.min'}))
+  //       .pipe(dest('./edlp_studio/assets/dist/scripts/'));
 };
 
 function styles() {
   return new Promise(function(resolve, reject) {
     modules.map(function(module) {
-      src('./'+module+'/assets/styles/*.scss')
-        .pipe(sass().on('error', sass.logError))
-        .pipe(autoprefixer({
-            cascade: false
-        })).on('error', handleError)
-        .pipe(gulpif(prod, cssmin()))
-        // .pipe(cssmin())
-        .pipe(rename({suffix: '.min'}))
-        .pipe(gulp.dest('./'+module+'/assets/dist/styles/'));
+      if (module.srccss) {
+        src(module.srccss, {allowEmpty: true})
+          .pipe(sass().on('error', sass.logError))
+          .pipe(autoprefixer({
+              cascade: false
+          })).on('error', handleError)
+          .pipe(gulpif(prod, cssmin()))
+          // .pipe(cssmin())
+          .pipe(rename({suffix: '.min'}))
+          .pipe(dest('./'+module.modname+'/assets/dist/styles/'));
+      }
     });
     resolve();
   });
+  // return src('./edlp_studio/assets/styles/*.scss')
+  //       .pipe(sass().on('error', sass.logError))
+  //       .pipe(autoprefixer({
+  //           cascade: false
+  //       })).on('error', handleError)
+  //       .pipe(gulpif(prod, cssmin()))
+  //       // .pipe(cssmin())
+  //       .pipe(rename({suffix: '.min'}))
+  //       .pipe(dest('./edlp_studio/assets/dist/styles/'));
 };
 
 // default gulp task
 function devwatch () {
   // series(scripts, styles, done => {
     for (var i = 0; i < modules.length; i++) {
-      watch('./'+modules[i]+'/assets/styles/*.scss', styles);
-      watch('./'+modules[i]+'/assets/scripts/*.js', scripts);
+      watch('./'+modules[i].modname+'/assets/styles/*.scss', styles);
+      watch('./'+modules[i].modname+'/assets/scripts/*.js', scripts);
     }
   //   done()
   // })
 };
 
 
-export default series(scripts, styles);
+export default series(scripts, styles); //
 export { devwatch }
 
 

Plik diff jest za duży
+ 0 - 0
web/themes/custom/edlptheme/assets/dist/scripts/main.min.js


+ 0 - 14
web/themes/custom/edlptheme/assets/dist/styles/app.css

@@ -1,14 +0,0 @@
-body {
-  background: white; }
-
-.btn--hollow {
-  background: red;
-  display: inline-block;
-  padding: 10px; }
-
-body, html {
-  position: relative;
-  width: 100%;
-  height: 100%;
-  font-family: Georgia, serif;
-  font-style: normal; }

Plik diff jest za duży
+ 0 - 0
web/themes/custom/edlptheme/assets/dist/styles/app.min.css


+ 1 - 1
web/themes/custom/edlptheme/assets/scripts/main.js

@@ -860,7 +860,7 @@
     function initAjaxLinks(){
       // console.log('initAjaxLinks');
 
-      $('a', '#block-mainnavigation')
+      $('a', '#block-edlptheme-mainnavigation')
         .add('a', '#block-mainnavigation-2')
         // .add('a', '.block.language-switcher-language-url')
         .add('a', '#block-footer.menu--footer')

+ 32 - 35
web/themes/custom/edlptheme/assets/styles/app.scss

@@ -13,11 +13,11 @@
 @import 'base/fonts';
 
 @mixin spining-loader-square{
+  animation: rotation 2s infinite linear;
   @keyframes rotation {
     from {transform: rotate(0deg);}
     to   {transform: rotate(359deg);}
   }
-  animation: rotation 2s infinite linear;
 }
 
 @mixin entree-micro-square {
@@ -132,6 +132,9 @@ header[role="banner"]{
 
 #block-edlptheme-branding{
   display: inline-block;
+  opacity: 1;
+  transition: opacity 0.7s ease-in-out;
+
   h1{
     margin:0; display: inline-block;
     a.site-name{
@@ -152,15 +155,12 @@ header[role="banner"]{
       }
     }
   }
-  opacity: 1;
-  transition: opacity 0.7s ease-in-out;
-
   .audio-player-visible &{
     opacity: 0;
   }
 }
 
-#block-mainnavigation, #block-mainnavigation-2{
+#block-mainnavigation, #block-edlptheme-mainnavigation{
   float:right;
   margin-top: 25px;
   z-index: 21;
@@ -497,11 +497,11 @@ main[role="main"]{
   }
 
   .agenda{
+    text-align: center;
     .past-events{
       border-top: 1px solid red;
       margin-top: 1em;
     }
-    text-align: center;
     h3{
       @include content_titles;
     }
@@ -956,20 +956,18 @@ main[role="main"]{
   min-width:700px;
   width: calc(100% - 460px);
   // width: calc(100% - 950px);
-  @media only screen and (max-width: 1270px) {
-    width: calc(100% - 180px);
-
-
-  }
   z-index: 20;
   opacity: 0;
   pointer-events: none;
   transition: opacity 0.7s ease-in-out;
+  white-space: nowrap;
+  @media only screen and (max-width: 1270px) {
+    width: calc(100% - 180px);
+  }
   &.visible{
     opacity: 1;
     pointer-events:all;
   }
-  white-space: nowrap;
   &>*{
     display: inline-block;
     vertical-align: middle;
@@ -1041,8 +1039,8 @@ main[role="main"]{
     // background-color: white;
     opacity: 1;
     transition: opacity 0.5s ease-in-out;
-    &.loading{opacity: 0;}
     white-space: nowrap;
+    &.loading{opacity: 0;}
     .actions, .cartels{
       display: inline-block;
       vertical-align: top;
@@ -1280,7 +1278,7 @@ main[role="main"]{
       transform: translateY(-100%) translateY(-$s) translateX($s);
       &:before{
         top:calc(100% + 1px);
-        left: - ($w +1px);
+        left: - ($w + 1px);
         transform-origin: top right;
         transform: rotateZ(-45deg);
       }
@@ -1296,7 +1294,6 @@ main[role="main"]{
   }
 }
 
-
  //  ___ _           _ _
  // / __| |_ _  _ __| (_)___
  // \__ \  _| || / _` | / _ \
@@ -1314,10 +1311,10 @@ main[role="main"]{
   background-repeat: no-repeat;
   background-size: contain;
   background-image: url(../img/favori-off.svg);
+  transition: opacity 0.2s ease-in-out;
   &[action="remove"]{
     background-image: url(../img/favori-on.svg);
   }
-  transition: opacity 0.2s ease-in-out;
   &.ajax-loading{
     opacity: 0.2;
   }
@@ -1365,11 +1362,11 @@ main[role="main"]{
     // margin-right: 25px;
     width:25px;
     height: 100%;
+    opacity: 1;
+    transition: opacity 0.1s ease-in-out;
     &.ui-draggable-dragging{
       height:100px;
     }
-    opacity: 1;
-    transition: opacity 0.1s ease-in-out;
     &.ready-to-remove{
       opacity:0.3;
       cursor:crosshair;
@@ -1388,6 +1385,7 @@ main[role="main"]{
         text-transform: none;
         a{
           white-space: nowrap!important;
+          font-size: 0.756em;
           &:before{
             content:"";
             display: inline-block;
@@ -1397,7 +1395,6 @@ main[role="main"]{
             background-color: white;
             // TODO: entries color;
           }
-          font-size: 0.756em;
         }
       }
     }
@@ -1544,7 +1541,7 @@ main[role="main"]{
             display: inline-block;
             box-sizing: border-box;
             // width:100%;
-            width: calc(100% - #{$w +$s +$m +2});
+            width: calc(100% - #{$w + $s + $m + 2});
             &:before{
               content: "";
               width:$w; height:$w;
@@ -1575,23 +1572,25 @@ main[role="main"]{
           }
           &.new-composition-link{
             // padding-left: 1em;
-            &:before{
-              content:"+";
-              // font-weight: bold;
-              margin-right: $m;
-            }
             display: inline-block;
             vertical-align: top;
             overflow: hidden;
             margin-top: 0.4em;
             height:1em;
             transition: height 0.2s ease-in-out;
+            &:before{
+              content:"+";
+              // font-weight: bold;
+              margin-right: $m;
+            }
             &.folded{
               height:0;
             }
           }
         }
         .new-compo-form{
+          opacity: 1;
+          transition: opacity 0.2s ease-in-out;
           input[type="text"]{
             font-size: 0.756em;
             padding:0 0.5em;
@@ -1608,8 +1607,6 @@ main[role="main"]{
             line-height: 1;
             font-weight: bold;
           }
-          opacity: 1;
-          transition: opacity 0.2s ease-in-out;
           &.ajax-loading{
             opacity: 0.4;
           }
@@ -1661,7 +1658,7 @@ main[role="main"]{
             }
             &:before{
               border-top: 1px solid $c;
-              height:$h /2;
+              height:calc($h / 2);
             }
             &:after{
               border-left: 1px solid $c;
@@ -2096,7 +2093,6 @@ body.path-frontpage, body.path-productions{
   display: inline-block;
   position: relative;
   list-style: none;
-  margin: 0 1.5em 0 0;
   // width:2em; height:10em;
   padding: 0;
   a{
@@ -2239,6 +2235,7 @@ footer{
       padding:0;
       li{
         pointer-events: all;
+        margin: 0 1.5em 0 0;
         @include oblique-list;
         &:first-of-type{
           margin-left: 1em;
@@ -2306,11 +2303,11 @@ footer{
 
   .block-block-edlp-entrees{
     pointer-events: none;
+    display: inline-block;
     body.path-productions &,
     body.entity-type-node.bundle-page &,
     body.path-agenda & {display:none}
 
-    display: inline-block;
     // vertical-align: top;
     // outline: 1px dotted green;
     div.item-list{
@@ -2318,10 +2315,10 @@ footer{
         margin:0;
         white-space: nowrap;
         li{
-          @include oblique-list;
-          margin:0;
           white-space: nowrap;
           pointer-events: none;
+          margin:0;
+          @include oblique-list;
           // docsindex
           &:first-of-type{
             margin-right: 3.4em;
@@ -2688,8 +2685,8 @@ footer{
 
   #block-edlpsearchlinkblock{
     margin-bottom: 1em;
-    @include iconlinkblock(url(../img/search.svg), url(../img/search-active.svg));
     margin-left: 0.2em;
+    @include iconlinkblock(url(../img/search.svg), url(../img/search-active.svg));
   }
 
   .block-language{
@@ -2807,11 +2804,11 @@ footer{
       }
     }
     .chutier-icon{
+      position:absolute;
+      top:0.4em; right:0.4em;
       &[action="add"]{
         display:none;
       }
-      position:absolute;
-      top:0.4em; right:0.4em;
     }
   }
   body.domain-expo-encyclopediedelaparole-org &{

+ 11 - 10
web/themes/custom/edlptheme/assets/styles/base/_grid.scss

@@ -16,7 +16,7 @@ $med-bp:1080px;
   }
 }
 
-%col-reset {
+@mixin col-reset {
     width: 100%;
     // display: inline-block;
     // white-space:normal;
@@ -26,21 +26,22 @@ $med-bp:1080px;
 }
 
 @mixin col($col, $offset: 0, $sum: $default_sum, $gap: $default_gap, $align: top) {
-  @extend %col-reset;
+  @include col-reset;
   padding-left: $gap*$offset;
   @if $col == $default_sum {
     padding-right: 0;
   }@else{
     padding-right: $gap;
   }
-  &:last-child{padding-right: 0;}
-
-  margin-left: percentage(($col/$sum)*$offset);
-
+  
+  margin-left: percentage(calc($col / $sum) * $offset);
+  
   // @media only screen and (min-width: 768px) {
-    width: percentage($col/$sum);
+    width: percentage(calc($col / $sum));
     // vertical-align: $align;
-  // }
+    // }
+
+  &:last-child{padding-right: 0;}
 }
 
 .row{
@@ -64,14 +65,14 @@ $med-bp:1080px;
 
   // medium
   .med-col-#{$c} {
-    @media only screen and (min-width: $small-bp+1) and (max-width: $med-bp) {
+    @media only screen and (min-width: $small-bp + 1) and (max-width: $med-bp) {
       @include col($c);
     }
   }
 
   // large
   .large-col-#{$c} {
-    @media only screen and (min-width: $med-bp+1) {
+    @media only screen and (min-width: $med-bp + 1) {
       @include col($c);
     }
   }

+ 6 - 8
web/themes/custom/edlptheme/gulpfile.mjs

@@ -11,17 +11,16 @@ import stripDebug from 'gulp-strip-debug';
 import jsmin from 'gulp-jsmin';
 import cssmin from 'gulp-cssmin';
 import rename from 'gulp-rename';
+import minimist from 'minimist';
 import mainBowerFiles from 'main-bower-files';
 import svgmin from 'gulp-svgmin';
-import minimist from 'minimist';
 
 // var shared_variables = JSON.parse(fs.readFileSync('./assets/json/shared_variables.json'));
 
 // to get minified assets run `gulp --env=prod`
 var argv = minimist(process.argv.slice(2));
 console.dir(argv);
-// var prod = argv.env === 'prod' ? true : false;
-var prod = true;
+var prod = argv.env === 'prod' ? true : false;
 
 function handleError(err) {
   console.log(err.toString());
@@ -41,14 +40,13 @@ async function styles() {
   return src(['./assets/styles/app.scss'])
     .pipe(sass().on('error', sass.logError))
     .pipe(autoprefixer({
-        browsers: ['last 2 versions'],
         cascade: false
     })).on('error', handleError)
     // .pipe(prod ? cssmin() : util.noop())
     .pipe(gulpif(prod, cssmin()))
     // .pipe(cssmin())
     .pipe(rename({suffix: '.min'}))
-    .pipe(gulp.dest('./assets/dist/styles/'));
+    .pipe(dest('./assets/dist/styles/'));
 }
 
 async function bower(){
@@ -67,18 +65,18 @@ async function bower(){
       "outlayer":{"ignore":true},
     }
   }))
-    .pipe(gulp.dest('./assets/dist/bower/'));
+    .pipe(dest('./assets/dist/bower/'));
 }
 
 async function minsvg(){
   return src(['./assets/img/*.svg', '!./assets/img/edlp-loader-anim.svg'])
     .pipe(svgmin())
-    .pipe(gulp.dest('./assets/dist/img'));
+    .pipe(dest('./assets/dist/img'));
 }
 
 async function svg(){
   return src('./assets/img/edlp-loader-anim.svg')
-    .pipe(gulp.dest('./assets/dist/img'));
+    .pipe(dest('./assets/dist/img'));
 }
 
 function devwatch(){

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików