forked from rc/aircox
clean up, merge the different kind of lists, merge BaseSection & Section
This commit is contained in:
33
cms/templates/aircox/cms/comments.html
Normal file
33
cms/templates/aircox/cms/comments.html
Normal file
@ -0,0 +1,33 @@
|
||||
{% extends "aircox/cms/section.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load honeypot %}
|
||||
|
||||
{% block header %}
|
||||
{% if comment_form %}
|
||||
{% with comment_form as form %}
|
||||
{{ form.non_field_errors }}
|
||||
<form action="" method="POST" class="comment_form">
|
||||
{% csrf_token %}
|
||||
{% render_honeypot_field "hp_website" %}
|
||||
<div>
|
||||
{{ form.author.errors }}
|
||||
{{ form.author }}
|
||||
<input type="checkbox" value="1">
|
||||
<div class="extra">
|
||||
{{ form.email.errors }}
|
||||
{{ form.email }}
|
||||
{{ form.url.errors }}
|
||||
{{ form.url }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{{ form.content.errors }}
|
||||
{{ form.content }}
|
||||
<button type="submit">{% trans "Post!" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -1,8 +0,0 @@
|
||||
|
||||
<{{ tag }} class="{{ classes }}"
|
||||
{% for k, v in attrs.items %}{{ k }} = "{{ v|addslashes }}" {% endfor %} >
|
||||
{% block content %}
|
||||
{{ content|safe }}
|
||||
{% endblock %}
|
||||
</{{ tag }}>
|
||||
|
@ -1,53 +1,78 @@
|
||||
{% extends "aircox/cms/website.html" %}
|
||||
{% extends base_template %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load thumbnail %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="post_list {{ classes }} {% if embed %}embed{% endif %}">
|
||||
{% for post in object_list %}
|
||||
<a class="post_item"
|
||||
href="{{ post.detail_url }}">
|
||||
{% if 'date' in view.fields or 'time' in view.fields %}
|
||||
<time datetime="{{ post.date }}" class="post_datetime">
|
||||
{% if 'date' in view.fields %}
|
||||
<span class="post_date">
|
||||
{{ post.date|date:'D. d F' }}
|
||||
<ul>
|
||||
{% for item in object_list %}
|
||||
<li {% if item.css_class %}class="{{ item.css_class }}"{% endif %}
|
||||
{% for k, v in item.attrs.items %}
|
||||
{{ k }} = "{{ v|addslashes }}"
|
||||
{% endfor %} >
|
||||
{% if item.detail_url %}
|
||||
<a href="{{ item.detail_url }}">
|
||||
{% endif %}
|
||||
|
||||
{% if 'date' in list.fields or 'time' in list.fields or 'author' in list.fields %}
|
||||
<div class="meta">
|
||||
{% if item.date and 'date' in list.fields or 'time' in list.fields %}
|
||||
<time datetime="{{ item.date }}">
|
||||
{% if 'date' in list.fields %}
|
||||
<span class="date">
|
||||
{{ item.date|date:'D. d F' }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if 'time' in view.fields %}
|
||||
<span class="post_time">
|
||||
{{ post.date|date:'H:i' }}
|
||||
{% if 'time' in list.fields %}
|
||||
<span class="time">
|
||||
{{ item.date|date:'H:i' }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</time>
|
||||
{% endif %}
|
||||
|
||||
{% if 'image' in view.fields and post.image %}
|
||||
<img src="{% thumbnail post.image view.icon_size crop %}" class="post_image">
|
||||
{% if item.author and 'author' in list.fields %}
|
||||
<span class="author">
|
||||
{{ item.author }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if 'title' in view.fields %}
|
||||
<h3 class="post_title">{{ post.title }}</h3>
|
||||
{% endif %}
|
||||
{% if 'image' in list.fields and item.image %}
|
||||
<img src="{% thumbnail item.image list.image_size crop %}">
|
||||
{% endif %}
|
||||
|
||||
{% if 'content' in view.fields %}
|
||||
<div class="post_content">
|
||||
{{ post.content|safe|striptags|truncatechars:"64" }}
|
||||
</div>
|
||||
{% if 'title' in list.fields %}
|
||||
<h2 class="title">{{ item.title }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{% if 'content' in list.fields %}
|
||||
<div class="content">
|
||||
{% if list.truncate %}
|
||||
{{ item.content|striptags|truncatewords:list.truncate }}
|
||||
{% else %}
|
||||
{{ item.content|striptags }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if item.detail_url %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% empty %}
|
||||
<div class="message empty">
|
||||
{{ list.message_empty }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if page_obj or list.url %}
|
||||
<nav>
|
||||
{% if embed %}
|
||||
{% with view.get_url as list_url %}
|
||||
{% if list_url %}
|
||||
<a href="{{list_url}}" title="More elements">⇲</a>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% if not page_obj or embed %}
|
||||
<a href="{{list.url}}" title={% trans "More elements" %}>⇲</a>
|
||||
{% else %}
|
||||
{# FIXME: page numbers #}
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
|
||||
{% endif %}
|
||||
@ -61,5 +86,6 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -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 }}>
|
||||
|
@ -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 %}
|
||||
<h1>
|
||||
{% block section_title %}
|
||||
{{ title }}
|
||||
{% endblock %}
|
||||
</h1>
|
||||
{% endif %}
|
||||
|
||||
{% if header %}
|
||||
<header>
|
||||
{% block section_header %}
|
||||
{{ header }}
|
||||
{% endblock %}
|
||||
</header>
|
||||
{% endif %}
|
||||
|
||||
<div class="content">
|
||||
{% block section_content %}
|
||||
{{ content|safe }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
{% if footer %}
|
||||
<footer>
|
||||
{% block section_footer %}
|
||||
{{ footer }}
|
||||
{% endblock %}
|
||||
</footer>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
{% if header %}
|
||||
<header>
|
||||
{{ header }}
|
||||
</header>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ content|safe }}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{% if footer %}
|
||||
<footer>
|
||||
{{ footer }}
|
||||
</footer>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</{{ tag }}>
|
||||
|
||||
|
@ -1,52 +0,0 @@
|
||||
{% extends "aircox/cms/section.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load honeypot %}
|
||||
|
||||
{% block section_content %}
|
||||
{{ form.non_field_errors }}
|
||||
<form action="" method="POST" class="comment_form">
|
||||
{% csrf_token %}
|
||||
{% render_honeypot_field "hp_website" %}
|
||||
<div>
|
||||
{{ form.author.errors }}
|
||||
{{ form.author }}
|
||||
<input type="checkbox" value="1">
|
||||
<div class="extra">
|
||||
{{ form.email.errors }}
|
||||
{{ form.email }}
|
||||
{{ form.url.errors }}
|
||||
{{ form.url }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{{ form.content.errors }}
|
||||
{{ form.content }}
|
||||
<button type="submit">{% trans "Post!" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="comment_list">
|
||||
{% for item in object_list %}
|
||||
<div id="comment-{{ item.id }}" class="comment_item">
|
||||
{{ item.content }}
|
||||
|
||||
<div class="metadata">
|
||||
<a href="{% if item.url %}{{ item.url }}{% else
|
||||
%}#{% endif %}" class="author">
|
||||
{{ item.author }}
|
||||
</a>
|
||||
|
||||
<time datetime="{{ item.date }}">
|
||||
{{ item.date|date:'l d F Y' }},
|
||||
{{ item.date|time:'H\hi' }}
|
||||
</time>
|
||||
|
||||
<a href="#comment-{{ item.id }}">#{{ item.id }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
{% extends "aircox/cms/section.html" %}
|
||||
|
||||
{% load thumbnail %}
|
||||
|
||||
{% block section_content %}
|
||||
<ul style="padding:0; margin:0">
|
||||
{% for item in object_list %}
|
||||
<li class="{{item.css}}">
|
||||
{% if item.url %}
|
||||
<a href="{{item.url}}">
|
||||
{% endif %}
|
||||
{% if use_icons and item.icon %}
|
||||
<img src="{% thumbnail item.icon icon_size crop %}" class="icon">
|
||||
{% endif %}
|
||||
|
||||
{{ item.title }}
|
||||
|
||||
{% if item.text %}
|
||||
<small>{{ item.text }}</small>
|
||||
{% endif %}
|
||||
{% if item.url %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user