- {{ post.date|date:'D. d F' }}
+
+{% if page_obj or list.url %}
+{% endif %}
{% endblock %}
diff --git a/cms/templates/aircox/cms/menu.html b/cms/templates/aircox/cms/menu.html
deleted file mode 100644
index acfc3f0..0000000
--- a/cms/templates/aircox/cms/menu.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-<{{ tag }} class="menu menu_{{ position }} {{ classes }}" {% if name %}
- name="{{ name }}"
- id="{{ name }}"
- {% endif %}>
- {% for section in sections %}
- {{ section|safe }}
- {% endfor %}
-{{ tag }}>
-
diff --git a/cms/templates/aircox/cms/section.html b/cms/templates/aircox/cms/section.html
index 672ef50..59e3b78 100644
--- a/cms/templates/aircox/cms/section.html
+++ b/cms/templates/aircox/cms/section.html
@@ -1,34 +1,35 @@
-{% extends "aircox/cms/content_object.html" %}
-{% block content %}
+<{{ tag }} class="{{ css_class }}"
+ {% for k, v in list.attrs.items %}
+ {{ k }} = "{{ v|addslashes }}"
+ {% endfor %} >
+
+{% block title %}
{% if title %}
- {% block section_title %}
{{ title }}
- {% endblock %}
{% endif %}
-
-{% if header %}
-
- {% block section_header %}
- {{ header }}
- {% endblock %}
-
-{% endif %}
-
-
- {% block section_content %}
- {{ content|safe }}
- {% endblock %}
-
-
-{% if footer %}
-
-{% endif %}
{% endblock %}
+{% block header %}
+{% if header %}
+
+{% endif %}
+{% endblock %}
+
+{% block content %}
+{{ content|safe }}
+{% endblock %}
+
+{% block footer %}
+{% if footer %}
+
+{% endif %}
+{% endblock %}
+{{ tag }}>
+
diff --git a/cms/templates/aircox/cms/section_comments.html b/cms/templates/aircox/cms/section_comments.html
deleted file mode 100644
index c05edca..0000000
--- a/cms/templates/aircox/cms/section_comments.html
+++ /dev/null
@@ -1,52 +0,0 @@
-{% extends "aircox/cms/section.html" %}
-
-{% load i18n %}
-{% load honeypot %}
-
-{% block section_content %}
-{{ form.non_field_errors }}
-
-
-
-{% endblock %}
-
-
diff --git a/cms/templates/aircox/cms/section_list.html b/cms/templates/aircox/cms/section_list.html
deleted file mode 100644
index c28de59..0000000
--- a/cms/templates/aircox/cms/section_list.html
+++ /dev/null
@@ -1,28 +0,0 @@
-{% extends "aircox/cms/section.html" %}
-
-{% load thumbnail %}
-
-{% block section_content %}
-
-{% endblock %}
-
diff --git a/cms/views.py b/cms/views.py
index 95c1c20..ccf92f2 100644
--- a/cms/views.py
+++ b/cms/views.py
@@ -5,7 +5,10 @@ from django.views.generic.base import View
from django.utils.translation import ugettext as _, ugettext_lazy
from django.http import Http404
-from django.views.decorators.http import require_http_methods
+from honeypot.decorators import verify_honeypot_value
+
+from aircox.cms.forms import CommentForm
+
class PostBaseView:
website = None # corresponding website
@@ -25,8 +28,9 @@ class PostBaseView:
}
if not self.embed:
+ object = self.object if hasattr(self, 'object') else None
context['menus'] = {
- k: v.get(self.request, object = self.object, **kwargs)
+ k: v.get(self.request, object = object, **kwargs)
for k, v in {
k: self.website.get_menu(k)
for k in self.website.menu_layouts
@@ -53,8 +57,7 @@ class PostListView(PostBaseView, ListView):
model = None
route = None
- fields = [ 'date', 'time', 'image', 'title', 'content' ]
- icon_size = '64x64'
+ list = None
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@@ -93,28 +96,28 @@ class PostListView(PostBaseView, ListView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update(self.get_base_context(**kwargs))
- context.update({
- 'title': self.get_title(),
- })
+
+ title = self.title if self.title else \
+ self.route and self.route.get_title(self.model, self.request,
+ **self.kwargs)
+ context['title'] = title
+ context['base_template'] = 'aircox/cms/website.html'
+
+ if not self.list:
+ import aircox.cms.sections as sections
+ self.list = sections.List(
+ truncate = 64,
+ fields = [ 'date', 'time', 'image', 'title', 'content' ],
+ )
+
+ context['list'] = self.list
+ # FIXME: list.url = if self.route: self.model(self.route, self.kwargs) else ''
return context
- def get_title(self):
- if self.title:
- return self.title
-
- title = self.route and self.route.get_title(self.model, self.request,
- **self.kwargs)
- return title
-
def get_url(self):
- if self.route:
- return self.model(self.route, self.kwargs)
return ''
-from honeypot.decorators import verify_honeypot_value
-from aircox.cms.forms import CommentForm
-
class PostDetailView(DetailView, PostBaseView):
"""
Detail view for posts and children
@@ -173,9 +176,8 @@ class PostDetailView(DetailView, PostBaseView):
return self.get(request, *args, **kwargs)
-
class Menu(View):
- template_name = 'aircox/cms/content_object.html'
+ template_name = 'aircox/cms/section.html'
tag = 'nav'
classes = ''
attrs = ''
@@ -212,4 +214,3 @@ class Menu(View):
return render_to_string(self.template_name, context)
-
diff --git a/programs/management/commands/diffusions_monitor.py b/programs/management/commands/diffusions_monitor.py
index 033dee7..794563d 100644
--- a/programs/management/commands/diffusions_monitor.py
+++ b/programs/management/commands/diffusions_monitor.py
@@ -74,7 +74,6 @@ class Actions:
if manual:
Diffusion.objects.bulk_create(items)
else:
- print('items: ', len(items))
for item in items:
count[1] += cl.__check_conflicts(item, saved_items)
if hasattr(item, 'do_not_save'):