changeset 89:4b4a5d7602f8

rename screenshots to media, since not only screenshots but also videos are listed
author souliane <souliane@mailoo.org>
date Tue, 16 Jun 2015 12:35:32 +0200
parents f91363b1048c
children 5de2a3dd4e67
files sat_website/media.py sat_website/screenshots.py sat_website/views.py templates/sat_website/features.html templates/sat_website/gallery.html templates/sat_website/media.html templates/sat_website/screenshots.html
diffstat 7 files changed, 157 insertions(+), 156 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_website/media.py	Tue Jun 16 12:35:32 2015 +0200
@@ -0,0 +1,84 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+SàT website: Salut à Toi's presentation website
+Copyright (C) 2012  Jérôme Poisson (goffi@goffi.org)
+
+This file is part of SàT website.
+
+SàT website is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Foobar is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+"""
+from django.utils.translation import ugettext_lazy as _
+from django.conf import settings
+from collections import namedtuple
+import os.path
+
+ImageDesc = namedtuple("ImageDesc", "path description data")
+VideoDesc = namedtuple("VideoDesc", "path description poster data")
+
+screencasts = os.path.join(settings.MEDIA_EXTERNAL_URL, "screencasts") + "/"
+video = os.path.join(settings.MEDIA_EXTERNAL_URL, "video") + "/"
+
+
+#list the pictures
+
+media = [
+
+    VideoDesc(video + "libervia_adhesion_2015_fr.webm",
+              _(u"Membership campaign for Libervia"),
+              video + "posters/libervia_adhesion_2015.png",
+              {_(u"version"): "0.5", _(u"year"): "2015", _(u"language"): "fr"}),
+
+    ImageDesc("images/screenshots/0.5/overview_libervia.png", _(u"Overview"),
+              {_(u"frontend"): "libervia", _(u"version"): "0.5", _(u"year"): "2014"}),
+    ImageDesc("images/screenshots/0.5/http_unsecure_warning.png", _(u"Optional security check"),
+              {_(u"frontend"): "libervia", _(u"version"): "0.5", _(u"year"): "2014"}),
+    ImageDesc("images/screenshots/0.4/sat_wysiwyg.png", _(u"Rich text editor"),
+              {_(u"frontend"): "libervia", _(u"version"): "0.4", _(u"year"): "2014"}),
+    VideoDesc(screencasts + "présentation_SàT_5_radio_collective.webm", _(u"Demo of the new Libervia UI, and of the collective radio feature"), screencasts + "posters/radiocol.jpg",
+              {_(u"frontend"): "libervia", _(u"version"): "0.3D", _(u"year"): "2012", _(u"language"): "fr"}),
+    ImageDesc("images/screenshots/libervia/libervia_login.png", _(u"Libervia's login page"),
+              {_(u"frontend"): "libervia", _(u"version"): "0.3D", _(u"year"): "2011"}),
+    ImageDesc("images/screenshots/libervia/libervia_discussions.png", _(u"Libervia's main view"),
+              {_(u"frontend"): "libervia", _(u"version"): "0.3D", _(u"year"): "2011"}),
+    ImageDesc("images/screenshots/wix/wix_tarot.png", _(u"Wix showing a french Tarot play"),
+              {_(u"frontend"): "wix", _(u"version"): "0.2", _(u"year"): "2011"}),
+    VideoDesc(screencasts + "présentation_SàT_3.webm", _(u"This video focuses on Libervia. The UI is really outdated, but we can see some features"), screencasts + "posters/présentation_SàT_3.jpg",
+              {_(u"frontend"): "libervia", _(u"version"): "0.2", _(u"year"): "2011", _(u"language"): "fr"}),
+    ]
+
+media_tech = [
+    ImageDesc("images/screenshots/0.5/adhoc_administration.png", _(u"Server administration from the web frontend Libervia."),
+              {_(u"frontend"): "libervia", _(u"version"): "0.5", _(u"year"): "2014"}),
+    VideoDesc(screencasts + "présentation_SàT_7_télécommande_universelle.webm", _(u"Use ad-hoc commands to control a VLC player from Libervia"), screencasts + "posters/présentation_SàT_7_télécommande_universelle.png",
+              {_(u"version"): "0.4", _(u"year"): "2014", _(u"language"): "fr"}),
+    VideoDesc(screencasts + "présentation_SàT_6_export_commande.webm", _(u"Exporting a command: an FTP client is exported to a Gajim contact"), screencasts + "posters/présentation_SàT_6_export_commande.jpg",
+              {_(u"version"): "0.4D", _(u"year"): "2013", _(u"language"): "fr"}),
+    VideoDesc(screencasts + "présentation_SàT_4_copie_et_pipe.webm", _(u"How to copy and pipe streams over XMPP"), screencasts + "posters/présentation_SàT_4.png",
+              {_(u"version"): "0.3D", _(u"year"): "2011", _(u"language"): "fr"}),
+    ImageDesc("images/screenshots/jp/jp.png", _(u"Cowsay sent in conversation through jp"),
+              {_(u"version"): "0.2", _(u"year"): "2011"}),
+    ImageDesc("images/screenshots/primitivus/primitivus_tarot.png", _(u"Primitivus showing a french Tarot play"),
+              {_(u"frontend"): "primitivus", _(u"version"): "0.2", _(u"year"): "2011"}),
+    VideoDesc(screencasts + "présentation_SàT_2.webm", _(u"This video shows french Tarot game, and how to use Thunderbird with SàT"), screencasts + "posters/présentation_SàT_2.jpg",
+              {_(u"version"): "0.2", _(u"year"): "2011", _(u"language"): "fr"}),
+    VideoDesc(screencasts + "présentation_SàT.webm", _(u"The first video shows wix, primitivus and jp"), screencasts + "posters/présentation_SàT.jpg",
+              {_(u"version"): "0.2", _(u"year"): "2011", _(u"language"): "fr"}),
+    ]
+
+
+
+
+
+
--- a/sat_website/screenshots.py	Mon Jun 15 21:06:38 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-"""
-SàT website: Salut à Toi's presentation website
-Copyright (C) 2012  Jérôme Poisson (goffi@goffi.org)
-
-This file is part of SàT website.
-
-SàT website is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Foobar is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
-"""
-from django.utils.translation import ugettext_lazy as _
-from django.conf import settings
-from collections import namedtuple
-import os.path
-
-ImageDesc = namedtuple("ImageDesc", "path description data")
-VideoDesc = namedtuple("VideoDesc", "path description poster data")
-
-screencasts = os.path.join(settings.MEDIA_EXTERNAL_URL, "screencasts") + "/"
-video = os.path.join(settings.MEDIA_EXTERNAL_URL, "video") + "/"
-
-
-#list the pictures
-
-screenshots = [
-
-    VideoDesc(video + "libervia_adhesion_2015_fr.webm",
-              _(u"Membership campaign for Libervia"),
-              video + "posters/libervia_adhesion_2015.png",
-              {_(u"version"): "0.5", _(u"year"): "2015", _(u"language"): "fr"}),
-
-    ImageDesc("images/screenshots/0.5/overview_libervia.png", _(u"Overview"),
-              {_(u"frontend"): "libervia", _(u"version"): "0.5", _(u"year"): "2014"}),
-    ImageDesc("images/screenshots/0.5/http_unsecure_warning.png", _(u"Optional security check"),
-              {_(u"frontend"): "libervia", _(u"version"): "0.5", _(u"year"): "2014"}),
-    ImageDesc("images/screenshots/0.4/sat_wysiwyg.png", _(u"Rich text editor"),
-              {_(u"frontend"): "libervia", _(u"version"): "0.4", _(u"year"): "2014"}),
-    VideoDesc(screencasts + "présentation_SàT_5_radio_collective.webm", _(u"Demo of the new Libervia UI, and of the collective radio feature"), screencasts + "posters/radiocol.jpg",
-              {_(u"frontend"): "libervia", _(u"version"): "0.3D", _(u"year"): "2012", _(u"language"): "fr"}),
-    ImageDesc("images/screenshots/libervia/libervia_login.png", _(u"Libervia's login page"),
-              {_(u"frontend"): "libervia", _(u"version"): "0.3D", _(u"year"): "2011"}),
-    ImageDesc("images/screenshots/libervia/libervia_discussions.png", _(u"Libervia's main view"),
-              {_(u"frontend"): "libervia", _(u"version"): "0.3D", _(u"year"): "2011"}),
-    ImageDesc("images/screenshots/wix/wix_tarot.png", _(u"Wix showing a french Tarot play"),
-              {_(u"frontend"): "wix", _(u"version"): "0.2", _(u"year"): "2011"}),
-    VideoDesc(screencasts + "présentation_SàT_3.webm", _(u"This video focuses on Libervia. The UI is really outdated, but we can see some features"), screencasts + "posters/présentation_SàT_3.jpg",
-              {_(u"frontend"): "libervia", _(u"version"): "0.2", _(u"year"): "2011", _(u"language"): "fr"}),
-    ]
-
-screenshots_tech = [
-    ImageDesc("images/screenshots/0.5/adhoc_administration.png", _(u"Server administration from the web frontend Libervia."),
-              {_(u"frontend"): "libervia", _(u"version"): "0.5", _(u"year"): "2014"}),
-    VideoDesc(screencasts + "présentation_SàT_7_télécommande_universelle.webm", _(u"Use ad-hoc commands to control a VLC player from Libervia"), screencasts + "posters/présentation_SàT_7_télécommande_universelle.png",
-              {_(u"version"): "0.4", _(u"year"): "2014", _(u"language"): "fr"}),
-    VideoDesc(screencasts + "présentation_SàT_6_export_commande.webm", _(u"Exporting a command: an FTP client is exported to a Gajim contact"), screencasts + "posters/présentation_SàT_6_export_commande.jpg",
-              {_(u"version"): "0.4D", _(u"year"): "2013", _(u"language"): "fr"}),
-    VideoDesc(screencasts + "présentation_SàT_4_copie_et_pipe.webm", _(u"How to copy and pipe streams over XMPP"), screencasts + "posters/présentation_SàT_4.png",
-              {_(u"version"): "0.3D", _(u"year"): "2011", _(u"language"): "fr"}),
-    ImageDesc("images/screenshots/jp/jp.png", _(u"Cowsay sent in conversation through jp"),
-              {_(u"version"): "0.2", _(u"year"): "2011"}),
-    ImageDesc("images/screenshots/primitivus/primitivus_tarot.png", _(u"Primitivus showing a french Tarot play"),
-              {_(u"frontend"): "primitivus", _(u"version"): "0.2", _(u"year"): "2011"}),
-    VideoDesc(screencasts + "présentation_SàT_2.webm", _(u"This video shows french Tarot game, and how to use Thunderbird with SàT"), screencasts + "posters/présentation_SàT_2.jpg",
-              {_(u"version"): "0.2", _(u"year"): "2011", _(u"language"): "fr"}),
-    VideoDesc(screencasts + "présentation_SàT.webm", _(u"The first video shows wix, primitivus and jp"), screencasts + "posters/présentation_SàT.jpg",
-              {_(u"version"): "0.2", _(u"year"): "2011", _(u"language"): "fr"}),
-    ]
-
-
-
-
-
-
--- a/sat_website/views.py	Mon Jun 15 21:06:38 2015 +0200
+++ b/sat_website/views.py	Tue Jun 16 12:35:32 2015 +0200
@@ -26,12 +26,12 @@
 from django.utils.translation import ugettext_lazy as _
 from django.template import RequestContext
 from collections import OrderedDict
-import screenshots, social_contract, utils, forms
+import media, social_contract, utils, forms
 
 CATEGORIES = OrderedDict([('frontends', (_(u"Presentation"),
                                 OrderedDict([("features", _(u"Features")),
                                              ("frontends", _(u"Frontends")),
-                                             ("screenshots", _(u"Screenshots & Videos")),
+                                             ("media", _(u"Screenshots & Videos")),
                                              ]))),
                           ('principles', (_(u"Technical area"),
                                 OrderedDict([("principles", _(u"Principles")),
@@ -54,6 +54,7 @@
 
 CATEGORIES_ALIASES = {"adhesion": "membership",
                       "adhesion_form": "membership_form",
+                      "screenshots": "media",
                       }
 
 CATEGORIES_HIDDEN = ('membership_form', 'thank_you')
@@ -87,9 +88,9 @@
     if not category or category == "overview":
         context.update(utils.get_asso_finance_status())
         return render_to_response('sat_website/overview.html', context)
-    elif category == "screenshots":
-        context["screenshots"] = screenshots.screenshots
-        context["screenshots_tech"] = screenshots.screenshots_tech
+    elif category == "media":
+        context["media"] = media.media
+        context["media_tech"] = media.media_tech
     elif category == "social_contract":
         context["SOCIAL_CONTRACT"] = social_contract.get_social_contract()
     elif category == "downloads":
--- a/templates/sat_website/features.html	Mon Jun 15 21:06:38 2015 +0200
+++ b/templates/sat_website/features.html	Tue Jun 16 12:35:32 2015 +0200
@@ -28,7 +28,7 @@
 
 <div class="row">
     <h5 class="alert alert-success">
-        <a name="screenshots"></a>{% trans "Short overview" %}
+        <a name="overview"></a>{% trans "Short overview" %}
     </h5>
     <div class="info">
 	    <div class="row">
--- a/templates/sat_website/gallery.html	Mon Jun 15 21:06:38 2015 +0200
+++ b/templates/sat_website/gallery.html	Tue Jun 16 12:35:32 2015 +0200
@@ -23,31 +23,31 @@
 {% load utils %}
 
 <div id="carousel-{{ name }}" class="carousel slide my-carousel" data-ride="carousel" data-interval="0">
-    {% if screenshots|length > 9 %}
+    {% if media|length > 9 %}
         <ol class="carousel-indicators">
-            {% for row in screenshots|buffer:9 %}
+            {% for row in media|buffer:9 %}
                 <li data-target="#carousel-{{ name }}" data-slide-to="{{ forloop.counter0 }}"{% if not forloop.counter0 %} class="active"{% endif %}></li>
             {% endfor %}
         </ol>
     {% endif %}
     <div class="carousel-inner" role="listbox">
-        {% for row in screenshots|buffer:9 %}
+        {% for row in media|buffer:9 %}
             <div class="item{% if not forloop.counter0 %} active{% endif %}">
-            {% for screenshot in row %}
+            {% for entry in row %}
                 <div class="col-md-4">
-                    {% if screenshot.poster %}
-                        <video index="{{ forloop.counter0 }}" class="thumbnail img-responsive" width="640" height="400" poster="{{ screenshot.poster }}" controls preload="none">
-                            <source src="{{ screenshot.path }}" type='video/webm; codecs="vp8.0, vorbis"'>
+                    {% if entry.poster %}
+                        <video index="{{ forloop.counter0 }}" class="thumbnail img-responsive" width="640" height="400" poster="{{ entry.poster }}" controls preload="none">
+                            <source src="{{ entry.path }}" type='video/webm; codecs="vp8.0, vorbis"'>
                             {% blocktrans with firefox="<a href=\"http://www.mozilla.org/\">Firefox</a>" %}Your browser doesn't manage the « video » tag, you should update, e.g. with the last {{ firefox }}.{% endblocktrans %}
 	                    </video>
                     {% else %}
-                        <img index="{{ forloop.counter0 }}" class="thumbnail img-responsive" src="{% static screenshot.path %}">
+                        <img index="{{ forloop.counter0 }}" class="thumbnail img-responsive" src="{% static entry.path %}">
                     {% endif %}
                 </div>
             {% endfor %}
             </div>
         {% endfor %}
-        {% if screenshots|length > 9 %}
+        {% if media|length > 9 %}
 	        <a class="left carousel-control" href="#carousel-{{ name }}" role="button" data-slide="prev">
 	          <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
 	          <span class="sr-only">Previous</span>
@@ -68,32 +68,32 @@
             </div>
             <div class="modal-body">
                 <div id="carousel-{{ name }}-modal" class="carousel slide my-carousel-modal" data-ride="carousel" data-interval="0">
-                    {% if screenshots|length > 1 %}
+                    {% if media|length > 1 %}
                         <ol class="carousel-indicators">
-                            {% for screenshot in screenshots %}
+                            {% for entry in media %}
                                 <li data-target="#carousel-{{ name }}-modal" data-slide-to="{{ forloop.counter0 }}"{% if not forloop.counter0 %} class="active"{% endif %}></li>
                             {% endfor %}
                         </ol>
                     {% endif %}
                     <div class="carousel-inner" role="listbox">
-                        {% for screenshot in screenshots %}
+                        {% for entry in media %}
                             <div class="item{% if not forloop.counter0 %} active{% endif %}">
-                                {% if screenshot.poster %}
-                                    <video class="img-responsive" width="640" height="400" poster="{{ screenshot.poster }}" controls preload="none">
-                                        <source src="{{ screenshot.path }}" type='video/webm; codecs="vp8.0, vorbis"'>
+                                {% if entry.poster %}
+                                    <video class="img-responsive" width="640" height="400" poster="{{ entry.poster }}" controls preload="none">
+                                        <source src="{{ entry.path }}" type='video/webm; codecs="vp8.0, vorbis"'>
                                         {% blocktrans with firefox="<a href=\"http://www.mozilla.org/\">Firefox</a>" %}Your browser doesn't manage the « video » tag, you should update, e.g. with the last {{ firefox }}.{% endblocktrans %}
                                     </video>
                                 {% else %}
-                                    <img class="img-responsive" src="{% static screenshot.path %}">                            
+                                    <img class="img-responsive" src="{% static entry.path %}">                            
                                 {% endif %}
                                 <div class="carousel-caption">
-                                    {{ screenshot.description }}<br/>
-                                    {{ screenshot.data|metadata }}
+                                    {{ entry.description }}<br/>
+                                    {{ entry.data|metadata }}
                                 </div>
                             </div>
                         {% endfor %}
                     </div>
-                    {% if screenshots|length > 1 %}
+                    {% if media|length > 1 %}
 	                    <a class="left carousel-control" href="#carousel-{{ name }}-modal" data-slide="prev">
 	                        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
 	                        <span class="sr-only">Previous</span>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/sat_website/media.html	Tue Jun 16 12:35:32 2015 +0200
@@ -0,0 +1,47 @@
+{% extends "sat_website/category.html" %}
+
+{% comment %}
+SàT website: Salut à Toi's presentation website
+Copyright (C) 2012  Jérôme Poisson (goffi@goffi.org)
+
+This file is part of SàT website.
+
+SàT website is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Foobar is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+{% endcomment %}
+
+{% load i18n %}
+{% block headline %}{% trans "Screenshots and videos" %}{% endblock %}
+{% block main_container %}
+
+<div class="row">
+    <h5 class="alert alert-success">
+        <a name="media"></a>{% trans "Basic usage" %}
+    </h5>
+    <div class="info">
+        {% trans "These media concern the basic utilisation SàT through graphical frontends like Libervia." %}
+        {% include "sat_website/gallery.html" with media=media name="media" %}
+    </div>
+</div>
+
+<div class="row">
+    <h5 class="alert alert-success">
+        <a name="media_tech"></a>{% trans "Advanced usage" %}
+    </h5>
+    <div class="info">
+        {% trans "These media concern the advanced utilisation and frontends of SàT, including administration tasks and experimental features." %}
+        {% include "sat_website/gallery.html" with media=media_tech name="media_tech" %}
+    </div>
+</div>
+
+{% endblock %}
--- a/templates/sat_website/screenshots.html	Mon Jun 15 21:06:38 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-{% extends "sat_website/category.html" %}
-
-{% comment %}
-SàT website: Salut à Toi's presentation website
-Copyright (C) 2012  Jérôme Poisson (goffi@goffi.org)
-
-This file is part of SàT website.
-
-SàT website is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Foobar is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
-{% endcomment %}
-
-{% load i18n %}
-{% block headline %}{% trans "Screenshots and videos" %}{% endblock %}
-{% block main_container %}
-
-<div class="row">
-    <h5 class="alert alert-success">
-        <a name="screenshots"></a>{% trans "Basic usage" %}
-    </h5>
-    <div class="info">
-        {% trans "These media concern the basic utilisation SàT through graphical frontends like Libervia." %}
-        {% include "sat_website/gallery.html" with screenshots=screenshots name="media" %}
-    </div>
-</div>
-
-<div class="row">
-    <h5 class="alert alert-success">
-        <a name="screenshots_tech"></a>{% trans "Advanced usage" %}
-    </h5>
-    <div class="info">
-        {% trans "These media concern the advanced utilisation and frontends of SàT, including administration tasks and experimental features." %}
-        {% include "sat_website/gallery.html" with screenshots=screenshots_tech name="media_tech" %}
-    </div>
-</div>
-
-{% endblock %}