doc; error in sections with object; update styles and templates

This commit is contained in:
bkfox
2016-06-01 20:07:22 +02:00
parent e0a268505e
commit ad58d3c332
10 changed files with 153 additions and 81 deletions

View File

@ -7,18 +7,22 @@
{% if comment_form %}
{% with comment_form as form %}
{{ form.non_field_errors }}
<form action="" method="POST" class="comment_form">
<form action="" method="POST">
{% 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>
<input type="checkbox" value="1" id="show_more">
<label for="show_more">{% trans "show more options" %}</label>
<div class="extra">
{{ form.email.errors }}
{{ form.email }}
{{ form.url.errors }}
{{ form.url }}
</div>
</div>
</div>
<div>

View File

@ -17,7 +17,6 @@
<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 }}">
@ -38,26 +37,33 @@
{{ item.author }}
</span>
{% endif %}
{% if item.info and 'info' in list.fields %}
<span class="info">
{{ item.info }}
</span>
{% endif %}
</div>
{% endif %}
{% if 'image' in list.fields and item.image %}
<img src="{% thumbnail item.image list.image_size crop %}">
{% endif %}
{% 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 }}
{% if 'title' in list.fields and item.title %}
<h2 class="title">{{ item.title }}</h2>
{% endif %}
{% if 'content' in list.fields and item.content %}
<div class="text">
{% if list.truncate %}
{{ item.content|striptags|truncatewords:list.truncate }}
{% else %}
{{ item.content|striptags }}
{% endif %}
</div>
{% endif %}
</div>
{% endif %}
{% if item.detail_url %}
</a>
@ -72,8 +78,9 @@
{% if page_obj or list.url %}
<nav>
{% if not page_obj or embed %}
<a href="{{list.url}}" title={% trans "More elements" %}>&#8690;</a>
{% else %}
{% comment %}link to show more elements of the list{% endcomment %}
<a href="{{list.url}}">{% trans "&#8226;&#8226;&#8226;" %}</a>
{% elif page_obj.paginator.num_pages > 1 %}
{% with page_obj.paginator.num_pages as num_pages %}
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}">previous</a>

View File

@ -1,5 +1,5 @@
<{{ tag }} class="{{ css_class }}"
<{{ tag }} {% if css_class %} class="{{ css_class }}" {% endif %}
{% for k, v in attrs.items %}
{{ k }} = "{{ v|addslashes }}"
{% endfor %} >
@ -15,7 +15,7 @@
{% block header %}
{% if header %}
<header>
{{ header }}
{{ header|safe }}
</header>
{% endif %}
{% endblock %}
@ -27,7 +27,7 @@
{% block footer %}
{% if footer %}
<footer>
{{ footer }}
{{ footer|safe }}
</footer>
{% endif %}
{% endblock %}

View File

@ -32,7 +32,10 @@
{{ menus.left|safe }}
{% endif %}
<main>
<main {% if css_class %} class="{{ css_class }}" {% endif %}
{% for k, v in attrs.items %}
{{ k }} = "{{ v|addslashes }}"
{% endfor %} >
{% endif %}
{% if messages %}
<ul class="messages">