summaryrefslogtreecommitdiff
path: root/rt/share/html/m/_elements
diff options
context:
space:
mode:
authormark <mark>2011-04-27 08:31:03 +0000
committermark <mark>2011-04-27 08:31:03 +0000
commit68fcc90d8e95f1efe0efe07b2f59e5fab2d8c535 (patch)
tree77e67410169c23cfa4499d9bbf779b0005a045fd /rt/share/html/m/_elements
parent9d5ada5763fdeca4f90a7357ab7c384b52c1c41c (diff)
RT mobile UI, #11630
Diffstat (limited to 'rt/share/html/m/_elements')
-rw-r--r--rt/share/html/m/_elements/footer11
-rw-r--r--rt/share/html/m/_elements/full_site_link1
-rw-r--r--rt/share/html/m/_elements/header38
-rw-r--r--rt/share/html/m/_elements/menu63
-rw-r--r--rt/share/html/m/_elements/raw_style417
-rw-r--r--rt/share/html/m/_elements/ticket_list64
-rw-r--r--rt/share/html/m/_elements/ticket_menu31
-rw-r--r--rt/share/html/m/_elements/wrapper15
8 files changed, 640 insertions, 0 deletions
diff --git a/rt/share/html/m/_elements/footer b/rt/share/html/m/_elements/footer
new file mode 100644
index 000000000..f3e0837cc
--- /dev/null
+++ b/rt/share/html/m/_elements/footer
@@ -0,0 +1,11 @@
+<& /elements/footer.html &>
+% if ( 0 ) {
+ <div id="bpscredits">
+ <& /Elements/Logo, ShowName => 0 &>
+ <div id="copyright">
+<&|/l, '', '', '2010', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&>
+</div>
+</div>
+</body>
+</html>
+% }
diff --git a/rt/share/html/m/_elements/full_site_link b/rt/share/html/m/_elements/full_site_link
new file mode 100644
index 000000000..7f43968e0
--- /dev/null
+++ b/rt/share/html/m/_elements/full_site_link
@@ -0,0 +1 @@
+<a id="fullsite" href="<%RT->Config->Get('WebPath')%>/m/index.html?NotMobile=1"><&|/l&>Not using a mobile browser?</&></a>
diff --git a/rt/share/html/m/_elements/header b/rt/share/html/m/_elements/header
new file mode 100644
index 000000000..4af62996c
--- /dev/null
+++ b/rt/share/html/m/_elements/header
@@ -0,0 +1,38 @@
+<%args>
+$title => undef
+$show_home_button => 1
+</%args>
+<%init>
+$r->headers_out->{'Pragma'} = 'no-cache';
+$r->headers_out->{'Cache-control'} = 'no-cache';
+
+my $head = '';
+
+my $etc = '';
+
+</%init>
+<& /elements/header.html, {
+ 'title' => $title,
+ 'head' => $head,
+ 'etc' => $etc,
+ 'nocss' => 1,
+ 'nobr' => 1,
+ 'mobile' => 1,
+} &>
+<link rel="stylesheet" type="text/css" href="<%RT->Config->Get('WebPath')|n%>/m/style.css"/>
+% if ( 0 ) { # Disabled in favor of Freeside header
+<html>
+<head>
+<title><%$title%></title>
+</head>
+<body>
+% if ($show_home_button) {
+% # The align is for older browsers, like the blackberry
+<div id="gohome" align="right">
+<a href="<%RT->Config->Get('WebPath')%>/m/"><&|/l&>Homepage</&></a>
+</div>
+% }
+% if ($title) {
+<h1><%$title%></h1>
+% }
+% } # disabled
diff --git a/rt/share/html/m/_elements/menu b/rt/share/html/m/_elements/menu
new file mode 100644
index 000000000..54e7fe9a3
--- /dev/null
+++ b/rt/share/html/m/_elements/menu
@@ -0,0 +1,63 @@
+<&| /Widgets/TitleBox, class => 'menu'&>
+<ul class="menu">
+% for my $item (@menu) {
+% if (exists $item->{html}) {
+<li><%$item->{html} |n%></li>
+% } else {
+<li><a href="<%RT->Config->Get('WebPath')%><%$item->{url}%>"><%$item->{label}%></a></li>
+% }
+% }
+</ul>
+</&>
+<%init>
+use RT::SavedSearches;
+my @menu = (
+ { html => '<form method="GET" id="search" action="'
+ . RT->Config->Get('WebPath')
+ . '/m/tickets/search">'
+ . loc("Search")
+ . ': <input type="text" name="q" id="q" value=""/>'
+ . '<input type="submit" value="'
+ . loc("Go")
+ . '"/></form>'
+ },
+ { label => loc("New ticket"),
+ url => '/m/ticket/select_create_queue',
+ },
+ { label => loc("Bookmarked tickets"),
+ url => '/m/tickets/search?name=Bookmarked%20Tickets',
+ },
+ { label => loc("Tickets I own"),
+ url => '/m/tickets/search?name=My%20Tickets',
+ },
+ { label => loc("Unowned tickets"),
+ url => '/m/tickets/search?name=Unowned%20Tickets',
+ },
+ { label => loc("All tickets"),
+ url => '/m/tickets/search?query=id!%3d0&order_by=id&order=DESC'
+ },
+);
+
+
+if ( $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', Object => $RT::System))
+ {
+
+ my @Objects = RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects;
+ push @Objects, RT::System->new( $session{'CurrentUser'} )
+ if $session{'CurrentUser'}->HasRight(
+ Object => $RT::System,
+ Right => 'SuperUser'
+ );
+
+ foreach my $object (@Objects) {
+ my @searches = $object->Attributes->Named('SavedSearch');
+ foreach my $search (@searches) {
+ next unless $search->SubValue("SearchType") eq 'Ticket';
+ push @menu, { label => $search->Description, url => '/m/tickets/search?query=' . $search->SubValue("Query").'&order='.$search->SubValue("Order").'&order_by='.$search->SubValue("OrderBy") };
+
+ }
+ }
+}
+push @menu, { label => loc("Logout"), url => '/m/logout', }
+ if !RT->Config->Get('WebExternalAuth');
+</%init>
diff --git a/rt/share/html/m/_elements/raw_style b/rt/share/html/m/_elements/raw_style
new file mode 100644
index 000000000..8c1997743
--- /dev/null
+++ b/rt/share/html/m/_elements/raw_style
@@ -0,0 +1,417 @@
+body {
+ font-family: helvetica, arial, sans-serif;
+ /*background-color: #ccf;*/
+ background-color: #f8f8f8;
+ margin: 0;
+}
+
+h1 {
+ font-size: 1.2em;
+ padding-top: 0.5em;
+ padding-left: 0.2em;
+ display: block;
+ background-color: #f8f8f8;
+
+}
+
+div.buttons {
+ text-align: right;
+ padding-right: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.titlebox-title {
+ font-size: 1.1em;
+ margin-left: 0.5em;
+ margin-top: -1.2em;
+ top: -0.5em;
+ padding: 0.5em;
+ position: relative;
+ display: inline-block;
+ text-decoration: none;
+ /*background-color: #fff;*/
+ background-color: #ccc;
+ -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
+{
+ text-align: left;
+ list-style: none;
+ padding: 0;
+ margin: -0.6em;
+ left: 0;
+}
+
+ul.menu li
+{
+ display: block;
+ margin: 0;
+ padding: 0;
+ font-weight: bold;
+}
+
+ul.ticketlist li:active, ul.ticketlist li:hover,
+ul.menu li:active, ul.menu li:hover {
+ background-color: #eee;
+}
+
+
+ul.menu li
+{
+ display: block;
+ padding: 1em;
+ margin: 0;
+ border:0;
+ border-top-width: 1px;
+ border-top-color: #666;
+ border-style: solid;
+ text-decoration: none;
+}
+
+ul.menu li:first-child{
+ border: none;
+}
+
+ul.menu li#active a
+{
+ color: #800000;
+}
+
+div.titlebox, #bpscredits, .ticket_menu{
+ -moz-border-radius: 1em;
+ -webkit-border-radius: 1em;
+ margin: 0.5em;
+ background-color: #fff;
+ padding-top: 1em;
+ padding-bottom: 0.8em;
+ margin-top: 1.25em;
+ -webkit-box-shadow: #333 0px 0px 5px;
+ -moz-box-shadow: #333 0px 0px 5px;
+ box-shadow: #333 0px 0px 5px;
+ margin-bottom: 1em;
+}
+
+div .titlebox-content {
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+}
+
+hr.clear {
+ display: none;
+}
+
+
+.label, .labeltop {
+ font-weight: normal;
+}
+.value {
+ font-weight: bold;
+ display:inline-block;
+}
+
+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: 1em;
+}
+
+ul.ticketlist li.ticket {
+ padding: 0.5em;
+ font-weight: bold;
+ border-bottom: 1px solid #999;
+
+}
+ul.ticketlist li.ticket:first-child {
+ border-top: 1px solid #999;
+}
+
+ul.ticketlist li.ticket a.ticket{
+ display: inline-block;
+ font-size: 1em;
+ width: 100%;
+ padding: 0.5em;
+ padding-bottom: 5em;
+ margin-bottom: -5em;
+}
+ul.ticketlist li.ticket div.metadata {
+}
+
+
+ul.ticketlist li.ticket div.metadata div {
+ padding: 0.2em;
+ font-size:0.8em;
+ display: block;
+}
+
+ul.ticketlist li.ticket div.metadata .label {
+ display: inline-block;
+ width: 6em;
+ font-size: 0.8em;
+ text-align: right;
+ color: #666;
+}
+
+div#paging {
+ text-align: center;
+}
+
+.ticket-reply .titlebox-title, .titlebox.search .titlebox-title, .titlebox.menu .titlebox-title, .ticket_menu .titlebox-title, .history .titlebox-title, #ticket-create-basics .titlebox-title{
+ display: none;
+}
+
+a {
+ color: #000;
+}
+
+.ticket_menu a, .menu a {
+ text-decoration: none;
+}
+
+ul.menu a {
+ padding: 0.5em;
+ margin-top: -0.5em;
+ margin-bottom: -0.5em;
+ display: inline-block;
+ width: 100%;
+}
+
+ul.menu a:after {
+ color: #666;
+ float: right;
+ content: ">";
+ font-size: 1.5em;
+ padding: 0;
+ margin: 0;
+ padding-right: 1em;
+
+}
+
+ul.menu form {
+ display: inline;
+}
+
+ul.menu form * {
+ display: inline;
+}
+
+
+ul.menu form input[type=text] {
+ width: 7em;
+}
+
+ul.menu form input{
+
+ width: auto;
+ padding: 0.5em;
+ margin: -0.5em;
+ margin-left: 1em;
+}
+
+.ticket_menu {
+ text-align: center;
+}
+
+.ticket_menu ul {
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+
+.ticket_menu ul li {
+
+ display: inline-block;
+ text-align: center;
+ padding-bottom: 0.25em;
+ padding-top: 0.25em;
+ font-size: 1em;
+ width: 28%;
+ padding-right: 0.3em;
+ padding-left: 0.2em;
+ border-right: 1px solid #000;
+}
+.ticket_menu ul li:last-child {
+ padding-right: 0;
+ border-right: 0;
+}
+
+.ticket-info-reminders table {
+
+ width: 100%;
+}
+
+#ticket-create .label:after {
+ content: ": ";
+ padding-right: 0.25em;
+
+}
+
+#ticket-create .content-label {
+ width: auto;
+ display: block;
+ text-align: left;
+
+}
+
+#ticket-show .label, .login-body .label {
+ display: inline-block;
+ text-align: right;
+ width: 6em;
+ padding-right: 0.25em;
+ font-size: 0.8em;
+}
+
+.login-body .value {
+ width: auto;
+}
+
+.history ul.history-list {
+ padding: 0;
+ margin: 0;
+ padding-bottom: 2em;
+}
+
+
+.history ul.history-list li:first-child {
+ border-top: 1px solid #ccc;
+}
+
+.history ul.history-list li {
+ list-style: none;
+ border-bottom: 1px solid #ccc;
+ padding: 0.5em;
+}
+
+.history .age {
+ display: inline-block;
+ min-width: 8em;
+ text-align: right;
+
+}
+
+div#login-box div.titlebox {
+ width: 100%;
+ margin-left:auto;
+ margin-right: auto;
+}
+
+div#login-box input[type=text], div#login-box input[type=password] {
+ width: 100%;
+}
+
+#bpscredits img {
+ padding-bottom: 1em;
+}
+
+
+
+#bpscredits {
+ float: right;
+ text-align: right;
+ width: auto;
+ font-size: 0.8em;
+ padding: 1em;
+}
+
+
+:focus {
+ background-color: #ffc;
+ border-color: #000;
+ border-weight: 3px;
+}
+
+input[type=submit], input[type=button], button, #paging a {
+ border: 2px outset;
+ margin: 0.3em;
+ padding: 0.3em;
+ padding-left: 0.6em;
+ padding-right: 0.6em;
+ -moz-border-radius: 0.5em;
+ -webkit-border-radius: 0.5em;
+ background-color: #006699;
+ color: #fff;
+}
+
+form {
+
+ margin:0;
+}
+
+#gohome {
+ position: absolute;
+ top: 0;
+ right: 0;
+ border-left: 1px solid black;
+ border-bottom: 1px solid black;
+ -moz-border-radius-bottomleft: 1em;
+ -webkit-border-bottom-left-radius: 1em;
+ padding: 0.5em;
+ background-color: #fff;
+}
+
+#gohome a {
+ font-size: 1em;
+ padding: 0.25em;
+ color: #000;
+}
+
+div.txn-content {
+
+ font-size:0.8em;
+ padding-left:1em;
+ padding-top:0.5em;
+ margin-top: 0.5em;
+ margin-left: 2em;
+ padding-bottom: 0.5em;
+ border-left: 5px solid #00c;
+
+}
+
+.label {
+ text-align: left;
+ width: 10em;
+ color: #666;
+ display: block;
+ padding-bottom: 0.2em;
+ padding-right: 0.2em;
+
+}
+
+div.entry, tr.input-row {
+ margin-bottom: 0.25em;
+ padding-bottom: 0.25em;
+ border-bottom: 1px solid #ccc;
+ display: block;
+ width: 100%;
+ min-height: 1em;
+}
+
+
+input, input[type=text], input[type=password], select {
+ width: 100%;
+}
+
+.timefield input {
+ width: 5em;
+}
+
+.timefield select {
+ width: auto;
+}
+
+
+textarea {
+ width: 100%;
+}
+
+a#fullsite {
+ padding-left: 1em;
+}
diff --git a/rt/share/html/m/_elements/ticket_list b/rt/share/html/m/_elements/ticket_list
new file mode 100644
index 000000000..822efe8d6
--- /dev/null
+++ b/rt/share/html/m/_elements/ticket_list
@@ -0,0 +1,64 @@
+<%args>
+$order => undef
+$order_by => undef
+$query => ''
+$page => 1
+</%args>
+<%init>
+my $collection = RT::Tickets->new($session{'CurrentUser'});
+$collection->FromSQL($query);
+$collection->RowsPerPage(10);
+$collection->GotoPage($page-1);
+# XXX: ->{'order_by'} is hacky, but there is no way to check if
+# collection is ordered or not
+if ( $order_by) {
+ my @order_by = split /\|/, $order_by;
+ my @order = split /\|/,$order;
+ $collection->OrderByCols(
+ map { { FIELD => $order_by[$_], ORDER => $order[$_] } }
+ ( 0 .. $#order_by )
+ );
+}
+
+
+
+$collection->RedoSearch();
+
+if ($page > 1 && ! @{$collection->ItemsArrayRef||[]}) {
+ RT::Interface::Web::Redirect( RT->Config->Get('WebURL')."m/tickets/search?page=".($page-1)."&query=".$query."&order=$order&order_by=$order_by");
+}
+
+</%init>
+<&| /m/_elements/wrapper, title =>
+loc("Found [quant,_1,ticket]",$collection->Count) &>
+<&|/Widgets/TitleBox, class => 'search'
+&>
+<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 &></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="created"><span class="label"><&|/l&>Created</&>:</span> <%$ticket->CreatedObj->AgeAsString()%></div>
+% if ($ticket->Priority) {
+<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%>&order=<%$order%>&order_by=<%$order_by%>">Back</a>
+% }
+Page <%$page%>
+
+<a href="<%RT->Config->Get('WebPath')%>/m/tickets/search?page=<%$page+1%>&query=<%$query%>&order=<%$order%>&order_by=<%$order_by%>">Next</a>
+</div>
+</&>
+</&>
diff --git a/rt/share/html/m/_elements/ticket_menu b/rt/share/html/m/_elements/ticket_menu
new file mode 100644
index 000000000..257b066bc
--- /dev/null
+++ b/rt/share/html/m/_elements/ticket_menu
@@ -0,0 +1,31 @@
+<%args>
+$ticket
+</%args>
+<div class="ticket_menu">
+<ul>
+% for my $item (@menu) {
+<li><a href="<%RT->Config->Get('WebPath')%><%$item->{url}%>"><%$item->{label}%></a></li>
+% }
+</ul>
+</div>
+<%init>
+my @menu = (
+{ label => loc("Basics"),
+ 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))-5;
+
+</%init>
diff --git a/rt/share/html/m/_elements/wrapper b/rt/share/html/m/_elements/wrapper
new file mode 100644
index 000000000..794385db4
--- /dev/null
+++ b/rt/share/html/m/_elements/wrapper
@@ -0,0 +1,15 @@
+<%args>
+$title => ''
+$show_home_button => 1
+</%args>
+<%init>
+if ($m->request_args->{'NotMobile'}) {
+ $session{'NotMobile'} = 1;
+ RT::Interface::Web::Redirect(RT->Config->Get('WebURL'));
+ $m->abort();
+}
+$m->comp('header', title => $title, show_home_button => $show_home_button);
+$m->out($m->content);
+$m->comp('footer');
+$m->abort();
+</%init>