2025.10.06-03:08:05

This commit is contained in:
2025-10-06 03:08:05 +02:00
parent 38a85cb9d5
commit e08b03bb42
57 changed files with 3222 additions and 157 deletions

View File

@@ -0,0 +1,91 @@
{% extends "account/base_manage_email.html" %}
{% load static allauth i18n widget_tweaks %}
{% block head_title %}
{% trans "Email Addresses" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Email Addresses" %}
{% endelement %}
{% if emailaddresses %}
{% element p %}
{% trans 'The following email addresses are associated with your account:' %}
{% endelement %}
{% url 'account_email' as email_url %}
{% element form form=form action=email_url method="post" tags="email,list" %}
{% slot body %}
{% csrf_token %}
{% for radio in emailaddress_radios %}
{% with emailaddress=radio.emailaddress %}
{% element field type="radio" checked=radio.checked name="email" value=emailaddress.email id=radio.id %}
{% slot label %}
{{ emailaddress.email }}
{% if emailaddress.verified %}
{% element badge tags="success,email,verified" %}
{% translate "Verified" %}
{% endelement %}
{% else %}
{% element badge tags="warning,email,unverified" %}
{% translate "Unverified" %}
{% endelement %}
{% endif %}
{% if emailaddress.primary %}
{% element badge tags="email,primary" %}
{% translate "Primary" %}
{% endelement %}
{% endif %}
{% endslot %}
{% endelement %}
{% endwith %}
{% endfor %}
{% endslot %}
{% slot actions %}
<div class="text-end">
{% element button type="submit" class="btn btn-primary mb-3" name="action_primary" %}
{% trans 'Make Primary' %}
{% endelement %}
{% element button tags="secondary" class="btn btn-secondary mb-3" type="submit" name="action_send" %}
{% trans 'Re-send Verification' %}
{% endelement %}
{% element button class="btn btn-danger mb-3" tags="danger,delete" type="submit" name="action_remove" %}
{% trans 'Remove' %}
{% endelement %}
</div>
{% endslot %}
{% endelement %}
{% else %}
{% include "account/snippets/warn_no_email.html" %}
{% endif %}
{% if can_add_email %}
{% element h2 %}
{% trans "Add Email Address" %}
{% endelement %}
{% url 'account_email' as action_url %}
{% element form form=form method="post" action=action_url tags="email,add" %}
{% slot body %}
{% csrf_token %}
<div class="form-floating form-floating-sm mb-3">
{% render_field form.email class="form-control" placeholder="Neue Email-Adresse" %}
<label for="id_email">Neue Email-Adresse</label>
</div>
{% endslot %}
{% slot actions %}
<div class="text-end">
{% element button name="action_add" class="btn btn-success" type="submit" %}
{% trans "Add Email" %}
{% endelement %}
</div>
{% endslot %}
{% endelement %}
{% endif %}
{% endblock content %}
{% block extra_body %}
<script src="{% static 'account/js/account.js' %}"></script>
<script src="{% static 'account/js/onload.js' %}"></script>
<script data-allauth-onload="allauth.account.forms.manageEmailForm" type="application/json">{
"i18n": {"confirmDelete": "{% trans 'Do you really want to remove the selected email address?' %}"}
}
</script>
{% endblock extra_body %}

View File

@@ -0,0 +1,68 @@
{% extends "account/base_manage_email.html" %}
{% load i18n %}
{% load allauth %}
{% block head_title %}
{% trans "Email Address" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Email Address" %}
{% endelement %}
{% if not emailaddresses %}
{% include "account/snippets/warn_no_email.html" %}
{% endif %}
{% url 'account_email' as action_url %}
{% element form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{% if current_emailaddress %}
{% element field id="current_email" disabled=True type="email" value=current_emailaddress.email %}
{% slot label %}
{% translate "Current email" %}:
{% endslot %}
{% endelement %}
{% endif %}
{% if new_emailaddress %}
{% element field id="new_email" value=new_emailaddress.email disabled=True type="email" %}
{% slot label %}
{% if not current_emailaddress %}
{% translate "Current email" %}:
{% else %}
{% translate "Changing to" %}:
{% endif %}
{% endslot %}
{% slot help_text %}
{% blocktranslate %}Your email address is still pending verification.{% endblocktranslate %}
{% element button class="btn btn-secondary" form="pending-email" type="submit" name="action_send" tags="minor,secondary" %}
{% trans 'Re-send Verification' %}
{% endelement %}
{% if current_emailaddress %}
{% element button class="btn btn-danger" form="pending-email" type="submit" name="action_remove" tags="danger,minor" %}
{% trans 'Cancel Change' %}
{% endelement %}
{% endif %}
{% endslot %}
{% endelement %}
{% endif %}
{% element field id=form.email.auto_id name="email" value=form.email.value errors=form.email.errors type="email" %}
{% slot label %}
{% translate "Change to" %}:
{% endslot %}
{% endelement %}
{% endslot %}
{% slot actions %}
{% element button class="btn btn-primary" name="action_add" type="submit" %}
{% trans "Change Email" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% if new_emailaddress %}
<form style="display: none"
id="pending-email"
method="post"
action="{% url 'account_email' %}">
{% csrf_token %}
<input type="hidden" name="email" value="{{ new_emailaddress.email }}">
</form>
{% endif %}
{% endblock content %}

View File

@@ -0,0 +1,41 @@
{% extends "account/base_entrance.html" %}
{% load i18n %}
{% load account %}
{% load allauth %}
{% block head_title %}
{% trans "Confirm Email Address" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Confirm Email Address" %}
{% endelement %}
{% if confirmation %}
{% user_display confirmation.email_address.user as user_display %}
{% if can_confirm %}
{% element p %}
{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an email address for user {{ user_display }}.{% endblocktrans %}
{% endelement %}
{% url 'account_confirm_email' confirmation.key as action_url %}
{% element form method="post" action=action_url %}
{% slot actions %}
{% csrf_token %}
{{ redirect_field }}
<div class="text-end">
{% element button class="btn btn-success" type="submit" %}
{% trans 'Confirm' %}
{% endelement %}
</div>
{% endslot %}
{% endelement %}
{% else %}
{% element p %}
{% blocktrans %}Unable to confirm {{ email }} because it is already confirmed by a different account.{% endblocktrans %}
{% endelement %}
{% endif %}
{% else %}
{% url 'account_email' as email_url %}
{% element p %}
{% blocktrans %}This email confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new email confirmation request</a>.{% endblocktrans %}
{% endelement %}
{% endif %}
{% endblock content %}

View File

@@ -0,0 +1,49 @@
{% extends 'base.html' %}
{% load i18n widget_tweaks allauth account socialaccount %}
{% block head_title %}cmoser.eu - {% translate 'Log in' %}{% endblock head_title %}
{% block content %}
<main class="card rounded mx-auto p-4" style="width:30rem;">
<div class="card-body">
<div class="d-flex flex-column">
<div class="flex flex-col text-center mb-4">
<h1 class="h3">Melde dich bei deinem Account an</h1>
<form method="POST" class="mb-4">
{% csrf_token %}
{% if form.errors %}
{% for field, errors in form.errors.items %}
{% for error in errors %}
<div class="p-2 my-2 text-sm text-red-700 bg-red-50 rounded-md border-red-300 border">
{{ error }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
<div class="form-floating mb-3">
{% render_field form.login class="form-control" placeholder="Emailadresse" %}
<label for="{{ form.login.id_for_label }}">Emailaddresse</label>
</div>
<div class="form-floating mb-3">
{% render_field form.password class="form-control" %}
<label for="{{ form.password.id_for_label }}">Passwort</label>
</div>
<div>
{% render_field form.remember class="input-checked" %}
<label class="input-checked-label" for="{{ form.remember.id_for_label }}">{{ form.remember.label }}</label>
</div>
<div class="text-end">
<button type="submit" class="btn btn-success">Sign in</button>
</div>
</form>
</div>
<hr>
<h2 class="h4 text-center">Oder nutze deinen Socialaccount</h3>
{% if SOCIALACCOUNT_ENABLED %}
{% include 'socialaccount/snippets/login.html' with page_layout="entrance" %}
{% endif %}
</div>
</main>
{% endblock content %}

View File

@@ -0,0 +1,39 @@
{% extends "account/base_manage_password.html" %}
{% load allauth i18n widget_tweaks %}
{% block head_title %}
{% trans "Change Password" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Change Password" %}
{% endelement %}
{% url 'account_change_password' as action_url %}
{% element form form=form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{#{{ redirect_field }}#}
{# {% element fields form=form %}{% endelement %} #}
<div class="form-floating form-floating-sm mb-3">
{% render_field form.oldpassword placeholder="Aktuelles Passwort" class="form-control" %}
<label for="{{ id_oldpassword }}">Aktuelles Passwort</label>
</div>
<div class="form-floating form-floating-sm mb-3">
{% render_field form.password1 class="form-control" placehoder="Neues Passwort" autocomplete="new-password" required="" %}
<label for="{{ id_password1 }}">Neues Passwort</label>
</div>
<div class="form-floating form-flaoting-sm mb-3">
{% render_field form.password2 class="form-control" placehoder="Neues Passwort" autocomplete="new-password" required="" %}
<label for="{{ id_password2 }}">Neues Passwort</label>
</div>
{% endslot %}
{% slot actions %}
<div class="text-end">
<a class="me-2" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
{% element button class="btn btn-primary" type="submit" %}
{% trans "Change Password" %}
{% endelement %}
</div>
{% endslot %}
{% endelement %}
{% endblock content %}

View File

@@ -0,0 +1,38 @@
{% extends "account/base_entrance.html" %}
{% load i18n allauth account widget_tweaks %}
{% block head_title %}
{% trans "Password Reset" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Password Reset" %}
{% endelement %}
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
{% element p %}
{% trans "Forgotten your password? Enter your email address below, and we'll send you an email allowing you to reset it." %}
{% endelement %}
{% url 'account_reset_password' as reset_url %}
{% element form form=form method="post" action=reset_url %}
{% slot body %}
{% csrf_token %}
{{ redirect_field }}
<div class="form-floating form-floating-sm">
{% render_field form.email name="email" autocomplete="email" placeholder="E-Mail-Adresse" max-length="320" required="" class="form-control mb-3" %}
<label for="id_email">E-Mail-Adresse</label>
</div>
{% endslot %}
{% slot actions %}
<div class="text-end mb-3">
{% element button type="submit" class="btn btn-primary" %}
{% trans 'Reset My Password' %}
{% endelement %}
</div>
{% endslot %}
{% endelement %}
{% element p %}
{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
{% endelement %}
{% endblock content %}

View File

@@ -0,0 +1,13 @@
{% load allauth %}
{% comment %} djlint:off {% endcomment %}
<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %}
{% if attrs.form %}form="{{ attrs.form }}"{% endif %}
{% if attrs.id %}id="{{ attrs.id }}"{% endif %}
{% if attrs.name %}name="{{ attrs.name }}"{% endif %}
{% if attrs.value %}value="{{ attrs.value }}"{% endif %}
{% if attrs.type %}type="{{ attrs.type }}"{% endif %}
{% if attrs.class %}class="{{ attrs.class }}"{% endif %}
>
{% slot %}
{% endslot %}
</{% if attrs.href %}a{% else %}button{% endif %}>

View File

@@ -0,0 +1,21 @@
{% load static %}
{% if not attrs.name|lower == "openid" %}
<li class="list-group-item">
<a title="{{ attrs.name }}" href="{{ attrs.href }}" class="icon-link">
{% if attrs.name|lower == "steam" %}
<svg class="bi">
<use xlink:href="{% static "img/bootstrap-icons.svg" %}#steam"></use>
</svg>
{% elif attrs.name|lower == "github" %}
<svg class="bi">
<use xlink:href="{% static "img/bootstrap-icons.svg" %}#github"></use>
</svg>
{% elif attrs.name|lower == "google" %}
<svg class="bi">
<use xlink:href="{% static "img/bootstrap-icons.svg" %}#google"></use>
</svg>
{% endif %}
{{ attrs.name }}
</a>
</li>
{% endif %}

View File

@@ -0,0 +1,5 @@
{% load allauth %}
<ul class="list-group">
{% slot %}
{% endslot %}
</ul>

View File

@@ -0,0 +1,2 @@
{% extends 'base.html' %}

View File

@@ -7,6 +7,9 @@
<title>TinyWiki</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
{% block extra_css %}{% endblock %}
<style>
{% block style %}{% endblock %}
</style>
<script>
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'));
</script>
@@ -15,8 +18,8 @@
<body class="min-vh-100 d-flex flex-column">
<div class="container-fluid">
<div class="row bg-info px-2">
<div clas="col-md-12 text-white">
<div class="row bg-primary pt-2">
<div clas="col-md-12 text-white ">
{% if brand_logo %}
<img class="mb2 me-2" width="46" height="46" src="{{ brand_logo }}">
{% else %}
@@ -26,7 +29,7 @@
{% endif %}
<span class="display-6 font-weight-bold text-white me-2">{{ brand_name }}</span>
{% if subtitle %}
<span class="h2">{{ subtitle }}</h2>
<span class="h2 text-truncate-sm">{{ subtitle }}</h2>
{% endif %}
</div>
</div>
@@ -61,8 +64,25 @@
</ul>
</div>
</div>
<div class="row h-100">
<div class="col-lg-3">
<div class="row h-100 mb-4">
<div class="col-lg-3 pt-6 px-4 d-none d-lg-block" >
<ul class="list-group mt-2">
<li class="list-group-item bg-primary text-white">
<span class="list-group-badge">TinyWiki Pages</span>
</li>
<li class="list-group-item">
<a href="{% url "tinywiki:page" slug="tw-bbcode" %}">BBCode Guide</a>
</li>
<li class="list-group-item">
<a href="{% url "tinywiki:page" slug="tw-markdown" %}">Markdown Guide</a>
</li>
<li class="list-group-item">
<a href="{% url "tinywiki:page" slug="tw-license" %}">TinyWiki License</a>
</li>
<li class="list-group-item">
<a href="{% url "tinywiki:page" slug="tw-bootstrap-license" %}">Bootstrap License</a>
</li>
</ul>
</div>
<div class="col-lg-6">
<main>
@@ -83,6 +103,7 @@
<a class="text-white" href="{% url 'tinywiki:page' 'tw-license' %}"> &copy; 2025</a>
</span>
</footer>
{% block extra_body %}{% endblock extra_body %}
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.min.js"></script>
{% block extra_scripts %}{% endblock extra_scripts %}

View File

@@ -0,0 +1,55 @@
{% extends 'base.html' %}
{# {% extends "socialaccount/base_manage.html" %} #}
{% load i18n %}
{% load allauth %}
{% block head_title %}
{% trans "Account Connections" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Account Connections" %}
{% endelement %}
{% if form.accounts %}
{% element p %}
{% blocktrans %}You can sign in to your account using any of the following third-party accounts:{% endblocktrans %}
{% endelement %}
{% url 'socialaccount_connections' as action_url %}
{% element form form=form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{% for acc in form.fields.account.choices %}
{% with account=acc.0.instance.get_provider_account %}
{% setvar radio_id %}
id_account_{{ account.account.pk }}
{% endsetvar %}
{% setvar tags %}
socialaccount,{{ account.account.provider }}
{% endsetvar %}
{% element field id=radio_id type="radio" name="account" value=account.account.pk %}
{% slot label %}
{{ account }}
{% element badge tags=tags %}
{{ account.get_brand.name }}
{% endelement %}
{% endslot %}
{% endelement %}
{% endwith %}
{% endfor %}
{% endslot %}
{% slot actions %}
{% element button tags="delete,danger" class="btn btn-danger" type="submit" %}
{% trans 'Remove' %}
{% endelement %}
{% endslot %}
{% endelement %}
{% else %}
{% element p %}
{% trans 'You currently have no third-party accounts connected to this account.' %}
{% endelement %}
{% endif %}
{% element h2 %}
{% trans 'Add a Third-Party Account' %}
{% endelement %}
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
{% include "socialaccount/snippets/login_extra.html" %}
{% endblock content %}

View File

@@ -0,0 +1,18 @@
{% load allauth socialaccount %}
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
{% element provider_list %}
{% for provider in socialaccount_providers %}
{% if not provider.name == "OpenID" %}
{% for brand in provider.get_brands %}
{% provider_login_url provider openid=brand.openid_url process=process as href %}
{% element provider name=brand.name provider_id=provider.id href=href %}
{% endelement %}
{% endfor %}
{% endif %}
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
{% element provider name=provider.name provider_id=provider.id href=href %}
{% endelement %}
{% endfor %}
{% endelement %}
{% endif %}