From d60bad5165d2e3a3731f1243d7ed2d330f588025 Mon Sep 17 00:00:00 2001
From: degygii <lukas.gygi@gmail.com>
Date: Sun, 11 Dec 2016 12:37:20 +0100
Subject: [PATCH] ability to upload pictures at event creation

---
 tools/events.tool | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/tools/events.tool b/tools/events.tool
index 1a566e6..3b40b0a 100644
--- a/tools/events.tool
+++ b/tools/events.tool
@@ -169,22 +169,22 @@
                     <div class="form-group">
                         <label for="img_infoscreen">Infoscreen Image</label>
                         <input type="file" id="img_infoscreen" name="myFile"/>
-                        <img src="" id="actual_img_infoscreen">
+                        <img class="event-image" visibility="invisble" src="" id="actual_img_infoscreen">
                     </div>
-                    <div class="form-group">
+                    <div class="form-group"> 
                         <label for="img_banner">Banner Image</label>
                         <input type="file" id="img_banner"/>
-                        <img src="" id="actual_img_banner">
+                        <img class="event-image" visibility="invisble" src="" id="actual_img_banner">
                     </div>
                     <div class="form-group">
                         <label for="img_poster">Poster Image</label>
                         <input type="file" id="img_poster"/>
-                        <img src="" id="actual_img_poster">
+                        <img class="event-image" visibility="invisble" src="" id="actual_img_poster">
                     </div>
                     <div class="form-group">
                         <label for="img_thumbnail">Thumbnail</label>
                         <input type="file" id="img_thumbnail"/>
-                        <img src="" id="actual_img_thumbnail">
+                        <img class="event-image" visibility="invisble" src="" id="actual_img_thumbnail">
                     </div>
 
 
@@ -242,6 +242,11 @@
         white-space: nowrap;
         max-width: none;
     }
+
+    .event-image {
+        margin-top: 10px;
+        width: 100%;
+    }
 </style>
 
 <script type="text/javascript">
@@ -534,11 +539,13 @@
 
             console.log(JSON.stringify(newEvent));
             if(isNew) {
-                var response = amivcore.events.POST(form, function(ret) {
+                var response = amivcore.events.POST(newEvent, function(ret) {
                     if (!ret.hasOwnProperty('_status') || ret['_status'] != 'OK')
                         tools.log(JSON.stringify(ret.responseJSON['_issues']), 'e');
                     else {
-                        events.uploadCallback();
+                        console.log(ret);
+                        curEventData = ret;
+                        events.uploadCallback(form);
                     }
                 });
             } 
-- 
GitLab