1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-05-17 07:32:33 +00:00

Compare commits

...

10 commits
2.1.0 ... main

9 changed files with 108 additions and 73 deletions

View file

@ -18,14 +18,14 @@ jobs:
name: isort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install gettext
run: sudo apt install gettext
- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/cache@v1
python-version: 3.12
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -41,14 +41,14 @@ jobs:
name: flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install gettext
run: sudo apt install gettext
- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/cache@v1
python-version: 3.12
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -65,14 +65,14 @@ jobs:
name: black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install gettext
run: sudo apt install gettext
- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/cache@v1
python-version: 3.12
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -89,14 +89,14 @@ jobs:
name: docformatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install gettext
run: sudo apt install gettext
- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/cache@v1
python-version: 3.12
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -113,14 +113,14 @@ jobs:
name: djhtml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install gettext
run: sudo apt install gettext
- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/cache@v1
python-version: 3.12
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -133,34 +133,34 @@ jobs:
- 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.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- 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: .
# packaging:
# name: packaging
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: install gettext
# run: sudo apt install gettext
# - name: Set up Python 3.12
# uses: actions/setup-python@v5
# with:
# python-version: 3.12
# - uses: actions/cache@v4
# 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: .
#

View file

@ -1,3 +1,8 @@
# 2.2.0
* add plugin category (#16)
* add placeholders `{TRACK_NAME}` and `{TRACK_NAME_COLOURED}`
# 2.1.0
* fixed installation procedure

View file

@ -15,7 +15,8 @@ class PluginApp(AppConfig):
"embedded into your broadcasting software"
)
visible = True
version = "2.1.0"
version = "2.2.0"
category = "FEATURE"
def ready(self):
from . import signals # NOQA

View file

@ -32,19 +32,22 @@
</p>
<dl>
<dt><code>{CODE}</code></dt>
<dd>Use to embed the talk code (<code>MUX9U3</code> for example).</dd>
<dd>talk code (<code>MUX9U3</code> for example) - most useful in combination with pretalx-proposal-redirects or something like that</dd>
<dt><code>{EVENT_SLUG}</code></dt>
<dd>Use to embed the event slug.</dd>
<dd>The event slug (<code>{{ request.event.slug }}</code>)</dd>
<dt><code>{FEEDBACK_URL}</code></dt>
<dd>URL to the talk feedback page.</dd>
<dt><code>{TALK_SLUG}</code></dt>
<dd>Use to embed the talk slug.</dd>
<dd>The talk slug (<code>{{ request.event.slug }}-1-my-super-great-talk</code>)</dd>
<dt><code>{TALK_URL}</code></dt>
<dd>URL to the talk detail page.</dd>
<dt><code>{TRACK_NAME}</code> or <code>{TRACK_NAME_COLOURED}</code></dt>
<dd>Track name in plain text or coloured using the track colour.</dd>
</dl>
<fieldset>

View file

@ -1,8 +1,10 @@
from django.conf import settings
def placeholders(schedule, talk):
return {
def placeholders(schedule, talk, supports_html_colour=False):
track_name = str(talk.submission.track.name) if talk.submission.track else ""
result = {
"CODE": talk.submission.code,
"EVENT_SLUG": str(schedule.event.slug),
"FEEDBACK_URL": "{}{}".format(
@ -14,4 +16,17 @@ def placeholders(schedule, talk):
schedule.event.custom_domain or settings.SITE_URL,
talk.submission.urls.public,
),
"TRACK_NAME": track_name,
}
if talk.submission.track and supports_html_colour:
result["TRACK_NAME_COLOURED"] = '<span style="color: {}">{}</span>'.format(
talk.submission.track.color, track_name
)
else:
result["TRACK_NAME_COLOURED"] = track_name
# for the americans
result["TRACK_NAME_COLORED"] = result["TRACK_NAME_COLOURED"]
return result

View file

@ -15,9 +15,11 @@ class BroadcastToolsEventInfoView(View):
"room-info": {
"lower_info": self.request.event.settings.broadcast_tools_room_info_lower_content
or "",
"show_next_talk": True
if self.request.event.settings.broadcast_tools_room_info_show_next_talk
else False,
"show_next_talk": (
True
if self.request.event.settings.broadcast_tools_room_info_show_next_talk
else False
),
},
"slug": self.request.event.slug,
"start": self.request.event.date_from.isoformat(),

View file

@ -53,14 +53,20 @@ class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, View):
person.get_display_name()
for person in talk.submission.speakers.all()
],
"track": {
"color": talk.submission.track.color,
"name": str(talk.submission.track.name),
}
if talk.submission.track
else None,
"track": (
{
"color": talk.submission.track.color,
"name": str(talk.submission.track.name),
}
if talk.submission.track
else None
),
"room": room["name"].localize(schedule.event.locale),
"infoline": infoline.format(**placeholders(schedule, talk)),
"infoline": infoline.format(
**placeholders(
schedule, talk, supports_html_colour=True
)
),
"image_url": talk.submission.image_url,
"locale": talk.submission.content_locale,
"do_not_record": talk.submission.do_not_record,

View file

@ -1,6 +1,6 @@
[project]
name = "pretalx-broadcast-tools"
version = "2.1.0"
version = "2.2.0"
description = """
Some tools which can be used for supporting a broadcasting software.
This currently includes a generator for PDF printouts, a 'lower thirds'

3
setup.py Normal file
View file

@ -0,0 +1,3 @@
from setuptools import setup
setup()