From e83205c66c30456c657053287a271b074e8da015 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 19 May 2010 23:37:20 +0000 Subject: [PATCH] calenaring (RT#6467): a little UI cleanup goes a long way --- rt/share/html/NoAuth/css/calendar.css | 41 +++++++++++- rt/share/html/Search/Calendar.html | 120 +++++++++++++++++++++++----------- 2 files changed, 120 insertions(+), 41 deletions(-) diff --git a/rt/share/html/NoAuth/css/calendar.css b/rt/share/html/NoAuth/css/calendar.css index e313dff99..1eec5d948 100644 --- a/rt/share/html/NoAuth/css/calendar.css +++ b/rt/share/html/NoAuth/css/calendar.css @@ -14,27 +14,62 @@ color:#505050; } .date { -text-align: right; + text-align: right; + background-color: #f8f8ff; + width:100%; +} + +.offmonthdate { + text-align: right; + background-color: #f8f8f8; + width:100%; +} + +.todaysdate { + text-align: right; + background-color: #fc6; /*#fad163*/ + width:100%; } table.rtxcalendar { width:100%; border-collapse: collapse; - border: 1px dotted #d0d0d0; + border: 1px solid #d0d0d0; margin-bottom: 6px; } table.rtxcalendar td { border: 1px solid #d7d7d7; + background: #fff; vertical-align: top; + width: 14%; } table.rtxcalendar th { border: 1px solid #d7d7d7; - background: #eee; + background: #eef; } table.rtxcalendar tbody th { border: 1px solid #d7d7d7; background: #eee; font-weight: normal; } + +table.rtxcalendar td.offmonth { + background: #f8f8f8; + color: #aaa; +} + +table.rtxcalendar td.today { + background: #ffe; /*#fed;*/ + border: 1px solid #fc6; +} + +table.rtxcalendar td.yesterday { + border-right: none; +} + +table.rtxcalendar td.aweekago { + border-bottom: none; +} + diff --git a/rt/share/html/Search/Calendar.html b/rt/share/html/Search/Calendar.html index e5a1c28a5..0fb5414aa 100644 --- a/rt/share/html/Search/Calendar.html +++ b/rt/share/html/Search/Calendar.html @@ -28,9 +28,9 @@ $NewQuery => 0 % } «<%$rtdate->GetMonth($PMonth)%> - -Calendar Preferences and Help - + + <% $rtdate->GetMonth($Month). " $Year" %> + % my ($NMonth, $NYear) = ($Month + 1, $Year); % if ($NMonth > 11) { @@ -43,32 +43,50 @@ $NewQuery => 0 + - % for ( @{$week{$weekstart}} ) { % } + % while ($date <= $end) { +% +% my $offmonth = $date->month != ($Month + 1); +% my $is_today = (DateTime->compare($today, $date) == 0); +% my $is_yesterday = (DateTime->compare($yesterday, $date) == 0); +% my $is_aweekago = (DateTime->compare($aweekago, $date) == 0); + + + +% $date = $set->next($date); % if ( $date->day_of_week == $startday_of_week ) { - + % } - -% $date = $set->next($date); -% if ( $date->day_of_week == $startday_of_week ) { - -% } + % } @@ -79,16 +97,8 @@ $NewQuery => 0 - - -
<%$rtdate->GetWeekday($_)%>
+
<%$date->day%>
+ +% my $sp = 3; +% for my $t ( @{ $Tickets{$date->strftime("%F")} } ) { +% $sp--; + <& /Elements/CalendarEvent, Object => $t, Date => $date, DateTypes => \%DateTypes &> +% } + <% ($sp>0) ? '
'x$sp : '' |n %> + +
<% $date->week_number %>
-

<%$date->day%>

-% for my $t ( @{ $Tickets{$date->strftime("%F")} } ) { -<& /Elements/CalendarEvent, Object => $t, Date => $date, DateTypes => \%DateTypes &> -% } -
«<%$rtdate->GetMonth($PMonth)%> -<%$rtdate->GetMonth($NMonth)%>» -
- - - - - + +
+
-<& /Elements/Submit&> +%# <& /Elements/Submit&> + +
- : <&|/l&>Created
- : <&|/l&>Due
- : <&|/l&>Resolved
- : <&|/l&>Last Updated
- : <&|/l&>Created, <&|/l&>Due
- : <&|/l&>Reminders
- : <&|/l&>Starts
- : <&|/l&>Started
- : <&|/l&>Starts, <&|/l&>Due
+
+<%$rtdate->GetMonth($NMonth)%>» +
+ + + + + +% foreach my $legend (keys %legend) { + + + + +% } +
+
+ Calendar Preferences and Help
+ + +% my $more = 0; +% foreach ( @{$legend{$legend}} ) { + <% $more++ ? ', ' : '' %> + <&|/l&><% $_ %> +% } +
- +<%ONCE> + +my %legend = ( + 'created' => ['Created'], + 'due' => ['Due'], + 'resolved' => ['Resolved'], + 'updated' => ['Last Updated'], + 'created_due' => ['Created','Due'], + 'reminder' => ['Reminders'], + 'started' => ['Started'], + 'starts_due' => ['Starts','Due'], +); + + <%INIT> use RTx::Calendar qw(FirstDay LastDay); @@ -143,6 +185,8 @@ my $startday_of_week = ${$week{$weekstart}}[0] || 7; my $endday_of_week = ${$week{$weekstart}}[-1] || 7; my $today = DateTime->today; +my $yesterday = $today->clone->subtract( days=>1 ); +my $aweekago = $today->clone->subtract( days=>7 ); my $date = FirstDay($Year, $Month + 1, $startday_of_week ); my $end = LastDay ($Year, $Month + 1, $endday_of_week ); -- 2.11.0