#parse("templates/email/includes/issueplugins.vm")

#macro (makeopifenabled $key $prop)
    #if( $!mailPluginsHelper.isPluginModuleEnabled("${key}") )
                <tr>
                    <td>
                        <img src="${baseurl}/images/icons/bullet_creme.gif" height="8" width="8" border="0" align="absmiddle">
                        <b>$i18n.getText("${prop}", "<a href='${baseurl}/browse/${issue.getKey()}?page=${key}'>", "</a>")</b>
                    </td>
                </tr>
    #end
#end

<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
    <td width="170" bgcolor="f0f0f0" valign="top">

        <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>

                <table cellpadding="3" cellspacing="0" border="0" width="100%">
                <tr>
                    <td bgcolor="dddddd">
                        <b>#text("common.concepts.issue")</b>
                        (<b><a href="${baseurl}/browse/${issue.getKey()}">#text("template.view.online")</a></b>)<br>
                    </td>
                </tr>
                </table>

                <img src="${baseurl}/images/bluepixel.gif" width="100%" height="1" border="0"><br>

                <table cellpadding="3" cellspacing="0" border="0" width="100%">
                <tr>
                    <td valign="top" width="1%" nowrap><b>#text("common.concepts.key"):</b></td>
                    <td valign="top" width="100%">
                        <b><a href="${baseurl}/browse/${issue.getKey()}">$issue.getKey()</a></b>
                    </td>
                </tr>
                <tr>
                    <td valign="top" nowrap><b>#text("issue.field.issuetype"):</b></td>
                    <td valign="top">
                        #set ($issueType = $issue.getIssueTypeObject())
                        ## This is all one line so that we don't get the bug in IE6 where the whitespace gets an underline
                        <a href="${baseurl}/browse/${issue.getKey()}">#if (${issueType.getIconUrl().startsWith("http://")})<img src="${issueType.getIconUrl()}" height="16" width="16" border="0" align="absmiddle" alt="$textutils.htmlEncode(${issueType.getNameTranslation($i18n)}, false)">#else<img src="${baseurl}${issueType.getIconUrl()}" height="16" width="16" border="0" align="absmiddle" alt="$textutils.htmlEncode(${issueType.getNameTranslation($i18n)}, false)">#end</a>
                        $textutils.htmlEncode(${issueType.getNameTranslation($i18n)}, false)
                    </td>
                </tr>
                <tr>
                    <td valign="top" nowrap><b>#text("issue.field.status"):</b></td>
                    <td valign="top">
                        #set ($status = ${issue.getStatusObject()})
                        #if (${status.getIconUrl().startsWith("http://")})
                        <img src="${status.getIconUrl()}" height="16" width="16" border="0" align="absmiddle" alt="$textutils.htmlEncode(${status.getNameTranslation($i18n)}, false)" title="$textutils.htmlEncode(${status.getNameTranslation($i18n)}, false)">
                        #else
                        <img src="${baseurl}${status.getIconUrl()}" height="16" width="16" border="0" align="absmiddle" alt="$textutils.htmlEncode(${status.getNameTranslation($i18n)}, false)" title="$textutils.htmlEncode(${status.getNameTranslation($i18n)}, false)">
                        #end
                        $textutils.htmlEncode(${status.getNameTranslation($i18n)}, false)
                    </td>
                </tr>
                #if ($issue.getPriorityObject())
                <tr>
                    <td valign="top" nowrap><b>#text("issue.field.priority"):</b></td>
                    <td valign="top">
                        #set ($priority = $issue.getPriorityObject())
                        #if (${priority.getIconurl().startsWith("http://")})
                        <img src="${priority.getIconUrl()}" height="16" width="16" border="0" align="absmiddle" alt="$textutils.htmlEncode(${priority.getNameTranslation($i18n)}, false)">
                        #else
                        <img src="${baseurl}${priority.getIconUrl()}" height="16" width="16" border="0" align="absmiddle" alt="$textutils.htmlEncode(${priority.getNameTranslation($i18n)}, false)">
                        #end
                        $textutils.htmlEncode(${priority.getNameTranslation($i18n)}, false)
                    </td>
                </tr>
                #end

                #if ($issue.getResolutionObject())
                <tr>
                    <td valign="top" nowrap><b>#text("issue.field.resolution"):</b></td>
                    <td valign="top">
                        $textutils.htmlEncode($issue.getResolutionObject().getNameTranslation($i18n), false)
                    </td>
                </tr>
                #end

                <tr>
                    <td valign="top" nowrap><b>#text("issue.field.assignee"):</b></td>
                    <td valign="top">
                        #if ($issue.assigneeUser)
                            #authorlink ($issue.assigneeUser.name)
                        #else
                            #text("common.concepts.unassigned")
                        #end
                    </td>
                </tr>
                <tr>
                    <td valign="top" nowrap><b>#text("issue.field.reporter"):</b></td>
                    <td valign="top">
                        #if ($issue.reporterUser)
                            #authorlink ($issue.reporterUser.name)
                        #else
                            #text("common.concepts.no.reporter")
                        #end
                    </td>
                </tr>

                #if ($issue.getVotes() && $issue.getVotes().intValue() > 0)
                <tr>
                    <td valign="top" nowrap><b>#text("common.concepts.votes"):</b></td>
                    <td valign="top">
                        $issue.getVotes()
                    </td>
                </tr>
                #end

                #if ($applicationProperties.getOption('jira.option.timetracking'))
                    #if ($issue.getOriginalEstimate() && $issue.getOriginalEstimate().intValue() > 0)
                    <tr>
                        <td valign="top" nowrap><b>#text("common.concepts.original.estimate"):</b></td>
                        <td valign="top">
                            $issue.getNiceTimeOriginalEstimate($i18n)
                        </td>
                    </tr>
                    #end

                    #if ($issue.getEstimate() && $issue.getEstimate().intValue() > 0)
                    <tr>
                        <td valign="top" nowrap><b>#text("common.concepts.remaining.estimate"):</b></td>
                        <td valign="top">
                            $issue.getNiceTimeEstimate($i18n)
                        </td>
                    </tr>
                    #end

                    #if ($issue.getTimeSpent() && $issue.getTimeSpent().intValue() > 0)
                    <tr>
                        <td valign="top" nowrap><b>#text("common.concepts.time.spent"):</b></td>
                        <td valign="top">
                            $issue.getNiceTimeSpent($i18n)
                        </td>
                    </tr>
                    #end
                #end

                #if ($issue.getEnvironment() && $issue.getEnvironment().length() != 0)
                    <tr>
                        <td valign="top" nowrap><b>#text("common.words.env"):</b></td>
                        <td valign="top">
                            $issue.getHtmlEnvironment()
                        </td>
                    </tr>
                #end
                </table>

                <p>

                <table cellpadding="3" cellspacing="0" border="0" width="100%">
                <tr>
                    <td bgcolor="dddddd">
                        <b>#text("common.words.operations")</b>
                    </td>
                </tr>
                </table>

                <img src="${baseurl}/images/bluepixel.gif" width="100%" height="1" border="0"><br />

                <table cellpadding="3" cellspacing="0" border="0" width="100%">

                #makeopifenabled( ${tabpanel-all} 'template.view.all' )
                #makeopifenabled( ${tabpanel-comment} 'template.view.comments' )
                #makeopifenabled( ${tabpanel-history} 'template.view.history' )

                </table>

            </td>
        </tr>
        </table>


    </td>
    <td bgcolor="ffffff" valign="top">

        <table width="100%" cellpadding="10" cellspacing="0" border="0">
        <tr>
            <td>

            <table cellpadding="1" cellspacing="0" border="0" bgcolor="bbbbbb" width="100%" align="center">
            <tr>
                <td>

                    <table cellpadding="4" cellspacing="0" border="0" width="100%" bgcolor="ffffff">
                    <tr>
                        <td bgcolor="f0f0f0" width="100%" colspan="2" valign="top">
                            <b><font size="4" color="003366"><a href="${baseurl}/browse/${issue.getKey()}">$textutils.htmlEncode($issue.getSummary())</a></font></b>&nbsp;
                            <br>
                            <font size="1">
                            #text("issue.field.updated"): <font color="336699">$dateformatter.formatDMYHMS($issue.getUpdated())</font>
                            &nbsp;
                            #text("issue.field.created"): <font color="336699">$dateformatter.formatDMYHMS($issue.getCreated())</font>
                            &nbsp;
                            #if ($issue.getDueDate())
                            #text("issue.field.duedate"): <font color="336699">$dateformatter.formatDMYHMS($issue.getDueDate())</font>
                            #end
                            </font>
                        </td>
                    </tr>
                    </table>

                </td>
            </tr>
            </table>
