[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Interactive Translation vs Modules Admin: Resolve overlap issue of the...

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68926975ed4a4_2cd5cdc175f7@gitlab-sidekiq-low-urgency-cpu-bound-v2-86c757c9d6-vl7ts.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
6e000150 by Espoir Baraka at 2025-08-05T20:20:18+00:00
[FIX] Interactive Translation vs Modules Admin: Resolve overlap issue of the new bar to exit modules
---
* [FIX] Interactive Translation: Resolve overlap issue in tiki-admin_modules where the Interactive Translation Assistant bar was covered by the toggle switch modules bar

See merge request tikiwiki/tiki!7464

- - - - -


9 changed files:

- lib/language/js/interactive_translation.js
- templates/layouts/basic/layout_view.tpl
- templates/layouts/social/layout_view.tpl
- + templates/module-header.tpl
- templates/tiki-admin_modules.tpl
- templates/tiki.tpl
- themes/base_files/scss/_tiki-modules.scss
- themes/base_files/scss/_tiki-translation.scss
- tiki-admin_modules.php


Changes:

=====================================
lib/language/js/interactive_translation.js
=====================================
@@ -8,8 +8,6 @@ if (localStorage.getItem("isCheckActiveTrans") === "true") {
     $("#intertrans-active").attr("checked", true);
 }
 
-$('body').css('padding-top', 64);
-
 var interTransDone = false;
 $('#intertrans-modal form').on("submit", function( e ) {
     e.preventDefault();


=====================================
templates/layouts/basic/layout_view.tpl
=====================================
@@ -4,7 +4,7 @@
     {include file='header.tpl'}
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 </head>
-<body {if $padding_top_layout}{html_body_attributes class="tiki-admin-padding-top"}{else}{html_body_attributes}{/if}>
+<body{html_body_attributes}>
 {$cookie_consent_html}
 
 {include file="layout_fullscreen_check.tpl"}
@@ -13,6 +13,7 @@
     {include file='tiki-ajax_header.tpl'}
 {/if}
 
+{block name=module_header}{/block}
 {if $section !== 'admin'}
     {include file='tiki-maintenance_banner.tpl'}
 {/if}


=====================================
templates/layouts/social/layout_view.tpl
=====================================
@@ -20,7 +20,7 @@
     }{/literal}
     </style>{/if}
 </head>
-<body{html_body_attributes class="navbar-padding"}{if $prefs.theme_navbar_fixed_topbar_offset ne ''} style="padding-top: {if isset($theme_navbar_fixed_topbar_offset)}{$theme_navbar_fixed_topbar_offset}{else}{$prefs.theme_navbar_fixed_topbar_offset}{/if}px" {/if}>
+<body{html_body_attributes class="navbar-padding"}>
     {$cookie_consent_html}
 
     {include file="layout_fullscreen_check.tpl"}
@@ -29,6 +29,17 @@
         {include file='tiki-ajax_header.tpl'}
     {/if}
     <a class="btn btn-info btn-lg skipnav" href="#col1" role="button">{tr}Skip to main content{/tr}</a>
+    {block name=module_header}{/block}
+    {if !isset($smarty.session.fullscreen) || isset($smarty.session.fullscreen) && $smarty.session.fullscreen ne 'y'}
+        {if $prefs.theme_unified_admin_backend neq 'y' or $smarty.server.SCRIPT_NAME|strpos:'tiki-admin.php' === false}            
+            <header
+                class="navbar navbar-expand-md tiki-top-nav-{$navbar_color_variant} navbar-{$navbar_color_variant} bg-{$navbar_color_variant} tiki-header-top" style="padding: 0 0 0 0;">
+                <div class="container-fluid">
+                    {modulelist zone=top class="top_modules w-100 tiki-top-nav-{$navbar_color_variant} navbar-{$navbar_color_variant}-parent bg-{$navbar_color_variant}-parent" heading_text='{tr}Site identity, navigation, etc.{/tr}' role=banner}
+                </div>
+            </header>
+        {/if}
+    {/if}
     <div class="middle_outer" id="middle_outer">
         {if !isset($smarty.session.fullscreen) && $smarty.session.fullscreen ne 'y'}
             {if $prefs.theme_unified_admin_backend eq 'y' && $smarty.server.SCRIPT_NAME eq $url_path|cat:'tiki-admin.php'}
@@ -205,14 +216,6 @@
                 </div>
             </div>
         </footer>
-        {if $prefs.theme_unified_admin_backend neq 'y' or $smarty.server.SCRIPT_NAME|strpos:'tiki-admin.php' === false}            
-            <header
-                class="navbar navbar-expand-md tiki-top-nav-{$navbar_color_variant} navbar-{$navbar_color_variant} bg-{$navbar_color_variant} fixed-top {if isset($padding_top_layout)}tiki-module-header-top{/if}">
-                <div class="container-fluid">
-                    {modulelist zone=top class="top_modules w-100 tiki-top-nav-{$navbar_color_variant} navbar-{$navbar_color_variant}-parent bg-{$navbar_color_variant}-parent" heading_text='{tr}Site identity, navigation, etc.{/tr}' role=banner}
-                </div>
-            </header>
-        {/if}
     {/if}
 
     {include file='footer.tpl'}


=====================================
templates/module-header.tpl
=====================================
@@ -0,0 +1,9 @@
+{if $layout_has_modules}
+    <div class="modules-admin-toggle-container alert alert-info" id="toggleSwitch_modules">
+        <div class="custom-toggle">
+            <a href="./" class="btn btn-link tips my-2" title=":{tr}Turn off modules admin{/tr}">
+                {icon name="off"} {tr}Exit Modules{/tr}
+            </a>
+        </div>
+    </div>
+{/if}
\ No newline at end of file


=====================================
templates/tiki-admin_modules.tpl
=====================================
@@ -1,16 +1,5 @@
 {strip}
 {title help="Modules" admpage="module"}{tr}Admin Modules{/tr}{/title}
-{block name="toggleSwitch_modules"}
-    <div class="modules-admin-toggle-container fixed-top">
-        <div class="custom-toggle">
-            <label class="form-switch">
-                <input class="form-check-input toggle-switch-modules" type="checkbox" id="toggleSwitch-modules" checked>
-            </label>
-            <span class="form-check-label" style="color: #ddd;">{tr}Exit Modules{/tr}</span>
-        </div>
-    </div>   
-{/block}
-
 <div class="t_navbar mb-4">
     <form action="tiki-admin_modules.php" method="post" style="display: inline">
         {ticket}
@@ -423,12 +412,6 @@
 $("#module_list_show_all").on("click", function(){
     $("#module_list li.disabled").toggle($(this).prop("checked"));
 });
-
-document.getElementById('toggleSwitch-modules').addEventListener('change', function() {
-    if (!this.checked) {
-        window.location.href = "./";
-    }
-});
         {/jq}
     {/tab}
 


=====================================
templates/tiki.tpl
=====================================
@@ -1,5 +1,9 @@
 {extends $global_extend_layout|default:'layout_view.tpl'}
 
+{block name=module_header}
+    {include file='module-header.tpl'}
+{/block}
+
 {block name=title}
     {* Legacy template, no support for title block *}
 {/block}


=====================================
themes/base_files/scss/_tiki-modules.scss
=====================================
@@ -459,23 +459,17 @@ header.fixed-top {
 // admin toogle
 .modules-admin-toggle-container {
     width: 100%;
-    height: 35px; 
-    background-color: #0a58ca;
+    height: 35px;
     display: flex; 
     align-items: center; 
     justify-content: center;
   }
   
-.toggle-switch-modules {
-    background-color: transparent; 
-    border: 2px solid #ddd;
-}
-
-// Add top padding to the body for basic layout when using tiki-modules only
-.tiki-admin-padding-top {
-    padding-top: 35px;
+#toggleSwitch_modules {
+    margin: 0;
 }
 
-.tiki-module-header-top {
-    margin-top: 35px;
+.tiki-header-top {
+    --tiki-fixed-top-border-top-width: 0px;
+    --tiki-fixed-top-border-bottom-width: 5px;
 }


=====================================
themes/base_files/scss/_tiki-translation.scss
=====================================
@@ -1,14 +1,4 @@
 // /* interactive translations */
-#intertrans-indicator {
-    position: fixed;
-    left: 0;
-    right: 0;
-    top: 0;
-    z-index: 1000;
-    //    background-color: $alert-success-bg; (this and other color-related rules are moved to _tiki-selectors.scss)
-    //    color: $alert-success-text;
-}
-
 #intertrans-form {
     position: fixed;
     top: 10%;


=====================================
tiki-admin_modules.php
=====================================
@@ -636,6 +636,7 @@ if (! empty($_REQUEST['edit_module'])) {    // pick up ajax calls
         unset($headerlib->css[100][array_search('#c1c2 #wrapper #col1.marginright { margin-right: 0; }', $headerlib->css[100])]);
     }
     $smarty->assign('padding_top_layout', true);
+    $smarty->assign('layout_has_modules', true);
     $smarty->assign('theme_navbar_fixed_topbar_offset', $prefs["theme_navbar_fixed_topbar_offset"] + 35);
     $smarty->assign('mid', 'tiki-admin_modules.tpl');
     $smarty->display('tiki.tpl');



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/6e000150c44ae45931686998254a28edb0f37124

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/6e000150c44ae45931686998254a28edb0f37124
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.