1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-26 15:46:30 +00:00

Compare commits

..

No commits in common. "ff414ea0468ec9c84f23a7a7586fcec95b2b323f" and "3efe5a2226a4e4de0c9e1581728a28ff3a9a020c" have entirely different histories.

22 changed files with 40 additions and 107 deletions

2
.gitignore vendored
View File

@ -36,7 +36,7 @@ secrets.py
*.log
media/
output/
/static/
static/
# Virtualenv
env/

View File

@ -4,7 +4,7 @@
{% block content %}
{% trans "any" as any %}
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{% trans "Participation of team" %} {{ participation.team.name }} ({{ participation.team.trigram }})</h4>
</div>

View File

@ -4,7 +4,7 @@
{% block content %}
{% trans "any" as any %}
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{{ passage }}</h4>
</div>
@ -59,7 +59,7 @@
{% render_table notes %}
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-body">
<dl class="row">
<dt class="col-sm-8">{% trans "Average points for the defender writing:" %}</dt>

View File

@ -3,7 +3,7 @@
{% load django_tables2 i18n %}
{% block content %}
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{{ pool }}</h4>
</div>
@ -36,7 +36,7 @@
<dd class="col-sm-9">{{ pool.bbb_url|urlize }}</dd>
</dl>
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h5>{% trans "Ranking" %}</h5>
</div>

View File

@ -4,7 +4,7 @@
{% load crispy_forms_filters %}
{% block content %}
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{{ team.name }}</h4>
</div>

View File

@ -3,7 +3,7 @@
{% load getconfig i18n django_tables2 %}
{% block content %}
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{{ tournament.name }}</h4>
</div>
@ -92,7 +92,7 @@
{% if notes %}
<hr>
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h5>{% trans "Ranking" %}</h5>
</div>

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% load i18n %}
{% block content %}
<div class="card bg-body">
<div class="card bg-light">
<h3 class="card-header text-center">
{{ title }}
</h3>

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% load i18n %}
{% block content %}
<div class="card bg-body">
<div class="card bg-light">
<h3 class="card-header text-center">
{% trans "Account activation" %}
</h3>

View File

@ -5,7 +5,7 @@
{% block content %}
{% trans "any" as any %}
<div class="card bg-body shadow">
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{{ user_object.first_name }} {{ user_object.last_name }}</h4>
</div>

View File

