[Bps-public-commit] rt-extension-mobileui branch, master, updated. ed6eb9ad71324bf2d6b6cf2369bf21dfe8159d97

Jesse Vincent jesse at bestpractical.com
Mon Jul 26 18:07:22 EDT 2010


The branch, master has been updated
       via  ed6eb9ad71324bf2d6b6cf2369bf21dfe8159d97 (commit)
      from  23b6ba001b09a7e45f067b523a1fcec190ae6538 (commit)

Summary of changes:
 .../RT-Extension-MobileUI/index.html/Initial       |    2 +-
 html/m/_elements/header                            |    7 +
 html/m/_elements/menu                              |    2 +-
 html/m/_elements/ticket_list                       |   51 +++++++--
 html/m/_elements/ticket_menu                       |   36 ++++++
 html/m/_elements/wrapper                           |    2 +-
 html/m/style.css                                   |  120 +++++++++++++++++++-
 html/m/ticket/history                              |   11 ++-
 html/m/ticket/show                                 |    1 +
 html/m/tickets/search                              |    4 +
 10 files changed, 214 insertions(+), 22 deletions(-)
 create mode 100644 html/m/_elements/ticket_menu
 create mode 100644 html/m/tickets/search

- Log -----------------------------------------------------------------
commit ed6eb9ad71324bf2d6b6cf2369bf21dfe8159d97
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Jul 26 15:09:08 2010 -0700

    snapshot.

diff --git a/html/Callbacks/RT-Extension-MobileUI/index.html/Initial b/html/Callbacks/RT-Extension-MobileUI/index.html/Initial
index 39df5e8..130c2af 100644
--- a/html/Callbacks/RT-Extension-MobileUI/index.html/Initial
+++ b/html/Callbacks/RT-Extension-MobileUI/index.html/Initial
@@ -1,5 +1,5 @@
 <%init>
 if (($ENV{'HTTP_USER_AGENT'} || '') !~ /(?:hiptop|Blazer|Novarra|Vagabond|SonyEricsson|Symbian|NetFront|UP.Browser|UP.Link|Windows CE|MIDP|J2ME|DoCoMo|J-PHONE|PalmOS|PalmSource|iPhone|iPod|AvantGo|Nokia|Android)/io && !$session{'NotMobile'})  {
-    RT::Interface::Web::Redirect('/m');
+    RT::Interface::Web::Redirect(RT->Config->Get('WebURL') ."/m")
 }
 </%init>
diff --git a/html/m/_elements/header b/html/m/_elements/header
index 8655c34..c285ad6 100644
--- a/html/m/_elements/header
+++ b/html/m/_elements/header
@@ -1,5 +1,12 @@
+<%args>
+$title => undef
+</%args>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="<%RT->Config->Get('WebPath')|n%>/m/style.css"/>
+<title><%$title%></title>
 </head>
 <body>
+% if ($title) {
+<h1><%$title%></h1>
+% }
diff --git a/html/m/_elements/menu b/html/m/_elements/menu
index 9bfb339..7e946f8 100644
--- a/html/m/_elements/menu
+++ b/html/m/_elements/menu
@@ -1,7 +1,7 @@
 <&| /Widgets/TitleBox &>
 <ul class="menu">
 % for my $item (@menu) {
-<li><a href="<%$item->{url}%>"><%$item->{label}%></li>
+<li><a href="<%RT->Config->Get('WebPath')%><%$item->{url}%>"><%$item->{label}%></a></li>
 % }
 </ul>
 </&>
diff --git a/html/m/_elements/ticket_list b/html/m/_elements/ticket_list
index c51abbb..f9e47af 100644
--- a/html/m/_elements/ticket_list
+++ b/html/m/_elements/ticket_list
@@ -1,20 +1,47 @@
 <%args>
 $query => ''
-$page => ''
+$page => 1
 </%args>
 <%init>
+my $collection = RT::Tickets->new($session{'CurrentUser'});
+$collection->FromSQL($query);
+$collection->RowsPerPage(10);
+$collection->GotoPage($page-1);
+$collection->OrderBy( FIELD => 'id', ORDER => 'desc');
+$collection->RedoSearch();
+ 
+if ($page > 1 && ! @{$collection->ItemsArrayRef||[]}) {
+    RT::Interface::Web::Redirect( RT->Config->Get('WebURL')."/m/tickets/search?page=".($page-1)."&query=".$query);
+}
+
 </%init>
