~launchpad-pqm/launchpad/devel

12384.1.17 by Curtis Hovey
Change the heading of the description area to a h3 because the single item
1
<div
2
  xmlns:tal="http://xml.zope.org/namespaces/tal"
3
  tal:attributes="id view/content_box_id;
12268.3.8 by Tim Penhey
Refactor the TextAreaEditorWidget so it doesn't need extra HTML code in the page template.
4
                     class view/tag_class">
5
  <div class="clearfix">
6
    <div class="edit-controls" tal:condition="view/can_write">
7
      &nbsp;
12534.3.13 by Tim Penhey
Add an optional edit_title property to the edit widgets.
8
      <a tal:attributes="href view/edit_url;
9
                         title view/edit_title"
12268.3.8 by Tim Penhey
Refactor the TextAreaEditorWidget so it doesn't need extra HTML code in the page template.
10
         class="yui3-editable_text-trigger sprite edit"></a>
11
    </div>
12384.1.17 by Curtis Hovey
Change the heading of the description area to a h3 because the single item
12
    <h3 tal:condition="view/title"
13
        tal:content="view/title">the title</h3>
12268.3.8 by Tim Penhey
Refactor the TextAreaEditorWidget so it doesn't need extra HTML code in the page template.
14
  </div>
15
  <div class="yui3-editable_text-text"
16
       tal:content="structure view/value">some text</div>
17
<script tal:condition="view/can_write"
18
        tal:content="structure string:
19
        LPS.use('lazr.editor', 'lp.client.plugins', function (Y) {
20
            var widget = new Y.EditableText({
12268.3.9 by Tim Penhey
Make the TextAreaEditorWidget inherit from WidgetBase.
21
                contentBox: ${view/widget_css_selector},
12268.3.8 by Tim Penhey
Refactor the TextAreaEditorWidget so it doesn't need extra HTML code in the page template.
22
                accept_empty: ${view/accept_empty},
23
                multiline: true,
24
                buttons: 'top'
25
            });
26
            widget.editor.plug({
27
                fn: Y.lp.client.plugins.PATCHPlugin, cfg: {
28
                  patch: ${view/json_attribute},
12421.1.2 by Tim Penhey
Update the PATCHPlugin to ask for lp_html, and use that.
29
                  resource: ${view/json_resource_uri},
30
                  use_html: true
12268.3.8 by Tim Penhey
Refactor the TextAreaEditorWidget so it doesn't need extra HTML code in the page template.
31
            }});
32
            if (!Y.UA.opera) {
33
                widget.render();
34
            }
35
            var lpns = Y.namespace('lp');
36
            if (!lpns.widgets) {
37
                lpns.widgets = {};
38
            }
12268.3.9 by Tim Penhey
Make the TextAreaEditorWidget inherit from WidgetBase.
39
            lpns.widgets['${view/content_box_id}'] = widget;
12268.3.8 by Tim Penhey
Refactor the TextAreaEditorWidget so it doesn't need extra HTML code in the page template.
40
        });
12384.1.17 by Curtis Hovey
Change the heading of the description area to a h3 because the single item
41
"></script>
12268.3.8 by Tim Penhey
Refactor the TextAreaEditorWidget so it doesn't need extra HTML code in the page template.
42
</div>