aboutsummaryrefslogtreecommitdiff
path: root/app/views/news/_comments.php
blob: d09d109bc14b2eb496ec7296b33b258ad3f7ac9e (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
<? if ($new['allow_comments']): ?>
    <footer>
        <section class="comments">
            <? if (Request::get('comments')): ?>
                <h1>
                    <?= _('Kommentare') ?>
                </h1>

                <? foreach (StudipComment::GetCommentsForObject($new['news_id']) as $index => $comment): ?>
                    <?= $this->render_partial('news/_commentbox', compact('index', 'comment')) ?>
                <? endforeach; ?>
                <? if (!$nobody) : ?>
                    <form action="<?= ContentBoxHelper::href($new->id, ['comments' => 1]) ?>" method="POST" class="default" style="text-align: left;">
                        <?= CSRFProtection::tokenTag() ?>
                        <input type="hidden" name="comsubmit" value="<?= $new['news_id'] ?>">
                        <fieldset>
                            <legend>
                                <?= _('Kommentieren') ?>
                            </legend>
                            <label>
                                <textarea class="wysiwyg" name="comment_content" rows="8"
                                          cols="38" wrap="virtual"
                                          placeholder="<?= _('Geben Sie hier Ihren Kommentar ein!') ?>"></textarea>
                            </label>
                        </fieldset>

                        <footer>
                            <?= Studip\Button::createAccept(_('Absenden')) ?>
                        </footer>
                    </form>
                <? endif ?>
            <? else: ?>
                <a href="<?= ContentBoxHelper::href($new['news_id'], ["comments" => 1]) ?>">
                    <?= sprintf(_('Kommentare lesen (%s) / Kommentar schreiben'), StudipComment::NumCommentsForObject($new['news_id']))
                    ?>
                </a>
            <? endif; ?>
        </section>
    </footer>
<? endif; ?>