-<&| /m/_elements/wrapper &>
-<&|/Widgets/TitleBox &>
-<& /Elements/CollectionList,
-    Query => $query,
-    OrderBy => 'id',
-    Order => 'desc',
-    Rows => '25',
-    Page => $page,
-    Format => q{'<a href="__WebPath__/m/ticket/show?id=__id__">__id__</a>','<a href="__WebPath__/m/ticket/show?id=__id__">Subject</a>',Status,Requestors,Owner,Priority},
-    Class => 'RT::Tickets',
-    BaseURL => '/m/list/'
+<&| /m/_elements/wrapper, title => 
+loc("Found [quant,_1,ticket]",$collection->Count) &>
+<&|/Widgets/TitleBox, 
 &>
+<ul class="ticketlist">
+% while (my $ticket = $collection->Next()) {
+<li class="ticket">
+<a class="ticket" href="<%RT->Config->Get('WebPath')%>/m/ticket/show?id=<%$ticket->id%>"><%$ticket->id%>: <%$ticket->Subject%></a>
+<div class="metadata">
+<%perl>
+
+</%perl>
+<div class="requestors"><span class="label"><&|/l&>Requestors</&>:</span> <& /Ticket/Elements/ShowGroupMembers, Group => $ticket->Requestors, Ticket => $ticket &> <%$ticket->CreatedObj->AgeAsString()%></div>
+<div class="status"><span class="label"><&|/l&>Status</&>:</span> <%$ticket->Status%></div>
+<div class="owner"><span class="label"><&|/l&>Owner</&>:</span> <& /Elements/ShowUser, User => $ticket->OwnerObj, Ticket => $ticket &></div>
+<div class="priority"><span class="label"><&|/l&>Priority</&>:</span> <%$ticket->Priority%></div>
+</div>
+</li>
+% }
+</ul>
+<div id="paging">
+% if ($page > 1) { 
+<a href="<%RT->Config->Get('WebPath')%>/m/tickets/search?page=<%$page-1%>&query=<%$query%>">Back</a>
+% }
+Page <%$page%>
+
+<a href="<%RT->Config->Get('WebPath')%>/m/tickets/search?page=<%$page+1%>&query=<%$query%>">Next</a>
+</div>
 </&>
 </&>
