From f8ea2c223933afdb012c46f04f6c1d1999b5e37d Mon Sep 17 00:00:00 2001 From: Emilie Date: Fri, 18 Nov 2016 12:55:30 +0100 Subject: [PATCH] Clean url / create sitemap / delete festival --- app/local_settings.py | 1 - app/locale/fr/LC_MESSAGES/django.mo | Bin 13724 -> 13109 bytes app/locale/fr/LC_MESSAGES/django.po | 165 +++++++----------- .../core/templatetags/organization_tags.py | 5 +- app/organization/festival/__init__.py | 7 - app/organization/festival/admin.py | 27 --- app/organization/festival/apps.py | 7 - .../festival/migrations/0001_initial.py | 57 ------ .../festival/migrations/__init__.py | 0 app/organization/festival/models.py | 35 ---- app/organization/festival/routers.py | 31 ---- .../festival/templatetags/festival_tags.py | 78 --------- app/organization/festival/tests.py | 3 - app/organization/festival/translation.py | 8 - app/organization/festival/urls.py | 16 -- app/organization/festival/views.py | 33 ---- app/organization/magazine/urls.py | 1 - app/organization/magazine/views.py | 14 -- app/organization/media/urls.py | 1 - app/organization/media/views.py | 7 - app/organization/urls.py | 1 - app/settings.py | 1 - app/sitemaps.py | 88 ++++++++++ app/templates/base.html | 5 - app/templates/blog/includes/filter_panel.html | 101 ----------- app/templates/blog/includes/post_card.html | 19 -- app/templates/festival/artist_detail.html | 43 ----- app/templates/festival/artist_list.html | 16 -- app/templates/festival/inc/artist_card.html | 16 -- .../festival/inc/audio_playlist.html | 26 --- app/templates/festival/inc/video_card.html | 11 -- app/templates/festival/video_detail.html | 52 ------ app/templates/festival/video_list.html | 30 ---- app/templates/includes/calendar.html | 58 ------ .../magazine/article/article_list.html | 105 ----------- app/templates/pages/richtextpage.html | 26 --- app/urls.py | 106 ++++++++++- 37 files changed, 255 insertions(+), 945 deletions(-) delete mode 100644 app/organization/festival/__init__.py delete mode 100644 app/organization/festival/admin.py delete mode 100644 app/organization/festival/apps.py delete mode 100644 app/organization/festival/migrations/0001_initial.py delete mode 100644 app/organization/festival/migrations/__init__.py delete mode 100644 app/organization/festival/models.py delete mode 100644 app/organization/festival/routers.py delete mode 100644 app/organization/festival/templatetags/festival_tags.py delete mode 100644 app/organization/festival/tests.py delete mode 100644 app/organization/festival/translation.py delete mode 100644 app/organization/festival/urls.py delete mode 100644 app/organization/festival/views.py create mode 100644 app/sitemaps.py delete mode 100644 app/templates/blog/includes/filter_panel.html delete mode 100644 app/templates/blog/includes/post_card.html delete mode 100644 app/templates/festival/artist_detail.html delete mode 100644 app/templates/festival/artist_list.html delete mode 100644 app/templates/festival/inc/artist_card.html delete mode 100644 app/templates/festival/inc/audio_playlist.html delete mode 100644 app/templates/festival/inc/video_card.html delete mode 100644 app/templates/festival/video_detail.html delete mode 100644 app/templates/festival/video_list.html delete mode 100644 app/templates/includes/calendar.html delete mode 100644 app/templates/magazine/article/article_list.html diff --git a/app/local_settings.py b/app/local_settings.py index e3ab9f24..de55255f 100644 --- a/app/local_settings.py +++ b/app/local_settings.py @@ -137,7 +137,6 @@ ADMIN_MENU_ORDER = ( 'shop.Sale', )), (_('Jobs'), ('organization-job.JobOffer','organization-job.Candidacy')), - (_('Festival'), ('organization-festival.Artist',)), (_('Users'), ('auth.User', 'auth.Group',)), (_('Site'), ('sites.Site', 'redirects.Redirect', 'conf.Setting')), ) diff --git a/app/locale/fr/LC_MESSAGES/django.mo b/app/locale/fr/LC_MESSAGES/django.mo index 54b3655cb8d01a6cc85fc01bf1e5cdd7a869716f..cbd3e77a6eb430eb6feee6ec5e94ce7745d7b1eb 100644 GIT binary patch delta 5056 zcmXxn33OD|9mnxI5VEm^WI~XTgpfcILKX=aL8GM#k)VKV%4R?mWEE%?3KT{Npn#}h zWGk{XN_ZVI*~58|Pv%8l%yVO)&*^KHbd5medQ7 zE?o)g`aV`4;MD_eI0xf7QEn&dF^2jPY=&Q2`zh1_=dnHh6Gvl2l5@>*9H!$m)Ih7S z1+K-p_$o$VYFn@03~cTK&gF2R8+xE_xC;}pKWZXlQ7fE`X*eB+kS+$|smpQ4^VE=jU7d64Vy2Kuu&lHo+}s z6>4JJP%GbqdK9%*ufu>Ia{~vu@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u`)Un`vfy>_-+`Jvx3em3r1N0!Nb;>xiJVG6$|Uz2^L9l4v_Lw-l@C4=?f84CN!ugMqWJ<^73Bae~UXiL2^0=ytJykAUH$Q_6LfK3$t^p%8Q+yVoi~pwEy}V__On?%9+{3?tSVMwRF>34p diff --git a/app/locale/fr/LC_MESSAGES/django.po b/app/locale/fr/LC_MESSAGES/django.po index 61fc63d3..36b3b634 100644 --- a/app/locale/fr/LC_MESSAGES/django.po +++ b/app/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-17 15:57+0100\n" +"POT-Creation-Date: 2016-11-18 12:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -67,14 +67,10 @@ msgid "Jobs" msgstr "Offres d'emplois et stages" #: local_settings.py:140 -msgid "Festival" -msgstr "" - -#: local_settings.py:141 msgid "Users" msgstr "" -#: local_settings.py:142 templates/admin/login.html:59 +#: local_settings.py:141 templates/admin/login.html:59 msgid "Site" msgstr "" @@ -356,24 +352,14 @@ msgstr "pays" msgid "Everything" msgstr "Tout" -#: organization/festival/models.py:21 organization/job/models.py:11 -#: organization/network/models.py:228 +#: organization/job/models.py:11 organization/network/models.py:228 msgid "first name" msgstr "" -#: organization/festival/models.py:22 organization/job/models.py:12 -#: organization/network/models.py:229 +#: organization/job/models.py:12 organization/network/models.py:229 msgid "last name" msgstr "" -#: organization/festival/models.py:23 organization/network/models.py:233 -msgid "biography" -msgstr "biographie" - -#: organization/festival/models.py:27 -msgid "artist" -msgstr "artiste" - #: organization/job/models.py:13 organization/network/models.py:230 msgid "email" msgstr "" @@ -668,6 +654,10 @@ msgstr "genre" msgid "birthday" msgstr "déte de naissance" +#: organization/network/models.py:233 +msgid "biography" +msgstr "biographie" + #: organization/network/models.py:234 organization/network/models.py:443 msgid "external ID" msgstr "" @@ -1982,16 +1972,20 @@ msgstr "Événements du lieu" msgid "Locations" msgstr "Lieux" -#: templates/agenda/includes/event_date.html:27 -#: templates/agenda/includes/event_date.html:47 -#: templates/agenda/includes/event_date.html:50 -#: templates/agenda/includes/event_date.html:66 +#: templates/agenda/includes/event_date.html:28 +#: templates/agenda/includes/event_date.html:48 +#: templates/agenda/includes/event_date.html:51 +#: templates/agenda/includes/event_date.html:67 +#: templates/agenda/includes/event_date_slider.html:28 +#: templates/agenda/includes/event_date_slider.html:39 msgid "and" msgstr "et" -#: templates/agenda/includes/event_date.html:41 -#: templates/agenda/includes/event_date.html:64 -#: templates/agenda/includes/event_date.html:72 +#: templates/agenda/includes/event_date.html:42 +#: templates/agenda/includes/event_date.html:65 +#: templates/agenda/includes/event_date.html:73 +#: templates/agenda/includes/event_date_slider.html:37 +#: templates/agenda/includes/event_date_slider.html:44 msgid "through" msgstr "au" @@ -2032,50 +2026,15 @@ msgid "Recent Events" msgstr "Événements récents" #: templates/agenda/includes/filter_panel.html:38 -#: templates/blog/includes/filter_panel.html:27 msgid "Archive" msgstr "Archive" #: templates/agenda/includes/filter_panel.html:74 -#: templates/blog/includes/filter_panel.html:56 msgid "Tags" msgstr "Mots clés" -#: templates/blog/includes/filter_panel.html:6 -msgid "Recent Posts" -msgstr "Articles récents" - -#: templates/blog/includes/filter_panel.html:43 -msgid "Categories" -msgstr "Catégories" - -#: templates/blog/includes/filter_panel.html:72 -#: templates/projects/project_demo_detail.html:36 -msgid "Authors" -msgstr "Auteurs" - -#: templates/blog/includes/filter_panel.html:84 -msgid "Feeds" -msgstr "Fils" - -#: templates/blog/includes/filter_panel.html:86 -#: templates/blog/includes/filter_panel.html:90 -#: templates/blog/includes/filter_panel.html:94 -#: templates/blog/includes/filter_panel.html:98 -msgid "RSS" -msgstr "" - -#: templates/blog/includes/filter_panel.html:87 -#: templates/blog/includes/filter_panel.html:91 -#: templates/blog/includes/filter_panel.html:95 -#: templates/blog/includes/filter_panel.html:99 -msgid "Atom" -msgstr "" - #: templates/core/inc/related_content.html:8 #: templates/core/inc/related_content_dynamic.html:8 -#: templates/festival/artist_detail.html:27 -#: templates/festival/video_detail.html:28 msgid "Also discover" msgstr "À découvrir aussi" @@ -2186,18 +2145,6 @@ msgstr "" msgid "Sorry, an error occurred." msgstr "Une erreur s'est produite." -#: templates/festival/artist_list.html:6 -msgid "Artists" -msgstr "Artistes" - -#: templates/festival/inc/video_card.html:10 -msgid "Play the video" -msgstr "Jouer la vidéo" - -#: templates/festival/video_list.html:6 -msgid "Videos" -msgstr "Vidéos" - #: templates/generic/includes/comment.html:22 #: templates/generic/includes/comment.html:59 templates/twitter/tweets.html:19 #, python-format @@ -2330,10 +2277,6 @@ msgstr "" msgid "News" msgstr "Actualité" -#: templates/includes/calendar.html:3 -msgid "Festival calendar" -msgstr "Calendrier du festival" - #: templates/includes/editable_form.html:16 msgid "Save" msgstr "" @@ -2463,28 +2406,14 @@ msgstr "" msgid "Publish date" msgstr "Date de publication" -#: templates/magazine/article/article_list.html:4 -#: templates/magazine/article/article_list.html:22 -#: templates/magazine/topic/topic_detail.html:24 -msgid "Articles" -msgstr "Articles" - -#: templates/magazine/article/article_list.html:31 -msgid "Tag:" -msgstr "Mot clé :" - -#: templates/magazine/article/article_list.html:33 -msgid "Category:" -msgstr "Catégorie :" - -#: templates/magazine/article/article_list.html:37 -msgid "Author:" -msgstr "Auteur :" - #: templates/magazine/brief/inc/brief_card.html:6 msgid "Brief !" msgstr "Brève !" +#: templates/magazine/topic/topic_detail.html:24 +msgid "Articles" +msgstr "Articles" + #: templates/media/audio/inc/audio_search.html:20 #: templates/media/inc/playlist_search.html:49 #: templates/media/video/inc/video_search.html:20 @@ -2559,14 +2488,6 @@ msgstr "" msgid "Project" msgstr "Projet" -#: templates/pages/richtextpage.html:17 -msgid "Related events" -msgstr "Événements associés" - -#: templates/pages/richtextpage.html:27 -msgid "Related posts" -msgstr "Articles associés" - #: templates/pages/teampage.html:86 msgid "Research topics and related projects" msgstr "Domaines de recherche et projets associés" @@ -2584,6 +2505,10 @@ msgstr "Demo" msgid "Demos" msgstr "Demos" +#: templates/projects/project_demo_detail.html:36 +msgid "Authors" +msgstr "Auteurs" + #: templates/projects/project_detail.html:124 msgid "Project details" msgstr "Détails du projet" @@ -2942,6 +2867,42 @@ msgstr "" msgid "Recent Tweets" msgstr "Tweets récents" +#~ msgid "artist" +#~ msgstr "artiste" + +#~ msgid "Recent Posts" +#~ msgstr "Articles récents" + +#~ msgid "Categories" +#~ msgstr "Catégories" + +#~ msgid "Feeds" +#~ msgstr "Fils" + +#~ msgid "Artists" +#~ msgstr "Artistes" + +#~ msgid "Play the video" +#~ msgstr "Jouer la vidéo" + +#~ msgid "Videos" +#~ msgstr "Vidéos" + +#~ msgid "Tag:" +#~ msgstr "Mot clé :" + +#~ msgid "Category:" +#~ msgstr "Catégorie :" + +#~ msgid "Author:" +#~ msgstr "Auteur :" + +#~ msgid "Related events" +#~ msgstr "Événements associés" + +#~ msgid "Related posts" +#~ msgstr "Articles associés" + #~ msgid "Tournées" #~ msgstr "On tour" diff --git a/app/organization/core/templatetags/organization_tags.py b/app/organization/core/templatetags/organization_tags.py index 731abfd0..5e9253d9 100644 --- a/app/organization/core/templatetags/organization_tags.py +++ b/app/organization/core/templatetags/organization_tags.py @@ -8,7 +8,6 @@ from mezzanine_agenda.models import Event from mezzanine.conf import settings from random import shuffle -from organization.festival.models import * from organization.magazine.models import * from organization.projects.models import * @@ -51,8 +50,6 @@ def featured(*args): featured_list.append(post) for video in featured.videos.all(): featured_list.append(video) - for artist in featured.artists.all(): - featured_list.append(artist) for playlist in featured.playlists.all(): featured_list.append(playlist) shuffle(featured_list) @@ -183,4 +180,4 @@ def unspam(email): @register.filter def get_attr(obj, attr): - return getattr(obj, attr) + return getattr(obj, attr) diff --git a/app/organization/festival/__init__.py b/app/organization/festival/__init__.py deleted file mode 100644 index e5988d7f..00000000 --- a/app/organization/festival/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -Provides abstract models and admin features used throughout the various -Mezzanine apps. -""" -from __future__ import unicode_literals - -default_app_config = 'organization.festival.apps.FestivalConfig' diff --git a/app/organization/festival/admin.py b/app/organization/festival/admin.py deleted file mode 100644 index f4843396..00000000 --- a/app/organization/festival/admin.py +++ /dev/null @@ -1,27 +0,0 @@ -from __future__ import unicode_literals - -from copy import deepcopy - -from django.contrib import admin -from django.utils.translation import ugettext_lazy as _ - -from mezzanine_agenda.models import Event, EventLocation -from mezzanine_agenda.admin import * - -from mezzanine.conf import settings -from mezzanine.core.admin import DisplayableAdmin, OwnableAdmin - -from organization.festival.models import * - - -class ArtistAdmin(admin.ModelAdmin): - - model = Artist - - -class ArtistAdminDisplayable(DisplayableAdmin): - - fieldsets = deepcopy(ArtistAdmin.fieldsets) - - -# admin.site.register(Artist, ArtistAdminDisplayable) diff --git a/app/organization/festival/apps.py b/app/organization/festival/apps.py deleted file mode 100644 index 4b525121..00000000 --- a/app/organization/festival/apps.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.apps import AppConfig - - -class FestivalConfig(AppConfig): - - name = 'organization.festival' - label = 'organization-festival' diff --git a/app/organization/festival/migrations/0001_initial.py b/app/organization/festival/migrations/0001_initial.py deleted file mode 100644 index bb1dea18..00000000 --- a/app/organization/festival/migrations/0001_initial.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-01 15:26 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import mezzanine.core.fields -import mezzanine.utils.models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('sites', '0002_alter_domain_unique'), - ] - - operations = [ - migrations.CreateModel( - name='Artist', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)), - ('title', models.CharField(max_length=500, verbose_name='Title')), - ('title_fr', models.CharField(max_length=500, null=True, verbose_name='Title')), - ('title_en', models.CharField(max_length=500, null=True, verbose_name='Title')), - ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')), - ('_meta_title', models.CharField(blank=True, help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title')), - ('description', models.TextField(blank=True, verbose_name='Description')), - ('description_fr', models.TextField(blank=True, null=True, verbose_name='Description')), - ('description_en', models.TextField(blank=True, null=True, verbose_name='Description')), - ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')), - ('created', models.DateTimeField(editable=False, null=True)), - ('updated', models.DateTimeField(editable=False, null=True)), - ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')), - ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')), - ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')), - ('short_url', models.URLField(blank=True, null=True)), - ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')), - ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), - ('content_fr', mezzanine.core.fields.RichTextField(null=True, verbose_name='Content')), - ('content_en', mezzanine.core.fields.RichTextField(null=True, verbose_name='Content')), - ('first_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='first name')), - ('last_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='last name')), - ('bio', mezzanine.core.fields.RichTextField(blank=True, verbose_name='biography')), - ('bio_fr', mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='biography')), - ('bio_en', mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='biography')), - ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')), - ], - options={ - 'ordering': ['last_name'], - 'verbose_name': 'artist', - }, - bases=(models.Model, mezzanine.utils.models.AdminThumbMixin), - ), - ] diff --git a/app/organization/festival/migrations/__init__.py b/app/organization/festival/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/organization/festival/models.py b/app/organization/festival/models.py deleted file mode 100644 index f2d55d59..00000000 --- a/app/organization/festival/models.py +++ /dev/null @@ -1,35 +0,0 @@ -from django.db import models -from django.utils.translation import ugettext_lazy as _ -from django.core.urlresolvers import reverse, reverse_lazy -from django.conf import settings - -from mezzanine.core.models import RichText, Displayable, Slugged -from mezzanine.core.fields import RichTextField, OrderField, FileField -from mezzanine.utils.models import AdminThumbMixin, upload_to -from mezzanine.blog.models import BlogPost -from mezzanine.pages.models import Page - -from organization.core.models import * - -import requests -from pyquery import PyQuery as pq - - -class Artist(Displayable, RichText, AdminThumbMixin): - """Artist""" - - first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True) - last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True) - bio = RichTextField(_('biography'), blank=True) - search_fields = ("title", "bio") - - class Meta: - verbose_name = _('artist') - ordering = ['last_name',] - - def __unicode__(self): - return self.title - - @property - def name(self): - return self.title diff --git a/app/organization/festival/routers.py b/app/organization/festival/routers.py deleted file mode 100644 index 6bde6a32..00000000 --- a/app/organization/festival/routers.py +++ /dev/null @@ -1,31 +0,0 @@ - -class FestivalRouter(object): - """ - A router to control all database operations on models in festival - """ - - def db_for_read(self, model, **hints): - if model._meta.app_label == 'festival': - return 'default' - return None - - def db_for_write(self, model, **hints): - if model._meta.app_label == 'festival': - return 'default' - return None - - def allow_relation(self, obj1, obj2, **hints): - if obj1._meta.app_label == 'festival' or \ - obj2._meta.app_label == 'festival': - return True - return None - - # def allow_migrate(self, db, app_label, model=None, **hints): - # if app_label == 'festival': - # return db == 'default' - # return None - - def allow_migrate(self, db, app_label, model_name=None, **hints): - if 'target_db' in hints: - return db == hints['target_db'] - return True diff --git a/app/organization/festival/templatetags/festival_tags.py b/app/organization/festival/templatetags/festival_tags.py deleted file mode 100644 index f2c974b1..00000000 --- a/app/organization/festival/templatetags/festival_tags.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -from mezzanine.pages.models import Page -from mezzanine.blog.models import BlogPost -from mezzanine.template import Library -from mezzanine_agenda.models import Event -from mezzanine.conf import settings -from random import shuffle - -from organization.festival.models import * -from organization.magazine.models import * - -register = Library() - - -@register.filter -def subtract(value, arg): - return value - arg - -@register.as_tag -def featured_edito(*args): - qs = Page.objects.filter(slug="edito") - if qs: - return qs[0].get_content_model() - else: - return None - -@register.as_tag -def featured_events(*args): - featured = Featured.objects.all() - if featured: - return featured[0].events.order_by('start') - return None - -@register.as_tag -def featured(*args): - featured_list = [] - featured = Featured.objects.filter(id=settings.HOME_FEATURED_ID) - if featured: - featured = featured[0] - for post in featured.blogposts.all(): - featured_list.append(post) - for video in featured.videos.all(): - featured_list.append(video) - for artist in featured.artists.all(): - featured_list.append(artist) - for playlist in featured.playlists.all(): - featured_list.append(playlist) - shuffle(featured_list) - return featured_list - -@register.as_tag -def featured_breaking_news_content(*args): - featured = Featured.objects.filter(id=settings.BREAKING_NEWS_FEATURED_ID) - if featured: - featured = featured[0] - news = featured.pages.all() - if news: - return news[0].richtextpage.content - else: - return '' - return '' - -@register.filter -def get_class(obj): - return obj.__class__.__name__ - -@register.filter -def unique_posts(events): - post_list = [] - for event in events: - for post in event.blog_posts.all(): - if not post in post_list: - post_list.append(post) - return post_list - -@register.filter -def no_parents(events): - return events.filter(parent=None) diff --git a/app/organization/festival/tests.py b/app/organization/festival/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/app/organization/festival/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/app/organization/festival/translation.py b/app/organization/festival/translation.py deleted file mode 100644 index b9e4936b..00000000 --- a/app/organization/festival/translation.py +++ /dev/null @@ -1,8 +0,0 @@ -from modeltranslation.translator import register, TranslationOptions - -from organization.festival.models import * - -@register(Artist) -class ArtistTranslationOptions(TranslationOptions): - - fields = ('title', 'description', 'bio', 'content') diff --git a/app/organization/festival/urls.py b/app/organization/festival/urls.py deleted file mode 100644 index c13eedb4..00000000 --- a/app/organization/festival/urls.py +++ /dev/null @@ -1,16 +0,0 @@ -from __future__ import unicode_literals - -import django.views.i18n -from django.conf.urls import patterns, include, url -from django.conf.urls.i18n import i18n_patterns - -from mezzanine.core.views import direct_to_template -from mezzanine.conf import settings - -from organization.festival.views import * - - -urlpatterns = [ - url(r'^artists/$', ArtistListView.as_view(), name="festival-artist-list"), - url(r'^artists/detail/(?P.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"), -] diff --git a/app/organization/festival/views.py b/app/organization/festival/views.py deleted file mode 100644 index beba1813..00000000 --- a/app/organization/festival/views.py +++ /dev/null @@ -1,33 +0,0 @@ -from django.shortcuts import render -from django.views.generic import * -from django.views.generic.base import * -from django.shortcuts import get_object_or_404 - -from organization.festival.models import * -from mezzanine_agenda.models import EventLocation - -from organization.core.views import * - - -class ArtistListView(ListView): - - model = Artist - template_name='festival/artist_list.html' - - def get_queryset(self, **kwargs): - return self.model.objects.published() - - def get_context_data(self, **kwargs): - context = super(ArtistListView, self).get_context_data(**kwargs) - return context - - -class ArtistDetailView(SlugMixin, DetailView): - - model = Artist - template_name='festival/artist_detail.html' - context_object_name = 'artist' - - def get_context_data(self, **kwargs): - context = super(ArtistDetailView, self).get_context_data(**kwargs) - return context diff --git a/app/organization/magazine/urls.py b/app/organization/magazine/urls.py index 13cb0729..a13a5a20 100644 --- a/app/organization/magazine/urls.py +++ b/app/organization/magazine/urls.py @@ -12,7 +12,6 @@ from organization.magazine.views import * _slash = "/" if settings.APPEND_SLASH else "" urlpatterns = [ - url("^article/$", ArticleListView.as_view(), name="magazine-article-list"), url("^article/detail/(?P.*)%s$" % _slash, ArticleDetailView.as_view(), name="magazine-article-detail"), url("^topic/detail/(?P.*)%s$" % _slash, TopicDetailView.as_view(), name='topic-detail'), url("^object-autocomplete/$", ObjectAutocomplete.as_view(), name='object-autocomplete'), diff --git a/app/organization/magazine/views.py b/app/organization/magazine/views.py index 0b7f10a9..d917465f 100644 --- a/app/organization/magazine/views.py +++ b/app/organization/magazine/views.py @@ -56,20 +56,6 @@ class ArticleDetailView(SlugMixin, DetailView): return context -class ArticleListView(SlugMixin, ListView): - - model = Article - template_name='magazine/article/article_list.html' - context_object_name = 'article' - - def get_queryset(self, **kwargs): - return self.model.objects.published(for_user=self.request.user).select_related() - - def get_context_data(self, **kwargs): - context = super(ArticleListView, self).get_context_data(**kwargs) - return context - - class BriefDetailView(SlugMixin, DetailView): model = Brief diff --git a/app/organization/media/urls.py b/app/organization/media/urls.py index 328efb7f..9ccd3320 100644 --- a/app/organization/media/urls.py +++ b/app/organization/media/urls.py @@ -16,5 +16,4 @@ urlpatterns = [ url("^playlist/list/(?P.*)$", PlaylistListView.as_view(), name="organization-playlist-list"), url("^playlist/detail/(?P.*)/$", PlaylistDetailView.as_view(), name="organization-playlist-detail"), url("^playlist-media-autocomplete/$", permission_required('playlist.can_edit')(PlayListMediaView.as_view()), name='media-autocomplete'), - url("^media/detail/(?P.*)/$", MediaDetailView.as_view(), name="organization-media-detail"), ] diff --git a/app/organization/media/views.py b/app/organization/media/views.py index 5b04af6f..e5d76161 100644 --- a/app/organization/media/views.py +++ b/app/organization/media/views.py @@ -74,10 +74,3 @@ class PlayListMediaView(autocomplete.Select2QuerySetView): if self.q: qs = qs.filter(title__istartswith=self.q) return qs - - -class MediaDetailView(SlugMixin, DetailView): - - model = Media - template_name='media/media_detail.html' - context_object_name = 'media' diff --git a/app/organization/urls.py b/app/organization/urls.py index d197a151..7e80a581 100644 --- a/app/organization/urls.py +++ b/app/organization/urls.py @@ -14,7 +14,6 @@ from mezzanine.conf import settings urlpatterns = [ url("^", include('organization.core.urls')), url("^", include('organization.pages.urls')), - url("^", include('organization.festival.urls')), url("^", include('organization.magazine.urls')), url("^", include('organization.media.urls')), url("^", include('organization.projects.urls')), diff --git a/app/settings.py b/app/settings.py index 890d51d1..c40b08c0 100644 --- a/app/settings.py +++ b/app/settings.py @@ -227,7 +227,6 @@ INSTALLED_APPS = [ "organization.media", "organization.pages", "organization.network", - "organization.festival", "organization.magazine", "organization.projects", "organization.agenda", diff --git a/app/sitemaps.py b/app/sitemaps.py new file mode 100644 index 00000000..eb2ff030 --- /dev/null +++ b/app/sitemaps.py @@ -0,0 +1,88 @@ +from django.contrib.sitemaps import Sitemap +from mezzanine_agenda.models import Event +from organization.agenda.models import * +from organization.core.models import * +from organization.job.models import * +from organization.magazine.models import * +from organization.media.models import * +from organization.network.models import * +from organization.pages.models import * +from organization.projects.models import * +from organization.shop.models import * + + +class ArticleSiteMap(Sitemap): + changefreq = "weekly" + priority = 0.5 + + def items(self): + return Article.objects.published() + + def lastmod(self, obj): + return obj.publish_date + + +class PersonSiteMap(Sitemap): + changefreq = "weekly" + priority = 0.5 + + def items(self): + return Person.objects.published() + + def lastmod(self, obj): + return obj.publish_date + + +class ProjectSiteMap(Sitemap): + changefreq = "weekly" + priority = 0.5 + + def items(self): + return Project.objects.published() + + def lastmod(self, obj): + return obj.publish_date + + +class EventSiteMap(Sitemap): + changefreq = "weekly" + priority = 0.5 + + def items(self): + return Event.objects.published() + + def lastmod(self, obj): + return obj.publish_date + + +class PageSiteMap(Sitemap): + changefreq = "weekly" + priority = 0.5 + + def items(self): + return Page.objects.published() + + def lastmod(self, obj): + return obj.publish_date + + +class HomeSiteMap(Sitemap): + changefreq = "daily" + priority = 1 + + def items(self): + return Home.objects.published() + + def lastmod(self, obj): + return obj.publish_date + + +class PlaylistSiteMap(Sitemap): + changefreq = "weekly" + priority = 0.5 + + def items(self): + return Playlist.objects.published() + + def lastmod(self, obj): + return obj.publish_date diff --git a/app/templates/base.html b/app/templates/base.html index e10af1bb..7e0bc2b2 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -21,11 +21,6 @@ - {% ifinstalled mezzanine.blog %} - - - {% endifinstalled %} - diff --git a/app/templates/blog/includes/filter_panel.html b/app/templates/blog/includes/filter_panel.html deleted file mode 100644 index d2817d8d..00000000 --- a/app/templates/blog/includes/filter_panel.html +++ /dev/null @@ -1,101 +0,0 @@ -{% load blog_tags keyword_tags mezzanine_tags i18n %} - -{% block blog_recent_posts %} -{% blog_recent_posts 5 as recent_posts %} -{% if recent_posts %} -

