Source

moin-2.0 / MoinMoin / templates / index.html

{% extends theme("layout.html") %}
{% import "forms.html" as forms with context %}

{% if item_name %}
    {% set title = _("Index of subitems of '%(item_name)s'", item_name=item_name) %}
{% else %}
    {% set title = _("Global Index") %}
{% endif %}

{% block head_scripts %}
{{ super() }}
    <script src="{{ url_for('frontend.template', filename='index_action.js') }}"></script>
{% endblock %}

{% block action_bars_inner %}
    <ul>
        {% if index %}
        <li class="action-bar">
        <div class="moin-select-all">
            <span class="moin-select-allitem allitem-toselect" title="{{ _("Select All") }}">{{ _("Select All") }}</span>
        </div>
        </li>
        {% endif %}
        <li class="action-bar">
        <div class="moin-select-actions">
            <div>
                <span class="show-action">Actions</span>
            </div>
            <ul>
                <li id="moin-create-newitem">{{ _("New item") }}</li>
                {% if index %}
                <li id="moin-download-trigger">{{ _("Download") }}</li>
                <li class="moin-action-tab"
                    id="moin-delete-trigger"
                    data-actionurl="{{ url_for('frontend.ajaxdelete', item_name=item_name) }}">
                    {{ _("Delete") }}
                </li>
                <li class="moin-action-tab"
                    id="moin-destroy-trigger"
                    data-actionurl="{{ url_for('frontend.ajaxdestroy', item_name=item_name) }}">
                    {{ _("Destroy") }}
                </li>
                {% endif %}
            </ul>
        </div>
        </li>
        <li class="action-bar">
        <div class="moin-contenttypes-wrapper">
            <div class="ct-hide">{{ _("Filter by content type") }}</div>
            {% set unknown_items_label = _("items having unknown mime types") %}
            {{ gen.form.open(form, method="get", action=url_for('frontend.index', item_name=item_name)) }}
            <ul>
                <li>
                    <a href="#" class="filter-toggle">&raquo; {{ _("Toggle") }}</a>
                    <a href="#" class="filter-more">&raquo; {{ _("More") }}</a>
                </li>
                {{ forms.render(form['contenttype']) }}
            </ul>
            {{ forms.render(form['submit']) }}
            {{ gen.form.close() }}
        </div>
        </li>
    </ul>
{% endblock %}

{% block action_bars %}
    <div class="moin-align-right">
        {{ self.action_bars_inner() }}
    </div>
{% endblock %}

