Changeset - 97beb8b13106
[Not reviewed]
0 2 1
Ben Sturmfels (bsturmfels) - 9 months ago 2023-07-14 08:37:45
ben@sturm.com.au
Add video URL field
3 files changed with 37 insertions and 0 deletions:
0 comments (0 inline, 0 general)
pinaxcon/templates/symposion/schedule/presentation_detail.html
Show inline comments
...
 
@@ -54,6 +54,21 @@
 
      {% autoescape off %}
 
      <div class="abstract pb-4"><p>{{ presentation.abstract_html|safe|clean_text|urlize }}</p></div>
 
      {% endautoescape %}
 

	
 
      {% if presentation.videos_split %}
 
        <h2 class="mt-4">Video</h4>
 
        <video controls style="max-width: 640px">
 
          {% for video in presentation.videos_split %}
 
            <source src="{{ video }}">
 
          {% endfor %}
 
        </video>
 
        <p style="margin-top: 1rem">Available formats:</p>
 
        <ul>
 
          {% for video in presentation.videos_split %}
 
            <li>{{ video|urlize }}</li>
 
          {% endfor %}
 
        </ul>
 
      {% endif %}
 
    </div>
 
  </div>
 
{% endblock %}
vendor/symposion/symposion/schedule/migrations/0009_presentation_videos.py
Show inline comments
 
new file 100644
 
# Generated by Django 2.2.28 on 2023-07-14 08:22
 

	
 
from django.db import migrations, models
 

	
 

	
 
class Migration(migrations.Migration):
 

	
 
    dependencies = [
 
        ('symposion_schedule', '0008_auto_20190122_0815'),
 
    ]
 

	
 
    operations = [
 
        migrations.AddField(
 
            model_name='presentation',
 
            name='videos',
 
            field=models.TextField(blank=True, help_text='One URL per line'),
 
        ),
 
    ]
vendor/symposion/symposion/schedule/models.py
Show inline comments
...
 
@@ -280,6 +280,7 @@ class Presentation(models.Model):
 
        verbose_name=_("Section"),
 
        on_delete=models.CASCADE,
 
    )
 
    videos = models.TextField(blank=True, help_text='One URL per line')
 

	
 
    def save(self, *args, **kwargs):
 
        self.abstract_html = parse(self.abstract)
...
 
@@ -304,6 +305,9 @@ class Presentation(models.Model):
 
    def __str__(self):
 
        return "#%s %s (%s)" % (self.number, self.title, self.speaker)
 

	
 
    def videos_split(self):
 
        return [v.strip() for v in self.videos.split('\n') if v != '']
 

	
 
    class Meta:
 
        ordering = ["slot"]
 
        verbose_name = _("presentation")
0 comments (0 inline, 0 general)