Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/okfde/froide
Browse files Browse the repository at this point in the history
  • Loading branch information
tyliec committed Nov 25, 2023
2 parents e171f42 + 7bf3322 commit 5664671
Show file tree
Hide file tree
Showing 230 changed files with 8,561 additions and 9,206 deletions.
4 changes: 3 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Migrate code style to Black
59bd3eeded3c3ed00fbc858fe20bfea99c8dbefa
# Migrate import style to isort + Black stable
3fae2ecb54ce1297c5734074709d336024a91153
3fae2ecb54ce1297c5734074709d336024a91153
# Format html files with djlint
3698b97c143c773639dd0e75617cd8d8fb034131
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: '3.10'
cache: 'pip'
- uses: actions/setup-node@v3
with:
Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ repos:
- prettier
- eslint-plugin-prettier
- eslint-config-standard
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.33.0
hooks:
- id: djlint-reformat-django
- id: djlint-django
- repo: local
hooks:
- id: make-messages
name: Update translation files
entry: make messagesde
language: system
pass_filenames: false
- id: make-messages
name: Update translation files
entry: make messagesde
language: system
pass_filenames: false

exclude: ^.*/migrations/.*$|eslintrc.js
60 changes: 34 additions & 26 deletions froide/accesstoken/templates/accesstoken/token_widget.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
{% load i18n %}
<div class="row">
<div class="col-7">
<input type="text" {% if widget.token %}value="{{ widget.url }}"{% endif %}
{% if not widget.token %}placeholder="{% trans 'No URL created yet.' %}"{% endif %}
{% if widget.token %}data-bs-toggle="tooltip"
title="{% trans 'Click to copy' %}"
data-copied="{% trans 'URL copied' %}"
{% endif %}
class="form-control{% if widget.token %} copy-text{% endif %}" readonly/>
</div>
<div class="col-5">
{% if widget.token %}
<button type="submit" name="reset" value="{{ widget.purpose }}" class="btn btn-outline-secondary">
<span class="fa fa-refresh"></span>
{% trans "Reset" %}
</button>
<button type="submit" name="remove" value="{{ widget.purpose }}" class="btn hover-btn-danger">
<span class="fa fa-close"></span>
{% trans "Remove" %}
</button>
{% else %}
<button type="submit" name="create" value="{{ widget.purpose }}" class="btn btn-outline-secondary">
<span class="fa fa-plus-square"></span>
{% trans "Create URL" %}
</button>
{% endif %}
</div>
<div class="col-7">
<input type="text"
{% if widget.token %}value="{{ widget.url }}"{% endif %}
{% if not widget.token %}placeholder="{% trans 'No URL created yet.' %}"{% endif %}
{% if widget.token %}data-bs-toggle="tooltip" title="{% trans 'Click to copy' %}" data-copied="{% trans 'URL copied' %}" {% endif %}
class="form-control{% if widget.token %} copy-text{% endif %}"
readonly />
</div>
<div class="col-5">
{% if widget.token %}
<button type="submit"
name="reset"
value="{{ widget.purpose }}"
class="btn btn-outline-secondary">
<span class="fa fa-refresh"></span>
{% trans "Reset" %}
</button>
<button type="submit"
name="remove"
value="{{ widget.purpose }}"
class="btn hover-btn-danger">
<span class="fa fa-close"></span>
{% trans "Remove" %}
</button>
{% else %}
<button type="submit"
name="create"
value="{{ widget.purpose }}"
class="btn btn-outline-secondary">
<span class="fa fa-plus-square"></span>
{% trans "Create URL" %}
</button>
{% endif %}
</div>
</div>
65 changes: 35 additions & 30 deletions froide/account/templates/account/admin_send_mail.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
{% extends "helper/admin_base_action.html" %}

{% load i18n l10n %}

{% block action_title %}{% trans 'Send mail to users' %}{% endblock %}

{% block action_title %}
{% trans 'Send mail to users' %}
{% endblock %}
{% block breadcrumbs_action_label %}
{% trans 'Send mail to users' %}
{% trans 'Send mail to users' %}
{% endblock %}