{% trans "Recent Posts" %}

- -{% endif %} -{% endblock %} - -{% block blog_months %} -{% blog_months as months %} -{% if months %} -

{% trans "Archive" %}

-{% for month in months %} - {% ifchanged month.date.year %} - {% if not forloop.first %}{% endif %} -
{{ month.date.year }}
-{% endif %} -{% endblock %} - -{% block blog_categories %} -{% blog_categories as categories %} -{% if categories %} -

{% trans "Categories" %}

-
    -{% for category in categories %} -
  • {{ category }} ({{ category.post_count }})
  • -{% endfor %} -
-{% endif %} -{% endblock %} - -{% block blog_keywords %} -{% keywords_for blog.blogpost as tags %} -{% if tags %} -

{% trans "Tags" %}

-
    -{% for tag in tags %} -
  • - {{ tag }} - ({{ tag.item_count }}) -
  • -{% endfor %} -
-{% endif %} -{% endblock %} - -{% block blog_authors %} -{% blog_authors as authors %} -{% if authors %} -

{% trans "Authors" %}

- -{% endif %} -{% endblock %} - -{% block blog_feeds %} -

{% trans "Feeds" %}

-{% if tag %} - {% trans "RSS" %} / - {% trans "Atom" %} -{% endif %} -{% if category %} - {% trans "RSS" %} / - {% trans "Atom" %} -{% endif %} -{% if author %} - {% trans "RSS" %} / - {% trans "Atom" %} -{% endif %} -{% if not tag and not category and not author %} - {% trans "RSS" %} / - {% trans "Atom" %} -{% endif %} -{% endblock %} diff --git a/app/templates/blog/includes/post_card.html b/app/templates/blog/includes/post_card.html deleted file mode 100644 index 43c3c8dd..00000000 --- a/app/templates/blog/includes/post_card.html +++ /dev/null @@ -1,19 +0,0 @@ -{% load i18n pages_tags mezzanine_tags %} - - diff --git a/app/templates/festival/artist_detail.html b/app/templates/festival/artist_detail.html deleted file mode 100644 index 38d7cca9..00000000 --- a/app/templates/festival/artist_detail.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load mezzanine_tags keyword_tags %} - -{% block title %} -{{ artist.name }} -{% endblock %} - -{% block main %} -
-

