Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes from a first pass at the templates #2

Merged
merged 12 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ In your templates settings for jinja you must have at least the following
"OPTIONS": {
"match_extension": None,
"app_dirname": "jinja2",
"undefined": "jinja2.Undefined",
"context_processors": [
"django.template.context_processors.request",
"django.contrib.messages.context_processors.messages",
Expand Down
4 changes: 2 additions & 2 deletions allauth_jinja/jinja2/account/account_inactive.jinja
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "account/base.jinja" %}

{% block head_title %}
{% trans %}Account Inactive{% endtrans %}
{% trans %}Account Inactive{% endtrans %}
{% endblock head_title %}
{% block content %}
<h1>{% trans %}Account Inactive{% endtrans %}</h1>

<p>{% trans %}This account is inactive.{% endtrans %}</p>
{% endblock content_content %}
{% endblock content %}
2 changes: 1 addition & 1 deletion allauth_jinja/jinja2/account/email/base_message.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
{% block content %}{% endblock %}

Thank you for using {{ current_site.name }}!
{{ site_domain }}
{{ current_site.domain }}
{% endautoescape %}

2 changes: 1 addition & 1 deletion allauth_jinja/jinja2/account/password_reset.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% trans %}
Reset Password
{% endtrans %}
{% endblock account_title %}
{% endblock head_title %}
{% block content %}
{% if request.user.is_authenticated %}
{% include "account/snippets/already_logged_in.jinja" %}
Expand Down
2 changes: 1 addition & 1 deletion allauth_jinja/jinja2/account/signup.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "account/base.html" %}
{% extends "account/base.jinja" %}

{% block head_title %}{% trans %}Sign Up{% endtrans %}{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions allauth_jinja/jinja2/account/signup_closed.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% extends "account/base.html" %}
{% extends "account/base.jinja" %}

{% block head_title %}{% trans %}Sign Up Closed{% endtrans %}{% endblock %}

{% block content %}
<h1>{% trans %}Sign Up Closed{% endtrans %}</h1>

<p>{% trans %}We are sorry, but the sign up is currently closed.{% endtrans %}</p>
<p>{% trans %}We are sorry, but the sign up is currently closed.{% endtrans %}</p>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "account/base.html" %}
{% extends "account/base.jinja" %}

{% block head_title %}{% trans %}Verify Your Email Address{% endtrans %}{% endblock %}
{% block head_title %}{% trans %}Verify Your Email Address{% endtrans %}{% endblock %}

{% block content %}
<h1>{% trans %}Verify Your Email Address{% endtrans %}</h1>
Expand Down
4 changes: 2 additions & 2 deletions allauth_jinja/jinja2/account/verification_sent.jinja
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "account/base.html" %}
{% extends "account/base.jinja" %}

{% block head_title %}{% trans %}Verify Your Email Address{% endtrans %}{% endblock %}
{% block head_title %}{% trans %}Verify Your Email Address{% endtrans %}{% endblock %}

{% block content %}
<h1>{% trans %}Verify Your Email Address{% endtrans %}</h1>
Expand Down
7 changes: 4 additions & 3 deletions allauth_jinja/jinja2/mfa/index.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "account/base.html" %}
{% extends "account/base.jinja" %}
{% block head_title %}
{% trans %}Two-Factor Authentication{% endtrans %}
{% endblock head_title %}
Expand Down Expand Up @@ -26,7 +26,8 @@
<h2>{% trans%}Recovery Codes{% endtrans %}</h2>
{% if authenticators.recovery_codes %}
<p>
{% trans total_count=authenticators.recovery_codes.generate_codes|length unused_count=authenticators.recovery_codes.get_unused_codes|length %}There is {{ unused_count }} out of {{ total_count }} recovery codes available.{% pluralize %}There are {{ unused_count }} out of {{ total_count }} recovery codes available.{% endtrans %}
{% trans total_count=authenticators.recovery_codes.generate_codes|length,
unused_count=authenticators.recovery_codes.get_unused_codes|length %}There is {{ unused_count }} out of {{ total_count }} recovery codes available.{% pluralize %}There are {{ unused_count }} out of {{ total_count }} recovery codes available.{% endtrans %}
</p>
<ul class="actions">
<li>
Expand All @@ -36,7 +37,7 @@
<a href="{{ url('mfa_download_recovery_codes') }}">{% trans %}Download Codes{% endtrans %}</a>
</li>
<li>
<a href="{{ url('mfa_generate_recovery_codes') }}">{% trans %}Generate New Codes</a>
<a href="{{ url('mfa_generate_recovery_codes') }}">{% trans %}Generate New Codes{% endtrans %}</a>
</li>
</ul>
{% else %}
Expand Down
10 changes: 5 additions & 5 deletions allauth_jinja/jinja2/socialaccount/connections.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@

