mirror of
				https://github.com/tiyn/container-critique.git
				synced 2025-11-04 05:01:20 +01:00 
			
		
		
		
	templates: cleaned up whitespaces
This commit is contained in:
		@@ -25,7 +25,7 @@ login.login_view = "login"
 | 
			
		||||
 | 
			
		||||
@app.context_processor
 | 
			
		||||
def inject_title():
 | 
			
		||||
    return dict(title=config.TITLE, style=config.STYLE,
 | 
			
		||||
    return dict(title=config.TITLE, style=config.STYLE, \
 | 
			
		||||
                description=config.DESCRIPTION, \
 | 
			
		||||
                registration=config.ALLOW_REGISTRATION, r_to_star=rating_to_star)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,26 +1,46 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="archive">
 | 
			
		||||
        <h1>Archive</h1><br>
 | 
			
		||||
        {% set ns = namespace(last_year="") %}
 | 
			
		||||
        {% for entry in entries %}
 | 
			
		||||
        {% if entry.item.date != ns.last_year %}
 | 
			
		||||
        {% if ns.last_year != "" %}
 | 
			
		||||
        </ul>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        <h2> {{ entry.item.date }} </h2>
 | 
			
		||||
        <ul>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% set ns.last_year = entry.item.date %}
 | 
			
		||||
            <li>
 | 
			
		||||
                {{ entry.item.name }}
 | 
			
		||||
{% block content -%}
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="archive">
 | 
			
		||||
            <h1>Archive</h1><br>
 | 
			
		||||
            {% set ns = namespace(last_year="", last_name="", open_li = False, open_ul = False) -%}
 | 
			
		||||
            {% for entry in entries -%}
 | 
			
		||||
            {% if ns.last_name != entry.item.name and ns.last_name != "" -%}
 | 
			
		||||
                </li>
 | 
			
		||||
            {% set ns.open_li = False -%}
 | 
			
		||||
            {% endif -%}
 | 
			
		||||
            {% if entry.item.date != ns.last_year -%}
 | 
			
		||||
            {% if ns.last_year != "" -%}
 | 
			
		||||
            </ul>
 | 
			
		||||
            {% set ns.open_ul = False -%}
 | 
			
		||||
            {% endif -%}
 | 
			
		||||
            <h2> {{ entry.item.date }} </h2>
 | 
			
		||||
            <ul>
 | 
			
		||||
            {% set ns.open_ul = True -%}
 | 
			
		||||
            {% endif -%}
 | 
			
		||||
            {% if ns.last_name == entry.item.name and ns.last_year == entry.item.date -%}
 | 
			
		||||
                <br>
 | 
			
		||||
                <a href="{{ url_for('entry', ident=entry.id) }}">
 | 
			
		||||
                    {{ r_to_star(entry.rating) }} by {{ entry.user.name }}
 | 
			
		||||
                </a>
 | 
			
		||||
            </li><br>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
            {% else -%}
 | 
			
		||||
                <li>
 | 
			
		||||
                    {{ entry.item.name }}<br>
 | 
			
		||||
                    <a href="{{ url_for('entry', ident=entry.id) }}">
 | 
			
		||||
                        {{ r_to_star(entry.rating) }} by {{ entry.user.name }}
 | 
			
		||||
                    </a>
 | 
			
		||||
            {% set ns.open_li = True -%}
 | 
			
		||||
            {% endif -%}
 | 
			
		||||
            {% set ns.last_year = entry.item.date -%}
 | 
			
		||||
            {% set ns.last_name = entry.item.name -%}
 | 
			
		||||
            {% endfor -%}
 | 
			
		||||
            {% if ns.open_li -%}
 | 
			
		||||
                </li>
 | 
			
		||||
            {% endif -%}
 | 
			
		||||
            {% if ns.open_ul -%}
 | 
			
		||||
            </ul>
 | 
			
		||||
            {% endif -%}
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% block content -%}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="important">
 | 
			
		||||
        Error<br>
 | 
			
		||||
	<span>{{ errorcode }}</span>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% block content -%}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="blog">
 | 
			
		||||
        <h1>Blog</h1><br>
 | 
			
		||||
        {% for entry in entries %}
 | 
			
		||||
        {% for entry in entries -%}
 | 
			
		||||
        <div class="entry">
 | 
			
		||||
            <h1 id="{{ entry.id }}">
 | 
			
		||||
                <a href="{{ url_for('entry', ident=entry.id) }}">
 | 
			
		||||
