54 lines
2.7 KiB
HTML
54 lines
2.7 KiB
HTML
{% extends "khaganat/base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "logs_title" %}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="content-bloc">
|
|
<h2>{% trans "logs_title" %}</h2>
|
|
{% if sources %}
|
|
<div class="row">
|
|
<div class="col-4">
|
|
<div class="list-group" id="list-tab" role="tablist">
|
|
{% for source in sources %}
|
|
<a class="list-group-item list-group-item-action" id="list-{{ source.source }}-list" data-toggle="list" href="#list-{{ source.source }}" role="tab" aria-controls="home">{{ source.source__name }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
<div class="col-8">
|
|
<div class="tab-content" id="nav-tabContent">
|
|
{% for source in sources %}
|
|
<div class="tab-pane fade show" id="list-{{ source.source }}" role="tabpanel" aria-labelledby="list-{{ source.source }}-list">
|
|
<div class="list-group">
|
|
{% for date in source.stats %}
|
|
<a href="{% url 'log_day' source=source.source__slug year=date.date.year month=date.date.month day=date.date.day %}" class="list-group-item list-group-item-action">{{ date.date }}</a>
|
|
{% endfor %}
|
|
{% if request.user.is_staff %}
|
|
<div class="list-group-item list-group-item-action">
|
|
<form method="post" action="{% url 'log_search' %}">
|
|
{% csrf_token %}
|
|
{{ form.date }}
|
|
<input type="hidden" name="{{ form.source.name }}" value="{{ source.source__slug }}" />
|
|
<input type="submit" value="{% trans 'go'|capfirst %}" class="btn btn-secondary" />
|
|
</form>
|
|
|
|
{% if source.source__hidden %}
|
|
{% blocktrans with name=source.source__name %}{{ name }} is hidden.{% endblocktrans %}
|
|
<a href="{% url 'log_switch_source' source.source__id %}" class="btn btn-warning">{% trans 'show'|capfirst %}</a>
|
|
{% else %}
|
|
{% blocktrans with name=source.source__name %}{{ name }} is published.{% endblocktrans %}
|
|
<a href="{% url 'log_switch_source' source.source__id %}" class="btn btn-warning">{% trans 'hide'|capfirst %}</a>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<p>{% trans "logs_no_logs_available" %}</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|