Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c81edff0407f35e81a7d4a85892f8fb2bb62772b (plain) (blame)
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
<!-- **************************************************************************
#
# Copyright  (c) 2004-2009 Oracle Corporation.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors: 
#
#    Kohsuke Kawaguchi, Tom Huybrechts, Yahoo! Inc.
#        
#
#************************************************************************** --> 


<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">
  <st:documentation>
    Renders ${it.description} and then allow it to be editable in place,
    if the current user has the specified permission.

    <st:attribute name="permission" use="required">
      If the current user doesn't have this permission, the description
      is not editable.
    </st:attribute>
  </st:documentation>

  <div id="description">
    <div>
      <j:out value="${it.description!=null ? app.markupFormatter.translate(it.description) : ''}" />
    </div>

    <l:hasPermission permission="${permission}">
      <div align="right"><a href="editDescription" onclick="${h.isAutoRefresh(request) ? null : 'return replaceDescription();'}">
        <img src="${imagesURL}/16x16/notepad.png" alt="" />
        <j:choose>
          <j:when test="${empty(it.description)}">
            ${%add description}
          </j:when>
          <j:otherwise>
            ${%edit description}
          </j:otherwise>
        </j:choose>
      </a></div>
    </l:hasPermission>
  </div>
</j:jelly>

Back to the top