@@ -17,11 +17,11 @@
 | 
			
		||||
                    {{ entry.user.name }}
 | 
			
		||||
                </a>
 | 
			
		||||
            </small><br>
 | 
			
		||||
            {% autoescape off %}
 | 
			
		||||
            {% autoescape off -%}
 | 
			
		||||
            {{ entry.text }}
 | 
			
		||||
            {% endautoescape %}
 | 
			
		||||
            {% endautoescape -%}
 | 
			
		||||
        </div><br>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
        {% endfor -%}
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,6 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content -%}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="logging">
 | 
			
		||||
        <h1>Sign In</h1>
 | 
			
		||||
@@ -16,10 +15,10 @@
 | 
			
		||||
                {{ form.password(size=32) }}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>{{ form.submit() }}</p>
 | 
			
		||||
            {% for mesg in get_flashed_messages() %}
 | 
			
		||||
            {% for mesg in get_flashed_messages() -%}
 | 
			
		||||
            <p>{{ mesg }}</p>
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
            {% endfor -%}
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,6 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content -%}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="logging">
 | 
			
		||||
        <h1>Register</h1>
 | 
			
		||||
@@ -10,29 +9,29 @@
 | 
			
		||||
            <p>
 | 
			
		||||
                {{ form.username.label }}<br>
 | 
			
		||||
                {{ form.username(size=32) }}
 | 
			
		||||
                {% for error in form.username.errors %}
 | 
			
		||||
                {% for error in form.username.errors -%}
 | 
			
		||||
                <span style="color: red;">[{{ error }}]</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% endfor -%}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>
 | 
			
		||||
                {{ form.password.label }}<br>
 | 
			
		||||
                {{ form.password(size=32) }}
 | 
			
		||||
                {% for error in form.password.errors %}
 | 
			
		||||
                {% for error in form.password.errors -%}
 | 
			
		||||
                <span style="color: red;">[{{ error }}]</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% endfor -%}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>
 | 
			
		||||
                {{ form.password2.label }}<br>
 | 
			
		||||
                {{ form.password2(size=32) }}
 | 
			
		||||
                {% for error in form.password2.errors %}
 | 
			
		||||
                {% for error in form.password2.errors -%}
 | 
			
		||||
                <span style="color: red;">[{{ error }}]</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% endfor -%}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>{{ form.submit() }}</p>
 | 
			
		||||
            {% for mesg in get_flashed_messages() %}
 | 
			
		||||
            {% for mesg in get_flashed_messages() -%}
 | 
			
		||||
            <p>{{ mesg }}</p>
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
            {% endfor -%}
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@
 | 
			
		||||
    <language>en-us</language>
 | 
			
		||||
    <link>{{ url_for("feed", _external=True) }}</link>
 | 
			
		||||
    <atom:link href="{{ url_for('feed', _external=True) }}" rel="self" type="application/rss+xml" />
 | 
			
		||||
    {% for entry in entries %}
 | 
			
		||||
    {% for entry in entries -%}
 | 
			
		||||
    <item>
 | 
			
		||||
        <title>
 | 
			
		||||
            {{ entry.item.name }} ({{ entry.item.date }}) {{ r_to_star(entry.rating) }} by {{ entry.user.name }}
 | 
			
		||||
@@ -19,11 +19,11 @@
 | 
			
		||||
            {{ entry.reviewed }}
 | 
			
		||||
        </pubDate>
 | 
			
		||||
        <description>
 | 
			
		||||
            {% autoescape off %}
 | 
			
		||||
            {% autoescape off -%}
 | 
			
		||||
            text
 | 
			
		||||
            {% endautoescape %}
 | 
			
		||||
            {% endautoescape -%}
 | 
			
		||||
        </description>
 | 
			
		||||
    </item>
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
    {% endfor -%}
 | 
			
		||||
