tag: Introduce tag system
Create a new table representing tags, composed of a name and color. They can be used to tag truths and filter them later. Tags display under the truths they correspond to and can be clicked to access all truths matching this tag. Introduce a new element in the top bar to allow navigating to the tag list, which can be used to create and edit tags for the admin and used to select a list of tags to filter against for everyone. Update the database records of the truths to include the tag vector. As the database query result is a multi-row result, it cannot be parsed automatically so it needs to be skipped and retrieved manually.
This commit is contained in:
parent
d79375365d
commit
b401aa7f5d
11 changed files with 549 additions and 23 deletions
|
@ -13,19 +13,33 @@
|
|||
<body>
|
||||
{% block top_bar %}
|
||||
<div class="top_bar">
|
||||
<h1>{{ title }}</h1>
|
||||
{% if user.logged_in == true %}
|
||||
<form class="login" id="logout" action="/{{ week_data.number }}/logout" method="POST">
|
||||
Connecté en tant que <b>{{ user.name }}</b>
|
||||
<button form="logout">Déconnecter</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="login" id="login" action="/{{ week_data.number }}/login" method="POST">
|
||||
<label>Pseudo <input form="login" type="text" name="name"/></label>
|
||||
<label>Mot de passe <input form="login" type="password" name="password"/></label>
|
||||
<button form="login">Se connecter</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<div class="top_bar_side">
|
||||
<h1><a href="/">{{ title }}</a></h1>
|
||||
<nav>
|
||||
Aller à :
|
||||
<a href="/">Vérités</a>
|
||||
-
|
||||
<a href="/tags">Thèmes</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="top_bar_side">
|
||||
{% block top_bar_side %}
|
||||
<div>
|
||||
{% if user.logged_in == true %}
|
||||
<form class="login" id="logout" action="/{{ week_data.number }}/logout" method="POST">
|
||||
Connecté en tant que <b>{{ user.name }}</b>
|
||||
<button form="logout">Déconnecter</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="login" id="login" action="/{{ week_data.number }}/login" method="POST">
|
||||
<label>Pseudo <input form="login" type="text" name="name"/></label>
|
||||
<label>Mot de passe <input form="login" type="password" name="password"/></label>
|
||||
<button form="login">Se connecter</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue