]> git.parisson.com Git - mezzo.git/commitdiff
add video views
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Feb 2016 13:08:00 +0000 (14:08 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Feb 2016 13:08:00 +0000 (14:08 +0100)
app/deploy/start_app.sh
app/festival/migrations/__init__.py [new file with mode: 0644]
app/festival/models.py
app/festival/templates/festival/video_detail.html [new file with mode: 0644]
app/festival/templates/festival/video_list.html [new file with mode: 0644]
app/festival/urls.py
app/festival/views.py

index e94244d64deab45dff88fcd5b6a9f1cf3849dbdf..a775934696e8cf13a069e7c3f24fecffab19d204 100644 (file)
@@ -34,15 +34,15 @@ python $manage migrate --noinput
 python $manage collectstatic --noinput
 python $manage create-admin-user
 
-# static files auto update
-watchmedo shell-command --patterns="*.js;*.css" --recursive \
-    --command='python '$manage' collectstatic --noinput' $src &
-
 # app start
 if [ $1 = "--runserver" ]
 then
     python $manage runserver 0.0.0.0:9000
 else
+    # static files auto update
+    watchmedo shell-command --patterns="*.js;*.css" --recursive \
+        --command='python '$manage' collectstatic --noinput' $src &
+
     uwsgi --socket :$port --wsgi-file $wsgi --chdir $app --master \
     --processes $processes --threads $threads \
     --uid $uid --gid $gid \
diff --git a/app/festival/migrations/__init__.py b/app/festival/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 0324bc23bb4bf09d3951e1eb3ec275b08409e71d..b6ea3c023d1b0a5e3a3559a0d93e8fffb33bffc2 100644 (file)
@@ -91,6 +91,9 @@ class Video(Displayable, RichText):
     def __unicode__(self):
         return
 
+    @property
+    def html(self):
+        pass
 
 class EventCategory(BaseNameModel):
     """Event Category"""
diff --git a/app/festival/templates/festival/video_detail.html b/app/festival/templates/festival/video_detail.html
new file mode 100644 (file)
index 0000000..e237ba7
--- /dev/null
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load mezzanine_tags keyword_tags %}
+
+{% block main %}
+
+<div class="video-title">
+ <h1>{{ video.title }}</h1>
+</div>
+
+<div class="video-description">
+ {{ video.description }}
+</div>
+
+<div class="video-html">
+  {{ video.html|safe }}
+</div>
+
+<div class="video-event">
+  <h2>{% trans 'Related event' %}</h2>
+    {{ video.event.title }}
+</div>
+
+{% endblock %}
diff --git a/app/festival/templates/festival/video_list.html b/app/festival/templates/festival/video_list.html
new file mode 100644 (file)
index 0000000..33a57d9
--- /dev/null
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load mezzanine_tags keyword_tags %}
+
+{% block main %}
+
+<div class="video-list">
+ <ul>
+ {% for video in object_list %}
+    <li><a href="{% url 'festival-video-detail' video.id %}">{{ video.title }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+
+{% endblock %}
index da5434c4bbb0384b071c3425bfa8818a350e7498..04aa490552992c3df08da9962fe3cfd7b7e5c28a 100644 (file)
@@ -10,7 +10,9 @@ from mezzanine.conf import settings
 from festival.views import *
 
 urlpatterns = patterns('',
-    url(r'^artists/$', ArtistListView.as_view(), name="festival-artists"),
+    url(r'^artists/$', ArtistListView.as_view(), name="festival-artist-list"),
     url(r'^artists/(?P<pk>.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"),
+    url(r'^videos/$', ArtistListView.as_view(), name="festival-video-list"),
+    url(r'^videos/(?P<pk>.*)/$', ArtistDetailView.as_view(), name="festival-video-detail"),
 
 )
index b8263ec949eacd8985e34c59ebda0c88363c60d0..defac746451ef2e76ad91480e498e94539b291cc 100644 (file)
@@ -40,7 +40,7 @@ class VideoDetailView(DetailView):
 
     model = Video
     template_name='festival/video_detail.html'
-    context_object_name = 'artist'
+    context_object_name = 'video'
 
     def get_context_data(self, **kwargs):
         context = super(VideoDetailView, self).get_context_data(**kwargs)