]> git.parisson.com Git - mezzo.git/commitdiff
add location infos and pages
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 10 Apr 2016 20:35:47 +0000 (22:35 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 10 Apr 2016 20:35:47 +0000 (22:35 +0200)
12 files changed:
app/festival/migrations/0019_auto_20160410_2148.py [new file with mode: 0644]
app/festival/urls.py
app/festival/views.py
app/migrations/mezzanine_agenda/0007_auto_20160410_2148.py [new file with mode: 0644]
app/migrations/mezzanine_agenda/0008_auto_20160410_2149.py [new file with mode: 0644]
app/migrations/mezzanine_agenda/0009_auto_20160410_2154.py [new file with mode: 0644]
app/templates/agenda/event_detail.html
app/templates/agenda/event_location_detail.html [new file with mode: 0644]
app/templates/agenda/event_location_list.html
app/templates/agenda/includes/event_location.html [new file with mode: 0644]
app/templates/agenda/includes/event_metainfo.html
app/translations.py

diff --git a/app/festival/migrations/0019_auto_20160410_2148.py b/app/festival/migrations/0019_auto_20160410_2148.py
new file mode 100644 (file)
index 0000000..0dea9bb
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.2 on 2016-04-10 19:48
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('festival', '0018_auto_20160407_2301'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='featured',
+            name='blogposts',
+            field=models.ManyToManyField(blank=True, related_name='featured', to='blog.BlogPost', verbose_name='blog posts'),
+        ),
+        migrations.AlterField(
+            model_name='featured',
+            name='pages',
+            field=models.ManyToManyField(blank=True, related_name='featured', to='pages.Page', verbose_name='pages'),
+        ),
+    ]
index 61e51e073a8f93faeb5b74890a7eb657931e790a..686b4770b5572fd9c96ee31596807eb79706f6ff 100644 (file)
@@ -14,5 +14,4 @@ urlpatterns = [
     url(r'^artists/(?P<slug>.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"),
     url(r'^videos/$', VideoListView.as_view(), name="festival-video-list"),
     url(r'^videos/(?P<slug>.*)/$', VideoDetailView.as_view(), name="festival-video-detail"),
-    url(r'^locations/$', LocationListView.as_view(), name="festival-location-list"),
 ]
index 500fd96176fac1d5702076a46b4bf60943d690f1..cb49419151418957e960f8dc829af35ec01e9198 100644 (file)
@@ -54,13 +54,3 @@ class VideoDetailView(SlugMixin, DetailView):
     def get_context_data(self, **kwargs):
         context = super(VideoDetailView, self).get_context_data(**kwargs)
         return context
-
-
-class LocationListView(ListView):
-
-    model = EventLocation
-    template_name='agenda/event_location_list.html'
-
-    def get_context_data(self, **kwargs):
-        context = super(LocationListView, self).get_context_data(**kwargs)
-        return context
diff --git a/app/migrations/mezzanine_agenda/0007_auto_20160410_2148.py b/app/migrations/mezzanine_agenda/0007_auto_20160410_2148.py
new file mode 100644 (file)
index 0000000..bfe547d
--- /dev/null
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.2 on 2016-04-10 19:48
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('mezzanine_agenda', '0006_remove_event_featured'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='EventPrice',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('price', models.FloatField(verbose_name='price')),
+                ('unit', models.CharField(blank=True, max_length=16, verbose_name='Unit')),
+            ],
+            options={
+                'verbose_name': 'Event price',
+                'verbose_name_plural': 'Event pricies',
+            },
+        ),
+        migrations.AlterModelOptions(
+            name='event',
+            options={'ordering': ('start',), 'verbose_name': 'Event', 'verbose_name_plural': 'Events'},
+        ),
+        migrations.AddField(
+            model_name='eventlocation',
+            name='description',
+            field=mezzanine.core.fields.RichTextField(blank=True, verbose_name='description'),
+        ),
+        migrations.AddField(
+            model_name='eventlocation',
+            name='link',
+            field=models.URLField(blank=True, max_length=512),
+        ),
+        migrations.AddField(
+            model_name='event',
+            name='prices',
+            field=models.ManyToManyField(blank=True, related_name='events', to='mezzanine_agenda.EventPrice', verbose_name='prices'),
+        ),
+    ]
diff --git a/app/migrations/mezzanine_agenda/0008_auto_20160410_2149.py b/app/migrations/mezzanine_agenda/0008_auto_20160410_2149.py
new file mode 100644 (file)
index 0000000..cf8aff9
--- /dev/null
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.2 on 2016-04-10 19:49
+from __future__ import unicode_literals
+
+from django.db import migrations
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('mezzanine_agenda', '0007_auto_20160410_2148'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='eventlocation',
+            name='description_en',
+            field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='description'),
+        ),
+        migrations.AddField(
+            model_name='eventlocation',
+            name='description_fr',
+            field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='description'),
+        ),
+    ]
diff --git a/app/migrations/mezzanine_agenda/0009_auto_20160410_2154.py b/app/migrations/mezzanine_agenda/0009_auto_20160410_2154.py
new file mode 100644 (file)
index 0000000..fd2605c
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.2 on 2016-04-10 19:54
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('mezzanine_agenda', '0008_auto_20160410_2149'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='eventlocation',
+            name='featured_name',
+            field=models.CharField(blank=True, max_length=512, null=True, verbose_name='fearured name'),
+        ),
+        migrations.AlterField(
+            model_name='eventlocation',
+            name='link',
+            field=models.URLField(blank=True, max_length=512, null=True),
+        ),
+    ]
index aa18efba6e4c5db66f312c03e9119fb4fa5165e2..d922e3c8ed7595bbeb5974095b5574441ba05057 100644 (file)
 </div>
 {% endblock %}
 
