Explorar o código

Merge remote-tracking branch 'origin/master'

KrisVos130 %!s(int64=9) %!d(string=hai) anos
pai
achega
ad6ea504f5
Modificáronse 3 ficheiros con 8 adicións e 3 borrados
  1. 5 1
      app/client/app.css
  2. 1 1
      app/client/templates/room.html
  3. 2 1
      app/server/server.js

+ 5 - 1
app/client/app.css

@@ -1171,6 +1171,10 @@ nav form input[type="image"]{
     padding-left: 15px;
     padding-right: 15px;
 }
+.chat-rank {
+    color: white;
+    font-size: 10px;
+}
 .row {
     margin: 0;
 }
@@ -1180,4 +1184,4 @@ nav form input[type="image"]{
 #chat {
     height:100%;
     overflow: auto;
-}
+}

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

@@ -102,7 +102,7 @@
                             <h2 class="chat-title">Chat</h2>
                             <ul id="chat-ul">
                                 {{#each chat}}
-                                <li class="chat-message"><b class="bold">{{this.username}}:</b> {{this.message}}</li>
+                                <li class="chat-message"><small class="chat-rank">[{{this.rank}}]</small> <a style="text-decoration: none" href="/u/{{this.username}}" target="_blank"><b class="bold">{{this.username}}</b></a>: {{this.message}}</li>
                                 <hr>
                                 {{/each}}
                             </ul>

+ 2 - 1
app/server/server.js

@@ -390,13 +390,14 @@ Meteor.methods({
             var user = Meteor.user();
             var time = new Date();
             var username = user.profile.username;
+            var rank = user.profile.rank;
             if (message.length === 0) {
                 throw new Meteor.Error(406, "Message length cannot be 0.");
             }
             if (message.length > 300) {
                 throw new Meteor.Error(406, "Message length cannot be more than 300 characters long..");
             }
-            Chat.insert({type: type, message: message, time: time, username: username});
+            Chat.insert({type: type, rank: rank, message: message, time: time, username: username});
             return true;
         } else {
             throw new Meteor.Error(403, "Invalid permissions.");