From: Guillaume Pellerin Date: Thu, 25 Feb 2016 12:56:00 +0000 (+0100) Subject: add custom agenda templates X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=65c1d0b8463750be7477eebd6bc912ab292802f2;p=mezzo.git add custom agenda templates --- diff --git a/app/festival/views.py b/app/festival/views.py index 53b72231..b8263ec9 100644 --- a/app/festival/views.py +++ b/app/festival/views.py @@ -24,3 +24,24 @@ class ArtistDetailView(DetailView): def get_context_data(self, **kwargs): context = super(ArtistDetailView, self).get_context_data(**kwargs) return context + + +class VideoListView(ListView): + + model = Video + template_name='festival/video_list.html' + + def get_context_data(self, **kwargs): + context = super(VideoListView, self).get_context_data(**kwargs) + return context + + +class VideoDetailView(DetailView): + + model = Video + template_name='festival/video_detail.html' + context_object_name = 'artist' + + def get_context_data(self, **kwargs): + context = super(VideoDetailView, self).get_context_data(**kwargs) + return context diff --git a/app/templates/agenda/event_detail.html b/app/templates/agenda/event_detail.html new file mode 100644 index 00000000..608255cf --- /dev/null +++ b/app/templates/agenda/event_detail.html @@ -0,0 +1,149 @@ +{% extends "agenda/event_list.html" %} +{% load mezzanine_tags comment_tags keyword_tags rating_tags i18n future disqus_tags event_tags %} + +{% block meta_title %}{{ event.meta_title }}{% endblock %} + +{% block meta_keywords %}{% metablock %} +{% keywords_for event as tags %} +{% for tag in tags %}{% if not forloop.first %}, {% endif %}{{ tag }}{% endfor %} +{% endmetablock %}{% endblock %} + +{% block meta_description %}{% metablock %} +{{ event.description }} +{% endmetablock %}{% endblock %} + +{% block title %} +{% editable event.title %}{{ event.title }}{% endeditable %} +{% endblock %} + +{% block breadcrumb_menu %} +{{ block.super }} +
  • {{ event.title }}
  • +{% endblock %} + +{% block main %} + +{% block event_detail_postedby %} +{% editable event.start event.end event.location %} +
    + {{ event.start }} + {% if event.end %} + {% trans "-" %} {{ event.end }} + {% endif %} + {% if event.location %} + {% trans "at" %} + {{ event.location }} + {% endif %}
    +{% endeditable %} +{% endblock %} +{% block event_detail_commentlink %} +

    + {% if event.allow_comments %} + {% if settings.COMMENTS_DISQUS_SHORTNAME %} + ({% spaceless %} + {% trans "Comments" %} + {% endspaceless %}) + {% else %}({% spaceless %} + {% blocktrans count comments_count=event.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %} + {% endspaceless %}) + {% endif %} + {% endif %} +

    +{% endblock %} + +{% block event_detail_calendar %} +

    + Add to Google Calendar + + + Add to Outlook/iCal +

    +{% endblock %} + +{% block event_detail_featured_image %} +{% if settings.EVENT_USE_FEATURED_IMAGE and event.featured_image %} +

    +{% endif %} +{% endblock %} + +{% if settings.COMMENTS_DISQUS_SHORTNAME %} +{% include "generic/includes/disqus_counts.html" %} +{% endif %} + +{% block event_detail_content %} +{% editable event.content %} +{{ event.content|richtext_filters|safe }} +{% endeditable %} +{% endblock %} + +{% if event.location %} +{% block event_detail_location %} +{% editable event.location %} +
    +
    +

    + {{ event.location.address|linebreaksbr }}
    + + Get Directions + +

    + {% google_static_map event 621 250 10 %} +
    +
    +{% endeditable %} +{% endblock %} +{% endif %} + +{% block event_detail_keywords %} +{% keywords_for event as tags %} +{% if tags %} +{% spaceless %} + +{% endspaceless %} +{% endif %} +{% endblock %} + +{% block event_detail_rating %} +
    +
    + {% rating_for event %} +
    +
    +{% endblock %} + +{% block event_detail_sharebuttons %} +{% set_short_url_for event %} +{% trans "Share on Twitter" %} +{% trans "Share on Facebook" %} +{% endblock %} + +{% block event_previous_next %} + +{% endblock %} + +{% block event_detail_comments %} +{% if event.allow_comments %}{% comments_for event %}{% endif %} +{% endblock %} + +{% endblock %} diff --git a/app/templates/agenda/event_list.html b/app/templates/agenda/event_list.html new file mode 100644 index 00000000..51236096 --- /dev/null +++ b/app/templates/agenda/event_list.html @@ -0,0 +1,157 @@ +{% extends "base.html" %} +{% load i18n future mezzanine_tags event_tags keyword_tags disqus_tags %} + +{% block meta_title %}{% if page %}{{ page.richtextpage.meta_title }}{% else %}{% trans "Events" %}{% 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 "Events" %} +{% endif %} +{% endblock %} + +{% block breadcrumb_menu %} +{{ block.super }} +{% if tag or location or year or month or author %} +
  • {% spaceless %} +{% if tag %} + {% trans "Tag:" %} {{ tag }} +{% else %}{% if location %} + {% trans "Location:" %} {{ location }} +{% 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 %} +{% if tag or location or year or month or author %} + {% block event_list_filterinfo %} +

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

    +{% else %} + {% if page %} + {% block event_list_pagecontent %} + {% editable page.richtextpage.content %} + {{ page.richtextpage.content|richtext_filters|safe }} + {% endeditable %} + {% endblock %} + {% endif %} +{% endif %} + +{% block event_calendar %} +

    + Subscribe to all events in Google Calendar/Outlook/iCal +

    +{% endblock %} + +{% for event in events.object_list %} +{% block event_list_event_title %} +{% editable event.title %} +

    + {{ event.title }} +

    +{% endeditable %} +{% endblock %} +{% block event_list_event_metainfo %} +{% editable event.start event.end event.location %} +
    + {{ event.start }} + {% if event.end %} + {% trans "-" %} {{ event.end }} + {% endif %} + {% if event.location %} + {% trans "at" %} + {{ event.location }} + {% endif %} +
    +{% endeditable %} +{% endblock %} + +{% if settings.EVENT_USE_FEATURED_IMAGE and event.featured_image %} +{% block event_list_event_featured_image %} + + + +{% endblock %} +{% endif %} + +{% block event_list_event_content %} +{% editable event.content %} +{{ event.description_from_content|safe }} +{% endeditable %} +{% endblock %} + +{% block event_list_event_links %} +
    + {% keywords_for event as tags %} + {% if tags %} + + {% endif %} +

    + {% trans "read more" %} + {% if event.allow_comments %} + / + {% if settings.COMMENTS_DISQUS_SHORTNAME %} + + {% trans "Comments" %} + + {% else %} + + {% blocktrans count comments_count=event.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %} + + {% endif %} + {% endif %} +

    +
    +{% endblock %} +{% endfor %} + +{% pagination_for events %} + +{% if settings.COMMENTS_DISQUS_SHORTNAME %} +{% include "generic/includes/disqus_counts.html" %} +{% endif %} + +{% endblock %} + +{% block right_panel %} +{% include "agenda/includes/filter_panel.html" %} +{% endblock %} diff --git a/app/templates/agenda/includes/filter_panel.html b/app/templates/agenda/includes/filter_panel.html new file mode 100644 index 00000000..e8eab0f3 --- /dev/null +++ b/app/templates/agenda/includes/filter_panel.html @@ -0,0 +1,106 @@ +{% load event_tags keyword_tags i18n future %} + +{% block upcoming_events %} +{% upcoming_events 5 as upcoming_events %} +{% if upcoming_events %} +

    {% trans "Upcoming Events" %}

    + +{% endif %} +{% endblock %} + +{% block recent_events %} +{% recent_events 5 as recent_events %} +{% if recent_events %} +

    {% trans "Recent Events" %}

    + +{% endif %} +{% endblock %} + +{% block event_months %} +{% event_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 event_locations %} +{% event_locations as locations %} +{% if locations %} +

    {% trans "Locations" %}

    + +{% endif %} +{% endblock %} + +{% block event_keywords %} +{% keywords_for mezzanine_agenda.event as tags %} +{% if tags %} +

    {% trans "Tags" %}

    + +{% endif %} +{% endblock %} + +{% block event_authors %} +{% event_authors as authors %} +{% if authors %} +

    {% trans "Authors" %}

    + +{% endif %} +{% endblock %} + +{% block event_feeds %} +

    {% trans "Feeds" %}

    +{% if tag %} + {% trans "RSS" %} / + {% trans "Atom" %} +{% endif %} +{% if location %} + {% trans "RSS" %} / + {% trans "Atom" %} +{% endif %} +{% if author %} + {% trans "RSS" %} / + {% trans "Atom" %} +{% endif %} +{% if not tag and not location and not author %} + {% trans "RSS" %} / + {% trans "Atom" %} +{% endif %} +{% endblock %}