refactor template structure

This commit is contained in:
j3d1 2021-10-17 22:45:49 +02:00
parent 73046dd6a7
commit 9e40022aca
8 changed files with 129 additions and 141 deletions

View file

@ -1,4 +1,4 @@
{% extends 'multimail/base.html' %}
{% extends 'multimail/page.html' %}
{% block content %}
<h1 class="mt-4">Aliases</h1>

View file

@ -22,65 +22,8 @@
<body>
<div class="d-flex" id="wrapper">
<!-- Sidebar -->
<div class="bg-dark border-right" id="sidebar-wrapper">
<div class="sidebar-heading">
<a href="{% url 'multimail:index' %}" class="link-unstyled">Multimail</a>
</div>
<div class="list-group list-group-flush">
<a href="{% url 'multimail:domains' %}" class="list-group-item list-group-item-action bg-dark">Domains</a>
<a href="{% url 'multimail:mailboxes' %}"
class="list-group-item list-group-item-action bg-dark">Mailboxes</a>
<a href="{% url 'multimail:aliases' %}" class="list-group-item list-group-item-action bg-dark">Aliases</a>
</div>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark border-bottom">
<button class="btn btn-link btn-lg" id="menu-toggle"><i class="fas fa-bars"></i></button>
<button class="navbar-toggler btn btn-link btn-lg" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-user"></i>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<!--li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ user }}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Nothing</a>
<div class="dropdown-divider"></div>
<a href="{% url 'multimail:logout' %}" class="dropdown-item">Logout</a>
</div>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
{% block content %}
{% endblock %}
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
<!-- /#wrapper -->
{% block main %}
{% endblock %}
<!-- Bootstrap core JavaScript -->
<script src="{% static 'vendor/jquery/jquery.slim.min.js' %}"></script>

View file

@ -1,4 +1,4 @@
{% extends 'multimail/base.html' %}
{% extends 'multimail/page.html' %}
{% block content %}
<h1 class="mt-4">Domains</h1>

View file

@ -1,4 +1,4 @@
{% extends 'multimail/base.html' %}
{% extends 'multimail/page.html' %}
{% load bootstrap4 %}
{% block content %}

View file

@ -1,4 +1,4 @@
{% extends 'multimail/base.html' %}
{% extends 'multimail/page.html' %}
{% block content %}
<div class="pt-3">

View file

@ -1,83 +1,63 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
{% extends 'multimail/base.html' %}
<head>
{% block main %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Multimail</title>
<!-- Bootstrap core CSS -->
<link href="{% static 'multimail/css/bootstrap.min.css' %}" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="{% static 'multimail/css/simple-sidebar.css' %}" rel="stylesheet">
<link href="{% static "fontawesome/css/all.min.css" %}" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="container" style="height:100vh;">
<div class="row h-100 justify-content-center align-items-center">
<div class="card col-6 bg-dark">
<article class="card-body">
<h4 class="card-title text-center mb-4 mt-1">Sign in</h4>
<hr>
{% if form.non_field_errors %}
<div class="alert alert-danger" role="alert">
<ul>
{% for error in form.non_field_errors %}
<li>{{ error|escape }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
<form method="POST">{% csrf_token %}
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"> <i class="fa fa-user"></i> </span>
</div>
<input id="{{ form.username.id_for_label }}" name="{{ form.username.html_name }}"
class="form-control" placeholder="Email or login" type="text" requird>
</div> <!-- input-group.//-->
{% if form.username.errors %}
<p class="text-danger text-center">
{% for error in form.username.errors %}
{{ error|escape }}<br>
<div class="container" style="height:100vh;">
<div class="row h-100 justify-content-center align-items-center">
<div class="card col-6 bg-dark">
<article class="card-body">
<h4 class="card-title text-center mb-4 mt-1">Sign in</h4>
<hr>
{% if form.non_field_errors %}
<div class="alert alert-danger" role="alert">
<ul>
{% for error in form.non_field_errors %}
<li>{{ error|escape }}</li>
{% endfor %}
</p>
{% endif %}
</div> <!-- form-group// -->
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"> <i class="fa fa-lock"></i> </span>
</div>
<input id="{{ form.password.id_for_label }}" name="{{ form.password.html_name }}"
class="form-control" placeholder="******" type="password" required>
</div> <!-- input-group.// -->
{% if form.password.errors %}
<p class="text-danger text-center">
{% for error in form.password.errors %}
{{ error|escape }}<br>
{% endfor %}
</p>
{% endif %}
</div> <!-- form-group// -->
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block"> Login</button>
</div> <!-- form-group// -->
<!--p class="text-center"><a href="#" class="btn">Forgot password?</a></p-->
</form>
</article>
</ul>
</div>
{% endif %}
<form method="POST">{% csrf_token %}
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"> <i class="fa fa-user"></i> </span>
</div>
<input id="{{ form.username.id_for_label }}" name="{{ form.username.html_name }}"
class="form-control" placeholder="Email or login" type="text" requird>
</div> <!-- input-group.//-->
{% if form.username.errors %}
<p class="text-danger text-center">
{% for error in form.username.errors %}
{{ error|escape }}<br>
{% endfor %}
</p>
{% endif %}
</div> <!-- form-group// -->
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"> <i class="fa fa-lock"></i> </span>
</div>
<input id="{{ form.password.id_for_label }}" name="{{ form.password.html_name }}"
class="form-control" placeholder="******" type="password" required>
</div> <!-- input-group.// -->
{% if form.password.errors %}
<p class="text-danger text-center">
{% for error in form.password.errors %}
{{ error|escape }}<br>
{% endfor %}
</p>
{% endif %}
</div> <!-- form-group// -->
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block"> Login</button>
</div> <!-- form-group// -->
<!--p class="text-center"><a href="#" class="btn">Forgot password?</a></p-->
</form>
</article>
</div>
</div>
</div>
</div>
</body>
</html>
{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'multimail/base.html' %}
{% extends 'multimail/page.html' %}
{% block content %}
<h1 class="mt-4">Mailboxes</h1>

View file

@ -0,0 +1,65 @@
{% extends 'multimail/base.html' %}
{% load static %}
{% block main %}
<div class="d-flex" id="wrapper">
<!-- Sidebar -->
<div class="bg-dark border-right" id="sidebar-wrapper">
<div class="sidebar-heading">
<a href="{% url 'multimail:index' %}" class="link-unstyled">Multimail</a>
</div>
<div class="list-group list-group-flush">
<a href="{% url 'multimail:domains' %}" class="list-group-item list-group-item-action bg-dark">Domains</a>
<a href="{% url 'multimail:mailboxes' %}"
class="list-group-item list-group-item-action bg-dark">Mailboxes</a>
<a href="{% url 'multimail:aliases' %}" class="list-group-item list-group-item-action bg-dark">Aliases</a>
</div>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark border-bottom">
<button class="btn btn-link btn-lg" id="menu-toggle"><i class="fas fa-bars"></i></button>
<button class="navbar-toggler btn btn-link btn-lg" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-user"></i>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<!--li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ user }}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Nothing</a>
<div class="dropdown-divider"></div>
<a href="{% url 'multimail:logout' %}" class="dropdown-item">Logout</a>
</div>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
{% block content %}
{% endblock %}
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
{% endblock %}