</channel>
 | 
			
		||||
</rss>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% block content -%}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="standalone">
 | 
			
		||||
        <h1>
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
                {{ entry.reviewed }}
 | 
			
		||||
            </a>
 | 
			
		||||
        </small><br>
 | 
			
		||||
        {% if current_user.id == entry.user.id %}
 | 
			
		||||
        {% if current_user.id == entry.user.id -%}
 | 
			
		||||
        <small>
 | 
			
		||||
            [
 | 
			
		||||
            <a href="{{ url_for('delete_entry', ident=entry.id) }}">
 | 
			
		||||
@@ -25,10 +25,10 @@
 | 
			
		||||
            </a>
 | 
			
		||||
            ]
 | 
			
		||||
        </small><br>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% autoescape off %}
 | 
			
		||||
        {% endif -%}
 | 
			
		||||
        {% autoescape off -%}
 | 
			
		||||
        {{ entry.text }}
 | 
			
		||||
        {% endautoescape %}<br>
 | 
			
		||||
        {% endautoescape -%}<br>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,12 +3,13 @@
 | 
			
		||||
    (url_for("archive"), 'archive', 'Archive')
 | 
			
		||||
] -%}
 | 
			
		||||
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
    <title>{{ title }}</title>
 | 
			
		||||
    <link href="{{ url_for('static', filename='css/' + style + '.css') }}" rel="stylesheet" type="text/css">
 | 
			
		||||
    <meta charset="utf-8">
 | 
			
		||||
    <meta name="viewport" content="width=device-width" initial-scale=1.0>
 | 
			
		||||
    <link href="{{ url_for('static', filename='css/' + style + '.css') }}" rel="stylesheet" type="text/css">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
    <!-- Menu -->
 | 
			
		||||
@@ -18,30 +19,26 @@
 | 
			
		||||
        <input type="checkbox" id="main-menu-check">
 | 
			
		||||
        <label for="main-menu-check" class="show-menu">☰</label>
 | 
			
		||||
        <div class="main-menu">
 | 
			
		||||
            {% for href, id, caption in navigation_bar %}
 | 
			
		||||
            {% for href, id, caption in navigation_bar -%}
 | 
			
		||||
            <a href="{{ href|e }}">{{ caption|e }}</a>
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
            {% endfor -%}
 | 
			
		||||
            <label for="main-menu-check" class="hide-menu">X</label>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- Menu -->
 | 
			
		||||
    <!-- Content -->
 | 
			
		||||
	{% block content %}
 | 
			
		||||
	{% endblock %}
 | 
			
		||||
    <!-- Content -->
 | 
			
		||||
    {% block content -%}
 | 
			
		||||
    {% endblock -%}
 | 
			
		||||
    <footer>
 | 
			
		||||
        Made with <a href="https://github.com/tiyn/container-critique">Container Critique </a>.<br>
 | 
			
		||||
        {% if current_user.is_anonymous %}
 | 
			
		||||
        {% if current_user.is_anonymous -%}
 | 
			
		||||
        <a href="{{ url_for('login') }}">Login</a>
 | 
			
		||||
        {% if registration %}
 | 
			
		||||
        {% if registration -%}
 | 
			
		||||
        -
 | 
			
		||||
        <a href="{{ url_for('register') }}">Register</a>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% else %}
 | 
			
		||||
        <a href="{{ url_for('logout') }}">Logout</a>
 | 
			
		||||
        -
 | 
			
		||||
        {% endif -%}
 | 
			
		||||
        {% else -%}
 | 
			
		||||
        <a href="{{ url_for('logout') }}">Logout</a> -
 | 
			
		||||
        <a href="{{ url_for('write_entry') }}">Write entry</a>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% endif -%}
 | 
			
		||||
    </footer>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,29 +1,29 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% block content -%}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="archive">
 | 
			
		||||
        <h1>User: {{ name }}</h1><br>
 | 
			
		||||
        {% set ns = namespace(last_year="") %}
 | 
			
		||||
        {% for entry in entries %}
 | 
			
		||||
        {% if entry.item.date != ns.last_year %}
 | 
			
		||||
        {% if ns.last_year != "" %}
 | 
			
		||||
        {% set ns = namespace(last_year="") -%}
 | 
			
		||||
        {% for entry in entries -%}
 | 
			
		||||
        {% if entry.item.date != ns.last_year -%}
 | 
			
		||||
        {% if ns.last_year != "" -%}
 | 
			
		||||
        </ul>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% endif -%}
 | 
			
		||||
        <h2> {{ entry.item.date }} </h2>
 | 
			
		||||
        <ul>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% set ns.last_year = entry.item.date %}
 | 
			
		||||
        {% endif -%}
 | 
			
		||||
        {% set ns.last_year = entry.item.date -%}
 | 
			
		||||
            <li>
 | 
			
		||||
                {{ entry.item.name }}
 | 
			
		||||
                <a href="{{ url_for('entry', ident=entry.id) }}">
 | 
			
		||||
                    {{ r_to_star(entry.rating) }} by {{ entry.user.name }}
 | 
			
		||||
                </a>
 | 
			
		||||
            </li><br>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
        {% autoescape off %}
 | 
			
		||||
        {% endfor -%}
 | 
			
		||||
        {% autoescape off -%}
 | 
			
		||||
        {{ content_string }}
 | 
			
		||||
        {% endautoescape %}
 | 
			
		||||
        {% endautoescape -%}
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,6 @@
 | 
			
		||||
{% extends "template.html" %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% extends "template.html" -%}
 | 
			
		||||
 | 
			
		||||
{% block content -%}
 | 
			
		||||
