EditionPN/app/templates/base.html

128 lines
5.1 KiB
HTML

{% macro render_dropdown(field) %}
<div class="control is-expanded">
<div class="dropdown is-hoverable" style="width: 100%">
<div class="dropdown-trigger" style="width: 100%">
<span class="button is-fullwidth" aria-controls="dropdown-menu">
<span>{{ field.label }}</span>
<span class="icon is-small">
<i class="fas fa-angle-down"></i>
</span>
</button>
</div>
<div class="dropdown-menu" style="width: 100%">
<div class="dropdown-content">
{% for val in field %}
<div class="dropdown-item">
{{ val }} {{ val.label }}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endmacro %}
{% macro render_field(field,class) %}
<div class="field">
<label class="label">{{ field.label }}</label>
<div class="control">
{{ field(class=class)}}
</div>
{% for error in field.errors %}
<p class="help is-danger">{{error}}</p>
{% endfor %}
</div>
{% endmacro %}
{% macro render_list(field) %}
<ul>
{% for ref in field.data %}
<li>{{ ref.code }} - {{ ref.titre }}{{ ref.nom }}</li>
{% endfor %}
</ul>
{% endmacro %}
<!DOCTYPE html>
<html class="has-navbar-fixed-top">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock %}</title>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css">
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="{{ url_for('static', filename='js/base.js') }}"></script>
{% block head %}{% endblock %}
</head>
<body>
<!-- Barre de navigation -->
<nav class="navbar is-primary is-spaced is-fixed-top py-0">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item is-size-5" href="https://scodoc.org/">ScoDoc</a>
<!-- Menu deroulant affiché uniquement sur mobile -->
<div class="navbar-burger">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div class="navbar-menu">
<div class="navbar-start">
<!-- Liste des catégories -->
<a class="navbar-item" href="{{ url_for('index') }}">Accueil</a>
<div class="navbar-item has-dropdown">
<a class="navbar-link">Semestres</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="{{ url_for('Semestre', num=1) }}">Semestre 1</a>
<a class="navbar-item" href="{{ url_for('Semestre', num=2) }}">Semestre 2</a>
<a class="navbar-item" href="{{ url_for('Semestre', num=3) }}">Semestre 3</a>
<a class="navbar-item" href="{{ url_for('Semestre', num=4) }}">Semestre 4</a>
<a class="navbar-item" href="{{ url_for('Semestre', num=5) }}">Semestre 5</a>
<a class="navbar-item" href="{{ url_for('Semestre', num=6) }}">Semestre 6</a>
</div>
</div>
<a class="navbar-item" href="{{ url_for('PN') }}">PN</a>
<a class="navbar-item" href="{{ url_for('AC') }}">AC</a>
<a class="navbar-item" href="{{ url_for('SAE') }}">SAÉ</a>
<a class="navbar-item" href="{{ url_for('Ressource') }}">Ressource</a>
<a class="navbar-item" href="{{ url_for('Competence') }}">Competence</a>
</div>
<div class="navbar-end">
</div>
</div>
</div>
</nav>
<!-- Contenu de la page -->
<div class="container">
<div class="box">
{% with messages = get_flashed_messages(category_filter=["error"]) %}
{% if messages %}
<article class="message is-danger">
<div class="message-body">
{% for message in messages %}
<p>{{message}}</p>
{% endfor %}
</div>
</article>
{% endif %}
{% endwith %}
{% with messages = get_flashed_messages(category_filter=["success"]) %}
{% if messages %}
<article class="message is-success">
<div class="message-body">
{% for message in messages %}
<p>{{message}}</p>
{% endfor %}
</div>
</article>
{% endif %}
{% endwith %}
{% block content %}
{% endblock %}
</div>
</div>
</body>
</html>