Create repo page stub
This commit is contained in:
parent
5759839415
commit
36a3974393
|
@ -29,7 +29,7 @@
|
|||
<div style="width: 600px;" class="repo-container shadow rounded overflow-hidden
|
||||
{% if repo.error %}bg-danger{% elif repo.warning %}bg-warning{% else %}bg-primary{% endif %}">
|
||||
<div class="row me-1 overflow-hidden text-truncate">
|
||||
<h2 class="h2">{{ repo.label }}
|
||||
<h2 class="h2"><a href="/repo/{{ repo.label }}">{{ repo.label }}</a>
|
||||
<small class="text-muted"> {{ repo.location }}</small>
|
||||
</h2>
|
||||
</div>
|
||||
|
|
28
borgweb/borg/templates/borg/repo.html
Normal file
28
borgweb/borg/templates/borg/repo.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
{% extends "borg/base.html" %}
|
||||
|
||||
{% block title %}Repo: {{ repo.label }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block script %}
|
||||
{{block.super}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
{{ hour_list|json_script:"hour_list" }}
|
||||
{# <script src="{% static 'js/index.js' %}"></script>#}
|
||||
{% endblock %}
|
||||
|
||||
{% block style %}
|
||||
|
||||
{# .repo-container {#}
|
||||
{# padding: 8px;#}
|
||||
{# margin: 8px;#}
|
||||
{# }#}
|
||||
{##}
|
||||
{# .att-label {#}
|
||||
{# margin-top: 4px;#}
|
||||
{# margin-bottom: 4px;#}
|
||||
{# }#}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Repo: {{ repo.label }}</h1>
|
||||
{% endblock %}
|
||||
|
|
@ -5,8 +5,9 @@ from . import views
|
|||
|
||||
urlpatterns = [
|
||||
path('', cache_page(60)(views.index), name='index'),
|
||||
path('post/repo', views.post_repo, name='repo'),
|
||||
path('post/archive', views.post_archive, name='archive'),
|
||||
path('post/error', views.post_error, name='error'),
|
||||
path('post/location', views.post_location, name='location'),
|
||||
path('repo/<str:repo_label>', views.repo, name='repo'),
|
||||
path('post/repo', views.post_repo, name='post repo'),
|
||||
path('post/archive', views.post_archive, name='post archive'),
|
||||
path('post/error', views.post_error, name='post error'),
|
||||
path('post/location', views.post_location, name='post location'),
|
||||
]
|
||||
|
|
|
@ -38,6 +38,11 @@ def repo_daily_dict(repo_list, n_days=14):
|
|||
}
|
||||
|
||||
|
||||
def repo(request, repo_label: str):
|
||||
s_repo = get_object_or_404(Repo, label__label=repo_label)
|
||||
return render(request, 'borg/repo.html', {'repo': s_repo})
|
||||
|
||||
|
||||
@permission_required("borg.add_repo")
|
||||
def post_repo(request):
|
||||
if request.method == 'POST':
|
||||
|
|
Loading…
Reference in New Issue
Block a user