Skip to content

Commit 9161332

Browse files
committed
Add fields for slides and extra slides text
1 parent ef3092f commit 9161332

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

program/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ class TalkAdmin(admin.ModelAdmin):
164164
"fields": [
165165
"video_url",
166166
"video_image_html",
167+
"slides_file",
168+
"slides_description",
167169
],
168170
},
169171
),
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generated by Django 4.2.1 on 2023-11-01 11:48
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("program", "0022_talk_video"),
9+
]
10+
11+
operations = [
12+
migrations.AddField(
13+
model_name="talk",
14+
name="slides_description",
15+
field=models.TextField(
16+
blank=True,
17+
help_text="Additional text that will be displayed under the file to download. Use it to link GitHub repo with examples, additional materials etc. You can use Markdown syntax.",
18+
null=True,
19+
verbose_name="Slides Description",
20+
),
21+
),
22+
migrations.AddField(
23+
model_name="talk",
24+
name="slides_file",
25+
field=models.FileField(
26+
blank=True,
27+
help_text="File for download, please use a PDF file.",
28+
null=True,
29+
upload_to="slides/session",
30+
verbose_name="Slides",
31+
),
32+
),
33+
]

program/models.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,23 @@ class Talk(Session):
283283
"""
284284
Image that will be used as a placeholder for the video.
285285
"""
286+
slides_file = models.FileField(
287+
null=True,
288+
blank=True,
289+
upload_to="slides/session",
290+
verbose_name="Slides",
291+
help_text="File for download, please use a PDF file.",
292+
)
293+
slides_description = models.TextField(
294+
null=True,
295+
blank=True,
296+
verbose_name="Slides Description",
297+
help_text=(
298+
"Additional text that will be displayed under the file to download. "
299+
"Use it to link GitHub repo with examples, additional materials etc. "
300+
"You can use Markdown syntax."
301+
),
302+
)
286303

287304
@property
288305
def speakers(self):

0 commit comments

Comments
 (0)