header
    h1.title(translate="WIKI.NAVIGATION.SECTION_NAME")

ul.wiki-link-container
    li.wiki-link.fixed-link
        a.link-title(
            href=""
            tg-nav="project-wiki:project=project.slug"
            translate="WIKI.NAVIGATION.HOME"
        )

ul.sortable.wiki-link-container
    li.wiki-link.e2e-wiki-page-link(
        ng-repeat="link in wikiLinks"
        data-id!="{{ $index }}"
        tg-bind-scope
        tg-class-permission="{'is-sortable': 'add_wiki_link'}"
    )
        <% if (addWikiLinkPermission) { %>
        tg-svg.dragger(svg-icon="icon-drag")
        <% } %>
        a.link-title(title!="{{ link.title }}", href!="{{ link.url }}") {{ link.title }}

        <% if (deleteWikiLinkPermission) { %>
        a.js-delete-link.remove-wiki-page(title!="{{'WIKI.DELETE_LINK_TITLE' | translate}}")
            tg-svg(svg-icon="icon-trash")
        <% } %>

        input.hidden(
            type="text"
            placeholder="{{'COMMON.FIELDS.NAME' | translate}}"
            value!="{{ link.title }}"
        )

ul.sortable.wiki-link-container
    li.new.hidden
        input(
            type="text"
            placeholder="{{'COMMON.FIELDS.NAME' | translate}}"
        )

<% if (addWikiLinkPermission) { %>
a.add-button(
    href=""
    title="{{'WIKI.NAVIGATION.ACTION_ADD_LINK' | translate}}"
)
    tg-svg(svg-icon="icon-add")
    span(translate="WIKI.NAVIGATION.ACTION_ADD_LINK")
<% } %>

ul.wiki-link-container.wiki-all-links(ng-if="wikiLinks.length")
    li.wiki-link.fixed-link
        a.link-title(
            href=""
            tg-nav="project-wiki-list:project=project.slug"
            translate="WIKI.NAVIGATION.ALL_PAGES"
        )
