|
- <?php
-
-
-
- use domain\User\User\UserModule;
- use yii\helpers\Html;
-
- $userModule = UserModule::getInstance();
-
- $this->setTitle("Infolettre");
-
- if($userModule->isUserSubscribedNewsletter($user)) {
- $this->addButton(
- [
- 'label' => '<i class="bi bi-x-circle"></i> Me désinscrire',
- 'url' => 'newsletter/unsubscribe',
- 'class' => 'btn btn-secondary'
- ]
- );
- }
- else {
- $this->addButton(
- [
- 'label' => '<i class="bi bi-megaphone"></i> M\'inscrire',
- 'url' => 'newsletter/subscribe',
- 'class' => 'btn btn-primary'
- ]
- );
- }
-
-
- ?>
- <div class="newsletter-index">
- <?php if($userModule->isUserSubscribedNewsletter($user)): ?>
- <div class="alert alert-success">
- <i class="bi bi-megaphone"></i>
- Vous êtes inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>.
- </div>
- <?php else: ?>
- <div class="alert alert-danger">
- <i class="bi bi-x-circle"></i>
- Vous n'êtes pas inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>.
- </div>
- <?php endif; ?>
- </div>
|