Begin work on the management panel

This commit is contained in:
Mark Veidemanis 2022-07-21 22:22:20 +01:00
parent 3cb908e6ae
commit c66055db9d
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
4 changed files with 135 additions and 0 deletions

View File

@ -37,6 +37,37 @@
</script> </script>
<style> <style>
.icon { border-bottom: 0px !important;} .icon { border-bottom: 0px !important;}
.navbar-item.is-hoverable:hover .navbar-dropdown .navbar-dropdown {
display: none;
}
.navbar-dropdown .navbar-item.is-hoverable:hover > .navbar-dropdown {
display: block;
}
.navbar-dropdown .navbar-item .navbar-dropdown {
top: -10px;
margin-left: 100%;
box-shadow: 0 16px 8px -8px rgba(10,10,10,.1), 8px 0 8px -8px rgba(10,10,10,.1);
}
.navbar-dropdown .navbar-item.has-dropdown {
padding: 0;
}
.navbar-dropdown .navbar-item.has-dropdown > .navbar-link {
width: 100%;
padding: .375rem 1rem;
background-color: #fff;
}
.navbar-dropdown .navbar-item.has-dropdown:hover > .navbar-link {
background-color: #f5f5f5;
}
.navbar-dropdown .navbar-item.has-dropdown > .navbar-link:not(.is-arrowless) {
padding-right: 2.5em;
}
</style> </style>
</head> </head>
<body> <body>
@ -64,6 +95,95 @@
Billing Billing
</a> </a>
{% endif %} {% endif %}
{% if user.is_superuser %}
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Manage
</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="#">
Pages
</a>
<a class="navbar-item" href="#">
Docs
</a>
<a class="navbar-item" href="#">
Users
</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Threshold
</a>
<div class="navbar-dropdown">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
IRC
</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="#">
Overview
</a>
<a class="navbar-item" href="#">
Networks
</a>
<a class="navbar-item" href="#">
Aliases
</a>
<a class="navbar-item" href="#">
Relays
</a>
<a class="navbar-item" href="#">
Channels
</a>
<a class="navbar-item" href="#">
AutoReg
</a>
<a class="navbar-item" href="#">
IRCs
</a>
<a class="navbar-item" href="#">
Tools
</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Discord
</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="#">
Overview
</a>
<a class="navbar-item" href="#">
Accounts
</a>
<a class="navbar-item" href="#">
Guilds
</a>
</div>
</div>
<a class="navbar-item" href="#">
Emails
</a>
<a class="navbar-item" href="#">
Client
</a>
<a class="navbar-item" href="#">
Tokens
</a>
</div>
</div>
<hr class="navbar-divider">
<a class="navbar-item" href="mailto:help@pathogen.is">
Report an issue
</a>
</div>
</div>
{% endif %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div class="navbar-item has-dropdown is-hoverable"> <div class="navbar-item has-dropdown is-hoverable">

View File

@ -0,0 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div class="block">
<h1> hello</h1>
{{ perms.app }}
</div>
{% endblock %}

View File

@ -0,0 +1,6 @@
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
class SuperUserRequiredMixin(LoginRequiredMixin, UserPassesTestMixin):
def test_func(self):
return self.request.user.is_superuser

View File