Kaynağa Gözat

Redesigned banned page.

KrisVos130 9 yıl önce
ebeveyn
işleme
27a4c7c674

+ 5 - 5
app/client/scripts/onCreated.js

@@ -17,15 +17,15 @@ Template.landing.onCreated(function(){
         scrolldelay = setTimeout(pageScroll,50);
     }
     pageScroll();
-})
+});
 
 Template.banned.onCreated(function() {
-    if (rTimeInterval !== undefined) {
-        Meteor.clearInterval(rTimeInterval)
+    if (Session.get("rTimeInterval") !== undefined) {
+        Meteor.clearInterval(Session.get("rTimeInterval"))
     }
-    rTimeInterval = Meteor.setInterval(function() {
+    Session.set("rTimeInterval", Meteor.setInterval(function() {
         Session.set("time", new Date().getTime());
-    }, 10000);
+    }, 10000));
     Session.set("ban", Meteor.user().punishments.ban);
 });
 

+ 8 - 10
app/client/scripts/onRendered.js

@@ -1,5 +1,3 @@
-var rTimeInterval = undefined;
-
 Template.queues.onRendered(function() {
     $("#previewModal").on("hidden.bs.modal", function() {
         if (previewEndSongTimeout !== undefined) {
@@ -76,21 +74,21 @@ Template.manageSongs.onRendered(function() {
 });
 
 Template.news.onRendered(function() {
-    if (rTimeInterval !== undefined) {
-        Meteor.clearInterval(rTimeInterval)
+    if (Session.get("rTimeInterval") !== undefined) {
+        Meteor.clearInterval(Session.get("rTimeInterval"))
     }
-    rTimeInterval = Meteor.setInterval(function() {
+    Session.set("rTimeInterval", Meteor.setInterval(function() {
         Session.set("time", new Date().getTime());
-    }, 10000);
+    }, 10000));
 });
 
 Template.room.onRendered(function() {
-    if (rTimeInterval !== undefined) {
-        Meteor.clearInterval(rTimeInterval)
+    if (Session.get("rTimeInterval") !== undefined) {
+        Meteor.clearInterval(Session.get("rTimeInterval"))
     }
-    rTimeInterval = Meteor.setInterval(function() {
+    Session.set("rTimeInterval", Meteor.setInterval(function() {
         Session.set("time", new Date().getTime());
-    }, 10000);
+    }, 10000));
     window.setTimeout(function(){
         console.log("THIS IS ME!")
         var volume = Number(localStorage.getItem("volume")) || 20;

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

@@ -2,12 +2,12 @@
     {{> alerts}}
 
     <div class="row">
-        <div class="col-md-4 col-md-offset-4" id="banned-container">
-            <i class="fa fa-gavel fa-5x" id="ban-icon"></i>
-            <hr/>
-            <h3 class="text text-center">You were banned by {{bannedBy}} <span title="{{bannedAt}}">{{rtime bannedAt}}</span>.</h3>
-            <h3 class="text text-center">You will be unbanned <span title="{{bannedAt}}">{{rtime bannedUntil}}</span>.</h3>
-            <h3 class="text text-center">Reason: {{bannedReason}}</h3>
+        <div class="col-md-4 col-md-offset-4 teal-text" id="banned-container">
+            <i class="material-icons center red-text" style="font-size: 20em; width: 100%;">remove_circle</i>
+            <div class="divider"></div>
+            <h3 class="text text-center"><b>You were banned by</b> {{bannedBy}} <span title="{{bannedAt}}">{{rtime bannedAt}}</span>.</h3>
+            <h3 class="text text-center"><b>You will be unbanned</b> <span title="{{bannedAt}}">{{rtime bannedUntil}}</span>.</h3>
+            <h3 class="text text-center"><b>Reason:</b> {{bannedReason}}</h3>
         </div>
     </div>
 </template>

+ 8 - 0
app/database/schemas.js

@@ -378,6 +378,10 @@ Schemas.UserPunishments = new SimpleSchema({
         type: String,
         label: "Banned By"
     },
+    "ban.bannedReason": {
+        type: String,
+        label: "Banned Reason"
+    },
     "ban.bannedAt": {
         type: Date,
         label: "Banned At"
@@ -399,6 +403,10 @@ Schemas.UserPunishments = new SimpleSchema({
         type: String,
         label: "Banned By"
     },
+    "bans.$.bannedReason": {
+        type: String,
+        label: "Banned Reason"
+    },
     "bans.$.bannedAt": {
         type: Date,
         label: "Banned At"