# HG changeset patch # User veltr # Date 1354800623 -3600 # Node ID ff6c954f3aaaef9196a6c1dbd7f74f83e238a24b # Parent 41c09a24bc92a4ca9722749e3aa24bc81485c4bf Added All medias view diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/locale/en/LC_MESSAGES/django.mo Binary file src/hashcut/locale/en/LC_MESSAGES/django.mo has changed diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/locale/en/LC_MESSAGES/django.po --- a/src/hashcut/locale/en/LC_MESSAGES/django.po Thu Dec 06 12:38:51 2012 +0100 +++ b/src/hashcut/locale/en/LC_MESSAGES/django.po Thu Dec 06 14:30:23 2012 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-12-05 11:13+0100\n" +"POT-Creation-Date: 2012-12-06 14:27+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,35 +18,45 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" -#: templates/mashup_all_mashups.html:22 templates/mashup_content.html:54 -#: templates/mashup_edit.html:78 templates/mashup_home.html:15 -#: templates/mashup_profile.html:27 +#: templates/mashup_all_contents.html:7 templates/mashup_all_contents.html:18 +#: templates/mashup_home.html:119 +msgid "All source videos" +msgstr "All source videos" + +#: templates/mashup_all_contents.html:22 templates/mashup_all_mashups.html:22 +#: templates/mashup_content.html:54 templates/mashup_edit.html:78 +#: templates/mashup_home.html:15 templates/mashup_profile.html:27 msgid "Home" msgstr "Home" -#: templates/mashup_all_mashups.html:23 templates/mashup_content.html:55 -#: templates/mashup_profile.html:28 +#: templates/mashup_all_contents.html:23 templates/mashup_all_mashups.html:23 +#: templates/mashup_content.html:55 templates/mashup_profile.html:28 msgid "New hashcut" msgstr "New Hashcut" -#: templates/mashup_all_mashups.html:24 templates/mashup_content.html:56 -#: templates/mashup_edit.html:79 templates/mashup_home.html:65 -#: templates/mashup_profile.html:29 +#: templates/mashup_all_contents.html:24 templates/mashup_all_mashups.html:24 +#: templates/mashup_content.html:56 templates/mashup_edit.html:79 +#: templates/mashup_home.html:65 templates/mashup_profile.html:29 msgid "My profile" msgstr "My profile" -#: templates/mashup_all_mashups.html:36 +#: templates/mashup_all_contents.html:36 templates/mashup_all_mashups.html:36 msgid "Previous" msgstr "Previous" -#: templates/mashup_all_mashups.html:44 +#: templates/mashup_all_contents.html:44 templates/mashup_all_mashups.html:44 msgid "Next" msgstr "Next" -#: templates/mashup_all_mashups.html:47 +#: templates/mashup_all_contents.html:47 templates/mashup_all_mashups.html:47 msgid "All" msgstr "All" +#: templates/mashup_all_mashups.html:7 templates/mashup_all_mashups.html:18 +#: templates/mashup_home.html:105 +msgid "All Hashcuts" +msgstr "All Hashcuts" + #: templates/mashup_content.html:6 #, python-format msgid "Playing video %(title)s" @@ -232,7 +242,7 @@ msgstr "Featured Hashcuts" #: templates/mashup_home.html:83 templates/mashup_home.html.py:89 -#: templates/mashup_home.html:99 +#: templates/mashup_home.html:99 templates/mashup_home.html.py:113 msgid "by" msgstr "by" @@ -240,31 +250,31 @@ msgid "Newest Hashcuts" msgstr "Newest Hashcuts" -#: templates/mashup_home.html:105 -msgid "All Hashcuts" -msgstr "All Hashcuts" +#: templates/mashup_home.html:108 +msgid "Available videos" +msgstr "Available source videos" -#: templates/mashup_home.html:111 +#: templates/mashup_home.html:125 msgid "What's a Hashcut?" msgstr "What's a Hashcut?" -#: templates/mashup_home.html:116 +#: templates/mashup_home.html:130 msgid "How to?" msgstr "How to?" -#: templates/mashup_home.html:119 +#: templates/mashup_home.html:133 msgid "Sign up" msgstr "Sign up" -#: templates/mashup_home.html:120 +#: templates/mashup_home.html:134 msgid "Start by creating your own profile on this platform." msgstr "Start by creating your own profile on this platform." -#: templates/mashup_home.html:124 +#: templates/mashup_home.html:138 msgid "Create a new hashcut" msgstr "Create a new Hashcut" -#: templates/mashup_home.html:125 +#: templates/mashup_home.html:139 msgid "" "Choose videos, define and organize segments and comment them to create your " "own hashcut." @@ -272,11 +282,11 @@ "Choose videos, define and organize segments and comment them to create your " "own hashcut." -#: templates/mashup_home.html:129 +#: templates/mashup_home.html:143 msgid "Publish and share" msgstr "Publish and share" -#: templates/mashup_home.html:130 +#: templates/mashup_home.html:144 msgid "" "Once your hashcut is done, publish it here and share your work on social " "networks." diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/locale/fr/LC_MESSAGES/django.mo Binary file src/hashcut/locale/fr/LC_MESSAGES/django.mo has changed diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/locale/fr/LC_MESSAGES/django.po --- a/src/hashcut/locale/fr/LC_MESSAGES/django.po Thu Dec 06 12:38:51 2012 +0100 +++ b/src/hashcut/locale/fr/LC_MESSAGES/django.po Thu Dec 06 14:30:23 2012 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-12-05 11:13+0100\n" +"POT-Creation-Date: 2012-12-06 14:27+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,35 +18,45 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" -#: templates/mashup_all_mashups.html:22 templates/mashup_content.html:54 -#: templates/mashup_edit.html:78 templates/mashup_home.html:15 -#: templates/mashup_profile.html:27 +#: templates/mashup_all_contents.html:7 templates/mashup_all_contents.html:18 +#: templates/mashup_home.html:119 +msgid "All source videos" +msgstr "Toutes les vidéos sources" + +#: templates/mashup_all_contents.html:22 templates/mashup_all_mashups.html:22 +#: templates/mashup_content.html:54 templates/mashup_edit.html:78 +#: templates/mashup_home.html:15 templates/mashup_profile.html:27 msgid "Home" msgstr "Accueil" -#: templates/mashup_all_mashups.html:23 templates/mashup_content.html:55 -#: templates/mashup_profile.html:28 +#: templates/mashup_all_contents.html:23 templates/mashup_all_mashups.html:23 +#: templates/mashup_content.html:55 templates/mashup_profile.html:28 msgid "New hashcut" msgstr "Créer un Hashcut" -#: templates/mashup_all_mashups.html:24 templates/mashup_content.html:56 -#: templates/mashup_edit.html:79 templates/mashup_home.html:65 -#: templates/mashup_profile.html:29 +#: templates/mashup_all_contents.html:24 templates/mashup_all_mashups.html:24 +#: templates/mashup_content.html:56 templates/mashup_edit.html:79 +#: templates/mashup_home.html:65 templates/mashup_profile.html:29 msgid "My profile" msgstr "Mon profil" -#: templates/mashup_all_mashups.html:36 +#: templates/mashup_all_contents.html:36 templates/mashup_all_mashups.html:36 msgid "Previous" msgstr "Précédents" -#: templates/mashup_all_mashups.html:44 +#: templates/mashup_all_contents.html:44 templates/mashup_all_mashups.html:44 msgid "Next" msgstr "Suivants" -#: templates/mashup_all_mashups.html:47 +#: templates/mashup_all_contents.html:47 templates/mashup_all_mashups.html:47 msgid "All" msgstr "Tous" +#: templates/mashup_all_mashups.html:7 templates/mashup_all_mashups.html:18 +#: templates/mashup_home.html:105 +msgid "All Hashcuts" +msgstr "Tous les Hashcuts" + #: templates/mashup_content.html:6 #, python-format msgid "Playing video %(title)s" @@ -234,7 +244,7 @@ msgstr "Hashcuts à la Une" #: templates/mashup_home.html:83 templates/mashup_home.html.py:89 -#: templates/mashup_home.html:99 +#: templates/mashup_home.html:99 templates/mashup_home.html.py:113 msgid "by" msgstr "par" @@ -242,31 +252,31 @@ msgid "Newest Hashcuts" msgstr "Derniers Hashcuts" -#: templates/mashup_home.html:105 -msgid "All Hashcuts" -msgstr "Tous les Hashcuts" +#: templates/mashup_home.html:108 +msgid "Available videos" +msgstr "Vidéos sources disponibles" -#: templates/mashup_home.html:111 +#: templates/mashup_home.html:125 msgid "What's a Hashcut?" msgstr "Hashcut ?" -#: templates/mashup_home.html:116 +#: templates/mashup_home.html:130 msgid "How to?" msgstr "Comment faire ?" -#: templates/mashup_home.html:119 +#: templates/mashup_home.html:133 msgid "Sign up" msgstr "S'inscrire" -#: templates/mashup_home.html:120 +#: templates/mashup_home.html:134 msgid "Start by creating your own profile on this platform." msgstr "Commencez par créer votre espace personnel sur cette plateforme." -#: templates/mashup_home.html:124 +#: templates/mashup_home.html:138 msgid "Create a new hashcut" msgstr "Créer un Hashcut" -#: templates/mashup_home.html:125 +#: templates/mashup_home.html:139 msgid "" "Choose videos, define and organize segments and comment them to create your " "own hashcut." @@ -274,11 +284,11 @@ "Choisissez des médias, segmentez les, assemblez les segments et rajoutez des " "commentaires sur le Hashcut." -#: templates/mashup_home.html:129 +#: templates/mashup_home.html:143 msgid "Publish and share" msgstr "Publier et partager" -#: templates/mashup_home.html:130 +#: templates/mashup_home.html:144 msgid "" "Once your hashcut is done, publish it here and share your work on social " "networks." diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/templates/mashup_all_contents.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hashcut/templates/mashup_all_contents.html Thu Dec 06 14:30:23 2012 +0100 @@ -0,0 +1,62 @@ +{% extends "mashup_home.html" %} +{% load static %} +{% load i18n %} +{% load analytics %} +{% load thumbnail %} +{% load front_tags %} + {% block title %}{% trans 'All source videos' %}{% endblock %} + {% block css_page %} + + {% endblock %} + +{% block wrap_header %} +
+
+ {% include 'partial/mashup_popin_user.html' %} + {% include 'partial/hashcut_logo.html' %} +
+

