{#
    Renders a web page filled with content type choices. These include:
        * Markup items ( MoinMoin, Creole, Markdown, ...)
        * Other text (plain, diff, ...)
        * Images (SVG, PNG, ...)
        * etc

    Displays links to existing items with similar names.
#}

{% extends theme("layout.html") %}
{% block content %}
    <h1>{{ _("Create new item named '{name}'").format(name=item_name) }}</h1>
    <p>
        {{ _("Please select the contenttype of the new {itemtype} item.").format(itemtype=itemtype) }}
    </p>
    <table id="moin-create-table" class="zebra">
        {% for group in group_names %}
            {% if groups[group]|length > 0 %}
                <tr>
                    <th>{{ group }}</th>
                </tr>
                <tr>
                    <td> |&nbsp;
                        {% for e in groups[group] %}
                            <a href="{{ url_for('frontend.modify_item', item_name=fqname, itemtype=itemtype, contenttype=Type(e.content_type, parameters=e.default_contenttype_params)|string) }}">{{ e.display_name }}</a> &nbsp;|&nbsp;
                        {% endfor %}
                    </td>
                </tr>
            {% endif %}
        {% endfor %}
    </table>

    {% if similar_names %}
        <div>
            <p>{{ _("Before creating a new item, review these existing items with similar names:") }}<p>
            <ol>
                {% for name in similar_names %}
                    <li><a href="{{ url_for('frontend.show_item', item_name=name) }}">{{ name }}</a></li>
                {% endfor %}
            </ol>
        </div>
    {% endif %}
{% endblock %}
