[Rt-commit] rt branch, 4.0/form-buttons-ordering, created. rt-4.0.21-20-gf53cbd1

Wallace Reis wreis at bestpractical.com
Tue Nov 18 13:10:22 EST 2014


The branch, 4.0/form-buttons-ordering has been created
        at  f53cbd1d24394906a2de5a3bd05fdca5889c5d8b (commit)

- Log -----------------------------------------------------------------
commit ddb2cf9d76b68d18055e4de1b7a71c5867876fd9
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Wed Aug 27 17:58:10 2014 -0300

    Button ordering on update user page
    
    1b39bc1c tried to address this issue, however modern browsers still
    submit the form when hitting enter. The 1b39bc1c changeset provides
    a good UX tho, by hiding the "Reset Auth Token" button.
    
    Thus, a proper solution is to put the save submit button first in
    the source since browser uses the first one as default button when
    hitting enter and it doesn't make a lot of sense UI-wise to have
    the button between the form fields and their submit element anyway.
    
    Fixes I#19431.

diff --git a/share/html/User/Prefs.html b/share/html/User/Prefs.html
index d91a149..c1d2957 100644
--- a/share/html/User/Prefs.html
+++ b/share/html/User/Prefs.html
@@ -167,6 +167,8 @@
 </table>
 </&>
 
+<& /Elements/Submit, Label => loc('Save Preferences') &>
+
 <&| /Widgets/TitleBox, title => loc('Secret authentication token'), id => "user-prefs-feeds" &>
 
 <&|/l&>All iCal feeds embed a secret token which authorizes you.  If the URL one of your iCal feeds got exposed to the outside world, you can get a new secret, <b>breaking all existing iCal feeds</b> below.</&>
@@ -196,7 +198,6 @@
 
 % $m->callback( %ARGS, UserObj => $UserObj, CallbackName => 'FormEnd' );
 
-<& /Elements/Submit, Label => loc('Save Preferences') &>
 </form>
 
 

commit f53cbd1d24394906a2de5a3bd05fdca5889c5d8b
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Thu Sep 11 15:12:07 2014 -0400

    Button ordering on ticket create/modify pages
    
    Form buttons as submit input type are triggered when hitting enter causing
    other actions in those pages to be fired instead of "Create" or
    "Save Changes" ones.
    
    Transforming them into button input type doesn't get the value posted as
    part of form data. Thus, let's make the workaround to add a "hidden" submit
    button early in the page for RT stable series and then work on a proper and
    deeper change in next major release.
    
    Fixes I#19431.

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 69f3036..21e20d8 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -53,6 +53,7 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form action="<% RT->Config->Get('WebPath') %>/Ticket/Create.html" method="post" enctype="multipart/form-data" name="TicketCreate">
+  <input type="submit" name="SubmitTicket" value="Create" style="display:none">
   <input type="hidden" class="hidden" name="id" value="new" />
   
 % $m->callback( CallbackName => 'FormStart', QueueObj => $QueueObj, ARGSRef => \%ARGS );
diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index e890c80..ba21f8e 100644
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -53,6 +53,7 @@
 
 <form method="post" action="ModifyAll.html" name="TicketModifyAll" enctype="multipart/form-data">
 % $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS );
+<input type="submit" name="SubmitTicket" value="Save Changes" style="display:none">
 <input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
 
 <&| /Widgets/TitleBox, title => loc('Modify ticket # [_1]', $Ticket->Id), class=>'ticket-info-basics' &>
diff --git a/share/html/Ticket/ModifyPeople.html b/share/html/Ticket/ModifyPeople.html
index cdf2580..c990162 100644
--- a/share/html/Ticket/ModifyPeople.html
+++ b/share/html/Ticket/ModifyPeople.html
@@ -52,6 +52,7 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form method="post" action="ModifyPeople.html">
+<input type="submit" name="SubmitTicket" value="Save Changes" style="display:none">
 <input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
 % $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS );
 <&| /Widgets/TitleBox, title => loc('Modify people related to ticket #[_1]', $Ticket->Id),   width => "100%", color=> "#333399", class=>'ticket-info-people' &>

-----------------------------------------------------------------------


More information about the rt-commit mailing list