]> git.parisson.com Git - mezzo.git/commitdiff
Task #105 #106: hide some fields in admin
authorEmilie <zawadzki@ircam.fr>
Fri, 26 Aug 2016 17:07:42 +0000 (19:07 +0200)
committerEmilie <zawadzki@ircam.fr>
Fri, 26 Aug 2016 17:07:42 +0000 (19:07 +0200)
app/organization/media/models.py
app/organization/network/admin.py
app/organization/pages/admin.py
app/templates/media/video/video_detail.html [new file with mode: 0644]

index ff770fabf83031f6e01ac7e9e23b8d209e85e2ab..d5aceeb592436fd50796c494fa5a074dab736035 100644 (file)
@@ -12,7 +12,7 @@ from organization.core.models import CustomDisplayable
 from organization.pages.models import Page
 from mezzanine_agenda.models import Event
 from django.conf import settings
-
+import requests
 
 MEDIA_BASE_URL = getattr(settings, 'MEDIA_BASE_URL', 'http://medias.ircam.fr/embed/media/')
 
index 0078351dcb566d8a2e647fa110c38adb40e17968..0645a9e67e51f485bfbcbfe17470cbb9fbd87631 100644 (file)
@@ -13,11 +13,13 @@ from organization.media.models import PageAudio, PageVideo
 class PageAudioInline(StackedDynamicInlineAdmin):
 
     model = PageAudio
+    exclude = ("short_url", "keywords", "description", "slug", )
 
 
 class PageVideoInline(StackedDynamicInlineAdmin):
 
     model = PageVideo
+    exclude = ("short_url", "keywords", "description", "slug", )
 
 
 class OrganizationImageInline(TabularDynamicInlineAdmin):
index 6c6142226afee66e6b585207a10a148674a5cb77..3c73a53f442e93fbd702c0f6745a9824e32e8d6f 100644 (file)
@@ -23,11 +23,13 @@ class PageImageInline(TabularDynamicInlineAdmin):
 class PageAudioInline(StackedDynamicInlineAdmin):
 
     model = PageAudio
+    exclude = ("short_url", "keywords", "description", "slug", )
 
 
 class PageVideoInline(StackedDynamicInlineAdmin):
 
     model = PageVideo
+    exclude = ("short_url", "keywords", "description", "slug", )
 
 
 class CustomPageAdmin(PageAdmin):
diff --git a/app/templates/media/video/video_detail.html b/app/templates/media/video/video_detail.html
new file mode 100644 (file)
index 0000000..b954cc1
--- /dev/null
@@ -0,0 +1,52 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load mezzanine_tags keyword_tags %}
+
+{% block title %}
+{{ video.title }}
+{% endblock %}
+
+{% block main %}
+
+<div class="video-html">
+    {{ video.content|safe }}
+</div>
+
+<div class="embed-responsive">
+       <video width="100%" poster="{{ video.poster_url }}" controls data-title="{{ video.title }}" preload="none">
+         <source src="{{ video.open_source_url }}" type="{{ video.open_source_mime_type }}" />
+      <source src="{{ video.closed_source_url }}" type="{{ video.closed_source_mime_type }}" />
+         </video>
+</div>
+
+{% with video as object %}
+  {% include "includes/share_buttons.html" %}
+{% endwith %}
+
+{% if video.event %}
+<div class="video-event">
+ <h2 class="section__title">{% trans 'Also discover' %}</h2>
+  <div class="msry__container">
+   <div class="msry__sizer"></div>
+    {% with video.event as event %}
+        {% include 'agenda/includes/event_card.html' %}
+    {% for artist in video.artists.all %}
+        {% include "festival/inc/artist_card.html" %}
+    {% endfor %}
+    {% for v in event.videos.all %}
+      {% if v != video %}
+       {% with v as video %}
+        {% include 'festival/inc/video_card.html' %}
+       {% endwith %}
+      {% endif %}
+    {% endfor %}
+    {% for post in event.blog_posts.all %}
+        {% include 'blog/includes/post_card.html' %}
+    {% endfor %}
+    {% endwith %}
+
+</div>
+</div>
+{% endif %}
+
+{% endblock %}