<commit_before><?php

use Sil\DevPortal\models\Key;

/* @var $this \Sil\DevPortal\controllers\KeyController */
/* @var $actionLinks \ActionLink[] */
/* @var $key Key */
/* @var $currentUser \Sil\DevPortal\models\User */

// Set up the breadcrumbs.
$this->breadcrumbs += array(
    'Keys' => array('/key/'),
    'Key Details',
);

$this->pageTitle = 'Key Details';

?>
<div class="row">
    <div class="span7">
        <?php
        $this->renderPartial('//partials/key-info', array(
            'key' => $key,
            'currentUser' => $currentUser,
        ));
        ?>
    </div>
    <div class="span4">
        <?php
        
        if ($currentUser->canApproveKey($key)) {
            
            // Provide a way for this admin user to grant/deny the request.
            ?>
            <h3>Actions</h3>
            <p>What do you want to do with this key? </p>
            <?php $form = $this->beginWidget('CActiveForm'); ?>
                <dl>
                    <dd>
                        <?= \CHtml::submitButton('Grant a Key', array(
                            'name' => Key::STATUS_APPROVED,
                            'class' => 'btn btn-primary',
                        )); ?>
                    </dd>
                    <dd>
                        <?= \CHtml::submitButton('Deny the Request', array(
                            'name' => Key::STATUS_DENIED,
                            'class' => 'btn btn-danger',
                        )); ?>
                    </dd>
                </dl>
                <?php //echo \CHtml::errorSummary($key); ?>
            <?php
            $this->endWidget();
            
        } else {
            
            // Otherwise, show any (normal) action links.
            echo LinksManager::generateActionsDropdownHtml(
                LinksManager::getKeyDetailsActionLinksForUser($key, $currentUser)
            );
        }

        ?>
    </div>
</div><commit_msg>Make the key details page use the passed-in action links.<commit_after><?php

use Sil\DevPortal\models\Key;

/* @var $this \Sil\DevPortal\controllers\KeyController */
/* @var $actionLinks \ActionLink[] */
/* @var $key Key */
/* @var $currentUser \Sil\DevPortal\models\User */

// Set up the breadcrumbs.
$this->breadcrumbs += array(
    'Keys' => array('/key/'),
    'Key Details',
);

$this->pageTitle = 'Key Details';

?>
<div class="row">
    <div class="span7">
        <?php
        $this->renderPartial('//partials/key-info', array(
            'key' => $key,
            'currentUser' => $currentUser,
        ));
        ?>
    </div>
    <div class="span4">
        <?php
        
        if ($currentUser->canApproveKey($key)) {
            
            // Provide a way for this admin user to grant/deny the request.
            ?>
            <h3>Actions</h3>
            <p>What do you want to do with this key? </p>
            <?php $form = $this->beginWidget('CActiveForm'); ?>
                <dl>
                    <dd>
                        <?= \CHtml::submitButton('Grant a Key', array(
                            'name' => Key::STATUS_APPROVED,
                            'class' => 'btn btn-primary',
                        )); ?>
                    </dd>
                    <dd>
                        <?= \CHtml::submitButton('Deny the Request', array(
                            'name' => Key::STATUS_DENIED,
                            'class' => 'btn btn-danger',
                        )); ?>
                    </dd>
                </dl>
                <?php //echo \CHtml::errorSummary($key); ?>
            <?php
            $this->endWidget();
            
        } else {
            
            // Otherwise, show any (normal) action links.
            echo LinksManager::generateActionsDropdownHtml($actionLinks);
        }

        ?>
    </div>
</div>
{'fraction_non_alphanumeric': 0.15276695245518315, 'fraction_numerical': 0.0020784619381657575, 'mean_word_length': 1.2794552989934873, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '402365', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1061, 'n_words': 230}