浏览代码

Worked on adding (edit)description to manageStation page.

KrisVos130 9 年之前
父节点
当前提交
f93685f193
共有 2 个文件被更改,包括 22 次插入0 次删除
  1. 11 0
      app/client/scripts/helpers.js
  2. 11 0
      app/client/templates/manageStation.html

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

@@ -227,6 +227,17 @@ Template.manageSongs.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 () {
         var parts = location.href.split('/');
         parts.pop();

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

@@ -3,6 +3,17 @@
     <div class="landing">
         {{> header}}
         <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="card-content white-text">
                     <h3 class="text-center">{{display}} playlist</h3>