{% for event in objects %}
<li class="event-list-item">
<a target="_blank" href="{{ event.link }}">
- {{ event.place }}, {{ event.date }}
+ <div class="date">
+ <div class="day">{{ event.date|date:"j" }}</div>
+ <div class="mon">{{ event.date|date:"b" }}</div>
+ </div>
+ {{ event.place }}
{{ event.title }}
{{ event.organizer }}
+ <div style="clear: both"></div>
</a>
</li>
{% endfor %}
</ul>
-<a href="{% url 'events' %}">{% trans "more events" %}</a>
+<!--p class="more"><a href="{% url 'events' %}">{% trans "more events" %}</a></p-->
category = None
if type_db:
entry_type = TYPES_DICT[type_db]
+ else:
+ entry_type = None
return {'entry_type': entry_type, 'category': category}
def title(self, obj):
--- /dev/null
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding field 'Category.taxonomy'
+ db.add_column('migdal_category', 'taxonomy',
+ self.gf('django.db.models.fields.CharField')(default='topics', max_length=32),
+ keep_default=False)
+
+
+ def backwards(self, orm):
+ # Deleting field 'Category.taxonomy'
+ db.delete_column('migdal_category', 'taxonomy')
+
+
+ models = {
+ 'migdal.attachment': {
+ 'Meta': {'object_name': 'Attachment'},
+ 'entry': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['migdal.Entry']"}),
+ 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+ },
+ 'migdal.category': {
+ 'Meta': {'object_name': 'Category'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slug_en': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
+ 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
+ 'taxonomy': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'title_en': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
+ 'title_pl': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'})
+ },
+ 'migdal.entry': {
+ 'Meta': {'ordering': "['-date']", 'object_name': 'Entry'},
+ '_body_en_rendered': ('django.db.models.fields.TextField', [], {}),
+ '_body_pl_rendered': ('django.db.models.fields.TextField', [], {}),
+ '_lead_en_rendered': ('django.db.models.fields.TextField', [], {}),
+ '_lead_pl_rendered': ('django.db.models.fields.TextField', [], {}),
+ 'author': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'author_email': ('django.db.models.fields.EmailField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
+ 'body_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
+ 'body_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
+ 'body_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
+ 'body_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
+ 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['migdal.Category']", 'null': 'True', 'blank': 'True'}),
+ 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'lead_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
+ 'lead_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
+ 'lead_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
+ 'lead_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
+ 'needed_en': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1', 'db_index': 'True'}),
+ 'promo': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'published_en': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'published_pl': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'slug_en': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
+ 'slug_pl': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
+ 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'title_pl': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'})
+ }
+ }
+
+ complete_apps = ['migdal']
\ No newline at end of file
class Category(models.Model):
+ taxonomy = models.CharField(_('taxonomy'), max_length=32,
+ choices=settings.TAXONOMIES)
class Meta:
verbose_name = _('category')
OBLIGATORY_LANGUAGES = app_setting('MIGDAL_OBLIGATORY', tuple(
lang for lang in LANGUAGES if lang[0]==LANGUAGE_CODE))
OPTIONAL_LANGUAGES = tuple(lang for lang in LANGUAGES if lang not in OBLIGATORY_LANGUAGES)
+
+
+TAXONOMIES = (
+ ('topics', _('topics')),
+ ('types', _('types')),
+)
<ul class="categories">
{% for cat in object_list %}
- <li class="category">
- <a href="{{ cat.get_absolute_url }}">{{ cat }} ({{cat.entry_set.count}})</a>
+ <li class="category category-taxonomy-{{ cat.taxonomy }}">
+ <a href="{{ cat.get_absolute_url }}">{{ cat }}</a>
</li>
{% endfor %}
</ul>
\ No newline at end of file
{% load migdal_tags %}
+{% block "main_menu" %}
+ {% if entry.categories %}
+ {% main_menu 'objects' entry.categories.all %}
+ {% else %}
+ {% main_menu 'entry_type' entry.type %}
+ {% endif %}
+{% endblock "main_menu" %}
+
+
{% block "body" %}
-<div class="entry entry-short entry-{{ object.type }}">
+<div class="entry entry-short entry-{{ entry.type }}">
{% entry_begin entry %}
{{ entry.body }}
{% load i18n %}
{% load migdal_tags %}
+
+{% block "main_menu" %}
+ {% if category %}
+ {% main_menu 'object' category %}
+ {% elif entry_type %}
+ {% main_menu 'entry_type' entry_type.db %}
+ {% else %}
+ {{ block.super }}
+ {% endif %}
+{% endblock "main_menu" %}
+
+
{% block "body" %}
<h1>
--- /dev/null
+{% load i18n %}
+{% for item in items %}
+ <li{% if item.active %}
+ class="active"{%endif %} {% if item.html_id %}
+ id="{{ item.html_id}}"{% endif %}>
+ <a href="{{ item.url }}">{{ item.title }}</a></li>
+{% endfor %}
#
from django_comments_xtd.models import XtdComment
from django.contrib import comments
+from django.core.urlresolvers import reverse
from django import template
-from migdal.models import Category
+from migdal.models import Category, Entry
+from migdal import settings
+from django.utils.translation import ugettext_lazy as _
register = template.Library()
'migdal/entry/%s/entry_begin.html' % entry.type,
'migdal/entry/entry_begin.html',
))
- context.update({'object': entry})
+ context = {
+ 'request': context['request'],
+ 'object': entry,
+ }
return t.render(template.Context(context))
'migdal/entry/%s/entry_short.html' % entry.type,
'migdal/entry/entry_short.html',
))
- context.update({'object': entry})
+ context = {
+ 'request': context['request'],
+ 'object': entry,
+ }
return t.render(template.Context(context))
@register.inclusion_tag('migdal/categories.html', takes_context=True)
-def categories(context):
- context.update({'object_list': Category.objects.all()})
+def categories(context, taxonomy):
+ context = {
+ 'request': context['request'],
+ 'object_list': Category.objects.filter(taxonomy=taxonomy)
+ }
return context
return {
'form': comments.get_form()(entry),
'next': entry.get_absolute_url(),
- }
\ No newline at end of file
+ }
+
+
+class MenuItem(object):
+ html_id = None
+
+ def __init__(self, title, url, html_id=None):
+ self.title = title
+ self.url = url
+ self.html_id = html_id
+
+ def check_active(self, chooser, value):
+ self.active = chooser == 'url' and value == self.url
+
+
+class ModelMenuItem(object):
+ def __init__(self, obj, html_id=None):
+ self.obj = obj
+ self.title = unicode(obj)
+ self.url = obj.get_absolute_url()
+ self.html_id = html_id
+
+ def check_active(self, chooser, value):
+ self.active = (chooser == 'object' and value == self.obj or
+ chooser == 'objects' and self.obj in value)
+
+
+class EntryTypeMenuItem(object):
+ def __init__(self, title, type_, html_id=None):
+ self.type = type_
+ self.title = title
+ self.url = reverse('migdal_entry_list_%s' % type_)
+ self.html_id = html_id
+
+ def check_active(self, chooser, value):
+ self.active = (chooser == 'object' and isinstance(value, Entry)
+ and value.type == self.type or
+ chooser == 'entry_type' and value == self.type)
+
+@register.inclusion_tag('migdal/menu.html', takes_context=True)
+def main_menu(context, chooser=None, value=None):
+ items = [
+ ModelMenuItem(Entry.objects.get(slug_pl='o-nas')),
+ EntryTypeMenuItem(_(u'Publications'), u'publications'),
+ MenuItem(_(u'Events'), reverse('events')),
+ ModelMenuItem(Category.objects.get(slug_pl='stanowisko')),
+ ModelMenuItem(Category.objects.get(slug_pl='pierwsza-pomoc')),
+ ]
+ if context['request'].LANGUAGE_CODE == 'pl':
+ items.append(MenuItem(u'en', '/en/', html_id='item-lang'))
+ else:
+ items.append(MenuItem(u'pl', '/', html_id='item-lang'))
+ for item in items:
+ item.check_active(chooser, value)
+ return {'items': items}
body {
- font-family: Purisa, sans-serif;
+ font-family: sans-serif;
+ font-size: .625em;
+ background: #edece7;
+}
+
+a {
+ text-decoration: none;
+}
+a:hover {
+ text-decoration: underline;
}
#menu {
list-style: none;
padding-left: 0;
margin-left: 0;
+ text-transform: uppercase;
+ margin: 0;
+}
+#menu #item-lang a {
+ color: #0050a2;
}
#menu li {
display: inline-block;
+ position: relative;
list-style: none;
padding-left: 0;
- margin-left: 0;
+ margin-right: 5em;
+}
+#menu li a {
+ color: black;
+}
+#menu li.active {
+ font-weight: bold;
+}
+#menu li.active:before {
+ color: #004e98;
+ content: "(";
+ position: absolute;
+ left: -.7em;
+ font-size: 2em;
+ top: -.25em;
+}
+#menu li.active:after {
+ color: #004e98;
+ content: ")";
+ position: absolute;
+ right: -.7em;
+ font-size: 2em;
+ top: -.25em;
}
.avatar {
}
.entry-data {
font-size: .8em;
+}
+
+
+
+.bar-right {
+ width: 25em;
+ float: right;
+}
+.bar-left {
+ width: 70em;
+ float: left;
+}
+#body {
+ width: 96em;
+ margin: auto;
+ padding: 1em;
+}
+#footer-bar {
+ color: #4b4c47;
+ border-top: 1px solid #acacaa;
+ padding-top: 1.5em;
+ margin-top: 4em;
+}
+.footer-item {
+ width: 24em;
+ float: left;
+}
+#search-form input {
+ font-size: 1.1em;
+ width: 18em;
+ border: none;
+ border-radius: 1.5em 0 0 1.5em;
+ background: white;
+ color: black;
+ height: 2em;
+}
+#search-form button {
+ font-size: 1.1em;
+ width: 3em;
+ height: 2em;
+ border: none;
+ background: #3bb0a8;
+ color: white;
+ border-radius: 0 1em 1em 0;
+}
+
+.sidebar-box {
+ border-top: 1px solid #8a8b85;
+ padding-top: 1.5em;
+ padding-bottom: 1.5em;
+ clear: both;
+}
+
+.sidebar-box .event-list {
+ list-style: none;
+ padding-left: 0;
+}
+.sidebar-box .more {
+ text-align: right;
+}
+.sidebar-box .event-list li {
+ margin-top: .8em;
+}
+
+.sidebar-box .event-list .date {
+ clear: both;
+ float: left;
+ background: #494949;
+ color: #69efe6;
+ width: 4em;
+ height: 3.8em;
+ border-radius: .5em;
+ padding: .5em;
+ text-align: center;
+ margin-right: 1em;
+}
+.sidebar-box .event-list a {
+ display: block;
+}
+.sidebar-box .event-list .date .day {
+ font-size: 1.8em;
+ font-style: italic;
+}
+.sidebar-box .event-list .date .mon {
+ text-transform: uppercase;
+}
+
+#sidebar-box-categories ul {
+ width: 50%;
+ display: table-cell;
+ list-style: none;
+ padding-left: 0;
+ padding-right: 4em;
+}
+#sidebar-box-categories .category-taxonomy-topics a {
+ color: #31ada3;
+}
+
+#sidebar-box-categories .category-taxonomy-types a {
+ color: #ff6100;
+}
+
+
+sdiv {
+ border: #ddd 1px solid;
}
\ No newline at end of file
{% compressed_css 'base' %}
</head>
<body>
- <a href="{% url "migdal_main" %}">{% trans "Culture's right" %}</a>
- <ul id="menu">
- {% if request.LANGUAGE_CODE == 'pl' %}
- <li><a href="{% url 'migdal_entry_info' 'o-nas' %}">{% trans "About us" %}</a></li>
- {% else %}
- <li><a href="{% url 'migdal_entry_info' 'about-us' %}">{% trans "About us" %}</a></li>
- {% endif %}
- <li><a href="{% url 'migdal_entry_list_publications' %}">{% trans "Publications" %}</a></li>
- <li><a href="{% url 'events' %}">{% trans "Events" %}</a></li>
- {% if request.LANGUAGE_CODE == 'pl' %}
- <li><a href="{% url 'migdal_category' 'stanowiska' %}">{% trans "Positions" %}</a></li>
- <li><a href="{% url 'migdal_category' 'pierwsza-pomoc' %}">{% trans "First aid" %}</a></li>
- <li><a href="/en">English</a></li>
- {% else %}
- <li><a href="{% url 'migdal_category' 'positions' %}">{% trans "Positions" %}</a></li>
- <li><a href="{% url 'migdal_category' 'first-aid' %}">{% trans "First aid" %}</a></li>
- <li><a href="/">polski</a></li>
- {% endif %}
+ <div id="body">
+
+ <div id="header-bar">
+ <div class="bar-left">
+ <a id="logo" href="{% url "migdal_main" %}">{% trans "Culture's right" %}</a>
+ </div>
+ <div class="bar-right">
+ <a id="logo-fnp" href="http://nowoczesnapolska.org.pl">[Logo FNP]</a>
+ <a id="logo-osi" href="http://osi">[Logo OSI]</a>
+ </div>
+ <div style="clear: both;"></div>
+ </div>
+
+ <div id="menu-bar">
+ <div class="bar-right">
+ <form id="search-form"><input /><button>?</button></form>
+ </div>
+ <ul id="menu" class="bar-left">
+ {% block "main_menu" %}
+ {% main_menu 'url' request.get_full_path %}
+ {% endblock %}
</ul>
+ <div style="clear: both;"></div>
+ </div>
- <div id="sidebar" style="float:right; width: 20%;">
+ <div id="main-bar">
+ <div id="sidebar" class="bar-right">
{% block "sidebar" %}
<div class="sidebar-box">
<h3>{% trans "Upcoming events" %}</h3>
{% events_box %}
</div>
+ <div id="sidebar-box-categories" class="sidebar-box">
+ {% categories 'topics' %}
+ {% categories 'types' %}
+ </div>
<div class="sidebar-box">
- <h3>{% trans "Categories" %}</h3>
- {% categories %}
+ <a href="{% url 'migdal_main_feed' %}">RSS</a>
</div>
<div class="sidebar-box">
<h3>{% trans "Latest comments" %}</h3>
{% last_comments %}
</div>
- <div class="sidebar-box">
- <h3>{% trans "Follow us" %}</h3>
- <a href="{% url 'migdal_main_feed' %}">RSS</a>
- </div>
{% endblock %}
</div>
-
- <div id="body" style="width: 75%">
+ <div id="content" class="bar-left">
{% block "body" %}{% endblock %}
</div>
+ <div style="clear: both;"></div>
+ </div>
+
+ <div id="footer-bar">
+ <p class="footer-item">
+ <strong>Fundacja Nowoczesna Polska</strong><br/>
+ <br/>
+ ul.MarszaĆkowska 84/92 lok. 125<br/>
+ 00-514 Warszawa<br/>
+ tel/fax: +48 22 621 30 17<br/>
+ e-mail: fundacja@nowoczesnapolska.org.pl
+ </p>
+ <p class="footer-item">
+ <br/><br/>
+ KRS: 0000070056<br/>
+ REGON: 017423865<br/>
+ Nr konta: 46 10201097 0000 7502 0001 6766
+ </p>
+ </div>
+
+ </div>
</body>
</html>
\ No newline at end of file