[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX][UX] Split page history form into separate forms to isolate pagination from version comparison

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68913ec92c53d_2cd5cdc1319c@gitlab-sidekiq-low-urgency-cpu-bound-v2-58b475bb65-kpgxv.mail>

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


Commits:
c28586b8 by Landry Bitege at 2025-08-04T22:33:03+00:00
[FIX][UX] Split page history form into separate forms to isolate pagination from version comparison
---
* [FIX] Split page history form into separate forms to isolate pagination from version comparison

See merge request tikiwiki/tiki!8118

- - - - -


1 changed file:

- templates/tiki-pagehistory.tpl


Changes:

=====================================
templates/tiki-pagehistory.tpl
=====================================
@@ -123,99 +123,102 @@
             {tr}History{/tr}
         </h2>
     {/if}
-    <form id="pagehistory" action="tiki-pagehistory.php?page={$page}">
+    <form id="pagehistory" action="tiki-pagehistory.php?page={$page}" class="multi mb-4 d-flex align-items-end justify-content-between flex-wrap gap-2">
         <input type="hidden" name="page" value="{$page|escape}">
         <input type="hidden" name="history_offset" value="{$history_offset}">
 
-        <div class="multi mb-4 d-flex align-items-end justify-content-between flex-wrap gap-2">
-            {if $prefs.feature_multilingual eq 'y' and $tiki_p_edit eq 'y'}
-                <div class="translation w-50">
-                    <label for="tra_lang" class="form-label">{tr}Translation{/tr}</label>
-                    <select name="tra_lang" class="form-select">
-                        {section name=ix loop=$languages}
-                            <option value="{$languages[ix].value|escape}"{if $lang eq $languages[ix].value} selected="selected"{/if}>{$languages[ix].name}</option>
-                        {/section}
-                    </select>
-                </div>
-
-                <div class="d-flex flex-grow-0 gap-2">
-                    <input type="submit" class="btn btn-primary" name="update_translation" value="{tr}Update Translation{/tr}"/>
-                    {if $show_translation_history}
-                        <input type="hidden" name="show_translation_history" value="1">
-                        {button show_translation_history=0 _text="{tr}Hide translation history{/tr}" _auto_args="*" _class="btn btn-info"}
-                    {else}
-                        {button show_translation_history=1 _text="{tr}Show translation history{/tr}" _auto_args="*" _class="btn btn-info"}
-                    {/if}
-                </div>
-
-            {/if}
-        </div>
+        {if $prefs.feature_multilingual eq 'y' and $tiki_p_edit eq 'y'}
+            <div class="translation w-50">
+                <label for="tra_lang" class="form-label">{tr}Translation{/tr}</label>
+                <select name="tra_lang" class="form-select">
+                    {section name=ix loop=$languages}
+                        <option value="{$languages[ix].value|escape}"{if $lang eq $languages[ix].value} selected="selected"{/if}>{$languages[ix].name}</option>
+                    {/section}
+                </select>
+            </div>
 
-        <div class="row mb-4">
-            <div class="col-sm-6">
-                <input type="checkbox" name="paginate" id="paginate"{if $paginate} checked="checked"{/if}>
-                <label for="paginate">{tr}Enable pagination{/tr}</label>
-                {if $paginate}
-                    <input type="text" name="history_pagesize" role="search" id="history_pagesize" value="{$history_pagesize}" class="form-control form-control-sm" style="width: 5em; display: inline-block">
-                    <label for="history_pagesize">{tr}rows per page{/tr}</label>
+            <div class="d-flex flex-grow-0 gap-2">
+                <input type="submit" class="btn btn-primary" name="update_translation" value="{tr}Update Translation{/tr}"/>
+                {if $show_translation_history}
+                    <input type="hidden" name="show_translation_history" value="1">
+                    {button show_translation_history=0 _text="{tr}Hide translation history{/tr}" _auto_args="*" _class="btn btn-info"}
+                {else}
+                    {button show_translation_history=1 _text="{tr}Show translation history{/tr}" _auto_args="*" _class="btn btn-info"}
                 {/if}
             </div>
