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

Craig Kaiser craig at bestpractical.com
Thu Mar 22 16:23:31 EDT 2018


The branch, master has been updated
       via  d40b83218c68a94c894bf866fa0296eef626d013 (commit)
       via  f56b9d6bc759544d79c5e422838df915e28cd0d1 (commit)
      from  860eaba971ad93a627e19bad4b6ed3cfd45874ea (commit)

Summary of changes:
 html/NoAuth/Featured/index.html | 22 ++++++++++++----------
 static/css/featured-tickets.css | 11 ++++++++++-
 static/js/Featured.js           | 24 ++++++++++++++++++------
 3 files changed, 40 insertions(+), 17 deletions(-)

- Log -----------------------------------------------------------------
commit f56b9d6bc759544d79c5e422838df915e28cd0d1
Author: craig Kaiser <craig at bestpractical.com>
Date:   Thu Mar 22 09:34:43 2018 -0400

    Clear form after submit

diff --git a/static/js/Featured.js b/static/js/Featured.js
index 0da284d..a4d3351 100644
--- a/static/js/Featured.js
+++ b/static/js/Featured.js
@@ -9,17 +9,21 @@ var form = jQuery("#new-sponsor").serialize();
 
 // Create our new ticket for the sponsor
 function NewSponsor() {
-    var name = document.getElementById('form-name').value;
-    var email = document.getElementById('form-email').value;
-    var amount = document.getElementById('form-amount').value;
-    var ticket_id = document.getElementById('form-ticket-id').value;
+    var name = document.getElementById('form-name');
+    var email = document.getElementById('form-email');
+    var amount = document.getElementById('form-amount');
+    var ticket_id = document.getElementById('form-ticket-id');
 
     jQuery.ajax({
             type: 'POST',
-            url: "http://localhost:8080/NoAuth//Helpers/LoadObj?Name=" + name +";Email=" + email + ";Amount=" + amount + ";ticket_id="+ticket_id,
+            url: "http://localhost:8080/NoAuth//Helpers/LoadObj?Name=" + name.value +";Email=" + email.value + ";Amount=" + amount.value + ";ticket_id="+ticket_id.value,
             dataType: "json",
     });
+
     modal.style.display = "none";
+    name.value = '';
+    email.value = '';
+    amount.value = '';
 };
 
 function detailsClicked( args )  {

commit d40b83218c68a94c894bf866fa0296eef626d013
Author: craig Kaiser <craig at bestpractical.com>
Date:   Thu Mar 22 15:16:33 2018 -0400

    Improve styling on pop-up page

diff --git a/html/NoAuth/Featured/index.html b/html/NoAuth/Featured/index.html
index bb9458c..f0f45a7 100644
--- a/html/NoAuth/Featured/index.html
+++ b/html/NoAuth/Featured/index.html
@@ -50,17 +50,19 @@ crossorigin="anonymous"></script>
 <div id="myModal" class="modal">
     <!-- Modal content -->
     <div class="modal-content details">
+        <span class="close">×</span>
         <h1 class='sponsor-header'>Sponsor This Feature!</h1>
-        <h1 id='sponsor-subject'></h1>
-        <h3 id='sponsor-details'></h3>
-        <h2 id='sponsor-goal'></h2>
-
-        <form class='box' id='sponsor-form' name='new-sponsor' onsubmit="event.preventDefault(); NewSponsor();">
-            <input placeholder="Name" name="Name" id='form-name' type="text">
-            <input placeholder="Email" type="email" id='form-email' name="Email" required>
-            <input placeholder="Contribution Amount" id='form-amount' name="Amount">
-            <input name="ticketId" id='form-ticket-id' type="hidden">
-            <button>Submit</button>
+        <hr>
+                <h1 id='sponsor-subject'></h1>
+                <h4 class='feature-details' id='sponsor-details'></h4>
+                <h4 id='sponsor-goal'></h4>
+
+        <form id='sponsor-form' name='new-sponsor' onsubmit="event.preventDefault(); NewSponsor();">
+            <input class="sponsor-form" placeholder="Name" name="Name" id='form-name' type="text">
+            <input class="sponsor-form" placeholder="Email" type="email" id='form-email' name="Email" required>
+            <input class="sponsor-form" placeholder="Contribution Amount" id='form-amount' name="Amount">
+            <input class="sponsor-form" name="ticketId" id='form-ticket-id' type="hidden">
+            <button class="button-choose pure-button">Submit</button>
         </form>
     </div>
 </div>
diff --git a/static/css/featured-tickets.css b/static/css/featured-tickets.css
index 278efa9..0889a12 100644
--- a/static/css/featured-tickets.css
+++ b/static/css/featured-tickets.css
@@ -231,6 +231,16 @@ p {
 
 }
 
+input {
+    display: block;
+    margin: 0 auto;
+    widows: 65%;
+}
+
+#sponsor-form {
+    align-content: center;
+}
+
 /*
  * -- PHONE MEDIA QUERIES --
  * On phones, we want to reduce the height and font-size of the banner further
@@ -288,7 +298,6 @@ p {
     margin: center;
     padding: 35px;
     border: 2px solid #006699;
-    border-radius: 20px/50px;
     background-clip: padding-box;
     text-align: center;
   }
diff --git a/static/js/Featured.js b/static/js/Featured.js
index a4d3351..c5c519f 100644
--- a/static/js/Featured.js
+++ b/static/js/Featured.js
@@ -4,9 +4,17 @@ var modal = document.getElementById('myModal');
 // Get the button that opens the modal
 var btn = document.getElementById("myBtn");
 
+// Get the <span> element that closes the modal
+var span = document.getElementsByClassName("close")[0];
+
 // Our new sponsor form
 var form = jQuery("#new-sponsor").serialize();
 
+// When the user clicks on <span> (x), close the modal
+span.onclick = function() {
+    modal.style.display = "none";
+}
+
 // Create our new ticket for the sponsor
 function NewSponsor() {
     var name = document.getElementById('form-name');
@@ -34,7 +42,7 @@ function detailsClicked( args )  {
 
     subject.innerHTML = args['Subject'];
     details.innerHTML = args['Details'];
-    goal.innerHTML = "Goal: $" + args['Goal'];
+    goal.innerHTML = "Goal: $" + ( args['Goal'] ? args['Goal'] : 0 );
     form_ticket_id.value = args['ticket_id'];
 
     modal.style.display = "block";

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


More information about the Bps-public-commit mailing list