{% macro render_entry(e) %}
    {% set maxchars = 20 %}
    <div>
        <span class="moin-select-item">&nbsp;</span>
        {% set mimetype = "application/x.moin.download" %}
        <a href="{{ url_for('.download_item', item_name=e.meta['name'], mimetype=mimetype) }}" class="moin-download-link">
        </a>
        <a href="{{ url_for('.show_item', item_name=e.meta['name']) }}"
           {# TODO .moin-itemtype-* classes are not styled yet #}
           class="{{ e.meta['contenttype']|contenttype_to_class }} moin-itemtype-{{ e.meta['itemtype'] }} moin-item"
           title="{{ e.relname }}">
           {{ e.relname|truncate(maxchars, true, '..') }}
        </a>
        {% if e.hassubitems %}
            <a href="{{ url_for('frontend.index', item_name=e.meta['name']) }}"
               title="{{ _("More") }}"
               class="moin-more-index">&nbsp;
        </a>
        {% endif %}
    </div>
{% endmacro %}

{% block content %}
    <div class="moin-index-message"><span></span></div>
    {{ self.action_bars() }}
    <div>
    {% if item_name: %}
        <h1>{{ title }}</h1>
        <div class="moin-index-path">
            <a href="{{ url_for('frontend.index') }}" title="{{ _("Global Index") }}">{{ ("..") }}</a>
            <span class="moin-path-separator">{{ ("/") }}</span>
            {% for i in range(0, item_names|count) %}
                {% set fullname = item_names[:i+1]|join('/') %}
                {% set relname = item_names[i] %}
                <a href="{{ url_for('frontend.index', item_name=fullname) }}" title="{{ relname }}">{{ relname }}</a>
                <span class="moin-path-separator">{{ ("/") }}</span>
            {% endfor %}
        </div>
    {% else %}
        <h1>{{ title }}</h1>
    {% endif %}
    </div>
    <div class='moin-clr'></div>
    <div id="moin-new-index" class="moin-item-index">
        <h3 style="display: none;">{{ _("Recently uploaded items") }}</h3>
        <div class="file_download_template" style="display: none;">
            <a></a>
        </div>
    </div>
    <div class="moin-index-separator"></div>
    {% if files or dirs %}
    <div id="moin-initials">
        {% if not startswith %}
            <a class="selected" href="{{ url_for('frontend.index', item_name=item_name) }}">{{ _("All") }}</a>
        {% else %}
            <a href="{{ url_for('frontend.index', item_name=item_name) }}">{{ _("All") }}</a>
        {% endif %}
        {% for initial in initials %}
            {% if startswith == initial %}
                <a class="selected" href="{{ url_for('frontend.index', item_name=item_name, startswith=initial) }}">{{ initial }}</a>
            {% else %}
                <a href="{{ url_for('frontend.index', item_name=item_name, startswith=initial) }}">{{ initial }}</a>
            {% endif %}
        {% endfor %}
    </div>
    {% if dirs %}
        <div class="moin-item-index">
            <p>{{ _("These items have subitems that match your filter:") }}</p>
            {% for e in dirs %}
                {{ render_entry(e) }}
            {% endfor %}
        </div>
        <div class="moin-clr"></div>
        <hr />
    {% endif %}
    {% if files %}
        <div class="moin-item-index">
            {% for e in files %}
                {{ render_entry(e) }}
            {% endfor %}
        </div>
        <div class="moin-clr"></div>
    {% endif %}
    {% endif %}
    <div id="popup">
        <div id="popup-for-action" class="popup-container">
            <div class="popup-header">
                <input type="button" class="popup-closer popup-cancel" value="{{ _("X") }}" title="{{ _("Close") }}"/>
                <span>{{ _("Please provide comment for this action") }}</span>
            </div>
            <div class="popup-body">
                <input type="text" class="popup-comment" placeholder="{{ _("Enter your comment") }}"/>
                <input type="hidden" class="popup-action" value=""/>
                <br/>
                <input type="button" class="popup-submit" value="{{ _("Submit") }}"/>
                <input type="button" class="popup-cancel" value="{{ _("Cancel") }}"/>
            </div>
        </div>
        <div id="popup-for-newitem" class="popup-container">
            <div class="popup-header">
                <input type="button" class="popup-closer popup-cancel" value="{{ _("X") }}" title="{{ _("Close") }}"/>
                <span>{{ _("Create new item") }}</span>
            </div>
            <div class="popup-body">
                <form action={{ url_for('.ajaxmodify') }} method="post">
                    <label for="moin-newitem">{{ _("Item name") }}</label>
                    {% if item_name %}
                        <input type="text" id="moin-newitem" name="newitem" placeholder="{{ _("Enter item name here") }}" value="{{ item_name }}/" required="required"/>
                    {% else %}
                        <input type="text" id="moin-newitem" name="newitem" placeholder="{{ _("Enter item name here") }}" required="required"/>
                    {% endif %}
                    <br/>
                    <input type="submit" value="{{ _("Create") }}"/>
                    <input type="button" class="popup-cancel" value="{{ _("Cancel") }}"/>
                </form>
            </div>
        </div>
    </div>

    <div id="moin-upload-cont">
    {% set submit_url = url_for('.jfu_server', item_name=item_name) %}
    {{ forms.render_file_uploader(submit_url) }}
    </div>
    <span class="moin-drag">{{ _("(Drag and drop multiple files to this white area to upload them.)") }}</span>
    <script src="{{ url_for('static', filename='js/jfu.js') }}"></script>
    <div id="lightbox">&nbsp;</div>
{% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.