commentlist.tpl 7 KB
Newer Older
Aaron Wells's avatar
Aaron Wells committed
1
<!-- The "feedbacktable" class is used as an identifier by Javascript -->
2
<div class="list-group list-group-lite">
Naomi Guyer's avatar
Naomi Guyer committed
3
{foreach from=$data item=item}
4
    <div id="comment{$item->id}" class="comment-item list-group-item {if $item->pubmessage}list-group-item-private{elseif $item->deletedmessage}deleted {/if} {cycle name=rows values='r0,r1'} {if $item->indent} indent-{$item->indent}{/if} {if !$item->deletedmessage && $item->attachments}has-attachment{/if}">
5
        <div class="usericon-heading">
6
            <span class="user-icon user-icon-30 float-left" role="presentation" aria-hidden="true">
7
                {if $item->author && !$item->author->deleted}
8
                    <img src="{profile_icon_url user=$item->author maxheight=30 maxwidth=30}" valign="middle" alt="{str tag=profileimagetext arg1=$item->author|display_default_name}"/>
9
                {else}
10
                    <img src="{profile_icon_url user=null maxheight=30 maxwidth=30}" valign="middle" alt="{str tag=profileimagetextanonymous}"/>
11 12
                {/if}
            </span>
Liam's avatar
Liam committed
13
            <h5 class="float-left list-group-item-heading">
14
                {if $item->author && !$item->author->deleted}
15
                <a href="{$item->author->profileurl}">
16
                <span>{$item->author|display_name}</span>
17
                </a>
18 19
                {elseif $item->author && $item->author->deleted}
                <span>{$item->author|full_name}</span>
20 21
                {else}
                <span>{$item->authorname}</span>
22 23 24 25 26 27
                {/if}
                <br />

                <span class="postedon text-small">
                {$item->date}
                {if $item->updated}
28
                    <p class="metadata">[{str tag=Updated}: {$item->updated}]</p>
29
                {/if}
30
                </span>
31 32
                {if $item->ratingdata}

33
                <span class="star-comment-rating">
34
                    {for i $item->ratingdata->min_rating $item->ratingdata->max_rating}
35 36 37
                        <div class="star-rating star-rating-readonly">
                            <a class="icon icon-{$star} {if $i <= $item->ratingdata->value}icon-solid{else}icon-regular{/if}" {if $colour}style="color: {$colour}"{/if}>&nbsp;</a>
                        </div>
38 39 40 41
                    {/for}
                </span>
                {/if}
            </h5>
Aaron Wells's avatar
Aaron Wells committed
42 43
            <!-- The "comment-item-buttons" class is used as an identifier by Javascript -->
            <div class="btn-group btn-group-top comment-item-buttons">
44 45
                {if !$onview}
                    {if $item->canedit}
Liam's avatar
Liam committed
46
                    <a href="{$WWWROOT}artefact/comment/edit.php?id={$item->id}&amp;view={$viewid}" class="btn btn-secondary btn-group-item form-as-button float-left">
47
                        <span class="icon icon-pencil-alt icon-lg" role="presentation" aria-hidden="true"></span>
48
                        <span class="sr-only">{str tag=edit}</span>
49 50
                    </a>
                    {/if}
51
                {/if}
52 53 54
                {if $item->deleteform}
                    {$item->deleteform|safe}
                {/if}
Aaron Wells's avatar
Aaron Wells committed
55
                {if $item->canreply}
56
                <button class="btn btn-secondary float-left commentreplyto btn-group-item js-reply" id="commentreplyto{$item->id}" title="{str tag=reply section=artefact.comment}" data-replyto="{$item->id}" data-canprivatereply="{$item->canprivatereply}" data-canpublicreply="{$item->canpublicreply}" {if $blockid}data-blockid="{$blockid}"{/if}>
57
                    <span class="icon icon-reply icon-lg" role="presentation" aria-hidden="true"></span>
58 59
                    <span class="sr-only">{str tag=reply section=artefact.comment}</span>
                </button>
Aaron Wells's avatar
Aaron Wells committed
60
                {/if}
