%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/985914/root/data/old/home/stash/atlassian-stash/static/feature/comments/
Upload File :
Create Path :
Current File : //proc/985914/root/data/old/home/stash/atlassian-stash/static/feature/comments/comments.soy

{namespace stash.feature}

/**
 * @param? line
 * @param? lineType
 * @param? comments
 * @param commitRange
 * @param? extraClasses
 */
{template .comments}
    <div class="comment-container{if $extraClasses} {$extraClasses}{/if}"
        {if $line} data-line-number="{$line}"{/if}
        {if $lineType} data-line-type="{$lineType}"{/if}
        >
        <div class="panel">
            <ol class="comment-list">
                {if $comments}
                    {foreach $comment in $comments}
                        {call .comment}
                            {param comment: $comment /}
                            {param numOfAncestors: 0 /}
                            {param pullRequest: $commitRange.pullRequest /}
                        {/call}
                    {/foreach}
                {/if}
            </ol>
        </div>
    </div>
{/template}

/**
 * @param comment
 * @param? pullRequest
 * @param? numOfAncestors
 * @param? extraClasses
 */
{template .comment}
    <li class="comment{if $comment.isNew} new{/if}{if $comment.isUnread} unread{/if}{if $comment.isFocused} focused{/if}{if $extraClasses} {$extraClasses}{/if}" data-id="{$comment.id}" data-version="{$comment.version}">
        {call stash.widget.avatar}
            {param size: 'medium' /}
            {param person: $comment.author /}
        {/call}
        {call .commentContent}
            {param comment: $comment /}
            {param pullRequest: $pullRequest /}
        {/call}
        <ol class="replies{if $numOfAncestors >= 7} no-indent{/if}">
            {if $comment.comments}
                {foreach $reply in $comment.comments}
                    {call .comment}
                        {param comment: $reply /}
                        {param pullRequest: $pullRequest /}
                        {param numOfAncestors: ($numOfAncestors + 1) /}
                    {/call}
                {/foreach}
            {/if}
        </ol>
    </li>
{/template}

/**
 * @param comment
 * @param pullRequest
 * @param? hideDelete
 */
{template .commentContent private="true"}
    <div class="content">
        {if $comment.deleted}
            {getText('stash.web.comment.deleted.detail')}
        {else}
            <h3 class="author">
                {call stash.widget.userLink}
                    {param user: $comment.author /}
                {/call}
            </h3>
            <div class="message {$comment.html ? 'markup' : 'plaintext'}" data-text="{$comment.text}">
                {if $comment.html}
                    {$comment.html|noAutoescape}
                {else}
                    <p>{$comment.text}</p>
                {/if}
            </div>
            <ul class="actions">
                <li>
                    <a class="reply" href="#">{getText('stash.web.comment.reply')}</a>
                </li>
                {if $comment.permittedOperations.editable}
                    <li>
                        <a class="edit" href="#">{getText('stash.web.comment.edit')}</a>
                    </li>
                {/if}
                {if $comment.permittedOperations.deletable}
                    <li{if $hideDelete or ($comment.comments and length($comment.comments))} class="hidden"{/if}>
                        <a class="delete" href="#">{getText('stash.web.comment.delete')}</a>
                    </li>
                {/if}
                // No plugin point for 2.11 to avoid breaking changes. Remove this if statement in 3.0
                {if $pullRequest}
                    // Pull request has been deprecated in 2.11 to be optional in 3.0
                    {foreach $item in getWebItems('stash.comments.actions', [
                        'comment': $comment,
                        'pullRequest': $pullRequest
                    ])}
                        <li>
                            {call stash.widget.webItem data="$item"/}
                        </li>
                    {/foreach}
                {/if}
            </ul>
            <ul class="info">
                // Pull request has been deprecated in 2.11 to be optional in 3.0
                {if $pullRequest}
                    {foreach $panelHtml in getWebPanels('stash.comments.info', [
                        'comment': $comment,
                        'pullRequest': $pullRequest
                    ])}
                        <li>
                            {$panelHtml|noAutoescape}
                        </li>
                    {/foreach}
                {/if}
                <li>
                    {if $pullRequest}
                        {let $pullRequestCommentLink: nav_pull_comment($pullRequest.toRef.repository.project.key,
                            $pullRequest.toRef.repository.slug,
                            $pullRequest.id,
                            $comment.id) /}
                        <a class="times" href="{$pullRequestCommentLink}">
                            {call .commentDate}
                                {param comment: $comment /}
                            {/call}
                        </a>
                    {else}
                        <span class="times">
                            {call .commentDate}
                                {param comment: $comment /}
                            {/call}
                        </span>
                    {/if}
                </li>
            </ul>
        {/if}
    </div>
{/template}

