From 12c1f6583ddacd59556cfc806e1a5dce8e5e167f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 31 Jan 2018 12:52:43 +0100 Subject: [PATCH 1/4] tiny update --- static/royal.css | 4 ++++ templates/diario.html | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/static/royal.css b/static/royal.css index f3445d9e..5f94ee2a 100644 --- a/static/royal.css +++ b/static/royal.css @@ -94,6 +94,10 @@ th { font-size: small; } +.saver-data { + font-size: smaller; +} + .timestamp-data { text-align: right; } \ No newline at end of file diff --git a/templates/diario.html b/templates/diario.html index a5047b4d..fdfccffd 100644 --- a/templates/diario.html +++ b/templates/diario.html @@ -17,16 +17,16 @@
+ {% if entry.saver %} +
+ Salvato da {{ entry.saver.royal.username }} +
+ {% endif %} {% if entry.author %}
{{ entry.author.royal.username }}
{% endif %} - {% if entry.saver %} -
- {{ entry.saver.royal.username }} -
- {% endif %}
From 3ed92e8c10f2f5e80abccb042e414435ede3e3d0 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 2 Feb 2018 08:36:31 +0100 Subject: [PATCH 2/4] Add Listening and Watching support --- telegrambot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/telegrambot.py b/telegrambot.py index 39d6a065..554d4e91 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -80,10 +80,10 @@ def cmd_discord(bot: Bot, update: Update): for member in members_in_channels[channel]: if member.status == DiscordStatus.offline and member.voice.voice_channel is None: continue - if member.bot: - continue # Online status emoji - if member.status == DiscordStatus.online: + if member.bot: + message += "🤖 " + elif member.status == DiscordStatus.online: message += "🔵 " elif member.status == DiscordStatus.idle: message += "⚫️ " @@ -111,6 +111,10 @@ def cmd_discord(bot: Bot, update: Update): message += f" | 🎮 {member.game.name}" elif member.game.type == 1: message += f" | 📡 [{member.game.name}]({member.game.url})" + elif member.game.type == 2: + message += f" | 🎧 {member.game.name}" + elif member.game.type == 3: + message += f" | 📺 {member.game.name}" message += "\n" message += "\n" bot.send_message(update.message.chat.id, message, disable_web_page_preview=True) From d9b7615843d911609a3ab9e2478b38e01e8b9203 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 2 Feb 2018 08:38:14 +0100 Subject: [PATCH 3/4] Remove not used imports --- db.py | 3 +-- telegrambot.py | 2 +- webserver.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/db.py b/db.py index 1620ec25..8c49ba9e 100644 --- a/db.py +++ b/db.py @@ -1,8 +1,7 @@ -import time import datetime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, relationship -from sqlalchemy import Column, BigInteger, Integer, String, Numeric, DateTime, ForeignKey, Float, Enum, create_engine, UniqueConstraint +from sqlalchemy import Column, BigInteger, Integer, String, DateTime, ForeignKey, Float, Enum, create_engine, UniqueConstraint import requests from errors import RequestError, NotFoundError, AlreadyExistingError import re diff --git a/telegrambot.py b/telegrambot.py index 554d4e91..fdd77508 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -4,7 +4,7 @@ import math import db import errors import stagismo -from telegram import Bot, Update, Message +from telegram import Bot, Update from telegram.ext import Updater, CommandHandler from discord import Status as DiscordStatus diff --git a/webserver.py b/webserver.py index ecc24d72..02d0680d 100644 --- a/webserver.py +++ b/webserver.py @@ -1,6 +1,5 @@ from flask import Flask, render_template from db import Session, Royal, Steam, RocketLeague, Dota, Osu, Overwatch, LeagueOfLegends, Diario, Telegram -from sqlalchemy.orm import joinedload app = Flask(__name__) From f7e98d2847a3ec8e1bdb7067ec03a7d4bdb6fd12 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 2 Feb 2018 08:44:36 +0100 Subject: [PATCH 4/4] Fix medal display on the Dota table --- templates/leaderboards.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/leaderboards.html b/templates/leaderboards.html index fc43711e..304a5bd5 100644 --- a/templates/leaderboards.html +++ b/templates/leaderboards.html @@ -38,11 +38,13 @@ {{ record.wins }}
- {% if record.get_rank_stars_url() %}{% endif %} - {% if record.rank_tier is not none and record.rank_tier >= 10 %} - {{ record.get_rank_name() }} {{ record.get_rank_number() }} - {% else %} + {% if record.rank_tier is not None %} + {% if record.get_rank_stars_url() %}{% endif %} + {% endif %} + {% if record.rank_tier is not None and record.rank_tier < 10 %} Unranked + {% else %} + {{ record.get_rank_name() }} {{ record.get_rank_number() }} {% endif %}