--- /dev/null
+.event {
+ margin-top: 2em;
+ padding-bottom: 2em;
+ border-bottom: 1px solid #8b8b87; }
+ .event h2 {
+ color: #01519a;
+ font-weight: normal;
+ font-size: 1.3em;
+ margin-bottom: 1.1em; }
+ .event a {
+ display: block;
+ color: #363a3b; }
+ .event .description {
+ margin-top: 1.4em; }
--- /dev/null
+.event {
+ margin-top: 2em;
+ padding-bottom: 2em;
+ border-bottom: 1px solid #8b8b87;
+
+ h2 {
+ color: #01519a;
+ font-weight: normal;
+ font-size: 1.3em;
+ margin-bottom: 1.1em;
+ }
+
+ a {
+ display: block;
+ color: #363a3b;
+ }
+
+ .description {
+ margin-top: 1.4em;
+ }
+
+
+}
{% extends "base.html" %}
-{% load i18n %}
+{% load url from future %}
+{% load i18n pagination_tags prevnext %}
{% block "body" %}
<h1>{% trans "Events" %}</h1>
+
+{% autopaginate object_list 10 %}
{% for event in object_list %}
- {{ event.title }}
- {{ event.place }}
- {{ event.organizer }}
- {{ event.date }}
+ <div class="event">
+ <a href="{{ event.link }}">
+ <h2>{{ event.date }}</h2>{# just date #}
+ <strong class="title">{{ event.title }}</strong>
+
+ <div class="description">
+ {{ event.date }}, {{ event.place }}<br/>
+ {% trans "Organizer" %}: {{ event.organizer }}<br/>
+ </div>
+ </a>
+ </div>
{% endfor %}
+
+<p class="prevnext">
+{% next_page %}
+{% if past %}
+ {% url "events" as prev_url %}
+ {% trans "see upcoming events" as prev_label %}
+ {% previous_page prev_url prev_label %}
+{% else %}
+ {% url "events_past" as prev_url %}
+ {% trans "see past events" as prev_label %}
+ {% previous_page prev_url prev_label %}
+{% endif %}
+</p>
+
{% endblock %}
\ No newline at end of file
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.conf.urls import patterns, include, url
-from django.views.generic import ListView, DetailView
-from events.models import Event
+from django.utils.translation import string_concat, ugettext_lazy as _
-urlpatterns = patterns('',
- url(r'^$', ListView.as_view(model=Event), name='events'),
- #url(r'^(?P<slug>[^/]+)/$', DetailView.as_view(model=Event), name='news'),
+urlpatterns = patterns('events.views',
+ url(r'^$', 'events', name='events'),
+ url(string_concat('^', _('past'), '/$'), 'events_past', name='events_past'),
)
-# Create your views here.
+from datetime import datetime
+from django.shortcuts import render
+from events.models import Event
+
+
+def events(request):
+ return render(request, 'events/event_list.html', {
+ 'object_list': Event.objects.filter(date__gte=datetime.now())
+ })
+
+
+def events_past(request):
+ return render(request, 'events/event_list.html', {
+ 'object_list': Event.objects.filter(date__lte=datetime.now()
+ ).order_by('-date'),
+ 'past': True,
+ })
('topics', _('topics')),
('types', _('types')),
)
- LAST_COMMENTS = 10
+ LAST_COMMENTS = 5
TYPES_DICT = None
def _more_TYPES_DICT(self, value):
{% load i18n %}
{% load gravatar thumbnail %}
-<img class="avatar" src="{% gravatar_for_email object.author_email 64 %}"/>
+<img class="avatar" src="{% gravatar_for_email object.author_email 64 %}" alt="Avatar"/>
{% if detail %}
<h1>{{ object.title }}</h1>
{% else %}
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
-{% load pagination_tags %}
+{% load pagination_tags prevnext %}
{% load migdal_tags %}
{% for object in object_list %}
{% entry_short object %}
{% endfor %}
-{% paginate %}
+{% prevnext %}
{% endblock %}
\ No newline at end of file
{% load i18n %}
-<li class="promobox-item"{% if counter == 1 %}class="active"{% endif %}
+<li class="promobox-item"{% if counter == 1 %} class="active"{% endif %}
style="
{% if counter != 1 %}display: none;{% endif %}
{% if object.image %}
{% load i18n %}
+{% load thumbnail %}
{% if detail %}
<h1>{{ object.title }}</h1>
{% if object.image %}
- <img class="entry-picture" src="{{ object.image.url }}" />
+ <img class="entry-picture" src="{% thumbnail object.image "250x300" as thumb %}
+ {{ thumb.url }}
+ {% empty %}
+ {{ object.image.url }}
+ {% endthumbnail %}" />
{% endif %}
<div class="lead">
{{ object.lead }}
--- /dev/null
+{% load i18n %}
+{% load thumbnail %}
+
+{% if detail %}
+ <h1>{{ object.title }}</h1>
+{% else %}
+ <h2><a href="{{ object.get_absolute_url }}">{{ object.title }}</a></h2>
+{% endif %}
+
+
+<div class="entry-data">
+{% if request.LANGUAGE_CODE == 'pl' %}
+ {% if object.published_en %}
+ {% language 'en' %}
+ <a href="{{ object.get_absolute_url }}">English version</a>
+ {% endlanguage %}
+ {% endif %}
+{% elif object.published_pl %}
+ {{ request.LANGUAGE_CODE }}
+ {% language 'pl' %}
+ <a href="{{ object.get_absolute_url }}">polska wersja</a>
+ {% endlanguage %}
+{% endif %}
+</div>
+
+
+{% if object.image %}
+ <img class="entry-picture" src="{% thumbnail object.image "250x300" as thumb %}
+ {{ thumb.url }}
+ {% empty %}
+ {{ object.image.url }}
+ {% endthumbnail %}" />
+{% endif %}
+<div class="lead">
+{{ object.lead }}
+</div>
ModelMenuItem(Entry.objects.get(slug_pl='o-nas')),
EntryTypeMenuItem(_(u'Publications'), u'publications'),
MenuItem(_(u'Events'), reverse('events')),
- CategoryMenuItem(Category.objects.get(slug_pl='stanowisko'), title=_('Positions')),
- CategoryMenuItem(Category.objects.get(slug_pl='pierwsza-pomoc')),
+ CategoryMenuItem(Category.objects.get(slug_pl='stanowisko'),
+ title=_('Positions')),
+ CategoryMenuItem(Category.objects.get(slug_pl='pierwsza-pomoc'),
+ title=_('First aid in copyright')),
]
if context['request'].LANGUAGE_CODE == 'pl':
items.append(MenuItem(u'en', '/en/', html_id='item-lang'))
'css/promobox.scss',
'css/entry.scss',
'css/footer.scss',
+ 'css/prevnext.scss',
+ 'events/events.scss',
),
'output_filename': 'compressed/base.css',
},
text-decoration: underline; }
h1 {
- margin: 0;
+ margin: 0 0 .5em 0;
color: #01519a;
font-size: 2em; }
h1 {
- margin: 0;
+ margin: 0 0 .5em 0;
color: #01519a;
font-size: 2em;
}
margin-top: 0em; }
.entry-short {
- border-top: 1px solid #8b8b87; }
+ border-bottom: 1px solid #8b8b87; }
.entry-short .entry-wrapped {
padding-top: .7em; }
content: url("/static/img/read-more.png");
margin-left: .7em; }
-.entry-info .entry-wrapped {
+.entry-info .entry-wrapped,
+.entry-publications .entry-wrapped {
margin-left: 0; }
- .entry-info .entry-wrapped h1 {
+ .entry-info .entry-wrapped h1,
+ .entry-publications .entry-wrapped h1 {
font-size: 2em; }
.entry-picture {
.submit-link {
margin-top: 1em;
- margin-bottom: 1em;
- height: 1.7em; }
+ padding-bottom: 1em;
+ height: 1.7em;
+ border-bottom: 1px solid #8b8b87; }
.submit-link a {
color: black;
font-size: 1.1em; }
}
.entry-short {
- border-top: 1px solid #8b8b87;
+ border-bottom: 1px solid #8b8b87;
.entry-wrapped {
padding-top: .7em;
}
}
-.entry-info .entry-wrapped {
+.entry-info .entry-wrapped,
+.entry-publications .entry-wrapped {
margin-left: 0;
h1 {
font-size: 2em;
.submit-link {
margin-top: 1em;
- margin-bottom: 1em;
+ padding-bottom: 1em;
height: 1.7em;
+ border-bottom: 1px solid #8b8b87;
a {
color: black;
--- /dev/null
+.prevnext {
+ font-size: 1.1em;
+ font-style: italic;
+ margin-top: 1.4em; }
+ .prevnext a {
+ color: #acacac; }
+ .prevnext .next_page {
+ float: right; }
+ .prevnext .next_page:after {
+ content: url("/static/img/read-more.png");
+ vertical-align: middle;
+ margin-left: .7em; }
+ .prevnext .previous_page:before {
+ content: url("/static/img/previous.png");
+ vertical-align: middle;
+ margin-right: .7em; }
--- /dev/null
+.prevnext {
+ font-size: 1.1em;
+ font-style: italic;
+ margin-top: 1.4em;
+
+ a {
+ color: #acacac;
+ }
+
+ .next_page {
+ float: right;
+ }
+ .next_page:after {
+ content: url('/static/img/read-more.png');
+ vertical-align: middle;
+ margin-left: .7em;
+ }
+ .previous_page {
+ }
+ .previous_page:before {
+ content: url('/static/img/previous.png');
+ vertical-align: middle;
+ margin-right: .7em;
+ }
+}
\ No newline at end of file
.sidebar-box .event-list li {
margin-top: 1em; }
.sidebar-box .event-list a {
- display: block; }
+ display: block;
+ color: #363a3b; }
.sidebar-box .event-list .date {
clear: both;
float: left;
font-size: 1.1em;
text-transform: uppercase;
margin-top: -0.3em; }
- .sidebar-box .event-list .date:hover {
- text-decoration: none; }
.sidebar-box .event-list .description {
- color: black;
font-size: 1.1em; }
#sidebar-box-categories ul {
a {
display: block;
+ color: #363a3b;;
}
-
+
.date {
clear: both;
float: left;
}
}
- .date:hover {
- text-decoration: none;
- }
-
.description {
- color: black;
font-size: 1.1em;
}
}
+<!DOCTYPE html>
{% load url from future %}
{% load i18n static %}
{% load migdal_tags events_tags %}
{% categories 'topics' %}
{% categories 'types' %}
</div>
- <div class="sidebar-box">
+ <!--div class="sidebar-box">
<a href="{% url 'migdal_main_feed' %}">RSS</a>
- </div>
+ </div-->
<div class="sidebar-box">
<h3>{% trans "Latest comments" %}</h3>
{% last_comments %}
--- /dev/null
+{% if number or url %}
+ {% load i18n %}
+ <a class="next_page"
+ {% if number %}
+ href="?page={{ number }}"
+ {% else %}
+ href="{{ url }}"
+ {% endif %}
+ >
+ {% if title %}
+ {{ title }}
+ {% else %}
+ {% trans "next" %}
+ {% endif %}
+ </a>
+{% endif %}
\ No newline at end of file
--- /dev/null
+{% if number or url %}
+ {% load i18n %}
+ <a class="previous_page"
+ {% if number %}
+ href="?page={{ number }}"
+ {% else %}
+ href="{{ url }}"
+ {% endif %}
+ >
+ {% if title %}
+ {{ title }}
+ {% else %}
+ {% trans "previous" %}
+ {% endif %}
+ </a>
+{% endif %}
\ No newline at end of file
--- /dev/null
+{% load prevnext %}
+<p class="prevnext">
+{% next_page %}
+{% previous_page %}
+</p>
\ No newline at end of file
--- /dev/null
+from django.template import Library
+
+register = Library()
+
+
+@register.inclusion_tag('prevnext/previous.html', takes_context=True)
+def previous_page(context, fallback=None, fallback_title=None):
+ current = context['page_obj'].number
+ if current > 1:
+ return {'number': current - 1, 'title': None, 'url': None}
+ else:
+ return {'number': None, 'title': fallback_title, 'url': fallback}
+
+
+@register.inclusion_tag('prevnext/next.html', takes_context=True)
+def next_page(context, fallback=None, fallback_title=None):
+ current = context['page_obj'].number
+ page_range = context['paginator'].page_range
+ if current < page_range[-1]:
+ return {'number': current + 1, 'title': None, 'url': None}
+ else:
+ return {'number': None, 'title': fallback_title, 'url': fallback}
+
+
+@register.inclusion_tag('prevnext/prevnext.html', takes_context=True)
+def prevnext(context):
+ return context