Skip to content

Commit 555a16b

Browse files
committed
demo
0 parents  commit 555a16b

File tree

20 files changed

+569
-0
lines changed

20 files changed

+569
-0
lines changed

Diff for: .github/workflows/python-version.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

Diff for: .github/workflows/style.yml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Code Style
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- 'pretalx_signals_demo/locale/**'
8+
- 'pretalx_signals_demo/static/**'
9+
pull_request:
10+
branches: [ main ]
11+
paths-ignore:
12+
- 'pretalx_signals_demo/locale/**'
13+
- 'pretalx_signals_demo/static/**'
14+
15+
jobs:
16+
isort:
17+
name: Include order checks
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: install gettext
22+
run: sudo apt install gettext
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version-file: ".github/workflows/python-version.txt"
27+
cache: "pip"
28+
- name: Install isort
29+
run: pip3 install isort
30+
- name: Run isort
31+
run: isort -c .
32+
working-directory: ./pretalx_signals_demo
33+
flake:
34+
name: Style guide checks
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: install gettext
39+
run: sudo apt install gettext
40+
- name: Set up Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version-file: ".github/workflows/python-version.txt"
44+
cache: "pip"
45+
- name: Install Dependencies
46+
run: pip3 install flake8 flake8-bugbear
47+
- name: Run flake8
48+
run: flake8 .
49+
working-directory: .
50+
black:
51+
name: Code formatter checks
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: install gettext
56+
run: sudo apt install gettext
57+
- name: Set up Python
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version-file: ".github/workflows/python-version.txt"
61+
cache: "pip"
62+
- name: Install Dependencies
63+
run: pip3 install black
64+
- name: Run black
65+
run: black --check .
66+
working-directory: ./pretalx_signals_demo
67+
djhtml:
68+
name: HTML checks
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: install gettext
73+
run: sudo apt install gettext
74+
- name: Set up Python
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version-file: ".github/workflows/python-version.txt"
78+
cache: "pip"
79+
- name: Install Dependencies
80+
run: pip3 install djhtml
81+
- name: Run docformatter
82+
run: find -name "*.html" | xargs djhtml -c
83+
working-directory: .
84+
packaging:
85+
name: packaging
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
- name: Set up Python
90+
uses: actions/setup-python@v5
91+
with:
92+
python-version-file: ".github/workflows/python-version.txt"
93+
cache: "pip"
94+
- name: Install Dependencies
95+
run: pip3 install twine check-manifest -Ue .
96+
- name: Run check-manifest
97+
run: check-manifest .
98+
working-directory: .
99+
- name: Build package
100+
run: python -m build
101+
working-directory: .
102+
- name: Check package
103+
run: twine check dist/*
104+
working-directory: .

Diff for: .gitignore

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
.ropeproject/
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*,cover
47+
.hypothesis/
48+
49+
# Translations
50+
*.mo
51+
*.pot
52+
53+
# Django stuff:
54+
*.log
55+
56+
# Sphinx documentation
57+
docs/_build/
58+
*.toc
59+
60+
# Environments
61+
.env
62+
.venv
63+
env/
64+
venv/
65+
ENV/
66+
67+
# editors
68+
*.swp
69+
*.aux
70+
*~
71+
.project
72+
.pydevproject
73+
.vscode
74+
75+
# IDEA / pycharm
76+
.idea/
77+
atlassian-ide-plugin.xml
78+
79+
# generic local files
80+
local/
81+
*.xml
82+
pretalx.cfg
83+
84+
# OS X
85+
.DS_Store
86+
87+
.pytest_cache
88+
*.cfg

Diff for: LICENSE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2024 Florian Moesch
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

Diff for: MANIFEST.in

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
recursive-include pretalx_signals_demo/static *
2+
recursive-include pretalx_signals_demo/templates *
3+
exclude pretalx_signals_demo/locale/django.pot
4+
recursive-include pretalx_signals_demo/locale *
5+
recursive-include pretalx_signals_demo *.py
6+
include Makefile

Diff for: Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
all: localecompile
2+
LNGS:=`find pretalx_signals_demo/locale/ -mindepth 1 -maxdepth 1 -type d -printf "-l %f "`
3+
4+
localecompile:
5+
django-admin compilemessages
6+
7+
localegen:
8+
django-admin makemessages -l de_DE -i build -i dist -i "*egg*" $(LNGS)
9+
10+
.PHONY: all localecompile localegen

Diff for: README.rst

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
pretalx signals demo plugin
2+
===========================
3+
4+
This is a plugin for `pretalx`_.
5+
pretalx plugin to test all html signals
6+
7+
Development setup
8+
-----------------
9+
10+
1. Make sure that you have a working `pretalx development setup`_.
11+
12+
2. Clone this repository, eg to ``local/pretalx-signals-demo``.
13+
14+
3. Activate the virtual environment you use for pretalx development.
15+
16+
4. Run ``pip install -e .`` within this directory to register this application with pretalx's plugin registry.
17+
18+
5. Run ``make`` within this directory to compile translations.
19+
20+
6. Restart your local pretalx server. This plugin should show up in the plugin list shown on startup in the console.
21+
You can now use the plugin from this repository for your events by enabling it in the 'plugins' tab in the settings.
22+
23+
This plugin has CI set up to enforce a few code style rules. To check locally, you need these packages installed::
24+
25+
pip install flake8 flake8-bugbear isort black
26+
27+
To check your plugin for rule violations, run::
28+
29+
black --check .
30+
isort -c .
31+
flake8 .
32+
33+
You can auto-fix some of these issues by running::
34+
35+
isort .
36+
black .
37+
38+
39+
License
40+
-------
41+
42+
Copyright 2024 Florian Moesch
43+
44+
Released under the terms of the Apache License 2.0
45+
46+
47+
.. _pretalx: https://github.com/pretalx/pretalx
48+
.. _pretalx development setup: https://docs.pretalx.org/en/latest/developer/setup.html

Diff for: pretalx_signals_demo/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.0"

Diff for: pretalx_signals_demo/apps.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from django.apps import AppConfig
2+
from django.utils.translation import gettext_lazy
3+
4+
from . import __version__
5+
6+
7+
class PluginApp(AppConfig):
8+
name = "pretalx_signals_demo"
9+
verbose_name = "pretalx signals demo plugin"
10+
11+
class PretalxPluginMeta:
12+
name = gettext_lazy("pretalx signals demo plugin")
13+
author = "Florian Moesch"
14+
description = gettext_lazy("pretalx plugin to test all html signals")
15+
visible = True
16+
version = __version__
17+
category = "INTEGRATION"
18+
19+
def ready(self):
20+
from . import signals # NOQA

Diff for: pretalx_signals_demo/forms.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from django import forms
2+
3+
from .models import MailNotes, TechRider, UserNotes
4+
5+
6+
class TechRiderForm(forms.ModelForm):
7+
class Meta:
8+
model = TechRider
9+
exclude = ["submission"]
10+
11+
12+
class UserNotesForm(forms.ModelForm):
13+
class Meta:
14+
model = UserNotes
15+
exclude = ["person"]
16+
17+
18+
class MailNotesForm(forms.ModelForm):
19+
class Meta:
20+
model = MailNotes
21+
exclude = ["mail"]

Diff for: pretalx_signals_demo/migrations/0001_initial.py

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Generated by Django 5.1.3 on 2024-12-13 22:04
2+
3+
import django.db.models.deletion
4+
from django.conf import settings
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
("mail", "0013_mailtemplate_role"),
14+
("submission", "0077_answeroption_position"),
15+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name="MailNotes",
21+
fields=[
22+
(
23+
"id",
24+
models.AutoField(
25+
auto_created=True, primary_key=True, serialize=False
26+
),
27+
),
28+
("notes", models.TextField()),
29+
(
30+
"mail",
31+
models.ForeignKey(
32+
on_delete=django.db.models.deletion.CASCADE,
33+
to="mail.queuedmail",
34+
),
35+
),
36+
],
37+
),
38+
migrations.CreateModel(
39+
name="TechRider",
40+
fields=[
41+
(
42+
"id",
43+
models.AutoField(
44+
auto_created=True, primary_key=True, serialize=False
45+
),
46+
),
47+
("text", models.TextField()),
48+
(
49+
"submission",
50+
models.ForeignKey(
51+
on_delete=django.db.models.deletion.CASCADE,
52+
to="submission.submission",
53+
),
54+
),
55+
],
56+
),
57+
migrations.CreateModel(
58+
name="UserNotes",
59+
fields=[
60+
(
61+
"id",
62+
models.AutoField(
63+
auto_created=True, primary_key=True, serialize=False
64+
),
65+
),
66+
("notes", models.TextField()),
67+
(
68+
"person",
69+
models.ForeignKey(
70+
on_delete=django.db.models.deletion.CASCADE,
71+
to=settings.AUTH_USER_MODEL,
72+
),
73+
),
74+
],
75+
),
76+
]

Diff for: pretalx_signals_demo/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)