aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/feedback/_entry.php
blob: d3ae6a3957b0793ed261883353b58912af823e2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
48
49
50
51
52
53
<article class="studip feedback-entry" data-id="<?= $entry->id ?>">
    <header>
        <h1>
            <? if (!$entry->anonymous): ?>
            <a href="<?= URLHelper::getLink('dispatch.php/profile?username=' . $entry->user->username) ?>">
                <?= Avatar::getAvatar($entry->user_id)->getImageTag(Avatar::SMALL) ?>
                <?= htmlReady($entry->user->getFullName()) ?>
            </a>
            <? else: ?>
                <?= Avatar::getNobody()->getImageTag(Avatar::SMALL) ?>
                <?= _('Anonym') ?>
            <? endif; ?>
        </h1>
        <nav>
            <? if ($entry->isEditable()) : ?>
            <a href="<?= $controller->link_for('course/feedback/entry_edit_form/' . $entry->id) ?>"
                title="<?= _('Bearbeiten') ?>" data-dialog="size=auto"
                class="feedback-entry-edit" >
                <?= Icon::create('edit'); ?>
            </a>
            <? endif; ?>
            <? if ($entry->isDeletable()) : ?>
            <a href="<?= $controller->link_for('course/feedback/entry_delete/' . $entry->id) ?>"
                title="<?= _('Löschen') ?>" data-dialog="size=auto"
                data-confirm="<?= _('Feedback löschen?') ?>"
                class="feedback-entry-delete"
                onclick="return STUDIP.Dialog.confirmAsPost($(this).attr('data-confirm'), this.href);">
                <?= Icon::create('trash'); ?>
            </a>
            <? endif; ?>
        </nav>
    </header>
    <? if ($entry->feedback->mode != FeedbackElement::MODE_NO_RATING) : ?>
        <div class="rating">
            <span title="<?= $entry->rating ?>">
                <? for ($i=0; $i < $entry->feedback->getMaxRating(); $i++) : ?>
                    <?= ($i >= $entry->rating) ? Icon::create('star-empty', 'info') : Icon::create('star', 'info') ?>
                <? endfor; ?>
            </span>
        </div>
    <? endif; ?>
    <div class="comment">
        <?= htmlReady($entry->comment) ?>
    </div>
    <div class="date">
        <span title="<?= strftime('%x %X', $entry->chdate) ?>">
                <? if ($entry->chdate != $entry->mkdate) : ?>
                <?= _('Bearbeitet') ?>:
                <? endif; ?>
                <?= $entry->chdate ? reltime($entry->chdate) : "" ?>
        </span>
    </div>
</article>