openvk/Web/Presenters/templates/Bugtracker/View.xml

126 lines
6.3 KiB
XML
Raw Normal View History

2022-08-20 20:30:04 +03:00
{extends "../@layout.xml"}
{block title}Отчёт #{$bug->getId()}{/block}
{block header}
<a href="/bugtracker">Баг-трекер</a>
» <a href="/bugtracker?product={$bug->getProduct()->getId()}">{$bug->getProduct()->getCanonicalName()}</a>
2022-08-20 20:30:04 +03:00
» Отчёт #{$bug->getId()}
{/block}
{block content}
2022-08-20 23:59:25 +03:00
{if $bug AND !$bug->isDeleted()}
2022-08-22 02:11:48 +03:00
<div n:if="in_array($bug->getRawStatus(), [4, 6]) AND $isModerator" class="user-alert">
Этот отчёт закрыт, и пользователь не может оставлять к нему комментарии. При необходимости Вы можете изменить его статус.
</div>
<div n:if="in_array($bug->getRawStatus(), [4, 6]) AND !$isModerator" class="user-alert">
Этот отчёт закрыт, и Вы больше не можете оставлять к нему комментарии.
</div>
2022-08-20 20:30:04 +03:00
<h4>{$bug->getCanonicalName()}</h4>
<div class="avatar-list-item" style="padding: 8px;">
<div class="avatar">
<a href="/bugtracker?act=reporter&id={$reporter->getId()}">
<img class="ava" src="{$reporter->getAvatarURL()}">
</a>
</div>
<div class="info" style="width: 92%">
<a href="/bugtracker?act=reporter&id={$reporter->getId()}" class="title">{$reporter->getCanonicalName()}</a>
2022-08-22 02:11:48 +03:00
<div class="subtitle">{_created}: {$bug->getCreationTime()}</div>
2022-08-20 20:30:04 +03:00
</div>
</div>
<hr color="#DAE1E8" size="1">
{$bug->getText()}
<hr color="#DAE1E8" size="1">
<table id="basicInfo" class="ugc-table group_info" cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
<tbody>
<tr>
<td class="label"><span class="nobold">{_bug_tracker_product}:</span></td>
<td class="data"><a href="/bugtracker?product={$bug->getProduct()->getId()}">{$bug->getProduct()->getCanonicalName()}</a></td>
</tr>
2022-08-20 20:30:04 +03:00
<tr>
2022-08-20 23:59:25 +03:00
<td class="label"><span class="nobold">{_bug_tracker_sent_by}: </span></td>
2022-08-20 20:30:04 +03:00
<td class="data">
<a href="/bugtracker?act=reporter&id={$bug->getReporter()->getId()}">{$bug->getReporter()->getCanonicalName()}</a>
</td>
</tr>
<tr>
2022-08-20 23:59:25 +03:00
<td class="label"><span class="nobold">{_bug_tracker_reproduced}:</span></td>
2022-08-20 20:30:04 +03:00
<td class="data"><a href="#">{tr("participants", $bug->getReproducedCount())}</a></td>
</tr>
<tr>
2022-08-20 23:59:25 +03:00
<td class="label"><span class="nobold">{_status}:</span></td>
2022-08-22 02:11:48 +03:00
<td class="data"><a href="#" n:attr='onClick => $isModerator ? "showBtStatusChangeDialog({$bug->getId()}, {$reporter->getCoins()}, \"{$csrfToken}\");" : false'>{$bug->getStatus()}</a></td>
2022-08-20 20:30:04 +03:00
</tr>
<tr>
2022-08-20 23:59:25 +03:00
<td class="label"><span class="nobold">{_bug_tracker_priority}:</span></td>
2022-08-22 02:11:48 +03:00
<td class="data"><a href="#" n:attr='onClick => $isModerator ? "showBtPriorityChangeDialog({$bug->getId()}, {$reporter->getCoins()}, \"{$csrfToken}\");" : false'>{$bug->getPriority()}</a></td>
2022-08-20 20:30:04 +03:00
</tr>
<tr>
2022-08-20 23:59:25 +03:00
<td class="label"><span class="nobold">{_bug_tracker_device}:</span></td>
2022-08-20 20:30:04 +03:00
<td class="data"><a href="#">{$bug->getDevice()}</a></td>
</tr>
</tbody>
</table>
<hr color="#DAE1E8" size="1">
2022-08-22 02:11:48 +03:00
<button n:if="$isModerator" class="button" onClick="showBtStatusChangeDialog({$bug->getId()}, {$reporter->getCoins()}, {$csrfToken})">{_bug_tracker_change_status}</button>
<button n:if="$isModerator" class="button" onClick="showBtPriorityChangeDialog({$bug->getId()}, {$reporter->getCoins()}, {$csrfToken})">{_bug_tracker_change_priority}</button>
2022-08-20 23:59:25 +03:00
<a n:if="$bug->getReporter()->getId() !== $user->identity->getId()" class="button" href="/bug{$bug->getId()}/reproduce">
{_bug_tracker_reproduced}
<span n:if="$bug->getReproducedCount() > 0">({$bug->getReproducedCount()})</span>
</a>
2022-08-20 20:30:04 +03:00
{if sizeof($comments) > 0}
<hr color="#DAE1E8" size="1">
<div n:foreach="$comments as $comment">
2022-08-22 02:11:48 +03:00
<div n:if="!$comment->isHidden() OR $comment->isHidden() AND $isModerator" class="avatar-list-item" style="padding: 8px;">
2022-08-20 20:30:04 +03:00
<div class="avatar">
<a href="/bugtracker?act=reporter&id={$comment->getAuthor()->getId()}">
<img class="ava" src="{$comment->isModer() ? 'https://vk.com/images/support15_specagent.png' : $comment->getAuthor()->getAvatarURL()}">
</a>
</div>
<div class="info" style="width: 90%;">
<a n:attr='href => $comment->isModer() ? false : "/bugtracker?act=reporter&id={$comment->getAuthor()->getId()}"' class="title">
2022-08-22 02:11:48 +03:00
{$comment->isModer() ? tr("bug_tracker_moderator") : $comment->getAuthor()->getCanonicalName()}
<a n:if="$comment->isModer() AND $isModerator" href="{$comment->getAuthor()->getURL()}">
2022-08-20 20:30:04 +03:00
(<b>{$comment->getAuthor()->getCanonicalName()}</b>)
</a>
</a>
2022-08-22 02:11:48 +03:00
<b n:if="$comment->isHidden() AND $isModerator">({_bug_tracker_hidden_comment_span})</b>
2022-08-20 20:30:04 +03:00
<br>
<b n:if="$comment->getLabel()" class="post-author" style="display: inline-block; border-top: 0;">{$comment->getLabel()}</b>
<div>
{$comment->getText()}
</div>
2022-08-22 02:11:48 +03:00
<div n:if="$isModerator AND $comment->getBalanceChanges()">
<b>(действия с балансом: {$comment->getBalanceChanges() > 0 ? "+" : false}{$comment->getBalanceChanges()})</b>
</div>
<span class="nobold">{$comment->getCreationTime()}</span>
2022-08-20 20:30:04 +03:00
</div>
</div>
<hr color="#DAE1E8" size="1">
</div>
{/if}
2022-08-22 02:11:48 +03:00
<form n:if="!in_array($bug->getRawStatus(), [4, 6]) OR in_array($bug->getRawStatus(), [4, 6]) AND $isModerator" method="post" action="/bug{$bug->getId()}/addComment">
<textarea name="text" style="width: 100%; resize: vertical;"></textarea><br />
2022-08-20 20:30:04 +03:00
<div style="float: right;">
2022-08-22 02:11:48 +03:00
<div n:if="$isModerator" style="display: inline;">
2022-08-20 20:30:04 +03:00
<input id="is_moder" type="checkbox" name="is_moder">
2022-08-20 23:59:25 +03:00
<label for="is_moder">{_bug_tracker_comment_as_moderator}</label>
2022-08-20 20:30:04 +03:00
<input id="is_hidden" type="checkbox" name="is_hidden">
2022-08-20 23:59:25 +03:00
<label for="is_hidden">{_bug_tracker_hidden_comment}</label>
2022-08-20 20:30:04 +03:00
</div>
<input type="hidden" name="hash" value="{$csrfToken}" />
<input type="submit" value="{_write}" class="button" />
</div>
</form>
{else}
<div>
2022-08-20 23:59:25 +03:00
{_bug_tracker_report_not_found}
2022-08-20 20:30:04 +03:00
</div>
{/if}
{/block}