Update
parent
c8dd8ef4fc
commit
175e13da4f
@ -0,0 +1,57 @@
|
||||
<!-- abac/templates/base.html -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Privacy Preserving ABAC{% endblock %}</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body class="d-flex flex-column min-vh-100">
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<a class="navbar-brand" href="{% url 'home' %}">Privacy Preserving ABAC</a>
|
||||
<span class="navbar-text ml-auto">
|
||||
{% if user.is_authenticated %}
|
||||
{{ user.username }}
|
||||
<a class="btn btn-outline-light ml-3" href="{% url 'logout' %}">Logout</a>
|
||||
{% else %}
|
||||
<a class="btn btn-outline-light" href="{% url 'login' %}">Login</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</nav>
|
||||
{% if user.is_authenticated %}
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<button class="btn btn-primary">Upload File</button>
|
||||
{% if perms.abac.can_create_users %}
|
||||
<button class="btn btn-primary ml-2">Create User</button>
|
||||
{% endif %}
|
||||
<span class="ml-auto">
|
||||
<button class="btn btn-primary">Upload Certificate</button>
|
||||
</span>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
<main class="flex-shrink-0">
|
||||
<div class="container mt-4">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer mt-auto py-3 bg-dark text-white">
|
||||
<div class="container text-center">
|
||||
<span>© 2023 Privacy Preserving ABAC</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS, Popper.js, and jQuery -->
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,14 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Landing Page{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>All Files</h2>
|
||||
<ul>
|
||||
{% for file in files %}
|
||||
<li>{{ file.name }}</li>
|
||||
{% empty %}
|
||||
<li>No files have been uploaded yet.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
@ -0,0 +1,12 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Login{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Login</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
{% endblock %}
|
@ -0,0 +1,11 @@
|
||||
# abac/urls.py
|
||||
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.urls import path
|
||||
|
||||
from .views import landing_page
|
||||
|
||||
urlpatterns = [
|
||||
path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'),
|
||||
path('', landing_page, name='home'),
|
||||
]
|
Loading…
Reference in New Issue