## This file contains macros that are useful to issue link plugins. ## ## Issue Link Dialog Macros ## ## Default for issue link actions #macro (issueLinkHeader $action $i18n $webResourceManager $keyboardShortcutManager) #if (${action.validToView}) ${i18n.getText("linkissue.title")} ${keyboardShortcutManager.requireShortcutsForContext(${action.keyboardShortcutContext})} #else $i18n.getText("common.words.error") #end #end ## Show global errors messages #macro (issueLinkErrorMessages $action) #if (${action.hasErrorMessages})
#foreach ($errorMsg in ${action.flushedErrorMessages})

$errorMsg

#end
#end #end ## Default hidden fields #macro (issueLinkHiddenFields $action) #end ## In dialog mode, this will be the heading of the dialog. ## In non-dialog mode, this heading will appear on the page. #macro (issueLinkTitle $i18n)

${i18n.getText("linkissue.title")}

#end ## Display a standard description for the action #macro (issueLinkDescription $i18n $i18nKey)
${i18n.getText($i18nKey)}
#end ## Indicates that a field is required #macro (issueLinkFieldRequired) required #end ## Show inline error for a field #macro (issueLinkFieldError $action $fieldName $textutils) #if ($action.getErrors().get($fieldName))
$textutils.htmlEncode($action.getErrors().get($fieldName).toString())
#end #end #macro (issueLinkWarningMessage $message)

$message

#end ## OAuth authentication message placeholder #macro (appLinksAuthenticationMessage $action $applicationType) #end ## Default comment section #macro (issueLinkCommentSection $action) #if (${action.issueExists} && ${action.isHasIssuePermission("comment", ${action.issue})}) $!{action.commentSectionHtml} #end #end ## Default footer for issue link actions ## should be included at the bottom of the
#macro (issueLinkFooter $action $req $i18n) #end ## Show error messages for when action.validToView is false ## Should be included at the bottom of the #macro (issueLinkNotValidToView $action $req $i18n $jirautils $urlcodec)

${i18n.getText("common.words.error")}

#if ($action.hasErrorMessages)
#foreach ($errorMsg in ${action.flushedErrorMessages})

$errorMsg

#end
#end #if ($action.issueExists)

${i18n.getText("perm.violation.desc")}

#if (!${action.remoteUser})

#set ($loginText = ${i18n.getText("login.required.login")}) #set ($destination = ${urlcodec.encode("/browse/${action.key}")}) #set ($loginUrl = "$loginText") #if (${jirautils.publicMode}) #set ($signUpUrl = "") ${i18n.getText("login.required.signup.description", $loginUrl, $signUpUrl, "")} #else ${i18n.getText("login.required.description")} $loginUrl #end

#end

${i18n.getText("contact.admin.for.perm", ${action.administratorContactLink})}

#end #end ## ## Issue Link Rendering Macros ## ## Only render the icon if the $url is not null #macro (renderIssueLinkIcon $url $title $alt $textutils) #if ($url) ${textutils.htmlEncode($!alt)} #end #end ## Default loading issue template #macro (loadingIssueLink $url $title $i18n $urlModeAbsolute $webResourceUrlProvider)

${title} ${i18n.getText("common.concepts.loading")}

#end