Skip to content

Commit

Permalink
Merge pull request #668 from sayanchowdhury/update-video-url
Browse files Browse the repository at this point in the history
Add the video URL to the proposal page
  • Loading branch information
sayanchowdhury committed May 2, 2020
2 parents 5d88e07 + 2f954ab commit db766c2
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions junction/proposals/forms.py
Expand Up @@ -114,6 +114,11 @@ class ProposalForm(forms.Form):
required=False,
help_text="What should the participants know before attending your session?",
)
video_url = forms.CharField(
required=False,
help_text="Short 1-2 min video describing your talk",
widget=forms.TextInput(attrs={"class": "charfield"}),
)
content_urls = forms.CharField(
widget=PagedownWidget(show_preview=True),
required=False,
Expand Down Expand Up @@ -148,6 +153,7 @@ def populate_form_for_update(self, proposal):
"description": proposal.description,
"target_audience": proposal.target_audience,
"prerequisites": proposal.prerequisites,
"video_url": proposal.video_url,
"content_urls": proposal.content_urls,
"speaker_info": proposal.speaker_info,
"speaker_links": proposal.speaker_links,
Expand Down
33 changes: 33 additions & 0 deletions junction/proposals/migrations/0027_auto_20200502_0540.py
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2020-05-02 00:10
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("proposals", "0026_auto_20200323_2010"),
]

operations = [
migrations.AddField(
model_name="historicalproposal",
name="video_url",
field=models.URLField(
blank=True,
default="",
help_text="A short 1-2 mins video link about your talk",
),
),
migrations.AddField(
model_name="proposal",
name="video_url",
field=models.URLField(
blank=True,
default="",
help_text="A short 1-2 mins video link about your talk",
),
),
]
3 changes: 3 additions & 0 deletions junction/proposals/models.py
Expand Up @@ -100,6 +100,9 @@ class Proposal(TimeAuditModel):
default=ProposalTargetAudience.BEGINNER,
verbose_name="Target Audience",
)
video_url = models.URLField(
blank=True, default="", help_text="Short 1-2 min video describing your talk",
)
prerequisites = models.TextField(blank=True, default="")
content_urls = models.TextField(blank=True, default="")
speaker_info = models.TextField(blank=True, default="")
Expand Down
2 changes: 2 additions & 0 deletions junction/proposals/views.py
Expand Up @@ -169,6 +169,7 @@ def create_proposal(request, conference_slug):
description=form.cleaned_data["description"],
target_audience=form.cleaned_data["target_audience"],
prerequisites=form.cleaned_data["prerequisites"],
video_url=form.cleaned_data["video_url"],
content_urls=form.cleaned_data["content_urls"],
speaker_info=form.cleaned_data["speaker_info"],
speaker_links=form.cleaned_data["speaker_links"],
Expand Down Expand Up @@ -319,6 +320,7 @@ def update_proposal(request, conference_slug, slug):
proposal.description = form.cleaned_data["description"]
proposal.target_audience = form.cleaned_data["target_audience"]
proposal.prerequisites = form.cleaned_data["prerequisites"]
proposal.video_url = form.cleaned_data["video_url"]
proposal.content_urls = form.cleaned_data["content_urls"]
proposal.speaker_info = form.cleaned_data["speaker_info"]
proposal.speaker_links = form.cleaned_data["speaker_links"]
Expand Down
7 changes: 7 additions & 0 deletions junction/templates/proposals/detail/base.html
Expand Up @@ -137,6 +137,13 @@ <h4 class='heading'><b>Prerequisites:</b></h4>
</div>
{% endif %}

{% if proposal.video_url %}
<div class="proposal-writeup--section">
<h4 class='heading'><b>Video URL:</b></h4>
<p>{{ proposal.video_url|markdown_safe }}</p>
</div>
{% endif %}

{% if proposal.content_urls %}
<div class="proposal-writeup--section">
<h4 class='heading'><b>Content URLs:</b></h4>
Expand Down

0 comments on commit db766c2

Please sign in to comment.