~launchpad-pqm/launchpad/devel

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
<div
  xmlns:tal="http://xml.zope.org/namespaces/tal"
  tal:attributes="id view/content_box_id;
                     class view/tag_class">
  <div class="clearfix">
    <div class="edit-controls" tal:condition="view/can_write">
      &nbsp;
      <a tal:attributes="href view/edit_url;
                         title view/edit_title"
         class="yui3-editable_text-trigger sprite edit"></a>
    </div>
    <h3 tal:condition="view/title"
        tal:content="view/title">the title</h3>
  </div>
  <div class="yui3-editable_text-text"
       tal:content="structure view/value">some text</div>
<script tal:condition="view/can_write"
        tal:content="structure string:
        LPS.use('lazr.editor', 'lp.client.plugins', function (Y) {
            var widget = new Y.EditableText({
                contentBox: ${view/widget_css_selector},
                accept_empty: ${view/accept_empty},
                multiline: true,
                buttons: 'top'
            });
            widget.editor.plug({
                fn: Y.lp.client.plugins.PATCHPlugin, cfg: {
                  patch: ${view/json_attribute},
                  resource: ${view/json_resource_uri},
                  use_html: true
            }});
            if (!Y.UA.opera) {
                widget.render();
            }
            var lpns = Y.namespace('lp');
            if (!lpns.widgets) {
                lpns.widgets = {};
            }
            lpns.widgets['${view/content_box_id}'] = widget;
        });
"></script>
</div>