2
0
Эх сурвалжийг харах

Worked on adding (edit)description to manageStation page.

KrisVos130 9 жил өмнө
parent
commit
f93685f193

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

@@ -227,6 +227,17 @@ Template.manageSongs.helpers({
 });
 });
 
 
 Template.manageStation.helpers({
 Template.manageStation.helpers({
+    editingDesc: function() {
+        return Session.get("editingDesc");
+    },
+    description: function() {
+        var parts = location.href.split('/');
+        parts.pop();
+        var id = parts.pop();
+        var type = id.toLowerCase();
+
+        return Rooms.findOne({type: type}).roomDesc;
+    },
     songs: function () {
     songs: function () {
         var parts = location.href.split('/');
         var parts = location.href.split('/');
         parts.pop();
         parts.pop();

+ 11 - 0
app/client/templates/manageStation.html

@@ -3,6 +3,17 @@
     <div class="landing">
     <div class="landing">
         {{> header}}
         {{> header}}
         <div class="row">
         <div class="row">
+            <div class="col m8 s8 l8 offset-l2 offset-m1 offset-s2 admin-playlist-panel card-panel teal accent-3">
+                <div class="card-content white-text">
+                    <h3 class="text-center">Description</h3>
+                    Meteor.call("editRoomDesc", Session.get("roomDesc"), description);
+                    {{#if editingDesc}}
+                        <input val="{{description}}" id="editDesc"/>
+                    {{else}}
+                        <h5>{{description}}</h5>
+                    {{/if}}
+                </div>
+            </div>
             <div class="col m8 s8 l8 offset-l2 offset-m1 offset-s2 admin-playlist-panel card-panel teal accent-3">
             <div class="col m8 s8 l8 offset-l2 offset-m1 offset-s2 admin-playlist-panel card-panel teal accent-3">
                 <div class="card-content white-text">
                 <div class="card-content white-text">
                     <h3 class="text-center">{{display}} playlist</h3>
                     <h3 class="text-center">{{display}} playlist</h3>