[Bps-public-commit] rt-extension-resetpassword branch, convert-to-bootstrap-for-rt5, created. 1.04-26-g525fefa

Blaine Motsinger blaine at bestpractical.com
Thu Oct 1 16:41:41 EDT 2020


The branch, convert-to-bootstrap-for-rt5 has been created
        at  525fefa99e91de28b0bf75654f92e1ea26ace2ac (commit)

- Log -----------------------------------------------------------------
commit efad7d3b14043f15bec658f944554903a066a528
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed Sep 16 16:43:27 2020 -0500

    Update Login for elevator on rt5

diff --git a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
index 58c1c00..0bc8b8e 100644
--- a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
+++ b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
@@ -1,8 +1,20 @@
 % unless ( RT::Config->Get('DisableResetPasswordOnLogin') ) {
-<div id="lostpassword" class="input-row" style="text-align:center;clear:both;">
-  <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html"><&|/l&>Forgot your password</&></a>
-%   if ( RT::Config->Get('CreateNewUserAndSetPassword') ) {
-  | <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Mode=create"><&|/l&>New account</&></a>
-%   }
+% if ( RT::Handle::cmp_version($RT::VERSION, '5.0.0') >= 0 ) {
+  <div class="form-row">
+    <div class="col-12 text-right">
+      <a class="btn btn-primary" href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html"><&|/l&>Forgot your password</&></a>
+%     if ( RT::Config->Get('CreateNewUserAndSetPassword') ) {
+      <a class="btn btn-primary" href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Mode=create"><&|/l&>New account</&></a>
+%     }
+    </div>
+  </div>
+% }
+% else {
+  <div id="lostpassword" class="input-row" style="text-align:center;clear:both;">
+    <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html"><&|/l&>Forgot your password</&></a>
+%     if ( RT::Config->Get('CreateNewUserAndSetPassword') ) {
+    | <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Mode=create"><&|/l&>New account</&></a>
+%     }
+  </div>
+% }
 % }
-</div>

commit 6edebff0ed71c09ac2cca45c4e87476e28d8c6c0
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed Sep 16 18:48:28 2020 -0500

    Update Request.html for elevator on rt5

diff --git a/html/NoAuth/ResetPassword/Request.html b/html/NoAuth/ResetPassword/Request.html
index 11c90ab..3a18d92 100644
--- a/html/NoAuth/ResetPassword/Request.html
+++ b/html/NoAuth/ResetPassword/Request.html
@@ -46,6 +46,44 @@
 <& /Elements/Header, Title => $title &>
 <div id="body" class="login-body">
 
+% if ( RT::Handle::cmp_version($RT::VERSION, '5.0.0') >= 0 ) {
+<& /Elements/ListActions, actions => \@actions &>
+
+<form action="Request.html" method="post" class="mx-auto max-width-sm">
+
+% my $title_box_title;
+% if ( $Mode eq 'create' ) {
+%     $title_box_title = loc("Enter your email address to create a new account");
+% }
+% else {
+%     $title_box_title = loc("Enter your email address to reset your password");
+% }
+
+<&| /Widgets/TitleBox, title => $title_box_title, hideable => 0, content_class => 'mx-auto col-12', class => 'text-center' &>
+  <div class="form-row">
+% if ( $Mode eq 'reset' ) {
+      <p class="col-12 text-center"><i><&|/l&>RT can send you an email message with a link that will allow you to reset your password.</&></i></p>
+% }
+  </div>
+  <div class="form-row">
+    <div class="label col-3">
+      <&|/l&>Email address</&>:
+    </div>
+    <div class="value col-8">
+      <input type="text" class="form-control" name="Email" value="" />
+    </div>
+  </div>
+</&>
+  <div class="form-row">
+    <div class="col-12">
+      <a class="btn btn-primary float-left" href="<%$RT::WebURL|n%>"><&|/l&>Back to Login</&></a>
+      <input class="button btn btn-primary form-control float-right" type="submit" value="<%loc('Send it!')%>" />
+    </div>
+  </div>
+
+</form>
+% }
+% else {
 <h1><%$title%></h1>
 <& /Elements/ListActions, actions => \@actions  &>
 <p>
@@ -59,8 +97,10 @@
     <input type="submit" class="button" value="<%loc('Send it!')%>" />
 </form>
     <a href="<%$RT::WebURL|n%>"><&|/l&>Login</&></a>
+% }
 </div>
 
