diff --git a/divent/bot.py b/divent/bot.py index 1b8e412..7d2aca7 100644 --- a/divent/bot.py +++ b/divent/bot.py @@ -74,7 +74,7 @@ def i18n(str: str) -> str: return str -def days_before_failure(): +def days_before_failure() -> int: nextYear = datetime.today().year + 5 - ((datetime.today().year + 5) % 5) nextDate = datetime(year=nextYear, month=6, day=3) nextDelta = nextDate - datetime.now() @@ -93,11 +93,18 @@ async def index(): guild = get_guild_by_id(guild_id) if guild: - return False + return redirect(url_for(".subscribe", guild_id=guild_id)) return await render_template("index.html.j2") +@app.route("/subscribe/") +async def subscribe(guild_id: str): + guild = get_guild_by_id(guild_id) + + return await render_template("subscribe.html.j2", guild=guild) + + @app.route("/.ics") async def ical(guild_id: str): guild = get_guild_by_id(guild_id) diff --git a/divent/static/css/global.css b/divent/static/css/global.css index f6d9d16..5babe6e 100644 --- a/divent/static/css/global.css +++ b/divent/static/css/global.css @@ -34,10 +34,15 @@ body { width: 130px; } -#avatars, footer, h1, h2 { +footer, h1, h2 { text-align: center; } +#avatars { + display: flex; + justify-content: center; +} + #avatars img { border-radius: 50%; } @@ -55,9 +60,27 @@ body { padding: 32px 16px 24px; } -#scopes { - list-style-type: none; - padding: 0; +#dots { + font-size: xx-large; + opacity: 0.2; + align-self: center; + margin: 0 24px; +} + +.hr-sect { + display: flex; + align-items: center; + color: rgba(79, 84, 92); + margin: 8px 0; +} + +.hr-sect:before, +.hr-sect:after { + content: ""; + flex-grow: 1; + background: rgba(79, 84, 92); + height: 1px; + margin: 0 8px; } #scopes li { @@ -65,12 +88,34 @@ body { font-size: 14px; } -footer ul { +#select_guid { + width: 100%; + background-color: #202225; + border: 0; + border-radius: 3px; + color: white; + font-size: 15px; + padding: 10px; +} + +#permissions { font-size: 12px; + margin-top: 8px; +} + +ul { list-style-type: none; padding: 0; } +ul li a { + color: #a3a6aa; +} + +footer ul { + font-size: 12px; +} + footer ul li { display: inline-block; } @@ -79,10 +124,6 @@ footer ul li:last-child { display: block; } -footer ul li a { - color: #a3a6aa; -} - footer ul li i { margin: 8px; } @@ -131,21 +172,25 @@ hr { padding: 16px; text-align: right; border-radius: 0 0 5px 5px; + display: flex; + justify-content: flex-end; } -#buttons a { +.button { background-color: #5865f2; line-height: 38px; font-size: 14px; padding: 0 16px; border-radius: 3px; color: white; - display: inline-block; + border: 0; + display: block; + text-align: center; } @media only screen and (max-width : 320px) { #logo { - text-align: center; + align-self: center; top: inherit; left: inherit; } diff --git a/divent/templates/error.html.j2 b/divent/templates/error.html.j2 index 2dce21b..af1b801 100644 --- a/divent/templates/error.html.j2 +++ b/divent/templates/error.html.j2 @@ -8,7 +8,7 @@ width="173"/>
- {{ error }} + {{ error }} {% endblock content %} diff --git a/divent/templates/subscribe.html.j2 b/divent/templates/subscribe.html.j2 index 8b13789..25a46f2 100644 --- a/divent/templates/subscribe.html.j2 +++ b/divent/templates/subscribe.html.j2 @@ -1 +1,19 @@ - +{% extends "base.html.j2" %} +{% block content %} +
+
+ {{ _('Bot Logo') }} + + {{ _('Guild Logo') }} +
+

{{ client.user.display_name }}

+

{{ _('The discord scheduled event calendar generator') }}

+
+
+{% endblock content %} diff --git a/divent/translations/fr.json b/divent/translations/fr.json index edaca29..9b7fd3e 100644 --- a/divent/translations/fr.json +++ b/divent/translations/fr.json @@ -2,13 +2,21 @@ "Discord Logo": "Logo Discord", "Bot Logo": "Logo du robot", "The discord scheduled event calendar generator": "Générateur de calendrier pour les évènements Discord", - "This will allow you to:": "Ceci vous permettra de :", - "Subscribe to a calendar on Google, Yahoo, Outlook, Apple or any ICS complient software": "S'abonner à un calendrier sur Google, Yahoo, Outlook, Apple ou tout autre logiciel compatible", - "Throwing you to a new isekai world": "Vous envoyer dans un monde fantaisiste armée d'une poile à frire", + "This will allow you to:": "Ceci te permettra de :", + "Subscribe to a calendar on Google, Yahoo, Outlook, Apple or any ICS complient software": "T'abonner à un calendrier sur Google, Yahoo, Outlook, Apple ou tout autre logiciel compatible", + "Throwing you to a new isekai world": "T'envoyer dans un monde fantaisiste armée d'une poile à frire", + "Choose a server:": "Choisi un serveur :", + "You must have": "Tu dois avoir la permission", + "Manage Server": "Gérer le serveur", + "permission on this server to perform this action": "sur ce serveur pour effectuer cette action", + "OR": "OU", + "Add the bot on your server": "Ajoute le bot sur ton serveur", + "After adding the bot,": "Après avoir ajouté le bot sur ton serveur,", + "reload the page": "actualise la page", "Let's go!": "C'est parti !", - "Add author on Discord": "Ajoute moi sur Discord :)", + "Add author on Discord": "Ajoute moi sur Discord ;)", "Read the licence": "Voir la licence", - "View the source code" : "Regarder le code source", - "Host it yourself": "Héberger ça vous-même", + "View the source code" : "Regarde le code source", + "Host it yourself": "Héberge ça chez toi", "Next castastrophic life failure in about %days% days": "Prochaine vie de merde dans environ %days% jours" }