{% block action_content %}
<form action="" method="post">{% csrf_token %}
<div>
<p>
<label>{% trans "Subject" %}: <input type="text" name="subject" value=""/>
</p>
<textarea name="body" rows="8" style="width: 100%">{% include "emails/footer.txt" %}</textarea><br/>
<small>{% trans "You can use the following placeholders:" %} <code>{name}, {first_name}, {last_name}, {url}</code></small>
<input type="hidden" name="action" value="send_mail" />
<p>
<input type="submit" value="{% blocktrans count count=queryset.count %}Send mail to one user{% plural %}Send mail to {{ count }} users{% endblocktrans %}" />
</p>
</div>
<input type="hidden" name="action" value="{{ action_name }}" />
{% if select_across %}
<input type="hidden" name="select_across" value="1"/>
{# set invalid selected, so confirmation action path is chosen in admin #}
<input type="hidden" name="{{ action_checkbox_name }}" value="_" />
{% else %}
{% for obj in queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}" />
{% endfor %}
{% endif %}
</form>
{% endblock %}
<form action="" method="post">
{% csrf_token %}
<div>
<p>
<label>
{% trans "Subject" %}:
<input type="text" name="subject" value="" />
</p>
<textarea name="body" rows="8" style="width: 100%">{% include "emails/footer.txt" %}</textarea>
<br />
<small>{% trans "You can use the following placeholders:" %} <code>{name}, {first_name}, {last_name}, {url}</code></small>
<input type="hidden" name="action" value="send_mail" />
<p>
<input type="submit"
value="{% blocktrans count count=queryset.count %}Send mail to one user{% plural %}Send mail to {{ count }} users{% endblocktrans %}" />
</p>
</div>
<input type="hidden" name="action" value="{{ action_name }}" />
{% if select_across %}
<input type="hidden" name="select_across" value="1" />
{# set invalid selected, so confirmation action path is chosen in admin #}
<input type="hidden" name="{{ action_checkbox_name }}" value="_" />
{% else %}
{% for obj in queryset %}
<input type="hidden"
name="{{ action_checkbox_name }}"
value="{{ obj.pk|unlocalize }}" />
{% endfor %}
{% endif %}
</form>
{% endblock %}
25 changes: 11 additions & 14 deletions froide/account/templates/account/base.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
{% extends "base.html" %}

{% load i18n %}

{% block navbar %}
{% include "account/header.html" %}
{% include "account/header.html" %}
{% endblock %}

{% block body %}
<div class="bg-body-tertiary text-body-tertiary">
{% block breadcrumbs %}{% include "account/includes/breadcrumbs.html" %}{% endblock %}
</div>

{% block app_body %}
<div class="container mb-5 mt-3">
{% block app_container %}{% endblock %}
</div>
{% endblock %}

<div class="bg-body-tertiary text-body-tertiary">
{% block breadcrumbs %}
{% include "account/includes/breadcrumbs.html" %}
{% endblock %}
</div>
{% block app_body %}
<div class="container mb-5 mt-3">
{% block app_container %}{% endblock %}
</div>
{% endblock %}
{% endblock %}
71 changes: 31 additions & 40 deletions froide/account/templates/account/confirmed.html
Original file line number Diff line number Diff line change
@@ -1,49 +1,40 @@
{% extends 'account/base.html' %}

{% load i18n %}
{% load static %}

{% block title %}{% trans "Your account is now confirmed" %}{% endblock %}

{% block title %}
{% trans "Your account is now confirmed" %}
{% endblock %}
{% block navbar %}{% endblock %}


{% block body %}
<div class="container">
<div class="row mt-5 justify-content-center">
<div class="col-6 col-md-3">
<img src="{% static 'img/onboarding/email-confirmed.svg' %}" alt="{% trans 'You got mail' %}">
</div>
</div>
<div class="row mt-5 justify-content-center">
<div class="col-md-8 text-center">

<h2>
{% trans "Your email address is now confirmed!" %}
</h2>

{% if foirequest %}
<p class="lead">
{% blocktrans with title=foirequest.title url=foirequest.get_absolute_url %}
<div class="container">
<div class="row mt-5 justify-content-center">
<div class="col-6 col-md-3">
<img src="{% static 'img/onboarding/email-confirmed.svg' %}"
alt="{% trans 'You got mail' %}">
</div>
</div>
<div class="row mt-5 justify-content-center">
<div class="col-md-8 text-center">
<h2>{% trans "Your email address is now confirmed!" %}</h2>
{% if foirequest %}
<p class="lead">
{% blocktrans with title=foirequest.title url=foirequest.get_absolute_url %}
Your request “<a href="{{ url }}">{{ title }}</a>” has been sent.
{% endblocktrans %}
</p>
<p>
{% trans "We will send you an email when you receive a reply from the public body." %}
</p>
{% endif %}
</div>
</div>
{% block password_form %}
<div class="row mt-5 justify-content-center">
<div class="col-lg-8">
{% trans "Please set a password for your account now" as form_title %}
{% trans "Set password" as form_button %}
{% include "account/includes/change_password_form.html" with form_title=form_title form_button=form_button %}
</p>
<p>{% trans "We will send you an email when you receive a reply from the public body." %}</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}
</div>
{% block below_password %}{% endblock %}

{% block password_form %}
<div class="row mt-5 justify-content-center">
<div class="col-lg-8">
{% trans "Please set a password for your account now" as form_title %}
{% trans "Set password" as form_button %}
{% include "account/includes/change_password_form.html" with form_title=form_title form_button=form_button %}
</div>
</div>
{% endblock %}
</div>
{% block below_password %}{% endblock %}
{% endblock %}
10 changes: 5 additions & 5 deletions froide/account/templates/account/emails/confirmation_mail.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% load i18n %}
<p>{% blocktrans %}Hello {{ name }},</p>