- {% if artist.photo %} -

- - -
- {% endif %} - {{ artist.bio|safe }} -
-

-
- -
-{% if artist.events.all %} -

{% trans "Also discover" %}


-
-
- {% for event in artist.events.all|no_parents %} - {% include 'agenda/event/includes/event_card.html' with object=event %} - {% endfor %} - {% for video in artist.videos.all %} - {% include 'festival/inc/video_card.html' %} - {% endfor %} - {% with artist.events.all|unique_posts as posts %} - {% for post in posts %} - {% include 'blog/includes/post_card.html' %} - {% endfor %} - {% endwith %} -
-{% endif %} -{% endblock %} diff --git a/app/templates/festival/artist_list.html b/app/templates/festival/artist_list.html deleted file mode 100644 index ba6e6a63..00000000 --- a/app/templates/festival/artist_list.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load mezzanine_tags keyword_tags %} - -{% block title %} - {% trans "Artists" %} -{% endblock %} - -{% block main %} -
-
- {% for artist in object_list %} - {% include "festival/inc/artist_card.html" %} - {% endfor %} -
-{% endblock %} diff --git a/app/templates/festival/inc/artist_card.html b/app/templates/festival/inc/artist_card.html deleted file mode 100644 index 21c3babe..00000000 --- a/app/templates/festival/inc/artist_card.html +++ /dev/null @@ -1,16 +0,0 @@ -{% load i18n pages_tags mezzanine_tags %} - - diff --git a/app/templates/festival/inc/audio_playlist.html b/app/templates/festival/inc/audio_playlist.html deleted file mode 100644 index 83478730..00000000 --- a/app/templates/festival/inc/audio_playlist.html +++ /dev/null @@ -1,26 +0,0 @@ -{% load staticfiles %} - -
- {% for audio in playlist.audios.all %} - {% if forloop.first %} -
- - - {{ audio.title }} - -
- - {% endif %} -
diff --git a/app/templates/festival/inc/video_card.html b/app/templates/festival/inc/video_card.html deleted file mode 100644 index 3d5bb2ed..00000000 --- a/app/templates/festival/inc/video_card.html +++ /dev/null @@ -1,11 +0,0 @@ -{% load i18n %} - -
-
- -
-
-

