[Bps-public-commit] RT-Extension-FeaturedTickets branch, master, updated. 5e8950044d4c42dc2865ef9868644bd3760641dd

Craig Kaiser craig at bestpractical.com
Thu Apr 5 12:02:41 EDT 2018


The branch, master has been updated
       via  5e8950044d4c42dc2865ef9868644bd3760641dd (commit)
      from  14c31569e744eee94338881ec571ec919ed5ab6c (commit)

Summary of changes:
 html/NoAuth/Featured/index.html | 18 ++++++++++++------
 static/css/featured-tickets.css | 24 ++++++++++--------------
 static/js/featured-tickets.js   |  7 +++++++
 3 files changed, 29 insertions(+), 20 deletions(-)

- Log -----------------------------------------------------------------
commit 5e8950044d4c42dc2865ef9868644bd3760641dd
Author: craig Kaiser <craig at bestpractical.com>
Date:   Thu Apr 5 11:48:27 2018 -0400

    Truncate description if it is too long for box

diff --git a/html/NoAuth/Featured/index.html b/html/NoAuth/Featured/index.html
index 8b16f16..b5401d5 100644
--- a/html/NoAuth/Featured/index.html
+++ b/html/NoAuth/Featured/index.html
@@ -61,15 +61,15 @@
                 <fieldset class="featured-tickets-inputs">
                     <div class="pure-control-group">
                         <label for="featured-tickets-name">Name</label>
-                        <input id="featured-tickets-name" placeholder="Name">
+                        <input class="featured-tickets-inputs"id="featured-tickets-name" placeholder="Name">
                     </div>
                     <div class="pure-control-group">
                         <label for="featured-tickets-email">Email</label>
-                        <input id="featured-tickets-email" placeholder="Email" type="email" required>
+                        <input class="featured-tickets-inputs" id="featured-tickets-email" placeholder="Email" type="email" required>
                     </div>
                     <div class="pure-control-group">
                         <label for="featured-tickets-amount">Amount</label>
-                        <input id="featured-tickets-amount" placeholder="Contribution Amount">
+                        <input class="featured-tickets-inputs" id="featured-tickets-amount" placeholder="Contribution Amount">
                     </div>
                     <input id="featured-tickets-ticket-id" type="hidden">
                     <button type="submit" class="featured-tickets-button-choose pure-button">Submit</button>
@@ -92,11 +92,17 @@
         <div class='ribbon'>Funded!</div>
     </div>
 %   }
-<p><% $ticket->FirstCustomFieldValue('Description') %></p>
+    <p>
+% if ( length($ticket->FirstCustomFieldValue('Description')) > 140 ) {
+    <% substr $ticket->FirstCustomFieldValue('Description'), 0, 140 %> ...
+% } else {
+    <% $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>
+    <button onclick="detailsClicked(<% encode_json( $args ) %>)" type="submit" class="featured-tickets-button-choose featured-tickets-button-page pure-button" value="<% $ticket->Id %>" name="ticket_id">Details</button>
+</div>
 %}
     </div> <!-- end pricing-tables -->
 </div>
diff --git a/static/css/featured-tickets.css b/static/css/featured-tickets.css
index f37ea0f..e05cee2 100644
--- a/static/css/featured-tickets.css
+++ b/static/css/featured-tickets.css
@@ -200,10 +200,13 @@
     color: #333;
     border-radius: 2em;
     font-weight: bold;
-    top: 80%;
     position: sticky;
 }
 
+.featured-tickets-button-page {
+    margin-top: -120px;
+}
+
 .featured-tickets-information-head {
     color: black;
     font-weight: 500;
@@ -254,7 +257,13 @@
     .banner-head {
         font-size: 3em;
     }
+}
 
+ at media (max-width: 450px) {
+    .featured-tickets-inputs {
+        width: 70%;
+    }
+}
 /*
  * -- DETAILS POP-UP --
  */
@@ -376,17 +385,4 @@
     -moz-box-shadow: 0px 0px 3px rgba(51, 30, 170, 0.3);
     box-shadow: 0px 0px 3px rgba(51, 30, 170, 0.3);
     }
-
- .featured-tickets-flash {
-     background: #006699;
-     text-align: center;
-     width: 30%;
-     position: absolute;
-     color:white;
-     border-radius:10px;
-     font-family:Tahoma,Geneva,Arial,sans-serif;font-size:11px;
-     padding:10px 10px 10px 10px;
-     margin:10px;
-     font-size: medium;
- }
 }
diff --git a/static/js/featured-tickets.js b/static/js/featured-tickets.js
index 31e1f4c..532b48c 100644
--- a/static/js/featured-tickets.js
+++ b/static/js/featured-tickets.js
@@ -49,6 +49,13 @@ function FeaturedTicketsHideModal() {
     ticket_id = '';
 }
 
+function truncate(string){
+    if (string.length > 5)
+       return string.substring(0,5)+'...';
+    else
+       return string;
+ };
+
 function detailsClicked( args )  {
     var subject = document.getElementById('featured-tickets-subject');
     var description = document.getElementById('featured-tickets-description');

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


More information about the Bps-public-commit mailing list