+<& /Elements/Footer, Menu => 0 &>
 <%INIT>
 my @actions;
 

commit b61a29e27128f280d40405dbe66fc2a0685d9d3c
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Sep 17 14:42:38 2020 -0500

    Update EditPassword for elevator on rt5

diff --git a/html/Elements/EditPassword b/html/Elements/EditPassword
index 3de003f..aa408f0 100644
--- a/html/Elements/EditPassword
+++ b/html/Elements/EditPassword
@@ -45,6 +45,51 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
+% if ( RT::Handle::cmp_version($RT::VERSION, '5.0.0') >= 0 ) {
+  <div class="form-row">
+    <div class="col-12">
+      <div class="custom-control custom-checkbox">
+        <input value="1" <% $session{'SendPasswordResetEmail'} ? 'checked' : '' %> class="custom-control-input checkbox" id="SendPasswordResetEmail" name="SendPasswordResetEmail" type="checkbox" />
+        <label class="custom-control-label" for="SendPasswordResetEmail"><&|/l&>Send new password email</&></label>
+      </div>
+    </div>
+  </div>
+
+% unless ( $cond{'CanSet'} ) {
+<% $cond{'Reason'} %><br />
+% }
+% else {
+% if ( $cond{'RequireCurrent'} ) {
+  <div class="form-row">
+    <div class="label col-3">
+      <&|/l, $session{'CurrentUser'}->Name()&>[_1]'s current password</&>:
+    </div>
+    <div class="value col-9">
+      <input type="password" class="form-control" name="<% $Name[0] %>" size="16" autocomplete="off" />
+    </div>
+  </div>
+% }
+
+  <div class="form-row">
+    <div class="label col-3">
+      <&|/l&>New password</&>:
+    </div>
+    <div class="value col-9">
+      <input type="password" class="form-control" name="<% $Name[1] %>" size="16" autocomplete="off" />
+    </div>
+  </div>
+
+  <div class="form-row">
+    <div class="label col-3">
+      <&|/l&>Retype Password</&>:
+    </div>
+    <div class="value col-9">
+      <input type="password" class="form-control" name="<% $Name[2] %>" size="16" autocomplete="off" />
+    </div>
+  </div>
+% }
+% }
+% else {
 <input value="1" <% $session{'SendPasswordResetEmail'} ? 'checked' : '' %> id="SendPasswordResetEmail" name="SendPasswordResetEmail" type="checkbox"></input>
 <label for="SendPasswordResetEmail"><&|/l&>Send new password email</&></label><br />
 
@@ -72,7 +117,7 @@
 
 </table>
 % }
-
+% }
 <%ARGS>
 $User
 @Name => qw(CurrentPass NewPass1 NewPass2)

commit 4aeddedd37670bbcdd80a62ca77094cde60e5f23
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Sep 17 17:14:19 2020 -0500

    Update ResetPassword/Reset for elevator on rt5