@ -23,18 +23,14 @@ class Matrix:
Retrieve the bot account.
If not logged, log in and store access token.
"""
if not os.getenv("SYNAPSE_PASSWORD") and not os.getenv("SYNAPSE_TOKEN"):
if not os.getenv("SYNAPSE_PASSWORD"):
return FakeMatrixClient()
from nio import AsyncClient
client = AsyncClient("https://tfjm.org", "@tfjmbot:tfjm.org")
client.user_id = "@tfjmbot:tfjm.org"
if os.getenv("SYNAPSE_TOKEN"):
client.access_token = os.getenv("SYNAPSE_TOKEN")
client.device_id = os.getenv("SYNAPSE_DEVICE")
return client
elif os.path.isfile(".matrix_token"):
if os.path.isfile(".matrix_token"):
with open(".matrix_device", "r") as f:
cls._device_id = f.read().rstrip(" \t\r\n")
client.device_id = cls._device_id

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
/*!
* Bootstrap-select v1.14.0-beta3 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2022 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){e.fn.selectpicker.defaults={noneSelectedText:"Aucune s\xe9lection",noneResultsText:"Aucun r\xe9sultat pour {0}",countSelectedText:function(e,t){return 1<e?"{0} \xe9l\xe9ments s\xe9lectionn\xe9s":"{0} \xe9l\xe9ment s\xe9lectionn\xe9"},maxOptionsText:function(e,t){return[1<e?"Limite atteinte ({n} \xe9l\xe9ments max)":"Limite atteinte ({n} \xe9l\xe9ment max)",1<t?"Limite du groupe atteinte ({n} \xe9l\xe9ments max)":"Limite du groupe atteinte ({n} \xe9l\xe9ment max)"]},multipleSeparator:", ",selectAllText:"Tout s\xe9lectionner",deselectAllText:"Tout d\xe9s\xe9lectionner"}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
function initModal(target, url, content_id = 'form-content') {
document.querySelector('[data-bs-target="#' + target + 'Modal"]').addEventListener('click', () => {
let modalBody = document.querySelector("#" + target + "Modal div.modal-body")
if (!modalBody.innerHTML.trim()) {
if (url instanceof Function) url = url()
fetch(url, {headers: {'CONTENT-ONLY': '1'}})
.then(resp => resp.text())
.then(resp => new DOMParser().parseFromString(resp, 'text/html'))
.then(res => modalBody.innerHTML = res.getElementById(content_id).outerHTML)
.then(() => $('.selectpicker').selectpicker()) // TODO Update that when the library will be JQuery-free
}
})
}

View File

@ -14,18 +14,8 @@
sodipodi:docname="logo.svg"
width="30.311995"
height="9.7779999"
style="fill:black"
inkscape:version="0.92.2 2405546, 2018-03-11">
<style>
path {
fill: black;
}
@media (prefers-color-scheme: dark) {
path {
fill: white;
}
}
</style>
<metadata
id="metadata31">
<rdf:RDF>

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -1,27 +0,0 @@
/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
*/
(() => {
'use strict'
const getPreferredTheme = () => {
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
const setTheme = function (theme) {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
}
setTheme(getPreferredTheme())
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
setTheme(getPreferredTheme())
})
})()

View File

@ -38,10 +38,10 @@
{% block extracss %}{% endblock %}
</head>
<body class="d-flex w-100 h-100 flex-column">
<nav class="navbar navbar-expand-lg fixed-navbar shadow-sm">
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-navbar shadow-sm">
<div class="container-fluid">
<a class="navbar-brand" href="https://tfjm.org/">
<img src="{% static "tfjm.svg" %}" style="height: 2em;" alt="Logo TFJM²" id="navbar-logo">
<img src="{% static "tfjm.svg" %}" style="width: 42px;" alt="Logo TFJM²" id="navbar-logo">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNavDropdown"
@ -107,7 +107,7 @@
<div class="input-group">
<input type="text" class="form-control" placeholder="{% trans "Search" %}" name="q" id="search-term" value="{{ request.GET.q }}">
<div class="input-group-btn">
<button class="btn btn-default" data-bs-toggle="modal" data-bs-target="#searchModal"><i class="fa fa-search text-body"></i></button>
<button class="btn btn-default" data-bs-toggle="modal" data-bs-target="#searchModal"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
@ -174,7 +174,7 @@
{% endblock %}
</main>
<footer class="text-primary mt-auto py-2">
<footer class="bg-light text-primary mt-auto py-2">
<div class="container-fluid">
<div class="row">
<div class="col-sm-1">
@ -248,13 +248,26 @@
{% include "base_modal.html" with modal_id="login" %}
{% endif %}
<script src="{% static 'main.js' %}"></script>
<script src="{% static 'theme.js' %}"></script>
<script>
CSRF_TOKEN = "{{ csrf_token }}";
document.querySelectorAll(".invalid-feedback").forEach(elem => elem.classList.add('d-block'))
function initModal(target, url, content_id = 'form-content') {
document.querySelector('[data-bs-target="#' + target + 'Modal"]').addEventListener('click', () => {
let modalBody = document.querySelector("#" + target + "Modal div.modal-body")
if (!modalBody.innerHTML.trim()) {
if (url instanceof Function) url = url()
fetch(url, {headers: {'CONTENT-ONLY': '1'}})
.then(resp => resp.text())
.then(resp => new DOMParser().parseFromString(resp, 'text/html'))
.then(res => modalBody.innerHTML = res.getElementById(content_id).outerHTML)
.then(() => $('.selectpicker').selectpicker()) // TODO Update that when the library will be JQuery-free
}
})
}
document.addEventListener('DOMContentLoaded', () => {
initModal("tournamentList", "{% url "participation:tournament_list" %}")

View File

@ -14,7 +14,7 @@
</p>
</div>
<div class="jumbotron p-5">
<div class="jumbotron bg-white p-5">
<div class="row text-center">
<h1 class="display-4">
Bienvenue sur le site d'inscription au <a href="https://tfjm.org/" target="_blank">𝕋𝔽𝕁𝕄²</a> !
@ -22,7 +22,7 @@
</div>
</div>
<div class="row p-5">
<div class="row bg-white p-5">
<div class="col-sm">
<h3>
Tu souhaites participer au 𝕋𝔽𝕁𝕄² ?
@ -33,12 +33,12 @@
<div class="col-sm text-end">
<div class="btn-group-vertical">
<a class="btn btn-primary btn-lg" href="{% url "registration:signup" %}" role="button">Inscris-toi maintenant !</a>
<a class="btn btn-light text-dark btn-lg" href="{% url "login" %}" role="button">J'ai déjà un compte</a>
<a class="btn btn-light btn-lg" href="{% url "login" %}" role="button">J'ai déjà un compte</a>
</div>
</div>
</div>
<div class="jumbotron p-5 border rounded-5">
<div class="jumbotron p-5 border rounded-5 bg-light">
<h5 class="display-4">Comment ça marche ?</h5>
<p>
Pour participer au 𝕋𝔽𝕁𝕄², il suffit de créer un compte sur la rubrique <strong><a href="{% url "registration:signup" %}">Inscription</a></strong>.

View File

@ -20,7 +20,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
<div id="form-content">
{% csrf_token %}
{{ form | crispy }}
<a href="{% url 'password_reset' %}" class="badge text-bg-warning">{% trans 'Forgotten your password or username?' %}</a>
<a href="{% url 'password_reset' %}" class="badge badge-light">{% trans 'Forgotten your password or username?' %}</a>
</div>
<input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary">
</form>