-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonatan Zint
committed
Apr 27, 2022
0 parents
commit f0aab51
Showing
25 changed files
with
796 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
name: Code Style | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- 'pretalx_hitalx/locale/**' | ||
- 'pretalx_hitalx/static/**' | ||
pull_request: | ||
branches: [ main ] | ||
paths-ignore: | ||
- 'pretalx_hitalx/locale/**' | ||
- 'pretalx_hitalx/static/**' | ||
|
||
|
||
jobs: | ||
isort: | ||
name: isort | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install gettext | ||
run: sudo apt install gettext | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install pretalx | ||
run: pip3 install pretalx | ||
- name: Install Dependencies | ||
run: pip3 install isort -Ue . | ||
- name: Run isort | ||
run: isort -c . | ||
flake: | ||
name: flake8 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install gettext | ||
run: sudo apt install gettext | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install pretalx | ||
run: pip3 install pretalx | ||
- name: Install Dependencies | ||
run: pip3 install flake8 flake8-bugbear -Ue . | ||
- name: Run flake8 | ||
run: flake8 . | ||
working-directory: . | ||
black: | ||
name: black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install gettext | ||
run: sudo apt install gettext | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install pretalx | ||
run: pip3 install pretalx | ||
- name: Install Dependencies | ||
run: pip3 install black -Ue . | ||
- name: Run black | ||
run: black --check . | ||
working-directory: . | ||
docformatter: | ||
name: docformatter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install gettext | ||
run: sudo apt install gettext | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install pretalx | ||
run: pip3 install pretalx | ||
- name: Install Dependencies | ||
run: pip3 install docformatter -Ue . | ||
- name: Run docformatter | ||
run: docformatter --check -r . | ||
working-directory: . | ||
djhtml: | ||
name: djhtml | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install gettext | ||
run: sudo apt install gettext | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install pretalx | ||
run: pip3 install pretalx | ||
- name: Install Dependencies | ||
run: pip3 install djhtml -Ue . | ||
- name: Run docformatter | ||
run: find -name "*.html" | xargs djhtml -c | ||
working-directory: . | ||
packaging: | ||
name: packaging | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install gettext | ||
run: sudo apt install gettext | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install pretalx | ||
run: pip3 install pretalx | ||
- name: Install Dependencies | ||
run: pip3 install twine check-manifest -Ue . | ||
- name: Run check-manifest | ||
run: check-manifest . | ||
working-directory: . | ||
- name: Build package | ||
run: python setup.py sdist | ||
working-directory: . | ||
- name: Check package | ||
run: twine check dist/* | ||
working-directory: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
.ropeproject/ | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
#Ipython Notebook | ||
.ipynb_checkpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2022 Jonatan Zint | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
recursive-include pretalx_hitalx/static * | ||
recursive-include pretalx_hitalx/templates * | ||
exclude pretalx_hitalx/locale/django.pot | ||
recursive-include pretalx_hitalx/locale * | ||
recursive-include pretalx_hitalx/ *.py | ||
include Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
all: localecompile | ||
|
||
localecompile: | ||
django-admin compilemessages | ||
|
||
localegen: | ||
django-admin makemessages -l de_DE -i build -i dist -i "*egg*" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
The pretalx super plugin | ||
========================== | ||
|
||
This is a plugin for `pretalx`_. | ||
|
||
Development setup | ||
----------------- | ||
|
||
1. Make sure that you have a working `pretalx development setup`_. | ||
|
||
2. Clone this repository, eg to ``local/pretalx-hitalx``. | ||
|
||
3. Activate the virtual environment you use for pretalx development. | ||
|
||
4. Execute ``pip install -e .`` within this directory to register this application with pretalx's plugin registry. | ||
|
||
5. Execute ``make`` within this directory to compile translations. | ||
|
||
6. Restart your local pretalx server. You can now use the plugin from this repository for your events by enabling it in | ||
the 'plugins' tab in the settings. | ||
|
||
|
||
License | ||
------- | ||
|
||
Copyright 2022 Jonatan Zint | ||
|
||
Released under the terms of the Apache License 2.0 | ||
|
||
|
||
.. _pretalx: https://github.com/pretalx/pretalx | ||
.. _pretalx development setup: https://docs.pretalx.org/en/latest/developer/setup.html |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.apps import AppConfig | ||
from django.utils.translation import gettext_lazy | ||
|
||
|
||
class PluginApp(AppConfig): | ||
name = "pretalx_hitalx" | ||
verbose_name = "Various extensions to make the Life easier for the HI Congress" | ||
|
||
class PretalxPluginMeta: | ||
name = gettext_lazy("Pretalx Hitalx") | ||
author = "Jonatan Zint" | ||
description = gettext_lazy("Various features specifically for the Hedonist International") | ||
visible = True | ||
version = "0.0.1" | ||
|
||
def ready(self): | ||
from . import signals # NOQA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from django.forms import ModelForm, CharField | ||
|
||
from pretalx.common.mixins.forms import ReadOnlyFlag | ||
from .models import ExpenseItem | ||
|
||
|
||
class SpeakerExpenseForm(ReadOnlyFlag, ModelForm): | ||
description = CharField() | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.fields['speaker'].disabled = True | ||
self.fields['paid'].disabled = True | ||
|
||
class Meta: | ||
model = ExpenseItem | ||
fields = ['speaker', 'description', 'amount', 'paid', 'reference', 'notes'] | ||
readonly_fields = ['speaker', 'paid'] | ||
|
Empty file.
Oops, something went wrong.