-            <div class="col-sm-6">
-            {if ($prefs.default_wiki_diff_style ne "old") and $history}
-                <div class="input-group">
-                    <select class="form-select" name="diff_style">
-                        <optgroup label="{tr}Simple{/tr}">
-                            {foreach  $diff_styles.options as $value => $label}
-                                {if $value == 'htmldiff' || $value == 'sidediff'}
+        {/if}
+    </form>
+
+        <div class="row mb-4">
+            <form id="pagehistory" action="tiki-pagehistory.php?page={$page}" class="col-sm-6">
+                <input type="hidden" name="page" value="{$page|escape}">
+                <input type="hidden" name="history_offset" value="{$history_offset}">
+
+                    <input type="checkbox" name="paginate" id="paginate"{if $paginate} checked="checked"{/if}>
+                    <label for="paginate">{tr}Enable pagination{/tr}</label>
+                    {if $paginate}
+                        <input type="text" name="history_pagesize" role="search" id="history_pagesize" value="{$history_pagesize}" class="form-control form-control-sm" style="width: 5em; display: inline-block">
+                        <label for="history_pagesize">{tr}rows per page{/tr}</label>
+                    {/if}
+            </form>
+            <form id="pagehistory" action="tiki-pagehistory.php?page={$page}" class="col-sm-6">
+                <input type="hidden" name="page" value="{$page|escape}">
+                <input type="hidden" name="history_offset" value="{$history_offset}">
+
+                {if ($prefs.default_wiki_diff_style ne "old") and $history}
+                    <div class="input-group">
+                        <select class="form-select" name="diff_style">
+                            <optgroup label="{tr}Simple{/tr}">
+                                {foreach  $diff_styles.options as $value => $label}
+                                    {if $value == 'htmldiff' || $value == 'sidediff'}
+                                        <option value="{$value}" {if $diff_style == $value} selected="selected"{/if}>
+                                            {tr}{$label}{/tr}
+                                        </option>
+                                    {/if}
+                                {/foreach}
+                            </optgroup>
+                            <optgroup label="{tr}Advanced{/tr}">
+                                {foreach  $diff_styles.options as $value => $label}
+                                    {if $value == 'htmldiff' || $value == 'sidediff'}
+                                        {continue}
+                                    {/if}
                                     <option value="{$value}" {if $diff_style == $value} selected="selected"{/if}>
                                         {tr}{$label}{/tr}
                                     </option>
-                                {/if}
-                            {/foreach}
-                        </optgroup>
-                        <optgroup label="{tr}Advanced{/tr}">
-                            {foreach  $diff_styles.options as $value => $label}
-                                {if $value == 'htmldiff' || $value == 'sidediff'}
-                                    {continue}
-                                {/if}
-                                <option value="{$value}" {if $diff_style == $value} selected="selected"{/if}>
-                                    {tr}{$label}{/tr}
-                                </option>
-                            {/foreach}
-                        </optgroup>
-                    </select>
-                        {jq}
-    $("form#pagehistory")
-        .each(function store_original_values(i, form){
-            form.originals = {};
+                                {/foreach}
+                            </optgroup>
+                        </select>
+                            {jq}
+        $("form#pagehistory")
+            .each(function store_original_values(i, form){
+                form.originals = {};
 
-            $(form).find(':input').each(function(i, input){
-                var name = $(input).attr('name');
-                var value = $(input).val();
-                form.originals[name] = value;
-            });
-        })
-        .on("submit", function submit_changed_values(evt){
-            var always = ['page', 'oldver'];
-            var originals = this.originals || {};
+                $(form).find(':input').each(function(i, input){
+                    var name = $(input).attr('name');
+                    var value = $(input).val();
+                    form.originals[name] = value;
+                });
+            })
+            .on("submit", function submit_changed_values(evt){
+                var always = ['page', 'oldver'];
+                var originals = this.originals || {};
 
-            $(this).find(':input:enabled').each(function(i, input){
-                var name = $(input).attr('name');
-                var value = $(input).val();
+                $(this).find(':input:enabled').each(function(i, input){
+                    var name = $(input).attr('name');
+                    var value = $(input).val();
 
-                if(always.indexOf(name) === -1 && originals[name] === value) {
-                    $(input).attr('disabled', 'disabled')
-                            .prop('disabled', 'disabled');
-                }
+                    if(always.indexOf(name) === -1 && originals[name] === value) {
+                        $(input).attr('disabled', 'disabled')
+                                .prop('disabled', 'disabled');
+                    }
+                });
             });
-        });
-                        {/jq}
-                </div>
-                <input type="hidden" name="show_all_versions" value="{$show_all_versions}">
-                {/if}
-            </div>
+                            {/jq}
+                    </div>
+                    <input type="hidden" name="show_all_versions" value="{$show_all_versions}">
+                    {/if}
         </div>
-            <div>
+        <div>
             <div class="{if $js}table-responsive{/if}"> {* table-responsive class cuts off css drop-down menus *}
                 <table class="table table-condensed table-hover table-striped">
                     <tr>
@@ -496,6 +499,6 @@
                     {/pagination_links}
                 {/if}
             {/if}
+            </form>
         </div>
-    </form>
 {/if}



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c28586b87df24da243afa9c00612834718795e0d
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.