<p>This is an email from {{ site_name }} to confirm your email address.<br/>
<p>This is an email from {{ site_name }} to confirm your email address.<br />
Please visit the link below:</p>
<p><a href="{{ action_url }}">Click here to confirm your email address</a></p>

{% endblocktrans %}
<p>{% blocktrans %}Cheers,<br/>
<p>
{% blocktrans %}Cheers,<br />
{{ site_name }}{% endblocktrans %}
</p>

{% include "emails/footer.html" %}
</p>
{% include "emails/footer.html" %}
25 changes: 11 additions & 14 deletions froide/account/templates/account/go.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
{% extends "base.html" %}

{% load static %}
{% load i18n %}

{% block body_tag %}
<div class="container mt-5 text-center">
<form action="{{ form_action }}" method="post" data-autosubmit="true">
{% csrf_token %}
<div class="spinner-border" role="status">
<span class="visually-hidden">{% translate "Loading..." %}</span>
<div class="container mt-5 text-center">
<form action="{{ form_action }}" method="post" data-autosubmit="true">
{% csrf_token %}
<div class="spinner-border" role="status">
<span class="visually-hidden">{% translate "Loading..." %}</span>
</div>
<p class="mt-5">
<button type="submit">{% translate "Continue" %}</button>
</p>
</form>
</div>
<p class="mt-5">
<button type="submit">{% translate "Continue" %}</button>
</p>
</form>
</div>
{% endblock body_tag %}

{% block scripts %}
<script async src="{% static 'account/go.js' %}"></script>
<script async src="{% static 'account/go.js' %}"></script>
{% endblock %}
2 changes: 0 additions & 2 deletions froide/account/templates/account/header.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{% extends "header.html" %}

{% block nav_login %}active{% endblock %}

{% block nav_account %}active{% endblock %}
33 changes: 16 additions & 17 deletions froide/account/templates/account/includes/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{% load i18n %}

<nav class="container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{% url 'account-show' %}">{% translate "Account" %}</a>
</li>
{% if section_url %}
<li class="breadcrumb-item">
<a href="{{ section_url }}">{{ section_name }}</a>
</li>
{% endif %}
{% if last_item %}
<li class="breadcrumb-item active">
<span>{{ last_item }}</span>
</li>
{% endif %}
</ol>
</nav>
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{% url 'account-show' %}">{% translate "Account" %}</a>
</li>
{% if section_url %}
<li class="breadcrumb-item">
<a href="{{ section_url }}">{{ section_name }}</a>
</li>
{% endif %}
{% if last_item %}
<li class="breadcrumb-item active">
<span>{{ last_item }}</span>
</li>
{% endif %}
</ol>
</nav>
Loading

0 comments on commit 5664671

Please sign in to comment.