<commit_before>{extends designs/site.tpl}

{block title}{$data->OwnerName|escape} &mdash; Keys &mdash; {$dwoo.parent}{/block}

{block content}
    {$Key = $data}

    <header class="page-header">
        <h2 class="header-title">Key: {apiKey $Key}</h2>
        <div class="header-buttons">
            <a class="button" href="/keys/{$Key->Key}/edit">Edit Key</a>
        </div>
    </header>

    <section class="page-section" id="key-endpoints">
        <h3>Permitted Endpoints</h3>

        {if $Key->AllEndpoints}
            <ul>
                <li>This key can access <strong>all endpoints</strong>.</li>
                <li><a href="/keys/{$Key->Key}/edit">Edit this key</a> to restrict access to an explicit list of endpoints here.</li>
            </ul>
        {else}
            <ul>
                {foreach item=Endpoint from=$Key->Endpoints}
                    <li>{endpoint $Endpoint}&nbsp;<a href="/keys/{$Key->Key}/endpoints/{$Endpoint->ID}/remove" class="button destructive tiny">Remove</a></li>
                {foreachelse}
                    <li><em>No endpoints added yet</em></li>
                {/foreach}
                {$unlinkedEndpoints = $Key->getUnlinkedEndpoints()}
                {if count($unlinkedEndpoints)}
                    <li>
                        <form action="/keys/{$Key->Key}/endpoints" method="POST">
                            <select name="EndpointID" class="field-control inline">
                                <option value="">Select endpoint</option>
                                {foreach item=Endpoint from=$unlinkedEndpoints}
                                    <option value="{$Endpoint->ID}">{$Endpoint->Title|escape} v{$Endpoint->Version|escape}</option>
                                {/foreach}
                            </select>
                            <input type="submit" value="Add">
                        </form>
                    </li>
                {/if}
            </ul>
        {/if}<commit_msg>use standard accessors for record title/url<commit_after>{extends designs/site.tpl}

{block title}{$data->OwnerName|escape} &mdash; Keys &mdash; {$dwoo.parent}{/block}

{block content}
    {$Key = $data}

    <header class="page-header">
        <h2 class="header-title">Key: {apiKey $Key}</h2>
        <div class="header-buttons">
            <a class="button" href="{$Key->getUrl('/edit')}">Edit Key</a>
        </div>
    </header>

    <section class="page-section" id="key-endpoints">
        <h3>Permitted Endpoints</h3>

        {if $Key->AllEndpoints}
            <ul>
                <li>This key can access <strong>all endpoints</strong>.</li>
                <li><a href="{$Key->getUrl('/edit')}">Edit this key</a> to restrict access to an explicit list of endpoints here.</li>
            </ul>
        {else}
            <ul>
                {foreach item=Endpoint from=$Key->Endpoints}
                    <li>{endpoint $Endpoint}&nbsp;<a href="{$Key->getUrl('/endpoints')}/{$Endpoint->ID}/remove" class="button destructive tiny">Remove</a></li>
                {foreachelse}
                    <li><em>No endpoints added yet</em></li>
                {/foreach}
                {$unlinkedEndpoints = $Key->getUnlinkedEndpoints()}
                {if count($unlinkedEndpoints)}
                    <li>
                        <form action="{$Key->getUrl('/endpoints')}" method="POST">
                            <select name="EndpointID" class="field-control inline">
                                <option value="">Select endpoint</option>
                                {foreach item=Endpoint from=$unlinkedEndpoints}
                                    <option value="{$Endpoint->ID}">{$Endpoint->getTitle()|escape}</option>
                                {/foreach}
                            </select>
                            <input type="submit" value="Add">
                        </form>
                    </li>
                {/if}
            </ul>
        {/if}
{'fraction_non_alphanumeric': 0.15706412825651303, 'fraction_numerical': 0.002004008016032064, 'mean_word_length': 1.5811247575953458, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 110, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '212711', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1055, 'n_words': 209}