[Bps-public-commit] RT-Extension-FeaturedTickets branch, master, updated. 4d42cf4a2251f403777d4785a8faeef34d055050

Craig Kaiser craig at bestpractical.com
Wed Apr 4 13:39:10 EDT 2018


The branch, master has been updated
       via  4d42cf4a2251f403777d4785a8faeef34d055050 (commit)
       via  95dae615727197ad5f77decd32abedeb221bbf52 (commit)
       via  135573fcb14fc7b7ba474dc19e72f958cc625cbf (commit)
       via  94c5a4676c7104721de14e880fa68be36d65bf11 (commit)
       via  949fba563465356476c76d952b39f7298895e918 (commit)
       via  ce2a5633f9b07a639fe832e322e277288dfc963c (commit)
      from  9c4dc0c333b4c8f4cde34d177d0cdefb7f77101d (commit)

Summary of changes:
 README                              | 55 ++++++++++++++++++-------------------
 etc/initialdata                     |  9 +++++-
 html/NoAuth/Featured/index.html     |  7 +++--
 html/NoAuth/Helpers/NewSponsor      |  2 +-
 lib/RT/Extension/FeaturedTickets.pm | 50 ++++++++++++++++-----------------
 static/css/featured-tickets.css     |  7 +++++
 static/js/featured-tickets.js       |  7 +++++
 7 files changed, 80 insertions(+), 57 deletions(-)

- Log -----------------------------------------------------------------
commit ce2a5633f9b07a639fe832e322e277288dfc963c
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 4 09:46:46 2018 -0400

    Add details custom field

diff --git a/etc/initialdata b/etc/initialdata
index fd4e3be..dad014e 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -37,7 +37,14 @@ our @Queues = ({
          Name        =>'Description',
          Type        =>'Text',
          LookupType  =>'RT::Queue-RT::Ticket',
-         Description =>'Details On Feature',
+         Description =>'Description Of Feature, shown on modal and main page.',
+         ApplyTo     => $QueueName,
+    },
+    {
+         Name        =>'Details',
+         Type        =>'Text',
+         LookupType  =>'RT::Queue-RT::Ticket',
+         Description =>'Details On Feature, shown only in modal',
          ApplyTo     => $QueueName,
     },
 );
\ No newline at end of file
diff --git a/html/NoAuth/Featured/index.html b/html/NoAuth/Featured/index.html
index 117b549..9ef7155 100644
--- a/html/NoAuth/Featured/index.html
+++ b/html/NoAuth/Featured/index.html
@@ -55,6 +55,7 @@
             <form class="pure-form pure-form-aligned" onsubmit="event.preventDefault(); NewSponsor();">
                 <span class="featured-tickets-modal-close" id="featured-tickets-modal-close"></span>
                 <h2><div id="featured-tickets-subject"></div></h2>
+                <h4><div id="featured-tickets-description"></div></h4>
                 <h4><div id="featured-tickets-details"></div></h4>
                 <h4><div id="featured-tickets-goal"></div></h4>
                 <fieldset class="featured-tickets-inputs">
@@ -92,7 +93,7 @@
     </div>
 %   }
 <p><% $ticket->FirstCustomFieldValue('Description') %></p>
-%   my $args = {'ticket_id' => $ticket->Id, 'Subject' => $ticket->Subject, 'Goal' => 'Goal: $' . ($ticket->FirstCustomFieldValue('Goal') ? $ticket->FirstCustomFieldValue('Goal') : 0), 'Details' => $ticket->FirstCustomFieldValue('Description') };
+%   my $args = {'ticket_id' => $ticket->Id, 'Subject' => $ticket->Subject, 'Goal' => 'Goal: $' . ($ticket->FirstCustomFieldValue('Goal') ? $ticket->FirstCustomFieldValue('Goal') : 0), 'Description' => $ticket->FirstCustomFieldValue('Description'), 'Details' => $ticket->FirstCustomFieldValue('Details') };
                     <button onclick="detailsClicked(<% encode_json( $args ) %>)" type="submit" class="featured-tickets-button-choose pure-button" value="<% $ticket->Id %>" name="ticket_id">Details</button>
             </div>
         </div>
