Skip to content

Commit db766c2

Browse files
Merge pull request #668 from sayanchowdhury/update-video-url
Add the video URL to the proposal page
2 parents 5d88e07 + 2f954ab commit db766c2

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

junction/proposals/forms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ class ProposalForm(forms.Form):
114114
required=False,
115115
help_text="What should the participants know before attending your session?",
116116
)
117+
video_url = forms.CharField(
118+
required=False,
119+
help_text="Short 1-2 min video describing your talk",
120+
widget=forms.TextInput(attrs={"class": "charfield"}),
121+
)
117122
content_urls = forms.CharField(
118123
widget=PagedownWidget(show_preview=True),
119124
required=False,
@@ -148,6 +153,7 @@ def populate_form_for_update(self, proposal):
148153
"description": proposal.description,
149154
"target_audience": proposal.target_audience,
150155
"prerequisites": proposal.prerequisites,
156+
"video_url": proposal.video_url,
151157
"content_urls": proposal.content_urls,
152158
"speaker_info": proposal.speaker_info,
153159
"speaker_links": proposal.speaker_links,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9 on 2020-05-02 00:10
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
("proposals", "0026_auto_20200323_2010"),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name="historicalproposal",
17+
name="video_url",
18+
field=models.URLField(
19+
blank=True,
20+
default="",
21+
help_text="A short 1-2 mins video link about your talk",
22+
),
23+
),
24+
migrations.AddField(
25+
model_name="proposal",
26+
name="video_url",
27+
field=models.URLField(
28+
blank=True,
29+
default="",
30+
help_text="A short 1-2 mins video link about your talk",
31+
),
32+
),
33+
]

junction/proposals/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class Proposal(TimeAuditModel):
100100
default=ProposalTargetAudience.BEGINNER,
101101
verbose_name="Target Audience",
102102
)
103+
video_url = models.URLField(
104+
blank=True, default="", help_text="Short 1-2 min video describing your talk",
105+
)
103106
prerequisites = models.TextField(blank=True, default="")
104107
content_urls = models.TextField(blank=True, default="")
105108
speaker_info = models.TextField(blank=True, default="")

junction/proposals/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def create_proposal(request, conference_slug):
169169
description=form.cleaned_data["description"],
170170
target_audience=form.cleaned_data["target_audience"],
171171
prerequisites=form.cleaned_data["prerequisites"],
172+
video_url=form.cleaned_data["video_url"],
172173
content_urls=form.cleaned_data["content_urls"],
173174
speaker_info=form.cleaned_data["speaker_info"],
174175
speaker_links=form.cleaned_data["speaker_links"],
@@ -319,6 +320,7 @@ def update_proposal(request, conference_slug, slug):
319320
proposal.description = form.cleaned_data["description"]
320321
proposal.target_audience = form.cleaned_data["target_audience"]
321322
proposal.prerequisites = form.cleaned_data["prerequisites"]
323+
proposal.video_url = form.cleaned_data["video_url"]
322324
proposal.content_urls = form.cleaned_data["content_urls"]
323325
proposal.speaker_info = form.cleaned_data["speaker_info"]
324326
proposal.speaker_links = form.cleaned_data["speaker_links"]

junction/templates/proposals/detail/base.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ <h4 class='heading'><b>Prerequisites:</b></h4>
137137
</div>
138138
{% endif %}
139139

140+
{% if proposal.video_url %}
141+
<div class="proposal-writeup--section">
142+
<h4 class='heading'><b>Video URL:</b></h4>
143+
<p>{{ proposal.video_url|markdown_safe }}</p>
144+
</div>
145+
{% endif %}
146+
140147
{% if proposal.content_urls %}
141148
<div class="proposal-writeup--section">
142149
<h4 class='heading'><b>Content URLs:</b></h4>

0 commit comments

Comments
 (0)