+{% comment %}
 {% if event.location %}
 <h3 class="section__title">Le lieu :</h3>
 {% block event_detail_location %}
-{% editable event.location %}
+<a href="{% url 'location-detail' event.location.slug %}">{{ event.location }}</a>
 <p>
     <p>{{ event.location }} {{ event.location.address|linebreaksbr }}</p>
     <a href="{{ event|google_nav_url }}" target="_blank">
 <a href="{{ event|google_nav_url }}" target="_blank" class="">
  {% google_static_map event 900 300 15 %}
 </a/>
-{% endeditable %}
 {% endblock %}
 {% endif %}
+{% endcomment %}
 
 {% block event_detail_keywords %}
 {% keywords_for event as tags %}
diff --git a/app/templates/agenda/event_location_detail.html b/app/templates/agenda/event_location_detail.html
new file mode 100644 (file)
index 0000000..7fa0b57
--- /dev/null
@@ -0,0 +1,6 @@
+{% extends "agenda/event_location_list.html" %}
+{% load i18n future mezzanine_tags event_tags keyword_tags disqus_tags %}
+
+{% block main %}
+    {% include "agenda/includes/event_location.html" %}
+{% endblock %}
index 414cd5eaaeb4d0b56e5bc6980de04eedae6c2350..49f7b75eee89b07edfc2f77ccc7a82ecf85a84f5 100644 (file)
 {% endblock %}
 
 {% block main %}
-
 <div id="tabs" class="c-tabs">
   <div class="c-tabs-nav">
     {% for location in object_list %}
-        <a href="#" class="c-tabs-nav__link {% if forloop.first %}is-active{% endif %}">{{ location.title }}</a>
+        <a href="#" class="c-tabs-nav__link {% if forloop.first %}is-active{% endif %}">
+            {% if location.featured_name %}{{ location.featured_name }}{% else %}{{ location.title }}{% endif %}</a>
     {% endfor %}
   </div>
   {% for location in object_list %}
       <div class="c-tab {% if forloop.first %}is-active{% endif %}">
-          <div class="c-tab__content">
-              <h3 class="location__title">{{ location.title }}</h3>
-                  {% block event_detail_location %}
-                  {% editable event.location %}
-                  <p>
-                      {{ location.address }}<br />
-                      <a href="{{ location|google_nav_url }}" target="_blank" class="">{% trans "Click to get the interactive map" %}</a>
-                  </p>
-                  <a href="{{ location|google_nav_url }}" target="_blank" class="location__map">
-                    {% google_static_map location 900 300 15 %}
-                  </a/>
-                  {% endeditable %}
-                  {% endblock %}
-          </div>
+          {% include "agenda/includes/event_location.html" %}
       </div>
   {% endfor %}
-
-
-
 {% endblock %}
 
 {% block right_panel %}
diff --git a/app/templates/agenda/includes/event_location.html b/app/templates/agenda/includes/event_location.html
new file mode 100644 (file)
index 0000000..20eebb9
--- /dev/null
@@ -0,0 +1,16 @@
+{% load i18n future mezzanine_tags event_tags %}
+
+<div class="c-tab__content">
+    <h3 class="location__title">{% if location.featured_name %}{{ location.featured_name }}{% else %}{{ location.title }}{% endif %}</h3>
+        {% block event_detail_location %}
+        <p>
+            {{ location.address }}<br />
+            <a href="{{ location.link }}" target="_blank">{{ location.link }}</a><br />
+        </p>
+        <a href="{{ location|google_nav_url }}" target="_blank" class="location__map">
+          {% google_static_map location 900 300 15 %}
+      </a/><br />
+        <a href="{{ location|google_nav_url }}" target="_blank" class="">{% trans "Click to get the interactive map" %}</a>
+        <p>{{ location.description|safe }}</p>
+        {% endblock %}
+</div>
index 10a3be8faec0db86944a8b58e513fd7a4f015624..4030c549cc53412492a74e69d6da679f8ba160e3 100644 (file)
@@ -12,7 +12,8 @@
         {% endif %}
         {% if event.location %}
         {# <a href="{% url "event_list_location" event.location.slug %}" class="event__meta__location">{{ event.location }}</a>#}
-        <span class="event__meta__location">{{ event.location }}</span>
+        <br />
+        <a href="{% url 'location-detail' event.location.slug %}">{{ event.location }}</a>
         {% endif %}
     </div>
 </div>
index 77a8844063739c12a571a6c86f4386bc768578e4..202c1370cd0be41cbfa8456ef69150e351e65a17 100644 (file)
@@ -1,6 +1,6 @@
 from modeltranslation.translator import register, TranslationOptions
 
-from mezzanine_agenda.models import Event
+from mezzanine_agenda.models import Event, EventLocation
 from festival.models import *
 
 
@@ -9,6 +9,10 @@ class EventTranslationOptions(TranslationOptions):
 
     fields = ('title', 'description', 'content')
 
+@register(EventLocation)
+class EventLocationTranslationOptions(TranslationOptions):
+
+    fields = ('description',)
 
 @register(Artist)
 class ArtistTranslationOptions(TranslationOptions):