<%namespace name="comment_tiles" file="/comment/tiles.html"/>

<%def name="row(tile, revision)">
    <div class="tile revision history">
        <div class="index">${revision.index}</div>
        ${h.user.link(revision.user, scope=revision.comment.topic)|n}
        · ${_("created %s") % h.datetime_tag(revision.create_time)|n}

        <div class="meta">
            &nbsp;

            %if can.comment.revert(revision.comment) and not revision.is_latest:
            <span> <a href="${h.entity_url(revision.comment, member='revert')}?${h.url_token()}&amp;to=${revision.id}">(${_("revert here")})</a></span>
            %endif
            ## only allow this to global admins as this deletes comment revisions from the database permanently
            %if h.has_permission('global.admin') and not revision.is_only:
            <span> <a href="${h.entity_url(revision.comment, member='purge_history')}?${h.url_token()}&amp;rev=${revision.id}">(${_("delete version permanently")})</a></span>
            %endif
        </div>
        <div style="clear: both;"></div>
    </div>

    <div class="headrev">
        %if revision.is_latest:
            <div class="hide_edit">
        %endif
            <div class="text">
                ${diff.comment_revisions_compare(revision, revision.previous)|n}
            </div>
    </div>
</%def>
