Skip to content
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
52 changes: 15 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,37 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
- uses: actions/checkout@v7
- uses: pnpm/setup@v3
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install
- uses: j178/prek-action@v1
cache: true
- uses: j178/prek-action@v3.1.1
env:
SKIP: makemessages-de
SKIP: checkmessages-de

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13", "3.14"]
python-version: ['3.12', '3.14']
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Install system-level dependencies
run: sudo apt-get update && sudo apt-get install libgdal-dev gdal-bin libmagic-dev libmagickwand-dev libpoppler-cpp-dev poppler-utils ghostscript gettext
- name: Start services
run: docker compose -f compose-dev.yaml up --wait
- name: Setup uv
uses: astral-sh/setup-uv@v8.0.0
uses: astral-sh/setup-uv@v10.3.3
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- name: Install pnpm
uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
- uses: pnpm/setup@v3
with:
node-version: 24
cache: pnpm
- name: Install system-level dependencies
run: sudo apt-get update && sudo apt-get install libgdal-dev gdal-bin libmagic-dev libmagickwand-dev libpoppler-cpp-dev poppler-utils ghostscript gettext
cache: true
- name: Install dependencies
run: |
uv sync
playwright install --with-deps chromium
pnpm install
- name: Check German translations are up to date
if: matrix.python-version == '3.13'
run: |
Expand All @@ -63,19 +56,4 @@ jobs:
pytest -n auto --cov --cov-report= froide/
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
env:
DATABASE_URL: postgis://postgres:postgres@localhost/froide

services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: froide
ports:
- 5432:5432
elasticsearch:
image: elasticsearch:8.14.3
options: -e "discovery.type=single-node" -e "xpack.security.enabled=false" --expose 9200 --health-cmd "curl localhost:9200/_cluster/health" --health-interval 10s --health-timeout 5s --health-retries 10
ports:
- 9200:9200
DATABASE_URL: postgis://froide:froide@localhost/froide
26 changes: 9 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.8
rev: v0.17.5
hooks:
- id: ruff
args: [--fix]
Expand All @@ -16,25 +16,17 @@ repos:
args: [--no-warn-ignored]

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.36.4
rev: v1.54.0
hooks:
- id: djlint-reformat-django
- id: djlint-django
- repo: local

- repo: https://github.com/fragdenstaat/pre-commit
rev: 86b4cdc9b7dc892154fb064d3c702d3ece9d5716
hooks:
- id: django-blocktrans-trimmed
name: Ensure blocktrans/blocktranslate use trimmed
language: script
entry: scripts/enforce_blocktrans_trimmed.py
files: \.html$
- id: gettext-named-placeholders
name: Ensure translatable strings use named placeholders
language: script
entry: scripts/enforce_named_placeholders.py
files: \.py$
- id: makemessages-de
name: Ensure German translations are up to date
language: system
entry: make checkmessagesde
files: \.(py|html|txt|po)$
pass_filenames: false
- id: checkmessages-de
- id: unlink-frontend
- id: ensure-consistent-dependencies
- id: relink-frontend
30 changes: 0 additions & 30 deletions .pre-commit-hooks.yaml

This file was deleted.

5 changes: 3 additions & 2 deletions compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
db:
image: postgis/postgis:16-3.4
image: postgis/postgis:18-3.7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also had to add platform: linux/amd64 here to make it run on my Mac.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that it worked without it before, can't find arm builds for those versions either. Also see postgis/docker-postgis#216

platform: linux/amd64
volumes:
- pg-data:/var/lib/postgresql/
environment:
Expand All @@ -10,7 +11,7 @@ services:
ports:
- 127.0.0.1:5432:5432
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
image: docker.elastic.co/elasticsearch/elasticsearch:8.19.25
volumes:
- es-data:/usr/share/elasticsearch/data
- es-logs:/var/log
Expand Down
4 changes: 2 additions & 2 deletions froide/account/templates/account/admin_send_mail.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "helper/admin_base_action.html" %}
{% load i18n l10n %}
{% block action_title %}
{% trans 'Send mail to users' %}
{% 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">
Expand Down
2 changes: 1 addition & 1 deletion froide/account/templates/account/confirmed.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'account/base.html' %}
{% extends "account/base.html" %}
{% load i18n %}
{% load static %}
{% block title %}
Expand Down
22 changes: 12 additions & 10 deletions froide/account/templates/account/emails/confirmation_mail.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{% load i18n %}
<p>{% blocktrans %}Hello {{ name }},</p>

