[Rt-commit] rt branch, 4.4/ticket-summary-bar, created. rt-4.2.11-239-g5332329

Dustin Graves dustin at bestpractical.com
Mon Oct 19 13:10:19 EDT 2015


The branch, 4.4/ticket-summary-bar has been created
        at  5332329de22fedfb54ec462ae715cb717415717b (commit)

- Log -----------------------------------------------------------------
commit 5332329de22fedfb54ec462ae715cb717415717b
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Tue Oct 6 21:37:45 2015 +0000

    add optional pinned ticket summary display bar to rudder and aileon themes
    
    Fixes: T#157669

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index bd321ee..f60b739 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -487,6 +487,15 @@ our %META;
             Description => 'Enable quote folding?' # loc
         }
     },
+    DisplayTicketSummaryBar => {
+        Section => 'Ticket display',
+        Overridable => 1,
+        SortOrder => 11,
+        Widget => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => 'Show ticket summary bar?' # loc
+        }
+    },
 
     # User overridable locale options
     DateTimeFormat => {
diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index 6f57083..b5e193e 100644
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -50,6 +50,10 @@
     LinkRel => \%link_rel &>
 <& /Elements/Tabs &>
 
+% if (RT->Config->Get("DisplayTicketSummaryBar", $session{'CurrentUser'})) {
+<& /Ticket/Elements/SummaryBar, Ticket => $TicketObj &>
+% }
+
 % $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@Actions, ARGSRef => \%ARGS, Ticket => $TicketObj);
 
 <& /Elements/ListActions, actions => \@Actions &>
diff --git a/share/html/Ticket/Elements/SummaryBar b/share/html/Ticket/Elements/SummaryBar
new file mode 100644
index 0000000..c826999
--- /dev/null
+++ b/share/html/Ticket/Elements/SummaryBar
@@ -0,0 +1,88 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+%#                                          <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<%ARGS>
+$Ticket
+</%ARGS>
+<%INIT>
+my $owner = $Ticket->OwnerObj;
+my $style = $session{'CurrentUser'}
+          ? $session{'CurrentUser'}->Stylesheet
+          : RT->Config->Get('WebDefaultStylesheet');
+
+$m->abort unless ($style eq 'rudder' || $style eq 'aileron');
+</%INIT>
+<div id="ticket-summary-bar">
+    <ul>
+        <li><% loc("#[_1]: [_2]", $Ticket->Id ,$Ticket->Subject || '') %></li>
+        <li>Requestors: <& ShowGroupMembers, Group => $Ticket->Requestors, Ticket => $Ticket &></li>
+        <li>Owner: <& /Elements/ShowUser, User => $owner, Ticket => $Ticket &></li>
+        <li>Status: <% loc($Ticket->Status) %></li>
+    </ul>
+</div>
+
+<script>
+jQuery(function() {
+    var floatSummaryBar = function() {
+        var pageMenu = jQuery('#page-menu');
+        if (!pageMenu.length) return;
+
+        var ticketSummaryBar = jQuery('#ticket-summary-bar');
+        if (!ticketSummaryBar.length) return;
+
+        if (jQuery(document).scrollTop() < pageMenu.offset().top) {
+            ticketSummaryBar.hide();
+            return;
+        }
+
+        ticketSummaryBar.show();
+    };
+
+    floatSummaryBar();
+    jQuery(window).scroll(floatSummaryBar);
+});
+</script>
diff --git a/share/static/css/base/main.css b/share/static/css/base/main.css
index c934db1..52062c7 100644
--- a/share/static/css/base/main.css
+++ b/share/static/css/base/main.css
@@ -31,3 +31,4 @@
 @import "dropzone.css";
 @import "dropzone.customized.css";
 @import "keyboard-shortcuts.css";
+ at import "ticket-summary-bar.css";
diff --git a/share/static/css/base/ticket-summary-bar.css b/share/static/css/base/ticket-summary-bar.css
new file mode 100644
index 0000000..0c6faf0
--- /dev/null
+++ b/share/static/css/base/ticket-summary-bar.css
@@ -0,0 +1,53 @@
+#ticket-summary-bar {
+    display:none;
+}
+
+#ticket-summary-bar ul {
+    position: fixed;
+    margin: 0;
+    padding: 0;
+    top: 3em;
+    left: auto;
+    right: 0;
+    font-size: 0.9em;
+    width: auto;
+    margin-top: 0;
+    background: white;
+    border-left: 1px #aaa solid;
+    border-bottom: 1px #aaa solid;
+    border-radius: 5px 0 0 5px;
+    box-shadow: 0 0 10px rgba(0,0,0,0.4);
+    z-index: 9994;
+    list-style: none;
+    line-height: 1.0;
+    /* stupid vendor prefixes */
+    -moz-border-radius: 5px 0 0 5px;
+    -webkit-border-radius: 5px 0 0 5px;
+    -moz-box-shadow: 0 0 10px rgba(0,0,0,0.4);
+    -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.4);
+}
+
+#ticket-summary-bar ul li {
+    display: inline-block;
+    border-left 1px solid #fff;
+    padding: .75em 1em;
+    text-decoration: none;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    max-width: 20em;
+}
+
+#ticket-summary-bar ul li br {
+    display: none;
+}
+
+#ticket-summary-bar ul li span.user {
+    margin-right: 5px;
+}
+
+#ticket-summary-bar ul li:last-of-type {
+    border-radius: 5px 0 0 5px;
+    -moz-border-radius: 5px 0 0 5px;
+    -webkit-border-radius: 5px 0 0 5px;
+}

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


More information about the rt-commit mailing list