mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-15 15:09:22 +00:00
102 lines
3.8 KiB
Django/Jinja
102 lines
3.8 KiB
Django/Jinja
{% extends "core/base.jinja" %}
|
|
|
|
{% from "timetable/macros.jinja" import display_timetable %}
|
|
|
|
{%- block additional_css -%}
|
|
<link rel="stylesheet" href="{{ static('timetable/css/generator.scss') }}">
|
|
{%- endblock -%}
|
|
|
|
{%- block additional_js -%}
|
|
<script type="module" src="{{ static('bundled/timetable/timetable-index.ts') }}"></script>
|
|
{%- endblock -%}
|
|
|
|
{% block title %}
|
|
{% trans %}Timetable generator{% endtrans %}
|
|
{% endblock %}
|
|
|
|
{% block description -%}
|
|
{% trans trimmed %}
|
|
Get a nice schedule from the raw text in your student file
|
|
{% endtrans %}
|
|
{%- endblock %}
|
|
|
|
{% block metatags %}
|
|
<meta property="og:url" content="{{ request.build_absolute_uri() }}" />
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:title" content="Générateur d'emploi du temps" />
|
|
<meta property="og:image" content="{{ request.build_absolute_uri(static("core/img/logo_no_text.png")) }}" />
|
|
<meta
|
|
property="og:description"
|
|
content="Générateur d'emploi du temps de l'UTBM.
|
|
Copiez le texte de l'emploi du temps de votre dossier étudiant
|
|
et récupérez une image plus jolie."
|
|
/>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div x-data="timetableGenerator">
|
|
<form @submit.prevent="generate()">
|
|
<h1>{% trans %}Timetable generator{% endtrans %}</h1>
|
|
<template x-if="error !== null" x-cloak>
|
|
<div class="alert alert-red">
|
|
<div class="alert-main">
|
|
<p>
|
|
{% trans trimmed %}
|
|
Wrong timetable format. Make sure you copied it from your student folder.
|
|
{% endtrans %}
|
|
</p>
|
|
<template x-if="!!error.incorrectRow">
|
|
<p>
|
|
{% trans %}Incorrect row{% endtrans %} :
|
|
<code x-text="error.incorrectRow"></code>
|
|
</p>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<div class="form-group">
|
|
<label for="timetable-input">
|
|
{% trans %}Paste your schedule (without the header){% endtrans %}
|
|
</label>
|
|
<textarea id="timetable-input" cols="30" rows="15" x-model="content"></textarea>
|
|
</div>
|
|
<input type="submit" class="btn btn-blue" value="{% trans %}Generate{% endtrans %}">
|
|
</form>
|
|
{{ display_timetable("courses") }}
|
|
<template x-if="courses.length > 0">
|
|
<section>
|
|
{% if user.has_perm("timetable.add_self_timetable") %}
|
|
<div id="timetable-save" class="margin-bottom">
|
|
<h3>{% trans %}Save on your profile{% endtrans %}</h3>
|
|
<form>
|
|
<fieldset>
|
|
<input type="checkbox" class="switch" id="edt-public-switch-id" x-model="edtPublic">
|
|
<label for="edt-public-switch-id">{% trans %}Make this timetable public{% endtrans %}</label>
|
|
<span class="helptext">
|
|
{% trans trimmed url=url("core:user_prefs", user_id=user.id) %}
|
|
You can change this at any time in <a href="{{ url }}">your preferences</a>
|
|
{% endtrans %}
|
|
</span>
|
|
</fieldset>
|
|
<button class="btn btn-blue" :disabled="saving" @click.prevent="saveSith">
|
|
{% trans %}Save timetable{% endtrans %}
|
|
</button>
|
|
<p
|
|
class="alert"
|
|
:class="timetableSavedMessage.success ? 'alert-green' : 'alert-red'"
|
|
x-show="timetableSavedMessage.open"
|
|
x-transition.duration.500ms
|
|
x-text="timetableSavedMessage.content"
|
|
></p>
|
|
</form>
|
|
</div>
|
|
{% endif %}
|
|
<h3 class="margin-bottom">{% trans %}Export{% endtrans %}</h3>
|
|
<button class="margin-bottom btn btn-blue" @click="savePng">
|
|
{% trans %}Export to PNG{% endtrans %}
|
|
</button>
|
|
</section>
|
|
</template>
|
|
</div>
|
|
{% endblock content %}
|