diff --git a/static/js/featured-tickets.js b/static/js/featured-tickets.js
index a594b5d..0a86368 100644
--- a/static/js/featured-tickets.js
+++ b/static/js/featured-tickets.js
@@ -51,11 +51,13 @@ function FeaturedTicketsHideModal() {
 
 function detailsClicked( args )  {
     var subject = document.getElementById('featured-tickets-subject');
+    var description = document.getElementById('featured-tickets-description');
     var details = document.getElementById('featured-tickets-details');
     var goal = document.getElementById('featured-tickets-goal');
     var form_ticket_id = document.getElementById('featured-tickets-ticket-id');
 
     subject.innerHTML = args['Subject'];
+    description.innerHTML = args['Description'];
     details.innerHTML = args['Details'];
     goal.innerHTML = args['Goal'];
     form_ticket_id.value = args['ticket_id'];

commit 949fba563465356476c76d952b39f7298895e918
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 4 09:47:41 2018 -0400

    Allow config for sponsors tickets queue

diff --git a/README b/README
index 4379712..aec43b7 100644
--- a/README
+++ b/README
@@ -26,6 +26,11 @@ Configuration
     featured page. It is advisable not to use 'new' as an accepted status,
     or sponsored tickets will also be displayed.
 
+        Set($SponsorsQueue, 'Sponsors');
+
+    Lastly need to set which queue new sponsor tickets will be placed into
+    with the $SponsorsQueue variable.
+
 RT VERSION
     Works with RT 4.4
 
diff --git a/html/NoAuth/Helpers/NewSponsor b/html/NoAuth/Helpers/NewSponsor
index ab7cf64..62774e6 100644
--- a/html/NoAuth/Helpers/NewSponsor
+++ b/html/NoAuth/Helpers/NewSponsor
@@ -34,7 +34,7 @@ if( $ARGS{Email} ){
         if ( $ARGS{Amount} > 0 ) {
             ($ret, $msg) = $ticket->Create(
                 Subject       => $ARGS{Name} . "\'s Sponsor Ticket For: \"". $parent_ticket->Subject ."\"",
-                Queue         => $queue->Name,
+                Queue         => RT->Config->Get('SponsorsQueue'),
                 DependedOnBy  => $ARGS{ticket_id},
                 'CustomField-' . $ticket->LoadCustomFieldByIdentifier('Amount')->Id => $ARGS{Amount},
             );
diff --git a/lib/RT/Extension/FeaturedTickets.pm b/lib/RT/Extension/FeaturedTickets.pm
index cb3e6d0..e630551 100644
--- a/lib/RT/Extension/FeaturedTickets.pm
+++ b/lib/RT/Extension/FeaturedTickets.pm
@@ -33,6 +33,10 @@ $FeaturedTicketStatuses is an array ref, where the ticket statuses that will be
 are specified. Only tickets with one of the statuses in the array will be listed on the featured page. It is advisable
 not to use 'new' as an accepted status, or sponsored tickets will also be displayed.
 
+    Set($SponsorsQueue, 'Sponsors');
+
+Lastly need to set which queue new sponsor tickets will be placed into with the $SponsorsQueue variable.
+
 =head1 RT VERSION
 
 Works with RT 4.4

commit 94c5a4676c7104721de14e880fa68be36d65bf11
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 4 09:48:09 2018 -0400

    Allow esc key to be used to close modal

diff --git a/static/js/featured-tickets.js b/static/js/featured-tickets.js
index 0a86368..31e1f4c 100644
--- a/static/js/featured-tickets.js
+++ b/static/js/featured-tickets.js
@@ -81,4 +81,9 @@ function detailsClicked( args )  {
             FeaturedTicketsPage.style.overflow = 'auto';
         }
     }
+    jQuery(document).keydown(function(event) {
+        if (event.keyCode == 27) {
+            FeaturedTicketsModal.style.display = "none";
+            FeaturedTicketsPage.style.overflow = 'auto';}
+      });
 }

commit 135573fcb14fc7b7ba474dc19e72f958cc625cbf
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 4 09:55:23 2018 -0400

    Change text color of thank you message

diff --git a/static/css/featured-tickets.css b/static/css/featured-tickets.css
index 0d63081..54af98c 100644
--- a/static/css/featured-tickets.css
+++ b/static/css/featured-tickets.css
@@ -306,6 +306,10 @@
     display: none;
 }
 
+.featured-tickets-modal-submitted h2{
+    color: black;
+}
+
 .featured-tickets-modal-close:hover,
 .featured-tickets-modal-close:focus {
     color: black;

commit 95dae615727197ad5f77decd32abedeb221bbf52
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 4 10:58:12 2018 -0400

    Make feature boxes a uniform height

diff --git a/html/NoAuth/Featured/index.html b/html/NoAuth/Featured/index.html
index 9ef7155..0888538 100644
--- a/html/NoAuth/Featured/index.html
+++ b/html/NoAuth/Featured/index.html
@@ -93,10 +93,12 @@
     </div>
 %   }
 <p><% $ticket->FirstCustomFieldValue('Description') %></p>
-%   my $args = {'ticket_id' => $ticket->Id, 'Subject' => $ticket->Subject, 'Goal' => 'Goal: $' . ($ticket->FirstCustomFieldValue('Goal') ? $ticket->FirstCustomFieldValue('Goal') : 0), 'Description' => $ticket->FirstCustomFieldValue('Description'), 'Details' => $ticket->FirstCustomFieldValue('Details') };
-                    <button onclick="detailsClicked(<% encode_json( $args ) %>)" type="submit" class="featured-tickets-button-choose pure-button" value="<% $ticket->Id %>" name="ticket_id">Details</button>
             </div>
+        <div class='detail-stuff'>
+%   my $args = {'ticket_id' => $ticket->Id, 'Subject' => $ticket->Subject, 'Goal' => 'Goal: $' . ($ticket->FirstCustomFieldValue('Goal') ? $ticket->FirstCustomFieldValue('Goal') : 0), 'Description' => $ticket->FirstCustomFieldValue('Description'), 'Details' => $ticket->FirstCustomFieldValue('Details') };
+        <button onclick="detailsClicked(<% encode_json( $args ) %>)" type="submit" class="featured-tickets-button-choose pure-button" value="<% $ticket->Id %>" name="ticket_id">Details</button>
         </div>
+    </div>
 %}
     </div> <!-- end pricing-tables -->
 