<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 %}
{% blocktrans trimmed %}
<p>Hello {{ name }},</p>
<p>
{% blocktrans %}Cheers,<br />
{{ site_name }}{% endblocktrans %}
This is an email from {{ site_name }} to confirm your email address.
<br />
Please visit the link below:
</p>
{% include "emails/footer.html" %}
<p><a href="{{ action_url }}">Click here to confirm your email address</a></p>
{% endblocktrans %}
<p>
{% blocktrans %}Cheers,<br />
{{ site_name }}{% endblocktrans %}
</p>
{% include "emails/footer.html" %}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ <h2 class="h5 card-header">
</button>
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
</form>
{% endrecentauthrequired %}
</div>
{% endrecentauthrequired %}
</div>
</div>
6 changes: 4 additions & 2 deletions froide/account/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ <h1 class="h5 card-header">{% blocktrans %}Log in{% endblocktrans %}</h1>
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
{% render_form form %}
<div class="clearfix">
<button type="submit" class="btn btn-primary btn-lg float-end">{% blocktrans %}Log In{% endblocktrans %}</button>
<button type="submit"
class="btn btn-primary btn-lg float-end">{% blocktrans %}Log In{% endblocktrans %}</button>
</div>
</form>
</div>
Expand All @@ -39,7 +40,8 @@ <h2 class="h5 card-header">{% blocktrans %}In case you forgot your password...{%
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
{% render_form reset_form %}
<div class="clearfix">
<button type="submit" class="btn btn-secondary float-end">{% blocktrans %}Send reset link{% endblocktrans %}</button>
<button type="submit"
class="btn btn-secondary float-end">{% blocktrans %}Send reset link{% endblocktrans %}</button>
</div>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion froide/account/templates/account/new.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'account/base.html' %}
{% extends "account/base.html" %}
{% load i18n %}
{% load static %}
{% load frontendbuild %}
Expand Down
2 changes: 1 addition & 1 deletion froide/account/templates/account/new_terms.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'simple_base.html' %}
{% extends "simple_base.html" %}
{% load i18n %}
{% load form_helper %}
{% block body %}
Expand Down
8 changes: 4 additions & 4 deletions froide/account/templates/account/password_reset_confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
{% load i18n %}
{% load form_helper %}
{% block title %}
{% trans 'Password reset' %}
{% trans "Password reset" %}
{% endblock %}
{% block navbar %}{% endblock %}
{% block app_body %}
{% if validlink %}
<div class="row justify-content-center mt-5">
<div class="col-md-8">
<h1 class="h2">{% trans 'Enter new password' %}</h1>
<h1 class="h2">{% trans "Enter new password" %}</h1>
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<form action="" method="post">
{% csrf_token %}
{% render_form form %}
<p>
<button type="submit" class="btn btn-primary">{% trans 'Change my password' %}</button>
<button type="submit" class="btn btn-primary">{% trans "Change my password" %}</button>
</p>
</form>
</div>
</div>
{% else %}
<h1 class="h2">{% trans 'Password reset unsuccessful' %}</h1>
<h1 class="h2">{% trans "Password reset unsuccessful" %}</h1>
<p>
{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}
</p>
Expand Down
13 changes: 9 additions & 4 deletions froide/account/templates/account/profile.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'account/base.html' %}
{% extends "account/base.html" %}
{% load i18n %}
{% load markup %}
{% load humanize %}
Expand Down Expand Up @@ -26,7 +26,8 @@ <h1 class="h2">{{ object.get_full_name }}</h1>
{% if object.organization_url and object.organization_name %}
<p>
<strong>
<a rel="external nofollow" href="{{ object.organization_url }}">{{ object.organization_name }}</a>
<a rel="external nofollow"
href="{{ object.organization_url }}">{{ object.organization_name }}</a>
</strong>
</p>
{% elif object.organization_name %}
Expand Down Expand Up @@ -84,7 +85,9 @@ <h1 class="h2">{{ object.get_full_name }}</h1>
<h2 class="h4 text-center">{% translate "Most followed requests" %}</h2>
<ul class="list-unstyled">
{% for foirequest in top_followers %}
<li>{% include "foirequest/snippets/request_item.html" with object=foirequest heading_tag="h3" %}</li>
<li>
{% include "foirequest/snippets/request_item.html" with object=foirequest heading_tag="h3" %}
</li>
{% endfor %}
</ul>
</div>
Expand Down Expand Up @@ -117,7 +120,9 @@ <h2 class="h4 my-1">{% translate "Last requests" %}</h2>
<div class="card-body">
<ul class="list-unstyled">
{% for foirequest in foirequests %}
<li>{% include "foirequest/snippets/request_item.html" with object=foirequest heading_tag="h3" %}</li>
<li>
{% include "foirequest/snippets/request_item.html" with object=foirequest heading_tag="h3" %}
</li>
{% endfor %}
</ul>
<a href="{% url 'foirequest-list' %}?user={{ object.username }}">
Expand Down
11 changes: 7 additions & 4 deletions froide/account/templates/account/reauth.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ <h1 class="card-header heading-reset mb-0">
{% if "FIDO2" in mfa_methods %}
<li class="list-group-item">
<h2 class="h5">{% translate "Use hardware security key" %}</h2>
<form data-fido2-auth="{{ mfa_data }}" method="POST" class="disable-submit">
<form data-fido2-auth="{{ mfa_data }}" method="post" class="disable-submit">
{% csrf_token %}
{{ form.code.as_hidden }}
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
<input type="hidden" name="method" value="FIDO2" />
<button autofocus class="btn btn-success">{% translate "Click here to check hardware security key" %}</button>
<button autofocus
class="btn btn-success">{% translate "Click here to check hardware security key" %}</button>
</form>
</li>
{% endif %}
Expand All @@ -43,7 +44,8 @@ <h2 class="h5">{% translate "Use your authenticator app" %}</h2>
{% render_field form.code %}
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
<input type="hidden" name="method" value="TOTP" />
<button type="submit" class="btn btn-primary float-end">{% translate "Verify code" %}</button>
<button type="submit"
class="btn btn-primary float-end">{% translate "Verify code" %}</button>
</form>
</li>
{% endif %}
Expand All @@ -56,7 +58,8 @@ <h2 class="h5">{% translate "Use your password" %}</h2>
{{ form.hidden_email }}
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
<input type="hidden" name="method" value="password" />
<button type="submit" class="btn btn-primary float-end">{% translate "Check password" %}</button>
<button type="submit"
class="btn btn-primary float-end">{% translate "Check password" %}</button>
</form>
</li>
{% endif %}
Expand Down
Loading