Ver Fonte

Just some templates and routing

What i managed to do... Had a busy day today
Johand há 9 anos atrás
pai
commit
ea5a842d34

+ 14 - 4
app/client/scripts/routes.js

@@ -70,10 +70,6 @@ Router.route("/privacy", {
     template: "privacy"
 });
 
-Router.route("/about", {
-    template: "about"
-});
-
 Router.route("/feedback", {
     template: "feedback"
 })
@@ -146,6 +142,20 @@ Router.route("/admin/alerts", {
     }
 });
 
+Router.route("/admin/news", {
+    waitOn: function() {
+        return [Meteor.subscribe("isModerator", Meteor.userId()), Meteor.subscribe("isAdmin", Meteor.userId())];
+    },
+    action: function() {
+        var user = Meteor.users.findOne({});
+        if (user !== undefined && user.profile !== undefined && (user.profile.rank === "admin")) {
+            this.render("mnews");
+        } else {
+            this.redirect("/");
+        }
+    }
+});
+
 Router.route("/u/:user", function() {
     this.render("profile");
 });

+ 0 - 14
app/client/templates/about.html

@@ -1,14 +0,0 @@
-<template name="about">
-    {{> alerts}}
-    <div class="landing">
-	    {{> header}}
-        <div class="row">
-            <div class="about col-md-8 col-md-offset-2">
-                <h2>About</h2>
-                <p>Musare is a modern, collaborative, open-source Music App.</p>
-                <p>Listen to music in one of the various stations, specific to one genre</p>
-                <p>Built by <a href="https://github.com/AkiraLaine">@AkiraLaine</a>, <a href="https://github.com/KrisVos130">@KrisVos130</a> and <a href="https://github.com/johand199">@johand199</a></p>
-            </div>
-        </div>
-    </div>
-</template>

+ 1 - 0
app/client/templates/admin.html

@@ -52,6 +52,7 @@
                 </div>
                 <div class="row">
                     <a class="btn col l12 s12 m12 waves-effect waves-light" href="/admin/queues">Manage Queues</a> <!-- TODO Make this redirect to the queues -->
+                    <a class="btn col l12 s12 m12 waves-effect waves-light" href="/admin/news">Manage News</a>
                 </div>
             </div>
         </div>

+ 10 - 0
app/client/templates/mnews.html

@@ -0,0 +1,10 @@
+<template name="mnews">
+    <div class="landing">
+	    {{> header}}
+        <div class="row">
+            <div class="about col-md-8 col-md-offset-2">
+              <h1>Manage News Here...</h1>
+            </div>
+        </div>
+    </div>
+</template>