Skip to content

Commit 7a477dd

Browse files
committed
Merge branch 'develop'
2 parents 5155eba + ca75097 commit 7a477dd

32 files changed

Lines changed: 373 additions & 383 deletions

.envs/.example

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ SMTP_USER=
4444
SMTP_PASSWORD=
4545
SMTP_SENDER_MAIL="jandig@memelab.com.br"
4646

47-
# Recaptcha
48-
RECAPTCHA_ENABLED=False
49-
RECAPTCHA_PROJECT_ID=
50-
RECAPTCHA_GCLOUD_API_KEY=
51-
RECAPTCHA_SITE_KEY=
47+
# Turnstile
48+
TURNSTILE_ENABLED=False
49+
TURNSTILE_SITE_KEY=
50+
TURNSTILE_SECRET_KEY=

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
RUNNING_CONTAINER := $(shell docker compose ps --services --filter "status=running" | grep django )
22

3+
.PHONY: test test-ui test-all lint check migrations migrate collectstatic gen translate_es translate_pt
4+
35
test:
46
@if [ -n "${RUNNING_CONTAINER}" ]; then \
57
docker compose exec django pytest src/core src/users src/blog; \

docs/_static/logo.png

17.3 KB
Loading

docs/_templates/about.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{#
2+
Override Alabaster's logo block so the sidebar logo points to the
3+
main Jandig site instead of the docs index.
4+
#}
5+
{%- if theme_logo %}
6+
<p class="logo">
7+
<a href="https://jandig.app">
8+
<img class="logo" src="{{ pathto('_static/' ~ theme_logo, 1) }}" alt="Logo" />
9+
</a>
10+
</p>
11+
{%- endif %}
12+
13+
{%- if theme_description %}
14+
<p class="blurb">{{ theme_description }}</p>
15+
{%- endif %}
16+
17+
{%- if theme_github_user and theme_github_repo %}
18+
{%- if theme_github_button|lower == 'true' %}
19+
<iframe src="https://ghbtns.com/github-btn.html?user={{ theme_github_user }}&repo={{ theme_github_repo }}&type={{ theme_github_type }}&count={{ theme_github_count }}&size=large&v=2"
20+
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
21+
{%- endif %}
22+
{%- endif %}

docs/conf.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
# -- Project information -----------------------------------------------------
1919

2020
project = "Jandig ARte Help"
21-
copyright = "2019, pablodiegoss, rodrigocam, vjpixel, hvalois"
21+
copyright = (
22+
"Conteúdo sob licenciamento "
23+
'<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>, '
24+
"a não ser quando explicitado o contrário."
25+
)
2226
author = "pablodiegoss, rodrigocam, vjpixel, hvalois"
2327

2428

@@ -42,7 +46,10 @@
4246
# List of patterns, relative to source directory, that match files and
4347
# directories to ignore when looking for source files.
4448
# This pattern also affects html_static_path and html_extra_path.
45-
exclude_patterns = []
49+
# about.rst clashes with the Alabaster sidebar template `about.html`
50+
# (renaming it would also work; excluding keeps the file as a draft
51+
# document without breaking the build).
52+
exclude_patterns = ["about.rst"]
4653

4754

4855
# -- Options for HTML output -------------------------------------------------
@@ -61,12 +68,6 @@
6168
"logo": "logo.png",
6269
"github_user": "memeLab",
6370
"github_repo": "Jandig",
64-
"html_sidebars": {
65-
"**": [
66-
"search.html",
67-
"navigation.html",
68-
]
69-
},
7071
"extra_nav_links": {
7172
"Official Site": "https://jandig.app",
7273
"Github": "https://github.com/memelab/Jandig",

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "Jandig"
3-
version = "2.0.10"
3+
version = "2.0.11"
44
description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.13"
@@ -22,7 +22,7 @@ dependencies = [
2222
"granian[reload]>=2.5.0",
2323
"jinja2~=3.1",
2424
"markupsafe~=3.0",
25-
"pillow~=11.1",
25+
"pillow~=12.2",
2626
"psycopg[binary,pool]>=3.2.9",
2727
"pymarker~=1.2",
2828
"sentry-sdk[django]~=2.20",
@@ -42,7 +42,7 @@ dev = [
4242
"pytest-django~=4.9",
4343
"pytest-playwright~=0.4",
4444
"pytest-xdist~=3.6",
45-
"pytest~=8.3",
45+
"pytest~=9.0",
4646
"ruff>=0.11.4",
4747
]
4848

src/blog/models.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,3 @@ class Post(TimeStampedModel):
8989

9090
def __str__(self):
9191
return self.title
92-
93-
def get_absolute_url(self):
94-
return f"/memories/{self.slug}/"

src/blog/views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.core.paginator import Paginator
2-
from django.shortcuts import render
2+
from django.shortcuts import get_object_or_404, render
33

44
from blog.models import Category, Clipping, Post, PostStatus
55

@@ -40,7 +40,10 @@ def blog_index(request):
4040

4141

4242
def post_detail(request, pk):
43-
post = Post.objects.prefetch_related("images", "categories").get(pk=pk)
43+
post = get_object_or_404(
44+
Post.objects.prefetch_related("images", "categories"),
45+
pk=pk,
46+
)
4447

4548
context = {"post": post, "images": post.images.all()}
4649

src/config/settings.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
SENTRY_TRACES_SAMPLE_RATE = env("SENTRY_TRACES_SAMPLE_RATE", default=0.1)
5353
SENTRY_PROFILES_SAMPLE_RATE = env("SENTRY_PROFILES_SAMPLE_RATE", default=0.1)
5454
SENTRY_ENVIRONMENT = env("SENTRY_ENVIRONMENT", default="")
55-
SENTRY_RELEASE = env("SENTRY_RELEASE", default="2.0.10")
55+
SENTRY_RELEASE = env("SENTRY_RELEASE", default="2.0.11")
5656

5757

5858
def traces_sampler(sampling_context):
@@ -271,11 +271,10 @@ def debug(_):
271271
EMAIL_HOST_PASSWORD = env("SMTP_PASSWORD", default="")
272272
EMAIL_USE_SSL = False
273273

274-
# Recaptcha
275-
RECAPTCHA_ENABLED = env("RECAPTCHA_ENABLED", default=False)
276-
RECAPTCHA_SITE_KEY = env("RECAPTCHA_SITE_KEY", default="")
277-
RECAPTCHA_PROJECT_ID = env("RECAPTCHA_PROJECT_ID", default="")
278-
RECAPTCHA_GCLOUD_API_KEY = env("RECAPTCHA_GCLOUD_API_KEY", default="")
274+
# Turnstile
275+
TURNSTILE_ENABLED = env("TURNSTILE_ENABLED", default=False)
276+
TURNSTILE_SITE_KEY = env("TURNSTILE_SITE_KEY", default="")
277+
TURNSTILE_SECRET_KEY = env("TURNSTILE_SECRET_KEY", default="")
279278

280279
###########################
281280
#### Storage settings ####

src/core/forms.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class ArtworkForm(forms.ModelForm):
184184
widget=RangeInput(attrs={"class": "slider", "step": "0.1"}),
185185
)
186186
selected_sound = forms.ModelChoiceField(
187-
queryset=Sound.objects.exclude(file_extension=ObjectExtensions.GLB),
187+
queryset=Sound.objects.all(),
188188
required=False,
189189
widget=forms.Select(attrs={"class": "form-control"}),
190190
)
@@ -256,6 +256,20 @@ def __init__(self, *args, **kwargs):
256256
self.fields["slug"].widget.attrs["placeholder"] = _(
257257
"Complete with your Exhibit URL here"
258258
)
259+
# On edit, pre-populate the hidden M2M inputs with the current
260+
# selections so a user who only changes name/URL doesn't end
261+
# up posting empty strings that clobber the data. The JS in
262+
# exhibit_create_*.jinja2 still rewrites the input on click.
263+
if self.instance.pk:
264+
self.fields["artworks"].initial = ",".join(
265+
str(a.id) for a in self.instance.artworks.all()
266+
)
267+
self.fields["augmenteds"].initial = ",".join(
268+
str(o.id) for o in self.instance.augmenteds.all()
269+
)
270+
self.fields["sounds"].initial = ",".join(
271+
str(s.id) for s in self.instance.sounds.all()
272+
)
259273

260274
class Meta:
261275
model = Exhibit
@@ -337,8 +351,8 @@ def clean_sounds(self):
337351

338352
def clean(self):
339353
cleaned_data = super().clean()
340-
artworks = cleaned_data.get("artworks", [])
341-
augmenteds = cleaned_data.get("augmenteds", [])
354+
artworks = cleaned_data.get("artworks") or []
355+
augmenteds = cleaned_data.get("augmenteds") or []
342356

343357
if not artworks and not augmenteds:
344358
raise forms.ValidationError(

0 commit comments

Comments
 (0)