mirror of
https://github.com/MOIS3Y/logs-collector.git
synced 2025-09-13 13:13:01 +02:00
Refactoring: new multi app structure
This commit is contained in:
@@ -1,42 +1,18 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="auto">
|
||||
<head>
|
||||
{% include 'collector/includes/metalinks.html' %}
|
||||
<title>Collector - {% block title %}{% endblock %}</title>
|
||||
{% block extra_media %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<!-- Two factor auth-->
|
||||
<section>
|
||||
<header>
|
||||
{% block 'navigation' %}{% endblock 'navigation' %}
|
||||
</header>
|
||||
</section>
|
||||
<section>
|
||||
<main>
|
||||
<div
|
||||
class="d-flex min-vh-100 align-items-center py-4 bg-body-tertiary"
|
||||
cz-shortcut-listen="true" >
|
||||
{% block content_wrapper %}
|
||||
<div class="container">
|
||||
<div class="row">{% block content %}{% endblock %}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
<!-- Theme switcher-->
|
||||
<section>
|
||||
<footer>
|
||||
<div
|
||||
class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle"
|
||||
>
|
||||
{% include 'collector/includes/theme_swither.html' %}
|
||||
</div>
|
||||
</footer>
|
||||
</section>
|
||||
<script src="{% static 'collector/js/bootstrap.bundle.min.js' %}"></script>
|
||||
<script src="{% static 'collector/js/bs.theme.mode.js' %}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
{% block account_head %}
|
||||
<title>Collector - {% block title %}{% endblock %}</title>
|
||||
{% block extra_media %}{% endblock %}
|
||||
{% endblock account_head %}
|
||||
|
||||
{% block account_content %}
|
||||
{% block content_wrapper %}
|
||||
{% block content %}{% endblock %}
|
||||
{% endblock %}
|
||||
<section>
|
||||
<footer>
|
||||
{% block theme_switcher %}{% endblock %}
|
||||
</footer>
|
||||
</section>
|
||||
{% endblock account_content %}
|
||||
|
@@ -1,11 +1,22 @@
|
||||
{% extends "two_factor/_base.html" %}
|
||||
|
||||
{% block content_wrapper %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4 offset-md-4">
|
||||
{% block content %}{% endblock %}
|
||||
<section>
|
||||
<header>
|
||||
{% block nav %}{% endblock nav %}
|
||||
</header>
|
||||
</section>
|
||||
<section>
|
||||
<main>
|
||||
<div class="container mt-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-center">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
@@ -1,13 +1,15 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% if cancel_url %}
|
||||
<a href="{{ cancel_url }}"
|
||||
class="float-right btn btn-link">{% trans "Cancel" %}</a>
|
||||
<a href="{{ cancel_url }}" class="float-right btn btn-link">{% trans "Cancel" %}</a>
|
||||
{% endif %}
|
||||
{% if wizard.steps.prev %}
|
||||
<button name="wizard_goto_step" type="submit"
|
||||
value="{{ wizard.steps.prev }}"
|
||||
class="btn btn-secondary">{% trans "Back" %}</button>
|
||||
<button
|
||||
name="wizard_goto_step"
|
||||
type="submit"
|
||||
value="{{ wizard.steps.prev }}"
|
||||
class="btn btn-secondary">{% trans "Back" %}
|
||||
</button>
|
||||
{% else %}
|
||||
<button disabled name="" type="button" class="btn">{% trans "Back" %}</button>
|
||||
{% endif %}
|
||||
|
@@ -1,18 +1,23 @@
|
||||
{% extends "two_factor/_base_focus.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block nav %}{% include 'includes/navigation.html' %}{% endblock nav %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}{% trans "Backup Tokens" %}{% endblock %}</h1>
|
||||
<p>{% blocktrans trimmed %}Backup tokens can be used when your primary and backup
|
||||
phone numbers aren't available. The backup tokens below can be used
|
||||
for login verification. If you've used up all your backup tokens, you
|
||||
can generate a new set of backup tokens. Only the backup tokens shown
|
||||
below will be valid.{% endblocktrans %}</p>
|
||||
|
||||
<h1>{% block title %}{% trans "Backup Tokens" %}{% endblock %}</h1>
|
||||
<div class="mb-3 d-flex justify-content-center">
|
||||
<p>{% blocktrans trimmed %}Backup tokens can be used when your primary and backup
|
||||
phone numbers aren't available. The backup tokens below can be used
|
||||
for login verification. If you've used up all your backup tokens, you
|
||||
can generate a new set of backup tokens. Only the backup tokens shown
|
||||
below will be valid.{% endblocktrans %}</p>
|
||||
</div>
|
||||
{% if device.token_set.count %}
|
||||
<ul>
|
||||
<ul class="list-group">
|
||||
{% for token in device.token_set.all %}
|
||||
<li>{{ token.token }}</li>
|
||||
<li class="list-group-item list-group-item-action">{{ token.token }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p>{% blocktrans %}Print these tokens and keep them somewhere safe.{% endblocktrans %}</p>
|
||||
@@ -20,9 +25,11 @@
|
||||
<p>{% trans "You don't have any backup codes yet." %}</p>
|
||||
{% endif %}
|
||||
|
||||
<form method="post">{% csrf_token %}{{ form.as_p }}
|
||||
<a href="{% url 'two_factor:profile'%}"
|
||||
class="float-right btn btn-link">{% trans "Back to Account Security" %}</a>
|
||||
<button class="btn btn-primary" type="submit">{% trans "Generate Tokens" %}</button>
|
||||
<form method="post">{% csrf_token %}{{ form|crispy }}
|
||||
<a
|
||||
href="{% url 'two_factor:profile'%}"
|
||||
class="float-right btn btn-link">{% trans "Back to Account Security" %}
|
||||
</a>
|
||||
<button class="btn btn-outline-primary" type="submit">{% trans "Generate Tokens" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{% extends "two_factor/_base_focus.html" %}
|
||||
{% extends "two_factor/_base.html" %}
|
||||
{% load i18n %}
|
||||
{% load two_factor_tags %}
|
||||
|
||||
@@ -7,51 +7,65 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}{% trans "Login" %}{% endblock %}</h1>
|
||||
|
||||
{% if wizard.steps.current == 'auth' %}
|
||||
<p>{% blocktrans %}Enter your credentials.{% endblocktrans %}</p>
|
||||
{% elif wizard.steps.current == 'token' %}
|
||||
<p>{{ device|as_verbose_action }}</p>
|
||||
{% elif wizard.steps.current == 'backup' %}
|
||||
<p>{% blocktrans trimmed %}Use this form for entering backup tokens for logging in.
|
||||
These tokens have been generated for you to print and keep safe. Please
|
||||
enter one of these backup tokens to login to your account.{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
{% include "two_factor/_wizard_forms.html" %}
|
||||
|
||||
{# hidden submit button to enable [enter] key #}
|
||||
<input type="submit" value="" hidden />
|
||||
|
||||
{% if other_devices %}
|
||||
<p>{% trans "Or, alternatively, use one of your other authentication methods:" %}</p>
|
||||
<p>
|
||||
{% for other in other_devices %}
|
||||
<button name="challenge_device" value="{{ other.persistent_id }}"
|
||||
class="btn btn-secondary btn-block" type="submit">
|
||||
{{ other|as_action }}
|
||||
</button>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% include "two_factor/_wizard_actions.html" %}
|
||||
</form>
|
||||
|
||||
{% block 'backup_tokens' %}
|
||||
{% if backup_tokens %}
|
||||
<hr>
|
||||
<div class="backup_tokens_form">
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
<p>{% trans "As a last resort, you can use a backup token:" %}</p>
|
||||
<div class="d-flex min-vh-100 align-items-center py-4" cz-shortcut-listen="true">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3 offset-md-4">
|
||||
<h1>{% block title %}{% trans "Login" %}{% endblock %}</h1>
|
||||
{% if wizard.steps.current == 'auth' %}
|
||||
<p>{% blocktrans %}Enter your credentials.{% endblocktrans %}</p>
|
||||
{% elif wizard.steps.current == 'token' %}
|
||||
<p>{{ device|as_verbose_action }}</p>
|
||||
{% elif wizard.steps.current == 'backup' %}
|
||||
<p>{% blocktrans trimmed %}Use this form for entering backup tokens for logging in.
|
||||
These tokens have been generated for you to print and keep safe. Please
|
||||
enter one of these backup tokens to login to your account.{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
{% include "two_factor/_wizard_forms.html" %}
|
||||
|
||||
{# hidden submit button to enable [enter] key #}
|
||||
<input type="submit" value="" hidden />
|
||||
|
||||
{% if other_devices %}
|
||||
<p>{% trans "Or, alternatively, use one of your other authentication methods:" %}</p>
|
||||
<p>
|
||||
<button name="wizard_goto_step" type="submit" value="backup"
|
||||
class="btn btn-sm btn-secondary btn-block">{% trans "Use Backup Token" %}</button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% for other in other_devices %}
|
||||
<button name="challenge_device" value="{{ other.persistent_id }}"
|
||||
class="btn btn-secondary btn-block" type="submit">
|
||||
{{ other|as_action }}
|
||||
</button>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% include "two_factor/_wizard_actions.html" %}
|
||||
</form>
|
||||
|
||||
{% block 'backup_tokens' %}
|
||||
{% if backup_tokens %}
|
||||
<hr>
|
||||
<div class="backup_tokens_form">
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
<p>{% trans "As a last resort, you can use a backup token:" %}</p>
|
||||
<p>
|
||||
<button name="wizard_goto_step" type="submit" value="backup"
|
||||
class="btn btn-sm btn-secondary btn-block">{% trans "Use Backup Token" %}</button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<!-- Theme switcher -->
|
||||
{% block theme_switcher %}
|
||||
<div class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle">
|
||||
{% include 'includes/theme_switcher.html' %}
|
||||
</div>
|
||||
{% endblock theme_switcher %}
|
||||
|
@@ -1,20 +1,35 @@
|
||||
{% extends "two_factor/_base_focus.html" %}
|
||||
{% extends "two_factor/_base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}{% trans "Permission Denied" %}{% endblock %}</h1>
|
||||
<div class="d-flex min-vh-100 align-items-center py-4" cz-shortcut-listen="true">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4 offset-md-4">
|
||||
<h1>{% block title %}{% trans "Permission Denied" %}{% endblock %}</h1>
|
||||
|
||||
<p>{% blocktrans trimmed %}The page you requested, enforces users to verify using
|
||||
two-factor authentication for security reasons. You need to enable these
|
||||
security features in order to access this page.{% endblocktrans %}</p>
|
||||
|
||||
<p>{% blocktrans trimmed %}Two-factor authentication is not enabled for your
|
||||
account. Enable two-factor authentication for enhanced account
|
||||
security.{% endblocktrans %}</p>
|
||||
<p>
|
||||
<a href="javascript:history.go(-1)"
|
||||
class="float-right btn btn-link">{% trans "Go back" %}</a>
|
||||
<a href="{% url 'two_factor:setup' %}" class="btn btn-primary">
|
||||
{% trans "Enable Two-Factor Authentication" %}</a>
|
||||
</p>
|
||||
<p>{% blocktrans trimmed %}The page you requested, enforces users to verify using
|
||||
two-factor authentication for security reasons. You need to enable these
|
||||
security features in order to access this page.{% endblocktrans %}</p>
|
||||
|
||||
<p>{% blocktrans trimmed %}Two-factor authentication is not enabled for your
|
||||
account. Enable two-factor authentication for enhanced account
|
||||
security.{% endblocktrans %}</p>
|
||||
<p>
|
||||
<a href="javascript:history.go(-1)"
|
||||
class="float-right btn btn-link">{% trans "Go back" %}</a>
|
||||
<a href="{% url 'two_factor:setup' %}" class="btn btn-primary">
|
||||
{% trans "Enable Two-Factor Authentication" %}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<!-- Theme switcher -->
|
||||
{% block theme_switcher %}
|
||||
<div class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle">
|
||||
{% include 'includes/theme_switcher.html' %}
|
||||
</div>
|
||||
{% endblock theme_switcher %}
|
||||
|
@@ -5,6 +5,8 @@
|
||||
{{ form.media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block nav %}{% include 'includes/navigation.html' %}{% endblock nav %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}{% trans "Enable Two-Factor Authentication" %}{% endblock %}</h1>
|
||||
{% if wizard.steps.current == 'welcome' %}
|
||||
@@ -52,13 +54,14 @@
|
||||
token in the field below. Your YubiKey will be linked to your
|
||||
account.{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
<div class="input-group mb-3 d-flex justify-content-center">
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
{% include "two_factor/_wizard_forms.html" %}
|
||||
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
{% include "two_factor/_wizard_forms.html" %}
|
||||
{# hidden submit button to enable [enter] key #}
|
||||
<input type="submit" value="" hidden />
|
||||
|
||||
{# hidden submit button to enable [enter] key #}
|
||||
<input type="submit" value="" hidden />
|
||||
|
||||
{% include "two_factor/_wizard_actions.html" %}
|
||||
</form>
|
||||
{% include "two_factor/_wizard_actions.html" %}
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
{% extends "two_factor/_base_focus.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block nav %}{% include 'includes/navigation.html' %}{% endblock nav %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}{% trans "Enable Two-Factor Authentication" %}{% endblock %}</h1>
|
||||
|
||||
|
@@ -1,14 +1,19 @@
|
||||
{% extends "two_factor/_base_focus.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block nav %}{% include 'includes/navigation.html' %}{% endblock nav %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}{% trans "Disable Two-factor Authentication" %}{% endblock %}</h1>
|
||||
<p>{% blocktrans trimmed %}You are about to disable two-factor authentication. This
|
||||
weakens your account security, are you sure?{% endblocktrans %}</p>
|
||||
<h1>{% block title %}{% trans "Disable Two-factor Authentication" %}{% endblock %}</h1>
|
||||
<p>{% blocktrans trimmed %}You are about to disable two-factor authentication. This
|
||||
weakens your account security, are you sure?{% endblocktrans %}</p>
|
||||
<div class="input-group mb-3 d-flex justify-content-center">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<table>{{ form.as_table }}</table>
|
||||
<button class="btn btn-danger"
|
||||
type="submit">{% trans "Disable" %}</button>
|
||||
<div>{{ form|crispy }}</div>
|
||||
<button class="btn btn-danger" type="submit">{% trans "Disable" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@@ -1,62 +1,59 @@
|
||||
{% extends "two_factor/_base.html" %}
|
||||
{% extends "two_factor/_base_focus.html" %}
|
||||
{% load i18n %}
|
||||
{% load two_factor_tags %}
|
||||
|
||||
{% block 'navigation' %}
|
||||
{% include 'collector/includes/navigation.html' %}
|
||||
{% endblock 'navigation' %}
|
||||
{% block nav %}{% include 'includes/navigation.html' %}{% endblock nav %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}{% trans "Account Security" %}{% endblock %}</h1>
|
||||
<h1>{% block title %}{% trans "Account Security" %}{% endblock %}</h1>
|
||||
{% if default_device %}
|
||||
<p>{% blocktrans with primary=default_device|as_action %}Primary method: {{ primary }}{% endblocktrans %}</p>
|
||||
|
||||
{% if default_device %}
|
||||
<p>{% blocktrans with primary=default_device|as_action %}Primary method: {{ primary }}{% endblocktrans %}</p>
|
||||
{% if available_phone_methods %}
|
||||
<h2>{% trans "Backup Phone Numbers" %}</h2>
|
||||
<p>{% blocktrans trimmed %}If your primary method is not available, we are able to
|
||||
send backup tokens to the phone numbers listed below.{% endblocktrans %}</p>
|
||||
<ul>
|
||||
{% for phone in backup_phones %}
|
||||
<li>
|
||||
{{ phone|as_action }}
|
||||
<form method="post" action="{% url 'two_factor:phone_delete' phone.id %}"
|
||||
onsubmit="return confirm({% trans 'Are you sure?' %})">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-sm btn-warning"
|
||||
type="submit">{% trans "Unregister" %}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><a href="{% url 'two_factor:phone_create' %}"
|
||||
class="btn btn-info">{% trans "Add Phone Number" %}</a></p>
|
||||
{% endif %}
|
||||
|
||||
<h2>{% trans "Backup Tokens" %}</h2>
|
||||
<p>
|
||||
{% blocktrans trimmed %}If you don't have any device with you, you can access
|
||||
your account using backup tokens.{% endblocktrans %}
|
||||
{% blocktrans trimmed count counter=backup_tokens %}
|
||||
You have only one backup token remaining.
|
||||
{% plural %}
|
||||
You have {{ counter }} backup tokens remaining.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<p><a href="{% url 'two_factor:backup_tokens' %}"
|
||||
class="btn btn-info">{% trans "Show Codes" %}</a></p>
|
||||
|
||||
{% if available_phone_methods %}
|
||||
<h2>{% trans "Backup Phone Numbers" %}</h2>
|
||||
<p>{% blocktrans trimmed %}If your primary method is not available, we are able to
|
||||
send backup tokens to the phone numbers listed below.{% endblocktrans %}</p>
|
||||
<ul>
|
||||
{% for phone in backup_phones %}
|
||||
<li>
|
||||
{{ phone|as_action }}
|
||||
<form method="post" action="{% url 'two_factor:phone_delete' phone.id %}"
|
||||
onsubmit="return confirm({% trans 'Are you sure?' %})">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-sm btn-warning"
|
||||
type="submit">{% trans "Unregister" %}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><a href="{% url 'two_factor:phone_create' %}"
|
||||
class="btn btn-info">{% trans "Add Phone Number" %}</a></p>
|
||||
{% endif %}
|
||||
|
||||
<h2>{% trans "Backup Tokens" %}</h2>
|
||||
<p>
|
||||
{% blocktrans trimmed %}If you don't have any device with you, you can access
|
||||
your account using backup tokens.{% endblocktrans %}
|
||||
{% blocktrans trimmed count counter=backup_tokens %}
|
||||
You have only one backup token remaining.
|
||||
{% plural %}
|
||||
You have {{ counter }} backup tokens remaining.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<p><a href="{% url 'two_factor:backup_tokens' %}"
|
||||
class="btn btn-info">{% trans "Show Codes" %}</a></p>
|
||||
|
||||
<h3>{% trans "Disable Two-Factor Authentication" %}</h3>
|
||||
<p>{% blocktrans trimmed %}However we strongly discourage you to do so, you can
|
||||
also disable two-factor authentication for your account.{% endblocktrans %}</p>
|
||||
<p><a class="btn btn-secondary" href="{% url 'two_factor:disable' %}">
|
||||
{% trans "Disable Two-Factor Authentication" %}</a></p>
|
||||
{% else %}
|
||||
<p>{% blocktrans trimmed %}Two-factor authentication is not enabled for your
|
||||
account. Enable two-factor authentication for enhanced account
|
||||
security.{% endblocktrans %}</p>
|
||||
<p><a href="{% url 'two_factor:setup' %}" class="btn btn-primary">
|
||||
{% trans "Enable Two-Factor Authentication" %}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
<h3>{% trans "Disable Two-Factor Authentication" %}</h3>
|
||||
<p>{% blocktrans trimmed %}However we strongly discourage you to do so, you can
|
||||
also disable two-factor authentication for your account.{% endblocktrans %}</p>
|
||||
<p><a class="btn btn-secondary" href="{% url 'two_factor:disable' %}">
|
||||
{% trans "Disable Two-Factor Authentication" %}</a></p>
|
||||
{% else %}
|
||||
<p>{% blocktrans trimmed %}Two-factor authentication is not enabled for your
|
||||
account. Enable two-factor authentication for enhanced account
|
||||
security.{% endblocktrans %}</p>
|
||||
<p><a href="{% url 'two_factor:setup' %}" class="btn btn-primary">
|
||||
{% trans "Enable Two-Factor Authentication" %}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user