diff --git a/html/m/_elements/ticket_menu b/html/m/_elements/ticket_menu
new file mode 100644
index 0000000..48fd46e
--- /dev/null
+++ b/html/m/_elements/ticket_menu
@@ -0,0 +1,36 @@
+<%args>
+$ticket
+</%args>
+<div class="ticket_menu">
+<&| /Widgets/TitleBox &>
+<ul>
+% for my $item (@menu) {
+<li style="width: <%$width%>%;"><a href="<%RT->Config->Get('WebPath')%><%$item->{url}%>"><%$item->{label}%></a></li>
+% }
+</ul>
+</&>
+</div>
+<%init>
+my @menu = ( 
+{ label =>  loc("Ticket"),
+  url => '/m/ticket/show?id='.$ticket->id
+},
+ {
+    label => loc("History"),
+  url => '/m/ticket/history?id='.$ticket->id
+    },
+ {
+    label => loc("Modify"),
+    url => '/m/ticket/modify?id='.$ticket->id
+    },
+{
+    label => loc("Reply"),
+    url => '/m/ticket/reply?id='.$ticket->id
+}
+
+
+); 
+
+my $width = int(100/ ($#menu +1))-1;
+
+</%init>
diff --git a/html/m/_elements/wrapper b/html/m/_elements/wrapper
index f0da9e3..98f5dec 100644
--- a/html/m/_elements/wrapper
+++ b/html/m/_elements/wrapper
@@ -1,5 +1,5 @@
 <%init>
-$m->comp('header');
+$m->comp('header', title => $ARGS{'title'});
 $m->out($m->content);
 $m->comp('footer');
 $m->abort();
diff --git a/html/m/style.css b/html/m/style.css
index c5fbc34..efe9144 100644
--- a/html/m/style.css
+++ b/html/m/style.css
@@ -2,12 +2,25 @@ body {
     font-family: helvetica, arial, sans-serif;
     background-color: #ccf;
     text-rendering: optimizeLegibility;
+    margin: 0;
 }
 
 .titlebox-title {
     font-size: 1.3em;
-    padding-top: 1em;
+    margin-left: 0.5em;
+    margin-top: -1.2em;
+    top: -0.5em;
+    padding: 0.5em;
+    position: relative;
+    display: inline-block;
     text-decoration: underline;
+    background-color: #fff;
+    -moz-border-radius: 0.25em;
+    -webkit-border-radius: 0.25em;
+    -webkit-box-shadow: #333 0px 0px 5px;
+    -moz-box-shadow: #333 0px 0px 5px;
+    box-shadow: #333 0px 0px 5px;
+
 }
 
 ul.menu
@@ -53,12 +66,21 @@ ul.menu li#active a
 }
 
 div.titlebox {
-    padding: 1em;
     -moz-border-radius: 1em;
     -webkit-border-radius: 1em;
-    margin: 1em;
+    margin: 0.5em;
     background-color: #fff;
+    padding-top: 1em;
+    margin-top: 1.5em;
+    -webkit-box-shadow: #333 0px 0px 5px;
+    -moz-box-shadow: #333 0px 0px 5px;
+    box-shadow: #333 0px 0px 5px;
+    margin-bottom: 2em;
+}
 
+div .titlebox-content {
+    padding-left: 0.5em;
+    padding-right: 0.5em;
 }
 
 hr.clear {
@@ -69,7 +91,97 @@ hr.clear {
 .label, .labeltop {
     text-align: right;
     display: inline-block;
-    width: 6em;
+    width: 8em;
+    font-weight: normal;
+}
+.value { 
+    font-weight: bold;
+}
+
+ul.ticketlist {
+    list-style: none;
+    padding-left: -0.5em;
+    padding-right: -0.5em; /* to counteract the titlebox and get shading to the end*/
+    margin-left: -0.5em;
+    margin-right: -0.5em;
+    padding: 0em;
+    padding-bottom: 2em;
+}
+
+ul.ticketlist li.ticket {
+    padding: 0.5em;
+    font-weight: bold;
+    border-bottom: 1px solid black;
+    
+}
+ul.ticketlist li.ticket:first-child {
+    border-top: 1px solid black;
+}
+
+ul.ticketlist li.ticket a.ticket{
+    font-size: 1.3em;
+}
+
+ul.ticketlist li.ticket div {
+    padding: 0.2em;
+}
+
+ul.ticketlist li.ticket .label{
+    font-weight: normal;
+}
+
+
+ul.ticketlist li.ticket br {
+    display: none;
+}
+
+ul.ticketlist li.ticket div.metadata div {
+    display: inline-block;
+}
+
+div#paging {
+    text-align: center;
+}
+
+.ticket_menu .titlebox-title, .history .titlebox-title{
+    display: none;
+}
+
+.ticket_menu ul li a{
+    text-decoration: none;
+    color: #000;
+}
+
+.ticket_menu ul li {
+    display: inline-block;
+    list-style: none;
+    text-align: center;
+    padding-bottom: 0.25em;
+    padding-top: 0.25em;
+    font-size: 1.5em;
+}
+.ticket_menu ul {
+    width: 100%;
+    display: block;
+    padding: 0;
+    margin: 0;
+}
+
+.history ul.history-list {
+    padding: 0;
+    margin: 0;
+    padding-bottom: 2em;
+}
+
+
+.history ul.history-list li:first-child {
+    border-top: 1px solid black;
+}
+
+.history ul.history-list li {
+    list-style: none;
+    border-bottom: 1px solid black;
+    padding: 0.5em;
 }
 
 %$m->abort();
diff --git a/html/m/ticket/history b/html/m/ticket/history
index 6dbd3fd..61806d5 100644
--- a/html/m/ticket/history
+++ b/html/m/ticket/history
@@ -7,11 +7,14 @@ $t->Load($id);
 my $history = $t->Transactions()->ItemsArrayRef;
 </%init>
 <&| /m/_elements/wrapper &>
-<ul>
+<div class="history">
+<& /m/_elements/ticket_menu, ticket => $t &>
+<&|/Widgets/TitleBox &>
+<ul class="history-list">
 % for my $entry (@$history) {
 <li>
-<% $entry->CreatedAsString() %>
- <& /Elements/ShowUser, User => $entry->CreatorObj &> 
+<% $entry->CreatedObj->AgeAsString() %> -
+<& /Elements/ShowUser, User => $entry->CreatorObj &> - 
 <%$entry->BriefDescription%>
 % if ($entry->Type !~ /EmailRecord/) {
 <div class="txn-content">
@@ -22,3 +25,5 @@ my $history = $t->Transactions()->ItemsArrayRef;
 % }
 </ul>
 </&>
+</div>
+</&>
diff --git a/html/m/ticket/show b/html/m/ticket/show
index 9909a85..2449d88 100644
--- a/html/m/ticket/show
+++ b/html/m/ticket/show
@@ -99,6 +99,7 @@ if (@Actions) {
 </%init>
 <&| /m/_elements/wrapper &>
 
+<& /m/_elements/ticket_menu, ticket => $TicketObj &>
 
     <&| /Widgets/TitleBox, title => loc('The Basics'),
         class => 'ticket-info-basics',
diff --git a/html/m/tickets/search b/html/m/tickets/search
new file mode 100644
index 0000000..0464e78
--- /dev/null
+++ b/html/m/tickets/search
@@ -0,0 +1,4 @@
+<%init>
+ $m->comp('../_elements/ticket_list', query => $ARGS{'query'}, page => $ARGS{'page'});
+$m->abort();
+</%init>

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



More information about the Bps-public-commit mailing list