This commit is contained in:
2021-08-30 02:29:20 +02:00
commit 3ccf65b8e5
251 changed files with 62644 additions and 0 deletions

View File

@ -0,0 +1,9 @@
{% extends 'admin/change_form.html' %}
{% block submit_buttons_bottom %}
{{ block.super }}
<div class="submit-row">
<input type="submit" value="Zaktualizuj wyniki uczniów" name="_update-student-scores">
<input type="submit" value="Wyłącz zgłoszenia" name="_update-disable-submissions">
</div>
{% endblock %}

88
app/templates/base.html Normal file
View File

@ -0,0 +1,88 @@
<!doctype html> {% load static %}
<html lang="pl" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
content="Konkurs Matematyczny o Puchar Dyrektora V Liceum Ogólnokształcącego w Bielsku-Białej ">
<meta name="author" content="Mikołaj Kubiczek">
<title>{% block title %}Puchar Dyrektora{% endblock %}</title>
<base href="/">
<link href="{% static 'bulma/css/bulma.css' %}" rel="stylesheet">
</head>
<body class="container">
<script>
document.addEventListener('DOMContentLoaded', () => {
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
if ($navbarBurgers.length > 0) {
$navbarBurgers.forEach(el => {
el.addEventListener('click', () => {
const target = el.dataset.target;
const $target = document.getElementById(target);
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
}
});
</script>
<header class="hero">
<a class="hero-body is-flex is-flex-direction-column has-text-black" href="{% url 'home' %}">
<span class="title is-2 mx-auto">Konkurs Matematyczny</span>
<span class="subtitle is-4 mx-auto">o Puchar Dyrektora V Liceum Ogólnokształcącego w Bielsku-Białej</span>
</a>
</header>
<nav class="navbar" role="navigation" aria-label="menu">
<div class="navbar-brand">
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbar">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbar" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item {{ news_page }}" href="{% url 'news' %}">Aktualności</a>
<a class="navbar-item {{ rules_page }}" href="{% url 'rules' %}">Regulamin</a>
<a class="navbar-item {{ tests_page }}" href="{% url 'tests' %}">Zadania</a>
<a class="navbar-item {{ scores_page }}" href="{% url 'scores' %}">Wyniki</a>
<a class="navbar-item {{ contact_page }} me-auto" href="{% url 'contact' %}">Kontakt</a>
</div>
<div class="navbar-end">
{% if user.is_authenticated %}
<a class="navbar-item has-text-link" href="{% url 'submission' %}">Zgłoszenie</a>
{% if user.is_superuser%}
<a class="navbar-item has-text-link" href="/admin">Panel administracyjny</a>
{% endif %}
<a class="navbar-item has-text-danger" href="{% url 'logout' %}">Wyloguj się</a>
{% else %}
<a class="navbar-item {{ login_page }}" href="{% url 'login' %}">Logowanie</a>
{% endif %}
</div>
</div>
</nav>
<main class="section">
{% block content %}{% endblock %}
</main>
<footer class="footer has-text-centered" style="background-color: transparent !important;">
<span class="has-text-weight-light is-italic">
&copy; 1998-<script>document.write(new Date().getFullYear());</script>
V Liceum Ogólnokształcące w Bielsku-Białej & Mikołaj Kubiczek
</span>
</footer>
</body>
<style>
.asterisk {
display: none;
}
</style>
</html>

View File

@ -0,0 +1,11 @@
{% extends 'base.html' %}
{% block title %}Puchar Dyrektora - kontakt{% endblock %}
{% block content %}
<div class="has-text-centered my-5">
<span class="title is-4">
W razie jakichkolwiek pytań, wątpiwości lub problemów prosimy o kontakt mailowy: <b>puchar@lo5.bielsko.pl</b>
</span>
</div>
{% endblock %}

40
app/templates/home.html Normal file
View File

@ -0,0 +1,40 @@
{% extends 'base.html' %}
{% block title %}Puchar Dyrektora{% endblock %}
{% load static %}
{% block content %}
<div class="columns">
<div class="column is-10 has-text-justified">
<h6>Pierwsza edycja Konkursu Matematycznego o Puchar Dyrektora V Liceum Ogólnokształcącego została zorganizowana w roku szkolnym 1998/1999.</h6>
<h6>
Konkurs — organizowany w formie dwustopniowych zawodów — adresowany jest do zainteresowanych matematyką uczniów szkół podstawowych.
<br><br>
W konkursie może wziąć udział drużyna każdej szkoły podstawowej lecz sukces należy do najlepszych.
<br><br>
Po ponad dwudziestu latach trwania konkursu z dużą satysfakcją stwierdzamy, że cieszy się on w dalszym ciągu niesłabnącym zainteresowaniem i prestiżem. Bo jak wytłumaczyć fakt, że kolejne roczniki uczniów biorą w nim udział chociaż jedyną zachętą jest wyróżnienie lub tytuł laureata?
<br><br>
Celem konkursu jest popularyzacja wiedzy matematycznej, rozwijanie uzdolnień i zainteresowań matematycznych uczniów, ujawnianie młodych talentów oraz stworzenie możliwości sprawdzenia własnego poziomu wiedzy i umiejętności w rywalizacji z innymi uczniami w dziedzinie matematyki. Konkurs ma również na celu promocję szkół, nauczycieli i uczniów biorących w nim udział.
<br><br>
Serdecznie dziękuję wszystkim, bez których konkurs ten nie mógłby się odbywać. W szczególności nauczycielom i ich uczniom ze szkół podstawowych
<br><br>
W roku szkolnym 2020/2021 zapraszamy uczniów szkół podstawowych oraz oddziałów gimnazjalnych do wzięcia udziału w XXIII edycji tego konkursu.
<br><br>
<em>
Dyrektor
<br>
V Liceum Ogólnokształcącego
<br>
w Bielsku-Białej
</em>
</h6>
</div>
<div class="column has-text-centered">
<img alt="Puchar Dyrektora" src="{% static 'puchar.png' %}" class="image my-3">
<a href="https://stowarzyszenie.lo5.bielsko.pl/" target="_blank" rel="noreferrer noopener">
<img alt="" src="{% static 'stowarzyszenie.png' %}" class="image my-3">
</a>
</div>
</div>
{% endblock %}

17
app/templates/news.html Normal file
View File

@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% block title %}Puchar Dyrektora - aktualności{% endblock %}
{% block content %}
{% for announcement in announcements %}
<article class="message is-dark">
<div class="message-header is-flex">
<h5 class="has-text-weight-bold">{{ announcement.title }}</h5>
<h5 class="has-text-gray-light">{{ announcement.created_at | date:"j E Y" }}, {{ announcement.created_at | time:"G:i" }}</h5>
</div>
<div class="message-body content">
{{ announcement.content | safe }}
</div>
</article>
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,19 @@
{% extends 'base.html' %}
{% load crispy_forms_filters %}
{% block title %}Logowanie{% endblock %}
{% block content %}
<div class="section is-flex is-flex-direction-column">
<span class="title mx-auto">Zaloguj się</span>
<form method="POST" class="is-flex is-flex-direction-column">
{% csrf_token %}
{{ form | crispy }}
<div class="buttons mx-auto">
<button type="submit" class="button is-success">Zaloguj się</button>
<a href="{% url 'signup' %}" class="button is-link" role="button" aria-pressed="true">Załóż konto</a>
<a href="{% url 'password_reset'%}" class="button is-danger" role="button" aria-pressed="true">Zmień hasło</a>
</div>
</form>
</div>
{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends 'base.html' %}
{% load crispy_forms_filters %}
{% block title %}Rejestracja{% endblock %}
{% block content %}
<div class="section is-flex is-flex-direction-column">
<span class="title mx-auto">Załóż konto</span>
<form method="POST" class="is-flex is-flex-direction-column">
{% csrf_token %}
{{ form | crispy }}
<div class="buttons mx-auto">
<button role="button" class="button is-success" type="submit">Załóż konto</button>
<a href="{% url 'login' %}" class="button is-link" role="button" aria-pressed="true">Zaloguj się</a>
</div>
</form>
</div>
{% endblock %}

41
app/templates/rules.html Normal file
View File

@ -0,0 +1,41 @@
{% extends 'base.html' %}
{% block title %}Puchar Dyrektora - regulamin{% endblock %}
{% block content %}
<div class="content">
<div class="has-text-centered">
<h2 class="has-text-weight-bold">
Regulamin Konkursu Matematycznego
</h2>
<h5>
o Puchar Dyrektora V LO w Bielsku-Białej
</h5>
</div>
<br>
<ol>
<li>Organizatorem konkursu jest V Liceum Ogólnokształcące w Bielsku-Białej.</li>
<li>W konkursie mogą uczestniczyć uczniowie szkół podstawowych.</li>
<li>Każda szkoła może zgłosić jedną drużynę trzyosobową, z wyjątkiem sytuacji opisanej w punkcie 9. W sytuacji, gdy szkoła nie jest w stanie wystawić drużyny trzyosobowej, może zgłosić jednego lub dwóch uczniów.</li>
<li>
Konkurs składa się z eliminacji i finału.<br>
W eliminacjach każdy uczeń rozwiązuje test wielokrotnego wyboru (spośród podanych 4 odpowiedzi, co najmniej jedna jest poprawna). Za poprawną odpowiedź uczeń otrzymuje 3 punkty, za brak odpowiedzi 0 punktów, za złą odpowiedź zostaje mu odjęty 1 punkt.<br>
<strong>Uwaga:</strong> Jeżeli w zadaniu zostaną podane cztery odpowiedzi NIE albo trzy odpowiedzi NIE i jednocześnie nie zostanie udzielona odpowiedź TAK, za to zadanie zostanie przyznane minus 12 punktów.<br>
Wynik drużyny w eliminacjach jest sumą punktów zdobytych przez członków tej drużyny.<br>
Do finału kwalifikowanych jest nie więcej niż 50 najlepszych uczniów w klasyfikacji indywidualnej zawodów eliminacyjnych.<br>
W finale uczestnicy rozwiązują po 4 zadania; za każde zadanie można uzyskać maksymalnie 5 punktów.<br>
Wynik drużyny w finale jest sumą punktów zdobytych przez członków drużyny biorących udział w zawodach finałowych.
</li>
<li>Wynik drużyny w konkursie jest iloczynem liczby punktów zdobytych w eliminacjach i w finale.</li>
<li>Dla finalistów klasyfikacja indywidualna prowadzona jest według tych samych zasad.</li>
<li>Dla najlepszych uczniów w klasyfikacji indywidualnej przyznawane będą tytuły laureata i finalisty z wyróżnieniem. Listę laureatów i finalistów z wyróżnieniem ustala organizator konkursu po ocenie prac zawodów finałowych i ustaleniu ostatecznych wyników konkursu.</li>
<li>Drużyna, która zdobyła pierwsze miejsce, otrzymuje Puchar Dyrektora V LO w Bielsku-Białej.</li>
<li>Szkoła, której drużyna zdobyła Puchar Dyrektora V LO w Bielsku-Białej, ma prawo w następnym roku szkolnym zgłosić dwie drużyny.</li>
<li>Puchar jest przechodni. Szkoła, której drużyna zdobyła puchar pięciokrotnie lub trzykrotnie z rzędu, otrzymuje puchar na własność.</li>
<li>Dla laureatów, finalistów z wyróżnieniem oraz dla trzech pierwszych drużyn organizator przewiduje upominki rzeczowe.</li>
<li>Zgłoszenia drużyn przyjmowane są do końca października danego roku szkolnego za pomocą formularza dostępnego na stronie internetowej konkursu.</li>
<li>Eliminacje odbywają się najwcześniej w trzeci czwartek listopada danego roku szkolnego. Finał odbywa się po Nowym Roku w terminie podanym przez organizatora.</li>
<li>Sytuacje nie przewidziane regulaminem rozstrzyga organizator konkursu.</li>
</ol>
</div>
{% endblock %}

78
app/templates/scores.html Normal file
View File

@ -0,0 +1,78 @@
{% extends 'base.html' %}
{% block title %}Puchar Dyrektora - wyniki{% endblock %}
{% block content %}
<nav class="pagination is-centered is-small my-0" role="navigation">
<ul class="pagination-list">
{% for edition in editions %}
<li>
<a class="pagination-link {% if edition.year == year %}is-current{% endif %}"
{% if edition.year != year %}href="{% url 'scores' edition.year %}"{% endif %}
>{{ edition.roman }}</a>
</li>
{% endfor %}
</ul>
</nav>
<div class="hero has-text-centered">
<span class="title my-6">Klasyfikacja indywidualna</span>
<table class="hero-body table is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>#</th>
<th>Uczeń</th>
<th>Wynik</th>
<th>Tytuł</th>
</tr>
</thead>
{% for student in individual %}
<tbody>
<tr>
<th>{{ forloop.counter }}</th>
<td>
<div class="dropdown is-hoverable">
<div class="dropdown-trigger">
<span>{{ student.name }} {{ student.surname }}</span>
</div>
<div class="dropdown-menu">
<div class="dropdown-content">
<div class="dropdown-item">
<b>Szkoła: </b>{{ student.school_name }}
<br>
<b>Miejscowość: </b>{{ student.school_town }}
</div>
</div>
</div>
</div>
</td>
<td>{{ student.score }}</td>
<td>{{ student.title }}</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
<div class="hero has-text-centered">
<span class="title my-6">Klasyfikacja szkół</span>
<table class="hero-body table is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>#</th>
<th>Szkoła</th>
<th>Miejscowość</th>
<th>Wynik</th>
</tr>
</thead>
{% for team in teams %}
<tbody>
<tr>
<th>{{ forloop.counter }}</th>
<td>{{ team.name }}</td>
<td>{{ team.town }}</td>
<td>{{ team.score }}</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
{% endblock %}

45
app/templates/tests.html Normal file
View File

@ -0,0 +1,45 @@
{% extends 'base.html' %}
{% load static %}
{% block title %}Puchar Dyrektora - zadania{% endblock %}
{% block content %}
<table class="table is-striped is-narrow is-hoverable is-fullwidth has-text-centered">
<thead>
<tr>
<th>Edycja</th>
<th>Lata</th>
<th>Eliminacje</th>
<th>Finał</th>
</tr>
</thead>
<tbody>
{% for edition in editions %}
<tr>
<th>{{ edition.roman }}</th>
<th>{{ edition.year }} / {{ edition.year | add:1 }}</th>
<td>
{% if edition.first_test %}
<a href="/media/{{ edition.first_test }}">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-text" viewBox="0 0 16 16">
<path d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5z"/>
<path d="M9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0zm0 1v2A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5z"/>
</svg>
</a>
{% else %}-{% endif %}
</td>
<td>
{% if edition.second_test %}
<a href="/media/{{ edition.second_test }}">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-text" viewBox="0 0 16 16">
<path d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5z"/>
<path d="M9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0zm0 1v2A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5z"/>
</svg>
</a>
{% else %}-{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -0,0 +1,22 @@
{% extends 'user/tabs.html' %}
{% load crispy_forms_filters %}
{% block title %}Puchar Dyrektora - zgłoś uczniów{% endblock %}
{% block tab %}
<form class="is-flex is-flex-direction-column" method="POST">
<div class="my-6 has-text-centered is-flex is-flex-direction-column">
<span class="title">Zaktualizuj konto</span>
<span class="subtitle">
W celu zmiany adresu e-mail lub numeru telefonu przypisanego do konta prosimy
o kontakt pod danym adresem e-mail: <b>puchar@lo5.bielsko.pl</b>
</span>
</div>
{% csrf_token %}
{{ form | crispy }}
<div class="buttons mx-auto my-3">
<button class="button is-success" type="submit">Zaktualizuj</button>
<a class="button is-link" href="{% url 'password_change' %}" target="_blank" rel="noopener noreferrer">Zmień hasło</a>
</div>
</form>
{% endblock %}

View File

@ -0,0 +1,34 @@
{% extends 'user/tabs.html' %}
{% load crispy_forms_filters %}
{% block title %}Puchar Dyrektora - zgłoś uczniów{% endblock %}
{% block tab %}
{% if students %}
<div class="hero has-text-centered">
<span class="title my-6">Zgłoszeni uczniowie</span>
<table class="hero-body table is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>Identyfikator</th>
<th>Uczeń</th>
<th>Klasa</th>
{% if ongoing.scores_eliminations %}<th>Wynik uzyskany podczas eliminacji</th>{% endif %}
</tr>
</thead>
{% for student in students %}
<tbody>
<tr>
<th>{{ student.identifier }}</th>
<td>{{ student.name }} {{ student.surname }}</td>
<td>{{ student.grade }}</td>
{% if ongoing.scores_eliminations %}<td>{{ student.score_first | default:"-" }}</td>{% endif %}
</tr>
</tbody>
{% endfor %}
</table>
</div>
{% else %}
<span>Brak zgłoszonych uczniów</span>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,22 @@
{% extends 'user/tabs.html' %}
{% load crispy_forms_filters %}
{% block title %}Puchar Dyrektora - zgłoś uczniów{% endblock %}
{% block tab %}
<form class="is-flex is-flex-direction-column" method="POST">
<div class="my-6 has-text-centered is-flex is-flex-direction-column">
<span class="title">Zgłoś uczniów</span>
</div>
{% csrf_token %}
{{ formset.management_form | crispy }}
{% for form in formset %}
<div class="columns">
<div class="column is-5">{{ form.name | as_crispy_field }}</div>
<div class="column is-5">{{ form.surname | as_crispy_field }}</div>
<div class="column is-2">{{ form.grade | as_crispy_field }}</div>
</div>
{% endfor %}
<button class="button is-success mx-auto" type="submit">Zgłoś</button>
</form>
{% endblock %}

View File

@ -0,0 +1,28 @@
{% extends 'base.html' %}
{% block title %}Puchar Dyrektora - zgłoś uczniów{% endblock %}
{% block content %}
<div class="tabs mb-0 is-centered is-boxed">
<ul>
<li class="{{ account_tab }}">
<a href="{% url 'account' %}">Konto</a>
</li>
{% if ongoing %}
<li class="{{ submission_tab }}">
<a href="{% url 'submission' %}">Zgłoszenie</a>
</li>
{% else %}
<li>
<a class="has-text-danger">Zgłoszenie niedostępne</a>
</li>
{% endif %}
</ul>
</div>
<div class="is-centered">
{% block tab %}{% endblock %}
</div>
{% endblock %}