/
summary.jelly
103 lines (100 loc) · 4.87 KB
/
summary.jelly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<script type="text/javascript">
function ShowPopup(hoveritem)
{
hp = document.getElementById("claimHoverPopup");
hp.style.display = "block";
}
function HidePopup()
{
hp = document.getElementById("claimHoverPopup");
hp.style.display = "none";
}
</script>
<t:summary icon="${rootUrl}/plugin/claim/icons/claim-48x48.png">
<j:choose>
<j:when test="${it.isClaimedByMe()}">
<p>
<j:choose>
<j:when test="${it.hasClaimDate()}">
<j:choose>
<j:when test="${it.isSelfAssigned()}">
${%you.claimed.on(it.noun)}
<i:formatDate value="${it.claimDate}" type="both" dateStyle="medium" timeStyle="medium"/>${%.}
</j:when>
<j:otherwise>
${%you.assigned.on(it.noun, it.assignedByName)}
<i:formatDate value="${it.claimDate}" type="both" dateStyle="medium" timeStyle="medium"/>${%.}
</j:otherwise>
</j:choose>
</j:when>
<j:otherwise>
${%you.claimed(it.noun)}
</j:otherwise>
</j:choose>
<j:if test="${it.canRelease()}">
<a id="dropClaim" href="claim/unclaim">${%Drop the claim.}</a>
<st:nbsp/><a id="reassign" href="#" onClick="ShowPopup(this); return false;">${%Reassign the claim.}</a>
</j:if>
</p>
<j:if test="${it.hasReason()}">
<p>${%Reason:} ${it.reason}</p>
</j:if>
</j:when>
<j:when test="${it.claimed}">
<p>
<j:choose>
<j:when test="${it.hasClaimDate()}">
<j:choose>
<j:when test="${it.isSelfAssigned()}">
${%one.claimed.on(it.noun,it.claimedByName)}
<i:formatDate value="${it.claimDate}" type="both" dateStyle="medium" timeStyle="medium"/>${%.}
</j:when>
<j:otherwise>
${%one.assigned.on(it.noun, it.claimedByName,it.assignedByName)}
<i:formatDate value="${it.claimDate}" type="both" dateStyle="medium" timeStyle="medium"/>${%.}
</j:otherwise>
</j:choose>
</j:when>
<j:otherwise>
${%one.claimed(it.noun,it.claimedByName)}
</j:otherwise>
</j:choose>
<j:if test="${it.canClaim()}">
<a id="reassign" href="#" onClick="ShowPopup(this); return false;">${%Reassign the claim.}</a>
</j:if>
</p>
<j:if test="${it.hasReason()}">
<p>${%Reason:} ${it.reason}</p>
</j:if>
</j:when>
<j:otherwise>
${%not.claimed(it.noun)}
<j:if test="${it.canClaim()}">
<a id="claim" href="#" onClick="ShowPopup(this); return false;">${%Claim it.}</a>
</j:if>
</j:otherwise>
</j:choose>
<div id="claimHoverPopup" style="display:none; width:500px; z-index:1000; border:1px solid #bbb;">
<j:set var="descriptor" value="${it.descriptor}"/>
<f:form method="post" action="claim/claim" name="claim">
<f:entry title="${%Assignee}" field="assignee" help="/plugin/claim/help-assignee.html">
<f:select />
</f:entry>
<f:entry title="${%Reason}" help="/plugin/claim/help-reason.html">
<f:textarea name="reason" value="${it.reason}"/>
</f:entry>
<f:entry title="${%Sticky}" help="/plugin/claim/help-sticky.html">
<f:checkbox name="sticky" checked="${it.sticky}"/>
</f:entry>
<f:block>
<div align="right">
<f:submit value="${%Claim}"/>
<input type="button" onClick="HidePopup();" value="${%Cancel}" class="submit-button"/>
</div>
</f:block>
</f:form>
</div>
</t:summary>
</j:jelly>