Browse Source

worked on report modal

Akira Laine 9 years ago
parent
commit
463c59f9dd
3 changed files with 46 additions and 77 deletions
  1. 8 40
      app/client/scripts/helpers.js
  2. 4 0
      app/client/stylesheets/app.css
  3. 34 37
      app/client/templates/room.html

+ 8 - 40
app/client/scripts/helpers.js

@@ -390,48 +390,16 @@ Template.room.helpers({
     private: function () {
         return Rooms.findOne({type: Session.get("type")}).private === true;
     },
-    report: function () {
-        return Session.get("reportObj");
-    },
-    reportSong: function () {
-        return Session.get("reportSong");
-    },
-    reportTitle: function () {
-        return Session.get("reportTitle");
-    },
-    reportAuthor: function () {
-        return Session.get("reportAuthor");
-    },
-    reportDuration: function () {
-        return Session.get("reportDuration");
-    },
-    reportAudio: function () {
-        return Session.get("reportAudio");
-    },
-    reportAlbumart: function () {
-        return Session.get("reportAlbumart");
-    },
-    reportOther: function () {
-        return Session.get("reportOther");
-    },
-    currentSong: function () {
+    currentSong: function(){
         return Session.get("currentSong");
     },
-    previousSong: function () {
-        return Session.get("previousSong");
-    },
-    currentSongR: function () {
-        return Session.get("currentSongR");
-    },
-    previousSongR: function () {
-        return Session.get("previousSongR");
-    },
-    reportingSong: function () {
-        if (Session.get("reportPrevious")) {
-            return Session.get("previousSongR");
-        } else {
-            return Session.get("currentSongR");
-        }
+    reportSong: function(){
+        Meteor.setInterval(function(){
+            if($("#report-song").is(":checked")){
+                Session.set("reportSong", true)
+            } else { Session.set("reportSong", false) }
+        }, 500);
+        return Session.get("reportSong");
     },
     votes: function () {
         console.log(Rooms.findOne({type: Session.get("type")}).votes);

+ 4 - 0
app/client/stylesheets/app.css

@@ -373,6 +373,10 @@ hr{
     line-height: 25px;
 }
 
+.report-layer-2{
+    margin-left: 38px;
+}
+
 /*Media queries stay on the bottom*/
 @media screen and (max-width: 990px){
     .card i{

+ 34 - 37
app/client/templates/room.html

@@ -276,44 +276,41 @@
     <!--Report modal-->
     <div id="report_modal" class="modal">
         <div class="modal-content container">
-                {{#if previousSongR}}
-                <button type="button" id="report-prev" class="btn btn-warning btn-lg btn-block">Report previous song ({{previousSongR.title}})</button>
-                {{/if}}
-                <button type="button" id="report-curr" class="btn btn-warning btn-lg btn-block" disabled>Report current song ({{currentSongR.title}})</button>
-
-                <h3 class="text-primary"><b>Reporting:</b> {{reportingSong.title}} by {{reportingSong.artist}}</h3>
-
-                <div class="report-layer-1">
-                    <div class="checkbox">
-                        <input class="checkbox-box" type="checkbox" id="report-song">
-                        <label for="report-song">
-                            Song
-                        </label>
-                    </div>
-                    <!-- Layer2 -->
-                    {{#if reportSong}}
-                        <div class="report-layer-2" id="report-song-list">
-                            <div class="checkbox">
-                                <input type="checkbox" id="report-song-not-playing">
-                                <label for="report-song-not-playing">
-                                    Not playing
-                                </label>
-                            </div>
-                            <div class="checkbox">
-                                <input type="checkbox" id="report-song-does-not-exist">
-                                <label for="report-song-does-not-exist">
-                                    Does not exist
-                                </label>
-                            </div>
-                            <div class="checkbox">
-                                <input type="checkbox" id="report-song-other">
-                                <label for="report-song-other">
-                                    Other: <br>
-                                    <textarea class="other-textarea" id="report-song-other-ta" type="text"></textarea>
-                                </label>
+            <h4>Reporting: {{currentSong.title}} by {{currentSong.artist}}</h4>
+            <div class="report-layer-1">
+                <p>
+                    <input type="checkbox" id="report-song">
+                    <label for="report-song">
+                        Song
+                    </label>
+                </p>
+                <!-- Layer2 -->
+                {{#if reportSong}}
+                    <div class="report-layer-2" id="report-song-list">
+                        <p>
+                            <input type="checkbox" id="report-song-not-playing">
+                            <label for="report-song-not-playing">
+                                Not playing
+                            </label>
+                        </p>
+                        <p>
+                            <input type="checkbox" id="report-song-does-not-exist">
+                            <label for="report-song-does-not-exist">
+                                Does not exist
+                            </label>
+                        </p>
+                        <p>
+                            <input type="checkbox" id="report-song-other">
+                            <label for="report-song-other">
+                                Other:
+                            </label>
+                            <div class="input-field">
+                                <textarea class="materialize-textarea" id="report-song-other-ta" type="text"></textarea>
+                                <label for="report-song-other-ta">What is the issue?</label>
                             </div>
-                        </div>
-                    {{/if}}
+                        </p>
+                    </div>
+                {{/if}}
                     <div class="checkbox">
                         <input class="checkbox-box" type="checkbox" id="report-title">
                         <label for="report-title">