/**
 * @param comment
 */
{template .commentDate private="true"}
    {if compare_date($comment.updatedDate, $comment.createdDate) > 0} // is edited
        // it'll look dumb to say "created yesterday, last edited yesterday". Don't show both if they're the same, just tooltip the full date.
        {if format_date($comment.createdDate, 'shortAge') != format_date($comment.updatedDate, 'shortAge')}
            {call .commentEditTimes}
                {param createdDateContent}
                    {call widget.date.shortAge}{param date: $comment.createdDate /}{/call}
                {/param}
                {param updatedDateContent}
                    {call widget.date.shortAge}{param date: $comment.updatedDate /}{/call}
                {/param}
            {/call}
        {else}
            {call widget.date.shortAge}
                {param date: $comment.createdDate /}
                {{param title: getText('stash.web.comment.createddate.then.updateddate',
                                    format_date($comment.createdDate, 'full'), format_date($comment.updatedDate, 'full')) /}}
            {/call}
        {/if}
    {else} // just show created date
        {call widget.date.shortAge}{param date: $comment.createdDate /}{/call}
    {/if}
{/template}


/**
 * @param createdDateContent
 * @param? updatedDateContent
 */
{template .commentEditTimes private="true"}
    {{getText('stash.web.comment.createddate.then.updateddate', $createdDateContent, $updatedDateContent)|noAutoescape}}
{/template}

/**
 * @param? id
 * @param? version
 * @param? text
 * @param? isHidden
 * @param currentUser
 * @param? extraFormClasses
 * @param tips
 */
{template .commentFormListItem}
    <li class="comment-form-container{if $isHidden} hidden{/if}">
        {call .commentForm}
            {param id : $id /}
            {param version : $version /}
            {param text : $text /}
            {param tips: $tips /}
            {param currentUser: $currentUser /}
            {param extraClasses: $extraFormClasses /}
        {/call}
    </li>
{/template}

/**
 * @param? id
 * @param? version
 * @param? text
 * @param currentUser
 * @param? extraClasses
 * @param tips
 */
{template .commentForm}

    <form{if $id} data-id="{$id}" data-version="{$version}"{/if} class="new-comment-form{if $extraClasses} {$extraClasses}{/if}">
    {call stash.widget.avatar}
        {param size: 'medium' /}
        {param person: $currentUser /}
    {/call}
    <div class="content">
        <div class="content-inner">
            {if $text}<input name="old_text" type="hidden" value="{$text}" />{/if}
            <div class="comment-actions">
                {call stash.widget.markup.previewButton}
                    {param descriptionText: getText('stash.web.diffview.comments.button.preview') /}
                {/call}
                {call stash.widget.markup.previewHelp/}
            </div>
            <div class="comment-submit-spinner"></div>
            {call stash.widget.markup.preview/}
            {call widget.aui.form.expandingTextarea}
                {param name: 'text' /}
                {param extraClasses: 'text' /}
                {param initialValue: $text /}
                {param placeholderText: getText('stash.web.diffview.comments.form.placeholder') /}
            {/call}
        </div>
        <div class="comment-form-footer">
            <div class="buttons">
                {call stash.buttons.button}
                    {param buttonText: $id ? getText('stash.web.diffview.comments.button.save') : getText('stash.web.diffview.comments.button.comment') /}
                {/call}
                {call widget.aui.form.cancelButton}
                    {param href: '#' /}
                {/call}
            </div>
            {if length($tips)}
                {call .commentFormTip}{param tips: $tips /}{/call}
            {/if}
        </div>
    </div>
    </form>
{/template}

/**
 * @param tips
 */
{template .commentFormTip}
    <div class="tip">
        <span class="tip-label">{getText('stash.web.tip')}</span>

        {$tips[randomInt(length($tips))]|noAutoescape}
    </div>
{/template}

/**
 */
{template .addCommentTrigger}
    <button class="add-comment-trigger">
        {call stash.widget.icons.icon}
            {param useIconFont: true /}
            {param icon: 'comment' /}
            {param accessibilityText: stash_i18n('stash.comments.present.line', 'This line has a comment.') /}
        {/call}
        {call stash.widget.icons.icon}
           {param useIconFont: true /}
            {param icon: 'add-comment' /}
            {param accessibilityText: getText('stash.comments.add.line') /}
        {/call}
    </button>
{/template}

/**
 * The dummy is necessary for CodeMirror to correctly render the gutters
 * when scrolling horizontally and when highlighting the current line
 * (which happens when hovering or when expanding context).
 *
 * @param? relevantContextLines
 */
{template .dummyCommentTrigger}

    /*
     TODO: we need to fix the translatability of this string using Choice Format
    */
    {{let $changeLocation:
        (hasData() and $relevantContextLines) ?
            getText('stash.comments.disabled.location.specific', $relevantContextLines) :
            getText('stash.comments.disabled.location.vague')
    /}}
    <div
        class="dummy-comment-trigger"
        title="{$changeLocation}"
     ></div>
{/template}


/**
 * @param? comments
 * @param? commitRange
 */
{template .fileComments}
    <div class="file-comments">
        {if $comments and length($comments) > 0}
            {call stash.feature.comments}
                {param comments: $comments /}
                {param commitRange: $commitRange /}
            {/call}
        {/if}
    </div>
{/template}


/**
 * @param count
 */
{template .commentCount}
    <span class="comment-count" title="{{$count == '1' ?
        getText('stash.web.comments.count', $count) :
        getText('stash.web.comments.count.plural', $count)}}">
            {call aui.icons.icon}
                {param icon: 'comment' /}
                {param size: 'small' /}
                {param useIconFont: true /}
            {/call}
           {cap_int($count, 99)}
    </span>
{/template}


Zerion Mini Shell 1.0