Pat Kira's avatar
Pat Kira committed
61
            </div>
62 63
        </div>
        <div class="comment-text">
Pat Kira's avatar
Pat Kira committed
64 65 66 67 68 69
            <div class="comment-content">
                {if $item->deletedmessage}
                    <span class="metadata">
                        {$item->deletedmessage}
                    </span>
                {else}
70 71 72 73 74
                    {if $item->author}
                        {$item->description|safe|clean_html}
                    {else}
                        {$item->description|safe}
                    {/if}
Pat Kira's avatar
Pat Kira committed
75 76
                {/if}
            </div>
77

Pat Kira's avatar
Pat Kira committed
78 79 80 81 82 83
            {if $item->makepublicform || ($item->makepublicrequested && !$item->deletedmessage)}
            <div class="metadata">
                {if $item->pubmessage}
                <em class="privatemessage"> {$item->pubmessage}
                </em> -
                {/if}
84

Pat Kira's avatar
Pat Kira committed
85 86 87
                {if $item->makepublicform}
                    {$item->makepublicform|safe}
                {/if}
88

Pat Kira's avatar
Pat Kira committed
89
                {if $item->makepublicrequested && !$item->deletedmessage}
90
                    <span class="icon icon-lock text-default left" role="presentation" aria-hidden="true"></span>
Pat Kira's avatar
Pat Kira committed
91 92 93
                    <span>{str tag=youhaverequestedpublic section=artefact.comment}</span>
                {/if}
            </div>
Naomi Guyer's avatar
Naomi Guyer committed
94 95
            {/if}
        </div>
96

97
        {if !$item->deletedmessage && $item->attachments}
Pat Kira's avatar
Pat Kira committed
98
        <div class="comment-attachment">
99 100
            <div class="card has-attachment collapsible">
                <h4 class="card-header">
101
                    <a class="collapsible collapsed" aria-expanded="false" href="#attachments_{$item->id}" data-toggle="collapse">
102
                        <span class="icon left icon-paperclip" role="presentation" aria-hidden="true"></span>
Pat Kira's avatar
Pat Kira committed
103
                        <span class="text-small">{str tag=Attachments section=artefact.comment} ({$item->filescount})</span>
Liam's avatar
Liam committed
104
                        <span class="icon icon-chevron-down float-right collapse-indicator" role="presentation" aria-hidden="true"></span>
105
                    </a>
Pat Kira's avatar
Pat Kira committed
106
                </h4>
107
                <div id="attachments_{$item->id}" class="collapse" aria-expanded="false">
108
                    <ul class=" list-group list-group-unbordered">
Pat Kira's avatar
Pat Kira committed
109 110 111 112 113 114 115 116
                    {strip}
                        {foreach $item->attachments item=a name=attachments}
                        <li class="list-group-item">
                            <a href="{$WWWROOT}artefact/file/download.php?file={$a->attachid}&comment={$item->id}&view={$viewid}" class="outer-link icon-on-hover">
                                <span class="sr-only">{$a->attachtitle}</span>
                            </a>
                            <span class="title">
                                {$a->attachtitle}
117 118
                                <span class="attachsize metadata">
                                    [{$a->attachsize}]
Pat Kira's avatar
Pat Kira committed
119
                                </span>
120
                            </span>
Liam's avatar
Liam committed
121
                            <span class="icon icon-download icon-lg float-right text-watermark icon-action" role="presentation" aria-hidden="true"></span>
Pat Kira's avatar
Pat Kira committed
122 123 124 125 126
                        </li>
                        {/foreach}
                    {/strip}
                    </ul>
                </div>
127
            </div>
Pat Kira's avatar
Pat Kira committed
128 129 130
            {if $item->attachmessage}
                <em class="attachmessage metadata">{$item->attachmessage}</em>
            {/if}
131
        </div>
Naomi Guyer's avatar
Naomi Guyer committed
132
        {/if}
133
    </div>
Naomi Guyer's avatar
Naomi Guyer committed
134
{/foreach}
135
</div>