<div class="container">
 | 
			
		||||
    <div class="writing">
 | 
			
		||||
        <h1>Write Critique</h1>
 | 
			
		||||
@@ -10,39 +9,39 @@
 | 
			
		||||
            <p>
 | 
			
		||||
                {{ form.name.label }}<br>
 | 
			
		||||
                {{ form.name(size=64) }}
 | 
			
		||||
                {% for error in form.name.errors %}
 | 
			
		||||
                {% for error in form.name.errors -%}
 | 
			
		||||
                <span style="color: red;">[{{ error }}]</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% endfor -%}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>
 | 
			
		||||
                {{ form.date.label }}<br>
 | 
			
		||||
                {{ form.date }}
 | 
			
		||||
                {% for error in form.date.errors %}
 | 
			
		||||
                {% for error in form.date.errors -%}
 | 
			
		||||
                <span style="color: red;">[{{ error }}]</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% endfor -%}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>
 | 
			
		||||
 | 
			
		||||
                {{ form.text.label }}<br>
 | 
			
		||||
                {{ form.text }}
 | 
			
		||||
                {% for error in form.text.errors %}
 | 
			
		||||
                {% for error in form.text.errors -%}
 | 
			
		||||
                <span style="color: red;">[{{ error }}]</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% endfor -%}
 | 
			
		||||
                {{ ckeditor.load() }}
 | 
			
		||||
                {{ ckeditor.config(name="text") }}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>
 | 
			
		||||
                {{ form.rating.label }}<br>
 | 
			
		||||
                {{ form.rating }}
 | 
			
		||||
                {% for error in form.rating.errors %}
 | 
			
		||||
                {% for error in form.rating.errors -%}
 | 
			
		||||
                <span style="color: red;">[{{ error }}]</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% endfor -%}
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>{{ form.submit() }}</p>
 | 
			
		||||
            {% for mesg in get_flashed_messages() %}
 | 
			
		||||
            {% for mesg in get_flashed_messages() -%}
 | 
			
		||||
            <p>{{ mesg }}</p>
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
            {% endfor -%}
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock -%}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user