validated.php 4.34 KB
Newer Older
Marcello Pivanti's avatar
Marcello Pivanti committed
1
2
3
4
5
6
<?php

/**
 * Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
 * OPEN 2.0
 *
7
8
9
 * @see https://www.open2.0.regione.lombardia.it Developers'community
 * @license GPLv3
 * @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
Marcello Pivanti's avatar
Marcello Pivanti committed
10
 *
waltermazza's avatar
waltermazza committed
11
 * @package    arter\amos\notificationmanager\views\email
Marcello Pivanti's avatar
Marcello Pivanti committed
12
13
14
15
 * @category   CategoryName
 * @author     Elite Division S.r.l.
 */

waltermazza's avatar
waltermazza committed
16
17
18
19
use arter\amos\core\helpers\Html;
use arter\amos\core\interfaces\ModelGrammarInterface;
use arter\amos\cwh\base\ModelContentInterface;
use arter\amos\notificationmanager\AmosNotify;
Marcello Pivanti's avatar
Marcello Pivanti committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

if (!empty($validator)) {
    $this->params['profile'] = $validator;
}

/** @var ModelGrammarInterface $modelGrammar */
$modelGrammar = $model->getGrammar();
$articleSingular = $modelGrammar->getArticleSingular();
$spaceAfterArticleSingular = (substr($articleSingular, -1) == "'" ? '' : ' ');

?>

<div>

    <div style="box-sizing:border-box;color:#000000;">
        <div style="padding:5px 10px;background-color: #F2F2F2;text-align:center;">
            <h1 style="color:#297A38;font-size:1.5em;margin:0;">
                <?= AmosNotify::t('amosnotify', '#validated_email_1') . ' ' . $articleSingular . $spaceAfterArticleSingular . strtolower($modelGrammar->getModelSingularLabel()) ?>
            </h1>
        </div>
    </div>
    <div style="border:1px solid #cccccc;padding:10px;margin-bottom: 10px;background-color: #ffffff;margin-top: 20px;">
        <div>
            <h2 style="font-size:2em;line-height: 1;"><?= Html::a($model->getTitle(), \Yii::$app->urlManager->createAbsoluteUrl($model->getFullViewUrl()), ['style' => 'color: #297A38;']) ?></h2>
        </div>
        <div style="box-sizing:border-box;">
            <div style="box-sizing:border-box;padding:0;font-weight:bold;color:#000000;font-weight: normal;">
                <?php
waltermazza's avatar
waltermazza committed
48
                if (!$model instanceof \arter\amos\admin\models\UserProfile) {
Marcello Pivanti's avatar
Marcello Pivanti committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
                    echo $model->getDescription(false);
                }
                ?>
            </div>
        </div>


        <div style="margin-top:20px; display: flex; padding: 10px;">
            <div
                style="width: 50px; height: 50px; overflow: hidden;-webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%;float: left;">
                <?php
                $layout = '{publisher}';
                if ($model instanceof ModelContentInterface) {
                    $layout = '{publisher}{publishingRules}{targetAdv}';
                }
                ?>
                <?php
                $user = $model->getCreatedUserProfile()->one();
                if(!is_null($user)) {
waltermazza's avatar
waltermazza committed
68
                    echo \arter\amos\admin\widgets\UserCardWidget::widget([
Marcello Pivanti's avatar
Marcello Pivanti committed
69
70
71
72
73
74
75
76
77
                        'model' => $user,
                        'onlyAvatar' => true,
                        'absoluteUrl' => true
                    ]);
                }
                ?>
            </div>

            <div style="margin-left: 20px;">
waltermazza's avatar
waltermazza committed
78
                <?= \arter\amos\core\forms\PublishedByWidget::widget([
Marcello Pivanti's avatar
Marcello Pivanti committed
79
80
81
82
83
84
85
                    'model' => $model,
                    'layout' => $layout,
                ]) ?>

                <div style="margin-top:20px; display: flex; padding: 10px;">
                    <div
                        style="width: 50px; height: 50px; overflow: hidden;-webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%;float: left;">
waltermazza's avatar
waltermazza committed
86
                        <?= \arter\amos\admin\widgets\UserCardWidget::widget([
Marcello Pivanti's avatar
Marcello Pivanti committed
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
                            'model' => $validator,
                            'onlyAvatar' => true,
                            'absoluteUrl' => true
                        ]) ?>
                    </div>

                    <div style="margin: 15px 0 0 20px;">
                        <?= AmosNotify::t('amosnotify', '#validated_by') . ' ' . $validator->nomeCognome ?>
                    </div>
                </div>

            </div>
        </div>

        <?php if(isset($comment)): ?>
            <h1 style="color:#297a38;font-size:1.3em;">
                <?= AmosNotify::t('amosnotify', '#with_comment') ?>
            </h1>
            <div style="box-sizing:border-box;padding:0;font-weight:bold;color:#000000;font-weight:normal">
                <?= $comment ?>
            </div>
        <?php endif; ?>

        <p>
            <?= AmosNotify::t('amosnotify', '#validated_email_footer') ?>
        </p>

    </div>
</div>