initial commit
This commit is contained in:
commit
164fa61ad2
40 changed files with 1263 additions and 0 deletions
6
community_backup/webui/templates/about.md
Normal file
6
community_backup/webui/templates/about.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# About Community Backup
|
||||
|
||||
Community Backup is a service that provides backup space free of charge.
|
||||
|
||||
* This is
|
||||
* a list
|
||||
62
community_backup/webui/templates/base.html
Normal file
62
community_backup/webui/templates/base.html
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Community Backup</title>
|
||||
</head>
|
||||
<body style="display: flex; flex-direction: column; height: 100vh">
|
||||
<header class="bg-body-tertiary">
|
||||
<div class="container">
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/" >Community Backup</a>
|
||||
<div class="navbar-nav">
|
||||
{% if request.user.is_authenticated %}
|
||||
<a class="nav-link" href="{% url 'borg_list' %}">Borg Repositories</a>
|
||||
<div class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{ user.username }}
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><form method=post action="{% url 'logout' %}?next={% url 'landing' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn dropdown-item">Logout</button>
|
||||
</form></li>
|
||||
<li><a class="dropdown-item" href="{% url 'password_change' %}">Change Password</a></li>
|
||||
{% if user.is_staff %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="{% url 'admin:index' %}">Admin</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<a class="btn nav-item" type="button" href="{% url 'login' %}?next={% url 'landing' %}">Login</a>
|
||||
<a class="btn nav-item" type="button" href="{% url 'register' %}">Register</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main class="container" style="flex: 1 1 auto">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
<footer class="bg-body-tertiary">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{% url "about" %}">About</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">Imprint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
7
community_backup/webui/templates/borg_edit.html
Normal file
7
community_backup/webui/templates/borg_edit.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form action="{% url borg_edit %}">
|
||||
{{ form }}
|
||||
</form>
|
||||
{% endblock %}
|
||||
28
community_backup/webui/templates/borg_list.html
Normal file
28
community_backup/webui/templates/borg_list.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex">
|
||||
<div class="p-2 ms-auto">
|
||||
<a class="btn btn-primary" href="{% url 'borg_add' %}" role="button">Add Repository</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Key</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for repo in object_list %}
|
||||
<tr>
|
||||
<td>{{ repo.name }}</td>
|
||||
<td>{{ repo.key }}</td>
|
||||
<td><a href="{% url 'borg_update' pk=repo.pk %}" class="btn btn-warning btn-sm">Edit</a>
|
||||
<a href="{% url 'borg_delete' pk=repo.pk %}" class="btn btn-danger btn-sm">Delete</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
||||
7
community_backup/webui/templates/landing.html
Normal file
7
community_backup/webui/templates/landing.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<row class="text-center p-2">
|
||||
<h1>Welcome to Community Backup!</h1>
|
||||
</row>
|
||||
{% endblock %}
|
||||
1
community_backup/webui/templates/login.html
Normal file
1
community_backup/webui/templates/login.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
Hello at the login template
|
||||
7
community_backup/webui/templates/markdown.html
Normal file
7
community_backup/webui/templates/markdown.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<row class="p-2">
|
||||
{{ markdown_content|safe }}
|
||||
</row>
|
||||
{% endblock %}
|
||||
28
community_backup/webui/templates/register.html
Normal file
28
community_backup/webui/templates/register.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{% extends "base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if form.errors %}
|
||||
{% for error in form.errors %}
|
||||
<p>{{ error }}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if next %}
|
||||
{% if user.is_authenticated %}
|
||||
<p>Your account doesn't have access to this page. To proceed,
|
||||
please login with an account that has access.</p>
|
||||
{% else %}
|
||||
<p>Please login to see this page.</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="{% url 'register' %}">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input class="btn btn-primary" type="submit" value="Register">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
26
community_backup/webui/templates/registration/login.html
Normal file
26
community_backup/webui/templates/registration/login.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{% extends "base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if form.errors %}
|
||||
<p>Your username and password didn't match. Please try again.</p>
|
||||
{% endif %}
|
||||
|
||||
{% if next %}
|
||||
{% if user.is_authenticated %}
|
||||
<p>Your account doesn't have access to this page. To proceed,
|
||||
please login with an account that has access.</p>
|
||||
{% else %}
|
||||
<p>Please login to see this page.</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="{% url 'login' %}">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input class="btn btn-primary" type="submit" value="login">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{% extends "base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to delete "{{ object.name }}"?</p>
|
||||
{{ form }}
|
||||
<input class="btn btn-danger" type="submit" value="Confirm">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% load crispy_forms_tags %}
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{% if form.initial %}
|
||||
<input class="btn btn-primary" type="submit" value="Save">
|
||||
{% else %}
|
||||
<input class="btn btn-primary" type="submit" value="Add">
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue