Commit 3e259d19 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Cosmétique

parent 73608050
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@
 * @var \UnicaenAuthToken\Entity\Db\AbstractUserToken $userToken
 * @var \UnicaenAuthToken\Form\UserTokenForm $form
 * @var \Application\View\Renderer\PhpRenderer $this
 *
 * @see \UnicaenAuthToken\Controller\TokenController::creerAction()
 * @see \UnicaenAuthToken\Controller\TokenController::modifierAction()
 */

use Zend\Form\Element\Text;
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
/**
 * @var \UnicaenAuthToken\Entity\Db\AbstractUserToken[] $paginator
 * @var \Application\View\Renderer\PhpRenderer $this
 *
 * @see \UnicaenAuthToken\Controller\TokenController::indexAction()
 */

$this->headTitle($this->translate("Jetons utilisateur"));
+4 −2
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ use UnicaenAuthToken\Entity\Db\AbstractUserToken;

/**
 * @var AbstractUserToken $userToken
 *
 * @see \UnicaenAuthToken\Controller\TokenController::envoyerAction()
 */

?>
@@ -28,6 +30,6 @@ use UnicaenAuthToken\Entity\Db\AbstractUserToken;
    <em>Votre attention, svp :</em>
</p>
<ul>
    <li>ce jeton d'authentification est strictement personnel et doit rester confidentiel ;</li>
    <li>ce jeton expirera le <?php echo $userToken->getExpiredOnToString() ?>.</li>
    <li><em>ce jeton d'authentification est personnel et doit rester strictement confidentiel ;</em></li>
    <li><em>ce jeton expirera le <?php echo $userToken->getExpiredOnToString() ?>.</em></li>
</ul>
+14 −48
Original line number Diff line number Diff line
@@ -12,49 +12,28 @@ use UnicaenAuthToken\Privilege\TokenPrivilege;
    <thead>
    <tr>
        <th>
            <span href="<?php echo $s = $this->sortable('userId'); ?>"
               title="<?php echo $this->translate("Utilisateur propriétaire du jeton"); ?>">
            <?php echo $this->translate("Utilisateur"); ?>
            </span> <?php echo $s->icon() ?>
        </th>
        <th>
            <span href="<?php echo $s = $this->sortable('actionsCount'); ?>"
               title="<?php echo $this->translate("Nombre d'utilisations"); ?>">
            <?php echo $this->translate("Utilisé"); ?>
            </span> <?php echo $s->icon() ?>
        </th>
        <th>
            <span href="<?php echo $s = $this->sortable('lastUsedOn'); ?>"
               title="<?php echo $this->translate("Date de dernière utilisation du jeton"); ?>">
            <?php echo $this->translate("Utilisé le"); ?>
            </span> <?php echo $s->icon() ?>
        </th>
        <th>
            <span href="<?php echo $s = $this->sortable('actionsMaxCount'); ?>"
               title="<?php echo $this->translate("Nombre d'utilisations maximum autorisé"); ?>">
            <?php echo $this->translate("Nb utilis. max"); ?>
            </span> <?php echo $s->icon() ?>
        </th>
        <th>
            <span href="<?php echo $s = $this->sortable('expiredOn'); ?>"
               title="<?php echo $this->translate("Date d'expiration du jeton"); ?>">
            <?php echo $this->translate("Expire le"); ?>
            </span> <?php echo $s->icon() ?>
        </th>
        <th>
            <span href="<?php echo $s = $this->sortable('createdOn'); ?>"
               title="<?php echo $this->translate("Date de création du jeton"); ?>">
            <?php echo $this->translate("Créé le"); ?>
            </span> <?php echo $s->icon() ?>
        </th>
        <th>
            <span href="<?php echo $s = $this->sortable('sentOn'); ?>"
                  title="<?php echo $this->translate("Date d'envoi du jeton"); ?>">
            <?php echo $this->translate("Envoyé le"); ?>
            </span> <?php echo $s->icon() ?>
        </th>
        <th>
            Lien de connexion
            <?php echo $this->translate("Lien de connexion"); ?>
        </th>
        <th>

@@ -92,6 +71,7 @@ use UnicaenAuthToken\Privilege\TokenPrivilege;
                <?php if ($prolongeable): ?>
                    <p>
                        <a href="<?php echo $this->url('unicaen-auth-token/token/prolonger', ['userToken' => $userToken->getId()], ['query' => ['redirect' => $redirect]]) ?>"
                           class="btn btn-default btn-xs"
                           title="Prolonger ce jeton utilisateur de <?php echo $userToken->getDefaultProlongationSpecToString() ?> ?"
                           data-toggle="confirmation">Prolonger</span></a>
                    </p>
@@ -110,8 +90,9 @@ use UnicaenAuthToken\Privilege\TokenPrivilege;
                <?php if ($envoyable): ?>
                    <p>
                        <a href="<?php echo $this->url('unicaen-auth-token/token/envoyer', ['userToken' => $userToken->getId()], ['query' => ['redirect' => $redirect]]) ?>"
                           title="Envoyer <?php echo $userToken->getSentOn() ? 'À NOUVEAU' : '' ?> ce jeton à <?php echo $userToken->getUserToString() ?> (<?php echo $emailUtilisateur ?>) ?"
                           data-toggle="confirmation">Envoyer</span></a>
                           class="btn btn-default btn-xs"
                           title="Envoyer <?php echo $userToken->getSentOn() ? 'à nouveau' : '' ?> ce jeton à <?php echo $emailUtilisateur ?> ?"
                           data-toggle="confirmation">Envoyer <?php echo $userToken->getSentOn() ? 'à nouveau' : '' ?></span></a>
                    </p>
                <?php endif ?>
            </td>
@@ -121,10 +102,12 @@ use UnicaenAuthToken\Privilege\TokenPrivilege;
            <td>
                <?php if ($modifiable): ?>
                    <a href="<?php echo $this->url('unicaen-auth-token/token/modifier', ['userToken' => $userToken->getId()], ['query' => ['redirect' => $redirect]]) ?>"
                       class="btn btn-default btn-xs"
                       title="Modifier ce jeton utilisateur ?"><span class="glyphicon glyphicon-pencil"></span></a>
                <?php endif ?>
                <?php if ($supprimable): ?>
                    <a href="<?php echo $this->url('unicaen-auth-token/token/supprimer', ['userToken' => $userToken->getId()], ['query' => ['redirect' => $redirect]]) ?>"
                       class="btn btn-default btn-xs"
                       title="Supprimer ce jeton utilisateur ?"
                       data-toggle="confirmation"><span class="glyphicon glyphicon-trash text-danger"></span></a>
                <?php endif ?>
@@ -143,22 +126,5 @@ use UnicaenAuthToken\Privilege\TokenPrivilege;
            btnOkLabel: "Oui",
            btnCancelLabel: "Non",
        });

        installClipboardCopyOn('.btn-copy-to-clipboard');
    });

    function installClipboardCopyOn(selector) {
        try {
            var clipboard = new ClipboardJS(selector);
            clipboard.on('success', function (e) {
                // console.info('Action:', e.action);
                // console.info('Text:', e.text);
                // console.info('Trigger:', e.trigger);
                // e.clearSelection();
                $(e.trigger).tooltip({title: "Lien copié !"}).tooltip('show');
    });
        } catch (e) {
            $(selector).hide();
        }
    }
</script>