Browse Source

Merge branch 'february_release' of https://github.com/Musare/Musare into february_release

Akira Laine 9 years ago
parent
commit
bdd403c364

+ 9 - 31
app/client/scripts/events.js

@@ -1464,14 +1464,14 @@ Template.room.events({
     "click #report-prev": function (e) {
         if (Session.get("previousSong") !== undefined) {
             Session.set("reportPrevious", true);
-            $("#report-prev").prop("disabled", true);
-            $("#report-curr").prop("disabled", false);
+            $("#report-prev").addClass("disabled");
+            $("#report-curr").removeClass("disabled");
         }
     },
     "click #report-curr": function (e) {
         Session.set("reportPrevious", false);
-        $("#report-prev").prop("disabled", false);
-        $("#report-curr").prop("disabled", true);
+        $("#report-prev").removeClass("disabled");
+        $("#report-curr").addClass("disabled");
     },
     "click #report-modal": function () {
         Session.set("currentSongR", Session.get("currentSong"));
@@ -1607,15 +1607,14 @@ Template.room.events({
             Session.set(camelCase, e.target.checked);
         }*/
     },
-    "click #report-modal-button": function(){
-        $("#report-pre-song-button").removeClass("disabled")
-        Session.set("reportingSong", Session.get("currentSong"));
-        $("#report-which").html(Session.get("currentSong").title + ' <span class="thin">by</span> ' + Session.get("currentSong").artist);
-    },
     "click #report-song-button": function () {
         var room = Session.get("type");
         var reportData = {};
-        reportData.song = Session.get("reportingSong").mid;
+        if (Session.get("reportPrevious") === false) {
+            reportData.song = Session.get("previousSongR").mid;
+        } else {
+            reportData.song = Session.get("currentSongR").mid;
+        }
         reportData.type = [];
         reportData.reason = [];
 
@@ -1629,7 +1628,6 @@ Template.room.events({
 
         console.log(reportData);
         Meteor.call("submitReport", room, reportData, function () {
-            $("#report-pre-song-button").removeClass("disabled")
             $("report_modal").closeModal();
         });
     },
@@ -1646,26 +1644,6 @@ Template.room.events({
         Meteor.setTimeout(function(){
             $(".dropdown-button").click();
         }, 10);
-    },
-    "click #report-pre-song-button": function(){
-        $("#report-pre-song-button").addClass("disabled")
-        var previousSong = {}
-        var songs = Songs.find({"genres": Session.get("type")}).fetch();
-        for(var i = 0; i < songs.length; i++){
-            if(songs[i].mid === Session.get("currentSong").mid){
-                if(i === 0){
-                    previousSong.title = songs[i].title;
-                    previousSong.artist = songs[i].artist;
-                } else {
-                    previousSong.title = songs[i-1].title;
-                    previousSong.artist = songs[i-1].artist;
-                    previousSong.mid = songs[i-1].mid;
-                    Session.set("reportingSong", previousSong);
-                }
-            }
-        }
-        console.log(previousSong.title + ' <span class="thin">by</span> ' + previousSong.artist);
-        $("#report-which").html(previousSong.title + ' <span class="thin">by</span> ' + previousSong.artist);
     }
 });
 // Settings Template

+ 13 - 0
app/client/scripts/helpers.js

@@ -281,6 +281,12 @@ Template.manageStation.helpers({
 });
 
 Template.room.helpers({
+    currentSongR: function() {
+        return Session.get("currentSongR");
+    },
+    previousSongR: function() {
+        return Session.get("previousSongR");
+    },
     editingSong: function() {
         return Session.get("editingSong");
     },
@@ -401,6 +407,13 @@ Template.room.helpers({
     currentSong: function(){
         return Session.get("currentSong");
     },
+    reportingSong: function() {
+        if (!Session.get("reportPrevious")) {
+            return Session.get("currentSongR");
+        } else {
+            return Session.get("previousSongR");
+        }
+    },
     reportSong: function(){
         Meteor.setInterval(function(){
             if($("#report-song").is(":checked")){

+ 1 - 1
app/client/stylesheets/app.css

@@ -409,6 +409,6 @@ hr{
     margin-right: 3px;
 }
 
-.side-nav li {
+.chat-ul li {
     padding: 0 !important;
 }

+ 1 - 1
app/client/templates/faq.html

@@ -27,7 +27,7 @@
                     <div class="collapsible-body"><p>If you can't access your account, please send an email to <a href="mailto:krisvos130@gmail.com">krisvos130@gmail.com</a> asking for support.</p></div>
                 </li>
                 <li>
-                    <div class="collapsible-header"><i class="material-icons">help</i>How do I reset my password?</div>
+                    <div class="collapsible-header"><i class="material-icons">help</i>How do I change my password?</div>
                     <div class="collapsible-body"><p>Go to the <a href="/settings">settings</a> page. You will be able to reset your password there.</p></div>
                 </li>
                 <li>

+ 6 - 6
app/client/templates/project.html

@@ -4,8 +4,8 @@
         <div class="col s12 l4 m8 offset-l4 offset-m2">
             <h3 class="black-text thin">The Project</h3>
             <hr>
-            <div class="card teal accent-3">
-                <div class="card-content white-text">
+            <div class="card white">
+                <div class="card-content black-text">
                     <span class="card-title">What is Musare?</span>
                     <p>
                         Musare is a modern, open source, collaborative music app where a user can go into any of our "stations" and
@@ -13,8 +13,8 @@
                     </p>
                 </div>
             </div>
-            <div class="card teal accent-3">
-                <div class="card-content white-text">
+            <div class="card white">
+                <div class="card-content black-text">
                     <span class="card-title">What is Musare's end goal?</span>
                     <p>
                         Musare's end goal is to be a collaborative way of discovering new music. We are working hard to implement
@@ -22,8 +22,8 @@
                     </p>
                 </div>
             </div>
-            <div class="card teal accent-3">
-                <div class="card-content white-text">
+            <div class="card white">
+                <div class="card-content black-text">
                     <span class="card-title">How can I help?</span>
                     <p>
                         There are essentially 3 main ways in which you can help us:

+ 12 - 5
app/client/templates/room.html

@@ -279,9 +279,9 @@
     </div>
     <!--Report modal-->
     <div id="report_modal" class="modal">
-        <div class="modal-content container">
+        <div class="modal-content">
             <h4>Reporting:</h4>
-            <h5 id="report-which">{{currentSong.title}} <span class="thin">by</span> {{currentSong.artist}}</h5>
+            <h5 id="report-which">{{reportingSong.title}} <span class="thin">by</span> {{reportingSong.artist}}</h5>
             <div class="report-layer-1">
                 <div>
                     <input type="checkbox" id="report-song">
@@ -477,8 +477,11 @@
                     {{/if}}
                 </div>
             </div>
-            <a id="report-song-button" class="waves-effect waves-light btn">Report Song</a>
-            <a id="report-pre-song-button" class="waves-effect waves-light btn">Report Previous Song</a>
+            <a id="report-song-button" class="waves-effect waves-light btn btn-block red">Submit Song Report</a>
+            {{#if previousSongR}}
+                <a id="report-prev" class="waves-effect waves-light btn btn-block">Report Previous Song</a>
+            {{/if}}
+                <a id="report-curr" class="waves-effect waves-light btn btn-block">Report Current Song</a>
         </div>
         <div class="divider"></div>
         <div class="modal-footer">
@@ -496,7 +499,11 @@
             dismissible: true,
             opacity: .5,
             in_duration: 500,
-            out_duration: 200
+            out_duration: 200,
+            ready: function() {
+                Session.set("currentSongR", Session.get("currentSong"));
+                Session.set("previousSongR", Session.get("previousSong"));
+            }
         });
         $(".dropdown-button").dropdown({
             belowOrigin: true