From 5a51f73f743b357b15f87266c3a088b4e7eaa4c5 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 8 Dec 2017 01:43:01 +0000 Subject: [PATCH] Stargazers name glow yellow --- webapp/titanembeds/blueprints/gateway/gateway.py | 5 ++++- webapp/titanembeds/static/css/embedstyle.css | 4 ++++ webapp/titanembeds/static/js/embed.js | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/blueprints/gateway/gateway.py b/webapp/titanembeds/blueprints/gateway/gateway.py index 013b74d..f86ce58 100644 --- a/webapp/titanembeds/blueprints/gateway/gateway.py +++ b/webapp/titanembeds/blueprints/gateway/gateway.py @@ -1,5 +1,5 @@ from titanembeds.utils import socketio, guild_accepts_visitors, get_client_ipaddr, discord_api, check_user_in_guild, get_guild_channels, update_user_status, guild_webhooks_enabled -from titanembeds.database import db, GuildMembers, get_guild_member, Guilds +from titanembeds.database import db, GuildMembers, get_guild_member, Guilds, get_badges from flask_socketio import Namespace, emit, disconnect, join_room, leave_room import functools from flask import request, session @@ -153,6 +153,7 @@ class Gateway(Namespace): "avatar": None, "color": None, "avatar_url": None, + "stargazer": False, } member = db.session.query(GuildMembers).filter(GuildMembers.guild_id == guild_id, GuildMembers.username == name, GuildMembers.discriminator == discriminator).first() if member: @@ -163,6 +164,7 @@ class Gateway(Namespace): usr["color"] = self.get_user_color(guild_id, usr["id"]) if (usr["avatar"]): usr["avatar_url"] = "https://cdn.discordapp.com/avatars/{}/{}.jpg".format(usr["id"], usr["avatar"]) + usr["stargazer"] = "star" in get_badges(member.user_id) else: member = db.session.query(GuildMembers).filter(GuildMembers.guild_id == guild_id, GuildMembers.nickname == name, GuildMembers.discriminator == discriminator).first() if member: @@ -173,5 +175,6 @@ class Gateway(Namespace): usr["color"] = self.get_user_color(guild_id, usr["id"]) if (usr["avatar"]): usr["avatar_url"] = "https://cdn.discordapp.com/avatars/{}/{}.jpg".format(usr["id"], usr["avatar"]) + usr["stargazer"] = "star" in get_badges(member.user_id) emit("lookup_user_info", usr) self.teardown_db_session() \ No newline at end of file diff --git a/webapp/titanembeds/static/css/embedstyle.css b/webapp/titanembeds/static/css/embedstyle.css index fad66a8..e73d48b 100644 --- a/webapp/titanembeds/static/css/embedstyle.css +++ b/webapp/titanembeds/static/css/embedstyle.css @@ -205,6 +205,10 @@ nav .brand-logo { cursor: pointer; } +#chatcontent .chatusername.stargazer { + text-shadow: 2px 2px 10px yellow; +} + /*#chatcontent > p > span {*/ /* display: table-row*/ /*}*/ diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index c4b10a9..9f79bd2 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -1163,6 +1163,9 @@ } else { parent.find(".chatusername").css("color", null); } + if (usr.stargazer) { + parent.find(".chatusername").addClass("stargazer"); + } if (usr.avatar_url) { parent.attr("discord_userid", usr.id); parent.find(".authoravatar").prop("src", usr.avatar_url);