Sfoglia il codice sorgente

Ticket #3399 - Popups, Search Results, etc.

AntonLV 5 anni fa
parent
commit
32cbdbb961

+ 1 - 1
inc/js/jquery.dolPopup.js

@@ -786,7 +786,7 @@
             
             
             if (o.pointer != false) {                
             if (o.pointer != false) {                
                 
                 
-                var yOffset = 3;
+                var yOffset = 8;
                 var ePointAt = typeof o.pointer.el == 'string' ? $(o.pointer.el) : o.pointer.el;
                 var ePointAt = typeof o.pointer.el == 'string' ? $(o.pointer.el) : o.pointer.el;
                 if (!ePointAt)
                 if (!ePointAt)
                     ePointAt = $('body');
                     ePointAt = $('body');

+ 1 - 1
modules/base/text/classes/BxBaseModTextSearchResult.php

@@ -28,7 +28,7 @@ class BxBaseModTextSearchResult extends BxBaseModGeneralSearchResult
 		$this->addContainerClass ('bx-def-margin-bottom-neg');
 		$this->addContainerClass ('bx-def-margin-bottom-neg');
         if ('unit_gallery.html' == $this->sUnitTemplate){
         if ('unit_gallery.html' == $this->sUnitTemplate){
 			$this->removeContainerClass ('bx-def-margin-bottom-neg');		
 			$this->removeContainerClass ('bx-def-margin-bottom-neg');		
-            $this->addContainerClass (array('bx-def-margin-sec-lefttopright-neg', 'bx-base-text-unit-gallery-wrapper bx-def-margin-sec-bottom-neg'));
+            $this->addContainerClass (array('bx-base-text-unit-gallery-wrapper', 'bx-def-margin-sec-neg'));
 		}
 		}
 		if ('unit_showcase.html' == $this->sUnitTemplate){
 		if ('unit_showcase.html' == $this->sUnitTemplate){
 			$this->bShowcaseView = true;
 			$this->bShowcaseView = true;

+ 13 - 0
modules/boonex/artificer/classes/BxArtificerConfig.php

@@ -13,6 +13,8 @@ bx_import('BxBaseModTemplateConfig');
 
 
 class BxArtificerConfig extends BxBaseModTemplateConfig
 class BxArtificerConfig extends BxBaseModTemplateConfig
 {
 {
+    protected $_aReplacements;
+
     protected $_sThumbSizeDefault;
     protected $_sThumbSizeDefault;
     protected $_aThumbSizes;
     protected $_aThumbSizes;
     protected $_aThumbSizeByTemplate;
     protected $_aThumbSizeByTemplate;
@@ -25,6 +27,10 @@ class BxArtificerConfig extends BxBaseModTemplateConfig
             'option' => 'bx_artificer_'
             'option' => 'bx_artificer_'
         ];
         ];
 
 
+        $this->_aReplacements = [
+            'bx-def-margin-sec-neg' => '-m-2',
+        ];
+                
         $this->_sThumbSizeDefault = 'thumb';
         $this->_sThumbSizeDefault = 'thumb';
         $this->_aThumbSizes = [
         $this->_aThumbSizes = [
             'icon' => 'h-8 w-8',
             'icon' => 'h-8 w-8',
@@ -35,6 +41,13 @@ class BxArtificerConfig extends BxBaseModTemplateConfig
         $this->_aThumbSizeByTemplate = [
         $this->_aThumbSizeByTemplate = [
             'unit_with_cover.html' => 'h-24 w-24' //--- 'ava' size
             'unit_with_cover.html' => 'h-24 w-24' //--- 'ava' size
         ];
         ];
+        
+        
+    }
+
+    public function getReplacements()
+    {
+        return $this->_aReplacements;
     }
     }
 
 
     public function getThumbSize($sName = '', $sTemplate = '')
     public function getThumbSize($sName = '', $sTemplate = '')

+ 9 - 0
modules/boonex/artificer/classes/BxArtificerModule.php

@@ -18,6 +18,15 @@ class BxArtificerModule extends BxBaseModTemplateModule
         parent::__construct($aModule);
         parent::__construct($aModule);
     }
     }
 
 
+    public function processReplacements($s)
+    {
+        $a = $this->_oConfig->getReplacements();
+        if(empty($a))
+            return $s;
+
+        return str_replace(array_keys($a), array_values($a), $s);
+    }
+
     public function serviceGetSafeServices()
     public function serviceGetSafeServices()
     {
     {
         return array_merge(parent::serviceGetSafeServices(), [
         return array_merge(parent::serviceGetSafeServices(), [

+ 12 - 0
modules/boonex/artificer/data/template/mod_text/css/main.css

@@ -1,3 +1,15 @@
+/*-- Browsing: Search results --*/
+.bx-base-text-unit-gallery-wrapper {
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: stretch;
+    align-items: stretch;
+    -webkit-flex-wrap: wrap;
+    flex-wrap: wrap;
+    -webkit-justify-content: flex-start;
+    justify-content: flex-start;
+}
+
 /*-- Entry: Actions Menu --*/
 /*-- Entry: Actions Menu --*/
 .bx-base-general-entity-actions .bx-menu-custom-hor li.bx-menu-item-more-auto .bx-popup .bx-menu-custom .bx-menu-item {
 .bx-base-general-entity-actions .bx-menu-custom-hor li.bx-menu-item-more-auto .bx-popup .bx-menu-custom .bx-menu-item {
     width: 100%;
     width: 100%;

+ 15 - 0
modules/boonex/artificer/data/template/system/scripts/BxTemplSearchResult.php

@@ -9,9 +9,24 @@
 
 
 class BxTemplSearchResult extends BxBaseSearchResult
 class BxTemplSearchResult extends BxBaseSearchResult
 {
 {
+    protected $_sModule;
+    protected $_oModule;
+
     function __construct($oFunctions = false)
     function __construct($oFunctions = false)
     {
     {
         parent::__construct($oFunctions);
         parent::__construct($oFunctions);
+
+        $this->_sModule = 'bx_artificer';
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+    }
+
+    /**
+     * Apply class(es) for search result container 
+     * @return string with a list of classes.
+     */
+    function applyContainerClass ()
+    {
+        return $this->_oModule->processReplacements(parent::applyContainerClass());
     }
     }
 }
 }
 
 

+ 2 - 2
modules/boonex/artificer/data/template/system/sidebar_account.html

@@ -1,11 +1,11 @@
 <div class="bx-sidebar bx-sidebar-account fixed inset-0 flex justify-end z-40" role="dialog" aria-modal="true">
 <div class="bx-sidebar bx-sidebar-account fixed inset-0 flex justify-end z-40" role="dialog" aria-modal="true">
-    <div class="fixed inset-0 bg-white dark:bg-black opacity-70" aria-hidden="true"></div>
+    <div class="fixed inset-0 bg-gray-600 opacity-75" aria-hidden="true"></div>
     <div class="flex-shrink-0 w-14" aria-hidden="true"></div>
     <div class="flex-shrink-0 w-14" aria-hidden="true"></div>
     <div class="relative flex-1 flex flex-col max-w-xs w-full py-4 bg-white dark:bg-gray-900">
     <div class="relative flex-1 flex flex-col max-w-xs w-full py-4 bg-white dark:bg-gray-900">
         <div class="absolute top-0 left-0 -ml-12 pt-2">
         <div class="absolute top-0 left-0 -ml-12 pt-2">
             <button type="button" class="bx-sidebar-account-close ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white">
             <button type="button" class="bx-sidebar-account-close ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white">
                 <span class="sr-only"><bx_text:_bx_artificer_txt_close_sidebar /></span>
                 <span class="sr-only"><bx_text:_bx_artificer_txt_close_sidebar /></span>
-                <svg class="h-6 w-6 text-gray-500 dark:text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
+                <svg class="h-6 w-6 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
                   <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
                   <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
                 </svg>
                 </svg>
             </button>
             </button>

+ 2 - 2
modules/boonex/artificer/data/template/system/sidebar_site.html

@@ -1,10 +1,10 @@
 <div class="bx-sidebar bx-sidebar-site fixed inset-0 flex z-40 lg:hidden" role="dialog" aria-modal="true">
 <div class="bx-sidebar bx-sidebar-site fixed inset-0 flex z-40 lg:hidden" role="dialog" aria-modal="true">
-    <div class="fixed inset-0 bg-white dark:bg-black opacity-70" aria-hidden="true"></div>
+    <div class="fixed inset-0 bg-gray-600 opacity-75" aria-hidden="true"></div>
     <div class="relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-white dark:bg-gray-900">
     <div class="relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-white dark:bg-gray-900">
         <div class="absolute top-0 right-0 -mr-12 pt-2">
         <div class="absolute top-0 right-0 -mr-12 pt-2">
             <button type="button" class="bx-sidebar-site-close ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white">
             <button type="button" class="bx-sidebar-site-close ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white">
                 <span class="sr-only"><bx_text:_bx_artificer_txt_close_sidebar /></span>
                 <span class="sr-only"><bx_text:_bx_artificer_txt_close_sidebar /></span>
-                <svg class="h-6 w-6 text-gray-500 dark:text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
+                <svg class="h-6 w-6 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
                   <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
                   <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
                 </svg>
                 </svg>
             </button>
             </button>

+ 1 - 1
modules/boonex/artificer/data/template/system/view_counter_label.html

@@ -1,4 +1,4 @@
-<span class="__style_prefix__-counter-label flex items-center text-sm font-normal p-1">
+<span class="__style_prefix__-counter-label flex items-center text-sm font-normal">
     <bx_if:show_icon>
     <bx_if:show_icon>
         <span class="sys-action-counter-icon __style_prefix__-counter-icon relative flex items-center justify-center ring-1 h-6 w-6 ring-white dark:ring-gray-800 h-6 w-6 bg-gray-200 dark:bg-gray-800 rounded-full">__name__</span>
         <span class="sys-action-counter-icon __style_prefix__-counter-icon relative flex items-center justify-center ring-1 h-6 w-6 ring-white dark:ring-gray-800 h-6 w-6 bg-gray-200 dark:bg-gray-800 rounded-full">__name__</span>
     </bx_if:show_icon>
     </bx_if:show_icon>

+ 3 - 0
modules/boonex/artificer/js/tailwind.config.js

@@ -7,6 +7,9 @@ module.exports = {
         './data/template/**/*.html',
         './data/template/**/*.html',
     ],
     ],
     safelist: [
     safelist: [
+        'w-8', 'w-10', 'w-24', 'w-48', 
+        'h-8', 'h-10', 'h-24', 'h-48',
+        '-m-2',
         'text-red-400', 
         'text-red-400', 
         'bx-form-required', 'bx-form-warn',
         'bx-form-required', 'bx-form-warn',
         'bx-popup-fog',
         'bx-popup-fog',

+ 1 - 1
modules/boonex/artificer/template/css/tailwind.css

@@ -103,7 +103,7 @@
     }
     }
 
 
     .bx-popup-fog {
     .bx-popup-fog {
-        @apply bg-white dark:bg-black opacity-70;
+        @apply bg-gray-600 opacity-75;
     }
     }
 
 
 
 

File diff suppressed because it is too large
+ 0 - 0
modules/boonex/artificer/template/css/tailwind.min.css


+ 13 - 4
template/scripts/BxBaseSearchResult.php

@@ -60,8 +60,8 @@ class BxBaseSearchResult extends BxDolSearchResult
             foreach ($aData as $aValue)
             foreach ($aData as $aValue)
                 $sCode .= $this->displaySearchUnit($aValue);
                 $sCode .= $this->displaySearchUnit($aValue);
 
 
-            $sSearchResultBlockId = 'bx-search-result-block-' . rand(0, PHP_INT_MAX);
-            $sClasses = implode(' ', $this->aContainerClasses);
+            $sHtmlId = 'bx-search-result-block-' . rand(0, PHP_INT_MAX);
+            $sClasses = $this->applyContainerClass();
 
 
             $sAttributes = '';
             $sAttributes = '';
             if(is_array($this->aContainerAttrs) && !empty($this->aContainerAttrs))
             if(is_array($this->aContainerAttrs) && !empty($this->aContainerAttrs))
@@ -69,14 +69,14 @@ class BxBaseSearchResult extends BxDolSearchResult
                     $sAttributes .= ' ' . $sName . '="' . $sValue . '"';
                     $sAttributes .= ' ' . $sName . '="' . $sValue . '"';
 
 
             $sCode = BxDolTemplate::getInstance()->parseHtmlByName('search_result_block.html', [
             $sCode = BxDolTemplate::getInstance()->parseHtmlByName('search_result_block.html', [
-                'html_id' => $sSearchResultBlockId,
+                'html_id' => $sHtmlId,
                 'class' => $sClasses,
                 'class' => $sClasses,
                 'attrs' => $sAttributes,
                 'attrs' => $sAttributes,
                 'content' => $sCode,
                 'content' => $sCode,
                 'bx_if:do_center' => [
                 'bx_if:do_center' => [
                     'condition' => !$this->_bLiveSearch && $this->sCenterContentUnitSelector,
                     'condition' => !$this->_bLiveSearch && $this->sCenterContentUnitSelector,
                     'content' => [
                     'content' => [
-                        'html_id' => $sSearchResultBlockId,
+                        'html_id' => $sHtmlId,
                         'selector_content' => $this->sCenterContentUnitSelector
                         'selector_content' => $this->sCenterContentUnitSelector
                     ]
                     ]
                 ]
                 ]
@@ -394,6 +394,15 @@ class BxBaseSearchResult extends BxDolSearchResult
                 unset($this->aContainerClasses[$i]);
                 unset($this->aContainerClasses[$i]);
     }
     }
 
 
+    /**
+     * Apply class(es) for search result container 
+     * @return string with a list of classes.
+     */
+    function applyContainerClass ()
+    {
+        return implode(' ', $this->aContainerClasses);
+    }
+
     /**
     /**
      * Add attribute(s) to search result container 
      * Add attribute(s) to search result container 
      * @param $aAttributes an array of Key -> Value pair(s).
      * @param $aAttributes an array of Key -> Value pair(s).

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