67 lines
2.4 KiB
HTML
67 lines
2.4 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ note_list_name }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1 class="mb-4">Piezīmju saraksts "{{ note_list_name }}"</h1>
|
|
<a href="{{ url_for('index') }}">Atpakaļ uz piezīmju sarakstiem</a>
|
|
|
|
<hr>
|
|
|
|
<!-- Birku filtrēšana -->
|
|
<h2 class="mt-4">Filtrēt pēc birkām</h2>
|
|
<div class="mb-3">
|
|
{% for tag in tags %}
|
|
<a
|
|
class="btn {% if tag == t %}btn-outline-primary{% else %}btn-outline-secondary{% endif %} btn-sm"
|
|
href="{{ url_for('edit_list', name=note_list_name) }}?t={{ tag }}"
|
|
>{{ tag }}</a>
|
|
{% endfor %}
|
|
{% if t %}
|
|
<a class="btn btn-danger btn-sm" href="{{ url_for('edit_list', name=note_list_name) }}">Atcelt filtru pēc birkas</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Meklēšanas forma -->
|
|
<h2 class="mt-4">Meklēt piezīmes</h2>
|
|
<form class="mb-3" method="get">
|
|
<div class="input-group">
|
|
<input type="text" class="form-control" name="s" placeholder="Ievadiet meklējamo tekstu" value="{{ s|default('', true) }}">
|
|
<button class="btn btn-primary" type="submit">Meklēt</button>
|
|
</div>
|
|
</form>
|
|
|
|
<hr />
|
|
|
|
<!-- Piezīmju saraksts -->
|
|
<h2 class="mt-4">Piezīmes</h2>
|
|
<a class="btn btn-success mb-3" href="{{ url_for('add_note', list_name=note_list_name) }}">Pievienot piezīmi</a>
|
|
<ul class="list-group">
|
|
{% for index, note in note_list %}
|
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h5>{{ note.name }}</h5>
|
|
<small>
|
|
{{ note.datetime.replace('T', ' ') }}
|
|
{% if note.tags %}•{% endif %}
|
|
{% for tag in note.tags %}
|
|
<span class="badge bg-secondary">{{ tag }}</span>
|
|
{% endfor %}
|
|
</small>
|
|
<p>{{ note.content.replace('\n', '<br>')|safe }}</p>
|
|
</div>
|
|
<div>
|
|
<a
|
|
class="btn btn-warning btn-sm"
|
|
href="{{ url_for('add_note', list_name=note_list_name, note_name=note.name) }}"
|
|
>Rediģēt</a>
|
|
<button
|
|
onclick="deletePrompt('Vai Jūs tiešām gribat dzēst šo piezīmi?', `{{ url_for('delete_note', list_name=note_list_name, note_name=note.name) }}`)"
|
|
class="btn btn-danger btn-sm"
|
|
>Dzēst</button>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endblock %}
|