{% trans 'All source videos' %}

+
+ +
+
+{% endblock %} + +{% block content %} +
+ + + + +
+{% endblock %} + diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/templates/mashup_all_mashups.html --- a/src/hashcut/templates/mashup_all_mashups.html Thu Dec 06 12:38:51 2012 +0100 +++ b/src/hashcut/templates/mashup_all_mashups.html Thu Dec 06 14:30:23 2012 +0100 @@ -4,7 +4,7 @@ {% load analytics %} {% load thumbnail %} {% load front_tags %} - {% block title %}Tous les Hashcuts{% endblock %} + {% block title %}{% trans 'All Hashcuts' %}{% endblock %} {% block css_page %} {% endblock %} @@ -15,7 +15,7 @@ {% include 'partial/mashup_popin_user.html' %} {% include 'partial/hashcut_logo.html' %}
-

Tous les Hashcuts

+

{% trans 'All Hashcuts' %}

@@ -104,7 +104,21 @@ - + +

{% trans "Available videos" %}

+ + + +
diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/urls.py --- a/src/hashcut/urls.py Thu Dec 06 12:38:51 2012 +0100 +++ b/src/hashcut/urls.py Thu Dec 06 14:30:23 2012 +0100 @@ -1,6 +1,6 @@ from django.conf.urls.defaults import patterns, url from hashcut.views import MashupHome, MashupEdit, MashupHashcut, MashupContent, MashupProfile, MashupAllMashups,\ - MashupCreateUser, MashupIdenticateUser + MashupAllContents, MashupCreateUser, MashupIdenticateUser urlpatterns = patterns('', url(r'^jsi18n/(?P\S+?)/$', 'django.views.i18n.javascript_catalog', name='jsi18n'), @@ -10,6 +10,7 @@ url(r'^(?P.*)/media/(?P.*)/$', MashupContent.as_view(), name="mashup_content"), url(r'^(?P.*)/profile/(?P.*)/$', MashupProfile.as_view(), name="mashup_profile"), url(r'^(?P.*)/all/$', MashupAllMashups.as_view(), name="mashup_all"), + url(r'^(?P.*)/allcontents/$', MashupAllContents.as_view(), name="mashup_all_contents"), url(r'^(?P.*)/createuser/$', MashupCreateUser.as_view(), name="mashup_create_user"), url(r'^(?P.*)/iduser/$', MashupIdenticateUser.as_view(), name="mashup_identicate_user"), url(r'^(?P.*)/$', MashupHome.as_view(), name="mashup_home"), diff -r 41c09a24bc92 -r ff6c954f3aaa src/hashcut/views.py --- a/src/hashcut/views.py Thu Dec 06 12:38:51 2012 +0100 +++ b/src/hashcut/views.py Thu Dec 06 14:30:23 2012 +0100 @@ -40,7 +40,7 @@ m1 = None m2 = None last_mashups = None - mashups = Mashup.objects.filter(branding=brd).order_by('-project__creation_date')[:10] + mashups = Mashup.objects.filter(branding=brd).order_by('-project__creation_date')[:6] logging.debug(repr(mashups)) l = len(mashups) if l>0: @@ -49,8 +49,11 @@ m2 = mashups[1] if l>2: last_mashups = mashups[2:] + + contents = Content.objects.filter(tags__icontains=branding).order_by('?')[:4] + context = self.get_context_dict(request) - context.update({"mashups":last_mashups, "m1":m1, "m2":m2}) + context.update({"mashups":last_mashups, "contents": contents, "m1":m1, "m2":m2}) return self.render_to_response(context) @@ -179,6 +182,32 @@ context = self.get_context_dict(request) context.update({"results":results}) return self.render_to_response(context) + + + +class MashupAllContents(TemplateResponseMixin, MashupContextView): + + def get_template_names(self): + return "mashup_all_contents.html" + + def get(self, request, branding="iri", **kwargs): + page = request.GET.get("page") or 1 + self.branding = branding + + contents = Content.objects.filter(tags__icontains=branding) + nb = getattr(settings, 'LDT_FRONT_MEDIA_PER_PAGE', 9) + if page=="x": + nb = contents.count() + + paginator = Paginator(contents, nb) + try: + results = paginator.page(page) + except (EmptyPage, InvalidPage): + results = paginator.page(paginator.num_pages) + + context = self.get_context_dict(request) + context.update({"results":results}) + return self.render_to_response(context)