This commit is contained in:
parent
bf2918795f
commit
89889e40f4
@ -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/<guild_id>")
|
||||
async def subscribe(guild_id: str):
|
||||
guild = get_guild_by_id(guild_id)
|
||||
|
||||
return await render_template("subscribe.html.j2", guild=guild)
|
||||
|
||||
|
||||
@app.route("/<guild_id>.ics")
|
||||
async def ical(guild_id: str):
|
||||
guild = get_guild_by_id(guild_id)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
width="173"/>
|
||||
</div>
|
||||
<hr />
|
||||
<span id="details">{{ error }}</span>
|
||||
<span>{{ error }}</span>
|
||||
</div>
|
||||
<div id="buttons">
|
||||
<a href="{{ url_for('index') }}">
|
||||
|
@ -24,8 +24,9 @@
|
||||
</ul>
|
||||
<hr />
|
||||
<h3>{{ _('Choose a server:') }}</h3>
|
||||
<select name="guild">
|
||||
<select name="guild" id="select_guid">
|
||||
<option>
|
||||
|
||||
</option>
|
||||
{% for guild in client.guilds %}
|
||||
<option value="{{ guild.id }}">
|
||||
@ -33,9 +34,29 @@
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="hr-sect">{{ _("OR") }}</div>
|
||||
<a class="button"
|
||||
target="_blank"
|
||||
href="https://discord.com/api/oauth2/authorize?client_id={{ client.user.id }}&permissions=536870912&scope=bot">
|
||||
{{ _("Add the bot on your server") }}
|
||||
</a>
|
||||
<ul id="permissions">
|
||||
<li>
|
||||
{{ _("You must have") }}
|
||||
<strong>{{ _("Manage Server") }}</strong>
|
||||
{{ _("permission on this server to perform this action") }}
|
||||
</li>
|
||||
<li>
|
||||
{{ _("After adding the bot,") }}
|
||||
<a href="">
|
||||
<i class="fa fa-refresh"></i>
|
||||
<strong>{{ _("reload the page") }}</strong>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="buttons">
|
||||
<a href="{{ url_for('index') }}">{{ _("Let's go!") }}</a>
|
||||
<input type="submit" class="button" value="{{ _("Let's go!") }}"/>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
|
@ -1 +1,19 @@
|
||||
|
||||
{% extends "base.html.j2" %}
|
||||
{% block content %}
|
||||
<div id="box">
|
||||
<div id="avatars">
|
||||
<img src="{{ client.user.display_avatar }}"
|
||||
alt="{{ _('Bot Logo') }}"
|
||||
width="80"
|
||||
height="80"/>
|
||||
<span id="dots">…</span>
|
||||
<img src="{{ guild.icon.url }}"
|
||||
alt="{{ _('Guild Logo') }}"
|
||||
width="80"
|
||||
height="80"/>
|
||||
</div>
|
||||
<h1>{{ client.user.display_name }}</h1>
|
||||
<h2>{{ _('The discord scheduled event calendar generator') }}</h2>
|
||||
<hr />
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user