[Bps-public-commit] rt-extension-timetracking branch, master, updated. 0.09-13-gce34742

? sunnavy sunnavy at bestpractical.com
Sat May 23 08:39:33 EDT 2020


The branch, master has been updated
       via  ce34742346c170d749f25d8ec0a0b8949dd7fded (commit)
       via  54ac7543543cfe1112757c363e3286d1a0a2e96a (commit)
       via  35b8872cb1af099250742730785d6d390458deb7 (commit)
      from  66ba2fba66609b051fc03cb41bd6c67cc7f6f3a4 (commit)

Summary of changes:
 .../Ticket/Elements/ShowBasics/EndOfList           | 58 +++++----------
 html/Tools/MyWeek.html                             | 84 +++++++++++++---------
 2 files changed, 71 insertions(+), 71 deletions(-)

- Log -----------------------------------------------------------------
commit 35b8872cb1af099250742730785d6d390458deb7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Sep 7 01:03:57 2019 +0800

    Migrate to 4.6 theme

diff --git a/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList b/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList
index d0d26fa..723b0be 100644
--- a/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList
+++ b/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList
@@ -32,49 +32,29 @@ my $cf_name = 'Object-RT::Transaction--CustomField-'
 my $today = RT::Date->new($session{CurrentUser});
 $today->SetToNow();
 
-# Escape : so id declaration is parsed properly
-my $cf_style = $cf_name;
-$cf_style =~ s/:/\\:/g;
-
 </%init>
-<style type="text/css">
-input#<% $cf_style %> {
-    width: 85px;
-}
-</style>
-<tr>
-  <td class="label"><&|/l&>Add to time</&><br /><&|/l&>worked:</&></td>
-  <td class="value">
+<div class="add-time form-row">
+  <div class="col-3 label"><&|/l&>Add to time</&> <&|/l&>worked:</&></div>
+  <div class="col-auto value">
     <form action="<% RT->Config->Get("WebPath") %>/Ticket/Display.html" method="POST">
       <input type="hidden" name="id" value="<% $TicketObj->id %>">
-      <& /Elements/SelectDate, Name => "$cf_name", current => 0, ShowTime => 0, Default => $today->Date( Timezone => 'user') &>
-      <& /Elements/EditTimeValue,
-          Name    => "UpdateTimeWorked",
-          Default => $ARGS{UpdateTimeWorked} || '',
-          InUnits => $ARGS{'UpdateTimeWorked-TimeUnits'} || 'minutes',
-      &>
-      <input type="submit" value="<% loc('Add') %>">
+      <div class="form-row">
+        <div class="col-auto">
+          <& /Elements/SelectDate, Name => "$cf_name", current => 0, ShowTime => 0, Default => $today->Date( Timezone => 'user') &>
+        </div>
+        <div class="col-auto">
+          <input name="UpdateTimeWorked" type="text" value="<% $ARGS{UpdateTimeWorked} || '' %>" size="5" class="form-control" />
+        </div>
+        <div class="col-auto">
+          <& /Elements/SelectTimeUnits, Name => 'UpdateTimeWorked-TimeUnits', Default => $ARGS{'UpdateTimeWorked-TimeUnits'} || 'minutes' &>
+        </div>
+        <div class="col-auto">
+          <input type="submit" class="btn btn-primary form-control" value="<% loc('Add') %>">
+        </div>
+      </div>
     </form>
-  </td>
-</tr>
-
-% # Render if less than RT 4.4.0, (which includes per user time)
-% if ( RT::Handle::cmp_version($RT::VERSION,'4.4.0') < 0 && $TicketObj->TimeWorked ) {
-<tr class="time worked">
-    <td class="label"><&|/l&>Worked</&>:</td>
-    <td>
-    <table>
-% for my $user ( keys %$time_worked ) {
-    <tr>
-% # add "value" class for $user label is to make the font the same size as value
-    <td class="value"><% $user %>:</td>
-    <td class="value"><& /Ticket/Elements/ShowTime, minutes => $time_worked->{$user} &></td>
-    </tr>
-% }
-    </table>
-    </td>
-</tr>
-% }
+  </div>
+</div>
 
 <%args>
 $TicketObj