<fieldset>
{% if form.non_field_errors %}
<div id="errorMsg">{{ form.non_field_errors }}</div>
<div id="errorMsg">{{ form.non_field_errors() }}</div>
{% endif %}

{% for base_account in form.accounts %}
{% with account=base_account.get_provider_account %}
{% with account=base_account.get_provider_account() %}
<div>
<label for="id_account_{{ base_account.id }}">
<input id="id_account_{{ base_account.id }}" type="radio" name="account"
value="{{ base_account.id }}" />
<span
class="socialaccount_provider {{ base_account.provider }} {{ account.get_brand.id }}">{{account.get_brand.name}}</span>
class="socialaccount_provider {{ base_account.provider }} {{ account.get_brand().id }}">{{account.get_brand().name}}</span>
{{ account }}
</label>
</div>
{% endwith %}
{% endfor %}

<div>
<button type="submit">{% trans 'Remove' %}</button>
<button type="submit">{% trans %}Remove{% endtrans %}</button>
</div>

</fieldset>
Expand All @@ -48,7 +48,7 @@

<ul class="socialaccount_providers">
{% with process="connect"%}
{% include "socialaccount/snippets/provider_list.jinja" %}
{% include "socialaccount/snippets/provider_list.jinja" %}
{% endwith %}
</ul>

Expand Down
8 changes: 4 additions & 4 deletions allauth_jinja/jinja2/socialaccount/login.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

{% block content %}
{% if process == "connect" %}
<h1>{% trans with provider.name as provider %}Connect {{ provider }}{% endtrans %}</h1>
<h1>{% trans provider=provider.name %}Connect {{ provider }}{% endtrans %}</h1>

<p>{% trans with provider.name as provider %}You are about to connect a new third party account from {{ provider }}.{% endtrans %}</p>
<p>{% trans provider=provider.name %}You are about to connect a new third party account from {{ provider }}.{% endtrans %}</p>
{% else %}
<h1>{% trans with provider.name as provider %}Sign In Via {{ provider }}{% endtrans %}</h1>
<h1>{% trans provider=provider.name %}Sign In Via {{ provider }}{% endtrans %}</h1>

<p>{% trans with provider.name as provider %}You are about to sign in using a third party account from {{ provider }}.{% endtrans %}</p>
<p>{% trans provider=provider.name %}You are about to sign in using a third party account from {{ provider }}.{% endtrans %}</p>
{% endif %}

<form method="post">
Expand Down
2 changes: 1 addition & 1 deletion allauth_jinja/jinja2/socialaccount/signup.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block content %}
<h1>{% trans %}Sign Up{% endtrans %}</h1>

<p>{% trans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to
<p>{% trans provider_name=account.get_provider().name, site_name=site.name %}You are about to use your {{provider_name}} account to login to
{{site_name}}. As a final step, please complete the following form:{% endtrans %}</p>

<form class="signup" id="signup_form" method="post" action="{{ url('socialaccount_signup') }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ providers_media_js }}
{{ providers_media_js() }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% for provider in socialaccount_providers %}
{% if provider.id == "openid" %}
{% for brand in provider.get_brands %}
{% for brand in provider.get_brands() %}
<li>
<a title="{{brand.name}}"
class="socialaccount_provider {{provider.id}} {{brand.id}}"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "allauth-jinja"
version = "0.0.1"
version = "0.0.2"
description = ""
authors = ["Eddie Cohen <eddie@lightmatter.com>"]
readme = "README.md"
Expand Down