diff --git a/static/css/featured-tickets.css b/static/css/featured-tickets.css
index 54af98c..01637fb 100644
--- a/static/css/featured-tickets.css
+++ b/static/css/featured-tickets.css
@@ -105,6 +105,8 @@
     padding: 0 0 1em;
     position: relative;
     background-color: lightgray;
+    overflow: auto;
+    height: 10em;
 }
 
 /*
@@ -198,6 +200,7 @@
     color: #333;
     border-radius: 2em;
     font-weight: bold;
+    top: 5px;
     position: relative;
 }
 

commit 4d42cf4a2251f403777d4785a8faeef34d055050
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 4 10:59:23 2018 -0400

    Update pod doc

diff --git a/README b/README
index aec43b7..3f4f0de 100644
--- a/README
+++ b/README
@@ -1,35 +1,5 @@
 NAME
-    RT-Extension-FeaturedTickets - Generate public web page for featured
-    tickets.
-
-DESCRIPTION
-    Create a webpage that anyone can view (NoAuth), displaying details on
-    featured tickets. A visitor can decide to sign up as a requestor on a
-    linked ticket in the same queue. The tickets featured can be selected
-    from a queue and limited to their statuses.
-
-Configuration
-    Will need to specify two config variables for the extension:
-
-        Set($FeaturedTicketsQueue, 'FeaturedTickets');
-
-    $FeaturedTicketsQueue specifies which queue the featured tickets will be
-    loaded from, when the initialdata is loaded the 'FeaturedTickets' queue
-    is created by default. Renaming this queue is the simplest way to use
-    another queue name but keep the relevant applied custom fields.
-
-        Set($FeaturedTicketStatuses, ['open', ...]);
-
-    $FeaturedTicketStatuses is an array ref, where the ticket statuses that
-    will be accepted from the $FeaturedTicketsQueue are specified. Only
-    tickets with one of the statuses in the array will be listed on the
-    featured page. It is advisable not to use 'new' as an accepted status,
-    or sponsored tickets will also be displayed.
-
-        Set($SponsorsQueue, 'Sponsors');
-
-    Lastly need to set which queue new sponsor tickets will be placed into
-    with the $SponsorsQueue variable.
+    RT-Extension-FeaturedTickets -Public web page for featured tickets.
 
 RT VERSION
     Works with RT 4.4
@@ -38,6 +8,7 @@ INSTALLATION
     perl Makefile.PL
     make
     make install
+    make initdb
         May need root permissions
 
     Edit your /opt/rt4/etc/RT_SiteConfig.pm
@@ -48,14 +19,37 @@ INSTALLATION
         or add RT::Extension::FeaturedTickets to your existing @Plugins
         line.
 
-    Insert into database
-            make initdb
+        $FeaturedTicketsQueue specifies which queue the featured tickets
+        will be loaded from when the initial data is loaded the
+        'FeaturedTickets' queue is created by default. Renaming this queue
+        is the simplest way to use another queue name but keep the relevant
+        applied custom fields.
+
+            Set($FeaturedTicketsQueue, 'FeaturedTickets');
+
+        $FeaturedTicketStatuses is an array ref, where the ticket statuses
+        that will be accepted from the $FeaturedTicketsQueue are specified.
+        Only tickets with one of the statuses in the array will be listed on
+        the featured page.
+
+            Set($FeaturedTicketStatuses, ['open', ...]);
+
+        Set which queue new sponsor tickets will be placed into with the
+        $SponsorsQueue variable.
+
+            Set($SponsorsQueue, 'Sponsors');
 
     Clear your mason cache
             rm -rf /opt/rt4/var/mason_data/obj
 
     Restart your webserver
 
+DESCRIPTION
+    Create a webpage that anyone can view (NoAuth), displaying details on
+    featured tickets. A visitor can decide to sign up as a requestor on a
+    linked ticket in the same queue. The tickets featured can be selected
+    from a queue and limited to their statuses.
+
 AUTHOR
     Best Practical Solutions, LLC <modules at bestpractical.com>
 
diff --git a/lib/RT/Extension/FeaturedTickets.pm b/lib/RT/Extension/FeaturedTickets.pm
index e630551..4363788 100644
--- a/lib/RT/Extension/FeaturedTickets.pm
+++ b/lib/RT/Extension/FeaturedTickets.pm
@@ -9,33 +9,7 @@ RT->AddJavaScript("featured-tickets.js");
 
 =head1 NAME
 
-RT-Extension-FeaturedTickets - Generate public web page for featured tickets.
-
-=head1 DESCRIPTION
-
-Create a webpage that anyone can view (NoAuth), displaying details on featured tickets. A visitor
-can decide to sign up as a requestor on a linked ticket in the same queue. The tickets featured
-can be selected from a queue and limited to their statuses.
-
-=head1 Configuration
-
-Will need to specify two config variables for the extension:
-
-    Set($FeaturedTicketsQueue, 'FeaturedTickets');
-
-$FeaturedTicketsQueue specifies which queue the featured tickets will be loaded from, when
-the initialdata is loaded the 'FeaturedTickets' queue is created by default. Renaming this queue is the simplest
-way to use another queue name but keep the relevant applied custom fields.
-
-    Set($FeaturedTicketStatuses, ['open', ...]);
-
-$FeaturedTicketStatuses is an array ref, where the ticket statuses that will be accepted from the $FeaturedTicketsQueue
-are specified. Only tickets with one of the statuses in the array will be listed on the featured page. It is advisable
-not to use 'new' as an accepted status, or sponsored tickets will also be displayed.
-
-    Set($SponsorsQueue, 'Sponsors');
-
-Lastly need to set which queue new sponsor tickets will be placed into with the $SponsorsQueue variable.
+RT-Extension-FeaturedTickets -Public web page for featured tickets.
 
 =head1 RT VERSION
 
@@ -52,8 +26,11 @@ Works with RT 4.4
 
 =item C<make install>
 
+=item C<make initdb>
+
 May need root permissions
 
+
 =item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
 
 Activate the plugin by adding the below:
@@ -62,9 +39,20 @@ Activate the plugin by adding the below:
 
 or add C<RT::Extension::FeaturedTickets> to your existing C<@Plugins> line.
 
-=item Insert into database
+$FeaturedTicketsQueue specifies which queue the featured tickets will be loaded from when
+the initial data is loaded the 'FeaturedTickets' queue is created by default. Renaming this queue is the simplest
+way to use another queue name but keep the relevant applied custom fields.
+
+    Set($FeaturedTicketsQueue, 'FeaturedTickets');
+
+$FeaturedTicketStatuses is an array ref, where the ticket statuses that will be accepted from the $FeaturedTicketsQueue
+are specified. Only tickets with one of the statuses in the array will be listed on the featured page.
 
-    make initdb
+    Set($FeaturedTicketStatuses, ['open', ...]);
+
+Set which queue new sponsor tickets will be placed into with the $SponsorsQueue variable.
+
+    Set($SponsorsQueue, 'Sponsors');
 
 =item Clear your mason cache
 
@@ -74,6 +62,14 @@ or add C<RT::Extension::FeaturedTickets> to your existing C<@Plugins> line.
 
 =back
 
+=head1 DESCRIPTION
+
+Create a webpage that anyone can view (NoAuth), displaying details on featured tickets. A visitor
+can decide to sign up as a requestor on a linked ticket in the same queue. The tickets featured
+can be selected from a queue and limited to their statuses.
+
+
+
 =head1 AUTHOR
 
 Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>

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


More information about the Bps-public-commit mailing list