diff --git a/html/Tools/MyWeek.html b/html/Tools/MyWeek.html
index 138b79d..df2101d 100644
--- a/html/Tools/MyWeek.html
+++ b/html/Tools/MyWeek.html
@@ -24,45 +24,56 @@ jQuery( function() {
 
 </script>
 <style type="text/css">
-input#Date {
-    width: 177px;
+table.ticket-list.collection-as-table.table td {
+    vertical-align: middle;
 }
+
 .week-links a {
     text-decoration: underline;
 }
-.week-links td:last-child{
-    text-align: right;
+
+div.day_entry {
+    margin-top: 2em;
 }
 </style>
 <div class="time_tracking">
 
 <form>
 % if ( $DefaultTimeUnits ) {
-<input type="hidden" value="<% $DefaultTimeUnits %>" name="DefaultTimeUnits" />
+  <input type="hidden" value="<% $DefaultTimeUnits %>" name="DefaultTimeUnits" />
 % }
-<table>
 % if ( $session{CurrentUser}->HasRight( Object => $RT::System, Right => 'AdminTimesheets' )) {
-<div>
-<tr><td class="label">
-<input type="hidden" name="User" value="<% $User || '' %>" />
-<&|/l&>Go to user</&>:</td>
-<td class="value"><input type="text" name="UserString" value="" data-autocomplete="Users" data-autocomplete-return="Name" data-autocomplete-privileged=1 id="autocomplete-User" /></td>
-</tr>
-</div>
+  <input type="hidden" name="User" value="<% $User || '' %>" />
+  <div class="form-row">
+    <div class="col-3 label">
+      <&|/l&>Go to user</&>:
+    </div>
+    <div class="col-auto value">
+      <input class="form-control" type="text" name="UserString" value="" data-autocomplete="Users" data-autocomplete-return="Name" data-autocomplete-privileged=1 id="autocomplete-User" />
+    </div>
+  </div>
 % }
-<tr><td class="label">
-<&|/l&>Week of (pick any day in week)</&>:</td>
-<td class="value"><& /Elements/SelectDate, ShowTime => 0, Name => 'Date', Default => $date->Date(Format=>'ISO', Timezone => 'user') &></td></tr>
-<tr class="week-links">
-    <td><a href='#' id='previous-week'><< Previous Week</a></td>
-    <td><a href='#' id='next-week'>Next Week >></a></td>
-</tr>
-</table>
+  <div class="form-row">
+    <div class="col-3 label">
+      <&|/l&>Week of (pick any day in week)</&>:
+    </div>
+    <div class="col-auto value">
+      <& /Elements/SelectDate, ShowTime => 0, Name => 'Date', Default => $date->Date(Format=>'ISO', Timezone => 'user') &>
+    </div>
+  </div>
+  <div class="week-links form-row">
+    <div class="col-6">
+      <a href='#' id='previous-week'><< Previous Week</a>
+    </div>
+    <div class="col-6 text-right">
+      <a href='#' id='next-week'>Next Week >></a>
+    </div>
+  </div>
 </form>
 
 % for my $day ( sort keys %week_worked ) {
 <div class="day_entry">
-<h2><% $week_worked{$day}{date}->RFC2822(Time => 0, Timezone => 'user') %></h2>
+<h4><% $week_worked{$day}{date}->RFC2822(Time => 0, Timezone => 'user') %></h4>
 
 % if ( %{$week_worked{$day}{tickets}} ) {
 <form method="POST">
@@ -70,7 +81,7 @@ input#Date {
 % if ( $user->id != $session{CurrentUser}->id ) {
 <input type="hidden" value="<% $session{CurrentUser}->id %>" name="Object-RT::Transaction--CustomField-<% $actor_cf->id %>-Values" />
 % }
-<table class="ticket-list collection-as-table">
+<table class="ticket-list collection-as-table table">
 <tr class="collection-as-table">
 <th class="collection-as-table"><&|/l&>id</&></th>
 <th class="collection-as-table"><&|/l&>Subject</&></th>
@@ -113,7 +124,7 @@ input#Date {
 % } # end for my $day
 </table>
 <div class="submit_day_time_button">
-<input type="submit" class="button" value="Save <% $week_worked{$day}{week_name} %> Updates">
+<input type="submit" class="button btn btn-primary form-control" value="Save <% $week_worked{$day}{week_name} %> Updates">
 </div>
 </form>
 <div class="time_worked_day">
@@ -126,14 +137,23 @@ input#Date {
 % if ( $user->id != $session{CurrentUser}->id ) {
     <input type="hidden" value="<% $session{CurrentUser}->id %>" name="Object-RT::Transaction--CustomField-<% $actor_cf->id %>-Values" />
 % }
-    <&|/l&>Add ticket</&>: <input name="id" type="text" size="8" data-autocomplete="Tickets" />
-    <&|/l&>Time Worked</&>:
-    <& /Elements/EditTimeValue,
-        Name    => "UpdateTimeWorked",
-        Default => '',
-        InUnits => $DefaultTimeUnits || 'minutes',
-    &>
-    <input type="submit" class="button" value="<% loc('Add') %>">
+  <div class="form-row">
+    <div class="col-auto label">
+      <&|/l&>Add ticket</&>:
+    </div>
+    <div class="col-auto">
+      <input class="form-control" name="id" type="text" size="8" data-autocomplete="Tickets" />
+    </div>
+    <div class="col-auto">
+      <input name="UpdateTimeWorked" type="text" size="5" class="form-control" />
+    </div>
+    <div class="col-auto">
+      <& /Elements/SelectTimeUnits, Name => 'UpdateTimeWorked-TimeUnits', Default => $DefaultTimeUnits || 'minutes' &>
+    </div>
+    <div class="col-auto">
+      <input type="submit" class="button btn btn-primary form-control" value="<% loc('Add') %>">
+    </div>
+  </div>
 </form>
 </div></div>
 % }

commit 54ac7543543cfe1112757c363e3286d1a0a2e96a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 26 21:21:04 2019 +0800

    Horizontally align label "Add to time worked"

diff --git a/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList b/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList
index 723b0be..f263638 100644
--- a/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList
+++ b/html/Callbacks/RT-Extension-TimeTracking/Ticket/Elements/ShowBasics/EndOfList
@@ -34,7 +34,7 @@ $today->SetToNow();
 
 </%init>
 <div class="add-time form-row">
-  <div class="col-3 label"><&|/l&>Add to time</&> <&|/l&>worked:</&></div>
+  <div class="col-3 label input"><&|/l&>Add to time</&> <&|/l&>worked:</&></div>
   <div class="col-auto value">
     <form action="<% RT->Config->Get("WebPath") %>/Ticket/Display.html" method="POST">
       <input type="hidden" name="id" value="<% $TicketObj->id %>">

commit ce34742346c170d749f25d8ec0a0b8949dd7fded
Merge: 66ba2fb 54ac754
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat May 23 20:16:17 2020 +0800

    Merge branch '4.6-theme'


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


More information about the Bps-public-commit mailing list