diff --git a/html/NoAuth/ResetPassword/Reset/dhandler b/html/NoAuth/ResetPassword/Reset/dhandler
index ad19b0a..e219749 100644
--- a/html/NoAuth/ResetPassword/Reset/dhandler
+++ b/html/NoAuth/ResetPassword/Reset/dhandler
@@ -55,6 +55,43 @@ else {
 <& /Elements/Header, Title => $title &>
 <div id="body" class="login-body">
 
+% if ( RT::Handle::cmp_version($RT::VERSION, '5.0.0') >= 0 ) {
+<& /Elements/ListActions, actions => \@results &>
+
+% if ($show_form) {
+<form action="<%$id%>" method="post" class="mx-auto max-width-sm">
+
+<&| /Widgets/TitleBox, hideable => 0, content_class => 'mx-auto col-12' &>
+  <div class="form-row">
+    <div class="label col-3">
+      <&|/l&>New password</&>:
+    </div>
+    <div class="value col-8">
+      <input name="password" type="password" class="form-control" />
+    </div>
+  </div>
+
+  <div class="form-row">
+    <div class="label col-3">
+      <&|/l&>Retype Password</&>:
+    </div>
+    <div class="value col-8">
+      <input type="password" class="form-control" name="password2" size="16" autocomplete="off" />
+    </div>
+  </div>
+
+</&>
+  <div class="form-row">
+    <div class="col-12">
+      <a class="btn btn-primary float-left" href="<%$RT::WebURL|n%>"><&|/l&>Back to Login</&></a>
+      <input class="button btn btn-primary form-control float-right" type="submit" value="<%loc('Change password')%>" />
+    </div>
+  </div>
+
+</form>
+% }
+% }
+% else {
 <h1><%$title%></h1>
 <& /Elements/ListActions, actions => \@results  &>
 <p>
@@ -76,3 +113,7 @@ else {
 </form>
 %}
 <a href="<%$RT::WebURL|n%>"><&|/l&>Login</&></a>
+% }
+</div>
+
+<& /Elements/Footer, Menu => 0 &>

commit 85ab7293fa7b574ac128abd86579fd539aebf4de
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Sep 17 17:20:08 2020 -0500

    Update back to login text for rt4
    
    For consistency with the language on the rt5 version, this commit
    updates the login links to say "back to login."

diff --git a/html/NoAuth/ResetPassword/Request.html b/html/NoAuth/ResetPassword/Request.html
index 3a18d92..15e53a1 100644
--- a/html/NoAuth/ResetPassword/Request.html
+++ b/html/NoAuth/ResetPassword/Request.html
@@ -96,7 +96,7 @@
     <&|/l&>Email address</&>:<input name="Email" value="" />
     <input type="submit" class="button" value="<%loc('Send it!')%>" />
 </form>
-    <a href="<%$RT::WebURL|n%>"><&|/l&>Login</&></a>
+    <a href="<%$RT::WebURL|n%>"><&|/l&>Back to Login</&></a>
 % }
 </div>
 
diff --git a/html/NoAuth/ResetPassword/Reset/dhandler b/html/NoAuth/ResetPassword/Reset/dhandler
index e219749..8a20e5e 100644
--- a/html/NoAuth/ResetPassword/Reset/dhandler
+++ b/html/NoAuth/ResetPassword/Reset/dhandler
@@ -112,7 +112,7 @@ else {
 <input type ="submit" value ="<%loc('Change password')%>">
 </form>
 %}
-<a href="<%$RT::WebURL|n%>"><&|/l&>Login</&></a>
+<a href="<%$RT::WebURL|n%>"><&|/l&>Back to Login</&></a>
 % }
 </div>
 

commit 2b3dfdecce5e4e44f147cb46f24a63be3816b473
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Sep 17 18:19:17 2020 -0500

    Add stylesheet for link colors in rt5

diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index 21fdfdf..1b5c3c3 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -5,6 +5,8 @@ use warnings;
 
 our $VERSION = '1.06';
 
