view MoinMoin/templates/global_history.html @ 2944:afe523052a7f

rework global history styling for modernized and basic themes, add user and comment fields, partial fix #471
author RogerHaase <haaserd@gmail.com>
date Sun, 10 May 2015 13:51:39 -0700
parents 40fd6fac76f8
children 10423855df46
line wrap: on
line source
{% extends theme("layout.html") %}
{% import "utils.html" as utils %}

{# map meta.action to font awesome classes #}
{% set awesome_class = {
    'REVERT': 'fa fa-undo',
    'SAVE': 'fa fa-save',
    'RENAME': 'fa fa-pencil-square-o',
    'TRASH': 'fa fa-trash-o',
} %}

{% block head %}
    {{ super() }}
    <link rel="alternate" title="Global History" href="{{ url_for('feed.atom') }}" type="application/atom+xml" />
{% endblock %}

{% block content %}
    <h1>{{ _("Global History") }}</h1>
    <div class='moin-clr'></div>
    <div id="moin-global-history">
        {% for day, revs in history %}
           {% set latest_timestamp = revs[0].meta['mtime'] %}
            <div class="moin-history-container">
                <div class="moin-history-container-header">
                    <span class="moin-history-date">{{ day }}</span>
                    {% if user.valid %}
                        <a class="moin-bookmark-link" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
                    {% endif %}
                </div>
                <div class="moin-history-container-body">
                    <table class="zebra">
                        {% for rev in revs|sort(attribute='fqname') %}
                            {% set meta = rev.meta %}
                            <tr>
                                <td class="moin-history-item moin-wordbreak">
                                    <a class="{{ meta.contenttype|contenttype_to_class }}" href="{{ url_for('frontend.show_item', item_name=rev.fqname) }}"
                                            title="{{ meta.contenttype|shorten_ctype }}">
                                        {% if meta.name %}
                                            {{ meta.name|join(' | ') }}
                                        {% elif meta.summary %}
                                            {{ meta.summary }}
                                        {% else %}
                                            {{ rev.fqname|shorten_fqname }}
                                        {% endif %}
                                    </a>
                                </td>
                                <td class="moin-wordbreak moin-history-editorinfo">{{ utils.editor_info(rev.meta) }}</td>
                                <td class="moin-history-time">{{ meta.mtime|time_hh_mm }}</td>
                                <td class="moin-history-action">
                                    <span title="{{ meta.action|title }}" class="{{ awesome_class[meta.action] }}"></span>
                                </td>
                                <td class="moin-history-links">
                                    <a href="{{ url_for('frontend.history', item_name=rev.fqname, bookmark=bookmark_time) }}">
                                        <span class="fa fa-clock-o" title="{{ _('History') }}"></span>
                                    </a>
                                </td>
                                {% if bookmark_time -%}
                                    <td class="moin-history-links">
                                        <a href="{{ url_for('frontend.diff', item_name=rev.fqname, bookmark=bookmark_time) }}">
                                            <span class="fa fa-copy" title="{{ _('Diff') }}"></span>
                                        </a>
                                    </td>
                                {%- endif %}
                                <td class="moin-wordbreak moin-history-comment">{{ rev.meta['comment'] }}</td>
                            </tr>
                        {% endfor %}
                    </table>
                </div>
            </div>
        {% endfor %}
        {% if bookmark_time %}
            <div class="moin-history-container">
                <div class="moin-history-container-header">
                    <span class="moin-history-date">{{ bookmark_time|datetimeformat }}</span>
                    <a class="moin-bookmark-link" href="{{ url_for('frontend.bookmark', time='del') }}">{{ _("Delete bookmark") }}</a>
                </div>
            </div>
        {% endif %}
    </div>
{% endblock %}