review/templates/changeset.html @ 9030dc9517cf

web: add basic tests

This patch adds a new test module `test_web` to automate testing of web
requests. For now the tests are rather simple and only check for
expected status codes.

To set up the flask app within the tests, it has to be configured
properly. This is the reason why the app configuration part in `web.py`
has been moved into an own function - now it may also be used by the
test module.
author Oben Sonne <obensonne@googlemail.com>
date Mon, 02 Jul 2012 22:32:48 +0200
parents e62677ebd73d
children 5bef954cfecd
{% extends "base.html" %}

{% block id %}changeset{% endblock %}
{% block title %}Changeset {{ rev.rev() }} - {% endblock %}

{% block navigation %}
    <div class="navigation group">
        <div class="left">
            {% if newer != None %}
                <a class="newer" href="/changeset/{{ utils['node_short'](newer.node()) }}/">&lArr; Newer Changeset ({{ newer.rev() }})</a>
            {% endif %}
        </div>
        <div class="middle">
            <a class="up" href="/{{ rev.rev() + 7 }}/">Back to Index &uarr;</a>
        </div>
        <div class="right">
            {% if older != None %}
                <a class="older" href="/changeset/{{ utils['node_short'](older.node()) }}/">Older Changeset ({{ older.rev() }}) &rArr;</a>
            {% endif %}
        </div>
    </div>
{% endblock %}


{% block content %}
    <div class="group head">
        <div class="committer-avatar" style="background: transparent url('{{ utils['cset_gravatar'](rev, 60) }}') top left no-repeat">&nbsp;</div>
        <div class="patch"><a href="/changeset/{{ utils['node_short'](rev.node()) }}/patch/">Download Patch &darr;</a></div>

        <h2>
            {{ rev.rev() }}:
            <span class="desc">{{ rev.description().splitlines()[0] }}</span>
            <span class="by">by</span>
            <a href="mailto:{{ utils['email'](rev.user()) }}">{{ utils['person'](rev.user()) }}</a>
        </h2>

        <div class="fulldesc">{{ rev.description() }}</div>
    </div>

    {% with %}
        {% set comments = rcset.review_level_comments() %}

        {% if comments %}
            <div class="review-level-comments item-listing">
                {% for comment in comments %}
                    {% include "pieces/comment.html" %}
                {% endfor %}
            </div>
        {% else %}
            <p class="placeholder">No changeset-level comments yet&hellip;</p>
        {% endif %}
    {% endwith %}

    {% if not read_only or allow_anon %}
        {% include "pieces/forms/review-comment.html" %}
    {% endif %}

    <h2>Signoffs</h2>

    {% with %}
        {% set signoffs = rcset.signoffs %}

        {% if signoffs %}
            <div class="signoffs item-listing">
                {% for signoff in signoffs %}
                    {% include "pieces/signoff.html" %}
                {% endfor %}
            </div>
        {% else %}
            <p class="placeholder">No signoffs yet&hellip;</p>
        {% endif %}
    {% endwith %}

    {% if not read_only %}
        {% include "pieces/forms/signoff.html" %}
    {% endif %}

    <h2>Files</h2>

    {% for ufilename, filename in rcset.unicode_files() %}
        {% set comments = rcset.file_level_comments(filename) %}
        {% set commentcount = utils['len'](comments) + utils['len'](rcset.line_level_comments(filename)) %}

        <div class="file">
            <div class="filename group">
                <span class="filename-b64 disabled">{{ utils['b64'](filename) }}</span>
                <h3>
                    <a class="fold" href="#"><span class="filename-u">{{ ufilename }}</span>{% if commentcount %} ({{ commentcount }} comment{% if commentcount != 1 %}s{% endif %}){% endif %}</a>
                    <span class="status">&darr;</span>
                </h3>
            </div>

            <div class="file-review-contents">
                {% if comments %}
                    <div class="comments item-listing">
                        {% for comment in comments %}
                            {% include "pieces/comment.html" %}
                        {% endfor %}
                    </div>
                {% endif %}

                {% if not read_only or allow_anon %}
                    {% set index = loop.index %}
                    {% include "pieces/forms/file-comment.html" %}
                {% endif %}

                {% include "pieces/diff.html" %}
            </div>
        </div>
    {% endfor %}
{% endblock %}