{{ video.title }}

-
- {% trans "Play the video" %} -
diff --git a/app/templates/festival/video_detail.html b/app/templates/festival/video_detail.html deleted file mode 100644 index f2c46b01..00000000 --- a/app/templates/festival/video_detail.html +++ /dev/null @@ -1,52 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load mezzanine_tags keyword_tags %} - -{% block title %} -{{ video.title }} -{% endblock %} - -{% block main %} - -
- {{ video.content|safe }} -
- -
- -
- -{% with video as object %} - {% include "includes/share_buttons.html" %} -{% endwith %} - -{% if video.event %} -
-

{% trans 'Also discover' %}

-
-
- {% with video.event as event %} - {% include 'agenda/event/includes/event_card.html' with object=event %} - {% 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 %} - -
-
-{% endif %} - -{% endblock %} diff --git a/app/templates/festival/video_list.html b/app/templates/festival/video_list.html deleted file mode 100644 index 550269d1..00000000 --- a/app/templates/festival/video_list.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load mezzanine_tags keyword_tags %} - -{% block title %} - {% trans "Videos" %} -{% endblock %} - -{% block main %} - -{% if categories %} -
    -{% for cat in categories %} -
  • - {{ cat }} ({{ cat.count }}) -
  • -{% endfor %} -
