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

Blaine Motsinger blaine at bestpractical.com
Fri Sep 18 12:57:46 EDT 2020


The branch, convert-to-bootstrap-for-rt5 has been created
        at  75bf97ed5f064ceb0b255185e580a1c921e21c0b (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 003496ddfe46752a6edcbe65d269ca713cf78351
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..6cbe3a4 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' &>
+  <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 cd7f56aa9650fd89a8069491a7a1b8c9a87fe3c8
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 6cbe3a4..97578a4 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 1bef083c71bb1f6b8ad989be073bacfc661e4ce0
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..1b369a8
--- /dev/null
+++ b/static/css/resetpassword.css
@@ -0,0 +1,25 @@
+
+/* 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 form div.form-row a.btn-primary {
+    color: #fff;
+    background: #4868b3;
+    border-color: transparent;
+}
+
+body.elevator-light .login-body form div.form-row a.btn-primary:hover,
+body.elevator-light .login-body form div.form-row a.btn-primary:focus {
+    background: #3D5B9D;
+}

commit 927cc009cd00091b89bf42af552e2695d67c0eb9
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 75bf97ed5f064ceb0b255185e580a1c921e21c0b
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Fri Sep 18 11:56:48 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