+RT->AddStyleSheets("resetpassword.css");
+
 sub CreateTokenAndResetPassword {
     my $user = shift;
 
diff --git a/static/css/resetpassword.css b/static/css/resetpassword.css
new file mode 100644
index 0000000..ceb6c0a
--- /dev/null
+++ b/static/css/resetpassword.css
@@ -0,0 +1,31 @@
+
+/* The "a" links styled as buttons are somewhat of an anomoly in the
+   elevator theme for rt5.  In this extension, if we use the "a" link
+   styles from rt5, the buttons aren't the correct size or color to
+   match the submit inputs they show up next to.
+
+   Since no other "a" links in rt5 need to be targeted like in this
+   extension, rather than update the targets in rt5 code, this stylesheet
+   is added.
+
+   In the event this extension is made core, please put these styles
+   near to the other btn-primary styles with a comment about what
+   they specifically control, or spend time adding these selector targets
+   to the existing submit input button targets.
+*/
+body.elevator-light .login-body div.form-row a.btn-primary {
+    color: #fff;
+    background: #4868b3;
+    border-color: transparent;
+}
+
+body.elevator-light .login-body div.form-row a.btn-primary:hover,
+body.elevator-light .login-body div.form-row a.btn-primary:focus {
+    background: #3D5B9D;
+}
+
+body.elevator-dark .login-body div.form-row a.btn-primary {
+    background: #323D42 !important;
+    border-color: #717171 !important;
+    color: #ededed !important;
+}

commit a00319be2c05c848d4e2113b913f302be5d443cf
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Fri Sep 18 11:07:01 2020 -0500

    Update message information sentence for rt4 and rt5
    
    To make the sentence fit without wrapping, remove the word message
    from the sentence.  The grammar also reads better without it.

diff --git a/html/NoAuth/ResetPassword/Request.html b/html/NoAuth/ResetPassword/Request.html
index 15e53a1..b4d86d0 100644
--- a/html/NoAuth/ResetPassword/Request.html
+++ b/html/NoAuth/ResetPassword/Request.html
@@ -62,7 +62,7 @@
 <&| /Widgets/TitleBox, title => $title_box_title, hideable => 0, content_class => 'mx-auto col-12', class => 'text-center' &>
   <div class="form-row">
 % if ( $Mode eq 'reset' ) {
-      <p class="col-12 text-center"><i><&|/l&>RT can send you an email message with a link that will allow you to reset your password.</&></i></p>
+      <p class="col-12 text-center"><i><&|/l&>RT can send you an email with a link that will allow you to reset your password.</&></i></p>
 % }
   </div>
   <div class="form-row">
@@ -90,7 +90,7 @@
 % if ( $Mode eq 'create' ) {
 <&|/l&>Enter your email address to create a new account.</&>
 % } else {
-<&|/l&>RT can send you an email message with a link that will allow you to reset your password.</&>
+<&|/l&>RT can send you an email with a link that will allow you to reset your password.</&>
 % }
 <form method="post" action="Request.html">
     <&|/l&>Email address</&>:<input name="Email" value="" />

commit 822e9a6e8ff89bb1fc585fe3ee27aaa0b80b7192
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Oct 1 15:27:45 2020 -0500

    Add back to login button after reset for RT5

diff --git a/html/NoAuth/ResetPassword/Reset/dhandler b/html/NoAuth/ResetPassword/Reset/dhandler
index 8a20e5e..b42f34b 100644
--- a/html/NoAuth/ResetPassword/Reset/dhandler
+++ b/html/NoAuth/ResetPassword/Reset/dhandler
@@ -90,6 +90,13 @@ else {
 
 </form>
 % }
+% else {
+<div class="form-row">
+  <div class="col-12">
+    <a class="btn btn-primary float-left" href="<%$RT::WebURL|n%>"><&|/l&>Back to Login</&></a>
+  </div>
+</div>
+% }
 % }
 % else {
 <h1><%$title%></h1>

commit 525fefa99e91de28b0bf75654f92e1ea26ace2ac
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Oct 1 15:36:34 2020 -0500

    Update supported versions in Pod to include 5.0

diff --git a/README b/README
index 691cef4..8e0926e 100644
--- a/README
+++ b/README
@@ -14,7 +14,7 @@ DESCRIPTION
     and disable self-service features.
 
 RT VERSION
-    Works with RT 4.0, 4.2, 4.4
+    Works with RT 4.0, 4.2, 4.4, 5.0
 
 INSTALLATION
     perl Makefile.PL
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index 1b5c3c3..33315b5 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -52,7 +52,7 @@ and disable self-service features.
 
 =head1 RT VERSION
 
-Works with RT 4.0, 4.2, 4.4
+Works with RT 4.0, 4.2, 4.4, 5.0
 
 =head1 INSTALLATION
 

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


More information about the Bps-public-commit mailing list