-
-{% endif %} - -
-
- {% for video in object_list %} - {% if video.status == 2 %} - {% include 'festival/inc/video_card.html' %} - {% endif %} - {% endfor %} -
-{% endblock %} diff --git a/app/templates/includes/calendar.html b/app/templates/includes/calendar.html deleted file mode 100644 index 23491b1f..00000000 --- a/app/templates/includes/calendar.html +++ /dev/null @@ -1,58 +0,0 @@ -{% load i18n event_tags %} -{% all_events as events %} - - -
    -
  • - {#
    Juin / Juillet
    #} -
    -
    L
    -
    -
    -
    M
    -
    -
    -
    M
    -
    -
    -
    J
    -
    -
    -
    V
    -
    -
    -
    S
    -
    -
    -
    D
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - {% all_days as days %} - {% for day in days %} - {% if day|events_in_day %} - - {% else %} -
    -
    {{ day.day }}
    -
    - {% endif %} - {% endfor %} - -
    -
    -
    -
  • -
diff --git a/app/templates/magazine/article/article_list.html b/app/templates/magazine/article/article_list.html deleted file mode 100644 index 0ca5f941..00000000 --- a/app/templates/magazine/article/article_list.html +++ /dev/null @@ -1,105 +0,0 @@ -{% extends "base.html" %} -{% load i18n mezzanine_tags blog_tags keyword_tags disqus_tags %} - -{% block meta_title %}{% if page %}{{ page.meta_title }}{% else %}{% trans "Articles" %}{% endif %}{% endblock %} - -{% block meta_keywords %}{% metablock %} -{% keywords_for page as keywords %} -{% for keyword in keywords %} - {% if not forloop.first %}, {% endif %} - {{ keyword }} -{% endfor %} -{% endmetablock %}{% endblock %} - -{% block meta_description %}{% metablock %} -{{ page.description }} -{% endmetablock %}{% endblock %} - -{% block title %} -{% if page %} -{% editable page.title %}{{ page.title }}{% endeditable %} -{% else %} -{% trans "Articles" %} -{% endif %} -{% endblock %} - -{% block breadcrumb_menu %} -{{ block.super }} -{% if tag or category or year or month or author %} -
  • {% spaceless %} -{% if tag %} - {% trans "Tag:" %} {{ tag }} -{% else %}{% if category %} - {% trans "Category:" %} {{ category }} -{% else %}{% if year or month %} - {% if month %}{{ month }}, {% endif %}{{ year }} -{% else %}{% if author %} - {% trans "Author:" %} {{ author.get_full_name|default:author.username }} -{% endif %}{% endif %}{% endif %}{% endif %} -{% endspaceless %} -
  • -{% endif %} -{% endblock %} - -{% block main %} - -{% comment %} -{% if tag or category or year or month or author %} - {% block blog_post_list_filterinfo %} -

    - {% if tag %} - {% trans "Viewing posts tagged" %} {{ tag }} - {% else %}{% if category %} - {% trans "Viewing posts for the category" %} {{ category }} - {% else %}{% if year or month %} - {% trans "Viewing posts from" %} {% if month %}{{ month }}, {% endif %} - {{ year }} - {% else %}{% if author %} - {% trans "Viewing posts by" %} - {{ author.get_full_name|default:author.username }} - {% endif %}{% endif %}{% endif %}{% endif %} - {% endblock %} -

    -{% else %} -{% endcomment %} -{% if page %} -{% if page.get_content_model.content %} - {% editable page.get_content_model.content %} - {{ page.get_content_model.content|richtext_filters|safe }} - {% endeditable %} -{% endif %} -{% else %} - {% blog_categories as categories %} - {% if categories %} -
      - {% for cat in categories %} -
    • - {{ cat }} ({{ cat.post_count }}) -
    • - {% endfor %} -
    -
    - {% endif %} -{# {% endif %}#} - -{% endif %} - -
    -
    - - {% for article in article_list %} - {% with article as post %} - {# {% trans "Article" %}#} - {% endwith %} - {% endfor %} -
    - -{% if settings.COMMENTS_DISQUS_SHORTNAME %} -{% include "generic/includes/disqus_counts.html" %} -{% endif %} - -{% endblock %} - -{% block right_panel %} -{% include "blog/includes/filter_panel.html" %} -{% endblock %} diff --git a/app/templates/pages/richtextpage.html b/app/templates/pages/richtextpage.html index 31a96068..5e974da6 100644 --- a/app/templates/pages/richtextpage.html +++ b/app/templates/pages/richtextpage.html @@ -8,31 +8,5 @@ {{ page.richtextpage.content|richtext_filters|safe }} {% endeditable %} -{% block related_objects %} -{% if page.featured.all %} -
    - -{% if page.featured.all.0.events.all %} -

    {% trans "Related events" %}


    -
    -
    - {% for event in page.featured.all.0.events.all %} - {% include 'agenda/event/includes/event_card.html' with object=event %} - {% endfor %} -
    -{% endif %} - -{% if page.featured.all.0.blogposts.all %} -

    {% trans "Related posts" %}


    -
    -
    - {% for post in page.featured.all.0.blogposts.all %} - {% include 'blog/includes/post_card.html' %} - {% endfor %} -
    -{% endif %} - -{% endif %} -{% endblock %} {% endblock %} diff --git a/app/urls.py b/app/urls.py index e4210986..e0a75b52 100644 --- a/app/urls.py +++ b/app/urls.py @@ -1,15 +1,31 @@ from __future__ import unicode_literals +from future.builtins import str + import django.views.i18n +from django.views.i18n import javascript_catalog from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.contrib import admin - -from mezzanine.core.views import direct_to_template +from django.contrib.sitemaps.views import sitemap +from django.http import HttpResponse from mezzanine.conf import settings +from mezzanine.core.sitemaps import DisplayableSitemap +from mezzanine.core.views import direct_to_template +from django.contrib.sitemaps.views import sitemap +from sitemaps import * admin.autodiscover() +sitemaps = { + 'home_sitemap' : HomeSiteMap(), + 'article_sitemap' : ArticleSiteMap(), + 'person_sitemap' : PersonSiteMap(), + 'project_sitemap' : ProjectSiteMap(), + 'event_sitemap' : EventSiteMap(), + 'page_sitemap' : PageSiteMap(), + 'playlist_sitemap' : PlaylistSiteMap(), +} # Add the urlpatterns for any custom Django applications here. # You can also change the ``home`` view to add your own functionality # to the project's homepage. @@ -31,6 +47,10 @@ urlpatterns += [ url("^", include('organization.urls')), url("^styles/$", direct_to_template, {"template": "styles.html"}, name="styles"), + # sitemap + url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, + name='django.contrib.sitemaps.views.sitemap'), + # We don't want to presume how your homepage works, so here are a # few patterns you can use to set it up. @@ -82,7 +102,7 @@ urlpatterns += [ # ``mezzanine.urls``, go right ahead and take the parts you want # from it, and use them directly below instead of using # ``mezzanine.urls``. - url("^", include("mezzanine.urls")), + # url("^", include("mezzanine.urls")), # MOUNTING MEZZANINE UNDER A PREFIX # --------------------------------- @@ -99,8 +119,88 @@ urlpatterns += [ # need to use the ``SITE_PREFIX`` setting as well. # ("^%s/" % settings.SITE_PREFIX, include("mezzanine.urls")) + + +] + + +################################################# +# MEZZANINE CONF CUSTOM # +################################################# +# JavaScript localization feature +js_info_dict = {'domain': 'django'} +urlpatterns += [ + url(r'^jsi18n/(?P\S+?)/$', javascript_catalog, js_info_dict), +] + +if settings.DEBUG and "debug_toolbar" in settings.INSTALLED_APPS: + try: + import debug_toolbar + except ImportError: + pass + else: + urlpatterns += [ + url(r'^__debug__/', include(debug_toolbar.urls)), + ] + +# Django's sitemap app. +if "django.contrib.sitemaps" in settings.INSTALLED_APPS: + sitemaps = {"sitemaps": {"all": DisplayableSitemap}} + urlpatterns += [ + url("^sitemap\.xml$", sitemap, sitemaps), + ] + +# Return a robots.txt that disallows all spiders when DEBUG is True. +if getattr(settings, "DEBUG", False): + urlpatterns += [ + url("^robots.txt$", + lambda r: HttpResponse("User-agent: *\nDisallow: /", + content_type="text/plain")), + ] + +# Miscellanous Mezzanine patterns. +urlpatterns += [ + url("^", include("mezzanine.core.urls")), + url("^", include("mezzanine.generic.urls")), ] +# Mezzanine's Accounts app +if "mezzanine.accounts" in settings.INSTALLED_APPS: + # We don't define a URL prefix here such as /account/ since we want + # to honour the LOGIN_* settings, which Django has prefixed with + # /account/ by default. So those settings are used in accounts.urls + urlpatterns += [ + url("^", include("mezzanine.accounts.urls")), + ] + +# Mezzanine's Blog app. +# blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS +# if blog_installed: +# BLOG_SLUG = settings.BLOG_SLUG.rstrip("/") +# if BLOG_SLUG: +# BLOG_SLUG += "/" +# blog_patterns = [ +# url("^%s" % BLOG_SLUG, include("mezzanine.blog.urls")), +# ] +# urlpatterns += blog_patterns + +# Mezzanine's Pages app. +PAGES_SLUG = "" +if "mezzanine.pages" in settings.INSTALLED_APPS: + # No BLOG_SLUG means catch-all patterns belong to the blog, + # so give pages their own prefix and inject them before the + # blog urlpatterns. + # if blog_installed and not BLOG_SLUG.rstrip("/"): + # PAGES_SLUG = getattr(settings, "PAGES_SLUG", "pages").strip("/") + "/" + # blog_patterns_start = urlpatterns.index(blog_patterns[0]) + # urlpatterns[blog_patterns_start:len(blog_patterns)] = [ + # url("^%s" % str(PAGES_SLUG), include("mezzanine.pages.urls")), + # ] + # else: + urlpatterns += [ + url("^", include("mezzanine.pages.urls")), + ] + # Adds ``STATIC_URL`` to the context of error pages, so that error # pages can use JS, CSS and images. handler404 = "mezzanine.core.views.page_not_found" -- 2.39.5