~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-23 22:39:32 UTC
  • mfrom: (13723.2.8 bug724025)
  • Revision ID: launchpad@pqm.canonical.com-20110823223932-6glp2oo6val45mga
[incr] [r=gmb][bug=724025] Speed up an inner loop for BugTask:+index
        with many tasks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<tal:bugtask
2
2
  xmlns:tal="http://xml.zope.org/namespaces/tal"
3
3
  xmlns:metal="http://xml.zope.org/namespaces/metal"
4
 
  define="expandable view/expandable;
5
 
          indent_task view/shouldIndentTask;
6
 
          is_conjoined_slave view/is_conjoined_slave;
7
 
          tasklink view/taskLink;
8
 
          row_id string:tasksummary${context/id};
9
 
          form_row_id string:task${context/id}">
10
 
  <tr tal:define="editstatus_url string:${context/fmt:url}/+editstatus"
11
 
      tal:attributes="class view/getTaskRowCSSClass; id row_id">
 
4
  define="data view/data">
 
5
  <tr tal:attributes="class data/row_css_class; id data/row_id">
12
6
    <td>
13
 
      <metal:expander
14
 
          metal:define-macro="expander"
15
 
          tal:define="expander_link_text expander_link_text|nothing">
16
 
        <a tal:condition="expandable"
17
 
           tal:attributes="href tasklink" class="bugtask-expander">
18
 
          <tal:link_text tal:replace="expander_link_text" />
19
 
          &#8203;
20
 
        </a>
21
 
        <tal:no_expander tal:condition="not: expandable"
22
 
                         tal:replace="expander_link_text" />
23
 
      </metal:expander>
 
7
      <a tal:condition="data/expandable"
 
8
         tal:attributes="href data/task_link" class="bugtask-expander">
 
9
        &#8203;
 
10
      </a>
24
11
    </td>
25
12
    <td style="padding: 0.3em 0em 0.3em 1.5em"
26
 
        tal:condition="indent_task"
27
 
        tal:define="series_targetname view/getSeriesTargetName">
 
13
        tal:condition="data/indent_task">
28
14
      <span class="sprite milestone"></span>
29
 
      <tal:not-conjoined-task condition="not: is_conjoined_slave">
 
15
      <tal:not-conjoined-task condition="not: data/is_conjoined_slave">
30
16
        <a
31
 
          tal:attributes="href context/target/fmt:url"
32
 
          tal:content="series_targetname"
 
17
          tal:attributes="href data/target_link"
 
18
          tal:content="view/getSeriesTargetName"
33
19
        />
34
20
      </tal:not-conjoined-task>
35
21
    </td>
36
 
    <td tal:condition="not:indent_task">
37
 
      <span tal:attributes="id string:bugtarget-picker-${row_id}">
 
22
    <td tal:condition="not:data/indent_task">
 
23
      <span tal:attributes="id string:bugtarget-picker-${data/row_id}">
38
24
        <span class="yui3-activator-data-box">
39
25
          <span title="This project&rsquo;s license has not been specified.">
40
 
            <a tal:attributes="href context/target/fmt:url;
41
 
                               title view/target_link_title;
 
26
            <a tal:attributes="href data/target_link;
 
27
                               title data/target_link_title;
42
28
                               class context/target/image:sprite_css"
43
29
               tal:content="context/bugtargetdisplayname" />
44
30
          </span>
50
36
      </span>
51
37
    </td>
52
38
 
53
 
    <tal:conjoined-task condition="is_conjoined_slave">
 
39
    <tal:conjoined-task condition="data/is_conjoined_slave">
54
40
    <td colspan="5" style="vertical-align: middle">
55
41
      <span class="discreet lesser" style="font-size: 100%">
56
42
        Status tracked in
61
47
    </td>
62
48
    </tal:conjoined-task>
63
49
 
64
 
    <tal:not-conjoined-task condition="not:is_conjoined_slave">
 
50
    <tal:not-conjoined-task condition="not:data/is_conjoined_slave">
65
51
    <td style="width: 20%; vertical-align: middle">
66
52
      <div class="status-content"
67
 
           style="width: 100%; float: left">
 
53
           style="width: 100%; float: left"
 
54
           tal:define="status context/status">
68
55
        <a href="+editstatus"
69
 
           tal:attributes="class string:value status${context/status/name};
70
 
                           href editstatus_url"
 
56
           tal:attributes="class string:value status${status/name};
 
57
                           href data/edit_link"
71
58
           style="float: left"
72
 
           tal:content="context/status/title" />
 
59
           tal:content="status/title" />
73
60
        <a href="+editstatus" style="margin-left: 3px"
74
 
           tal:attributes="href editstatus_url">
 
61
           tal:attributes="href data/edit_link">
75
62
          <img class="editicon" src="/@@/edit" />
76
63
        </a>
77
64
      </div>
78
65
    </td>
79
66
 
80
 
    <td tal:condition="view/user_can_edit_importance"
 
67
    <td tal:condition="data/user_can_edit_importance"
81
68
        style="width: 20%; vertical-align: middle">
82
69
      <div class="importance-content"
83
70
           style="width: 100%; float: left">
84
71
        <a href="+editstatus"
85
 
           tal:attributes="class string:value importance${context/importance/name};
86
 
                           href editstatus_url"
 
72
           tal:attributes="class string:value ${data/importance_css_class};
 
73
                           href data/edit_link"
87
74
           style="float: left"
88
 
           tal:content="context/importance/title" />
 
75
           tal:content="data/importance_title" />
89
76
        <a href="+editstatus" style="margin-left: 3px"
90
 
           tal:attributes="href editstatus_url">
 
77
           tal:attributes="href data/edit_link">
91
78
          <img class="editicon" src="/@@/edit" />
92
79
        </a>
93
80
      </div>
94
81
    </td>
95
 
    <td tal:condition="not: view/user_can_edit_importance"
 
82
    <td tal:condition="not: data/user_can_edit_importance"
96
83
        style="width: 15em; vertical-align: middle">
97
84
      <div class="importance-content"
98
85
           style="width: 100%; float: left">
99
86
        <span
100
 
           tal:attributes="class string:value importance${context/importance/name}"
 
87
           tal:attributes="class string:value ${data/importance_css_class}"
101
88
           style="float: left"
102
 
           tal:content="context/importance/title" />
 
89
           tal:content="data/importance_title" />
103
90
      </div>
104
91
    </td>
105
92
 
106
93
    <td style="width:20%; margin: 0; padding: 0;
107
 
               vertical-align: middle; padding-left: 0.5em">
108
 
      <tal:has_watch condition="context/bugwatch">
109
 
        <div style="text-decoration: none; padding: 0.25em">
110
 
          <tal:bugtracker-active
111
 
              condition="context/bugwatch/bugtracker/active">
112
 
            <span tal:condition="not:context/bugwatch/last_error_type"
113
 
                  class="sprite bug-remote"></span>
114
 
            <a tal:condition="context/bugwatch/last_error_type"
115
 
                tal:attributes="href view/bug_watch_error_message/help_url"
116
 
                target="help"
117
 
                class="icon help">
118
 
              <span class="sprite warning-icon"
119
 
                    tal:attributes="title view/bug_watch_error_message/message"
120
 
                    id="bugwatch-error-sprite"></span>
121
 
            </a>
 
94
               vertical-align: middle; padding-left: 0.5em"
 
95
        tal:define="bugwatch context/bugwatch;">
 
96
      <tal:has_watch condition="bugwatch">
 
97
        <div style="text-decoration: none; padding: 0.25em"
 
98
             tal:define="active_bugtracker bugwatch/bugtracker/active;">
 
99
          <tal:bugtracker-active condition="active_bugtracker">
 
100
            <tal:block define="last_error_type bugwatch/last_error_type;">
 
101
              <span tal:condition="not:last_error_type"
 
102
                    class="sprite bug-remote"></span>
 
103
              <a tal:condition="last_error_type"
 
104
                  tal:attributes="href view/bug_watch_error_message/help_url"
 
105
                  target="help"
 
106
                  class="icon help">
 
107
                <span class="sprite warning-icon"
 
108
                      tal:attributes=
 
109
                            "title view/bug_watch_error_message/message"
 
110
                      id="bugwatch-error-sprite"></span>
 
111
              </a>
 
112
            </tal:block>
122
113
          </tal:bugtracker-active>
123
 
          <span tal:condition="not:context/bugwatch/bugtracker/active"
 
114
          <span tal:condition="not:active_bugtracker"
124
115
                class="sprite warning-icon"></span>
125
 
          <a tal:replace="structure context/bugwatch/fmt:external-link" />
 
116
          <a tal:replace="structure bugwatch/fmt:external-link" />
126
117
        </div>
127
118
      </tal:has_watch>
128
119
 
129
 
      <tal:has_no_watch condition="not: context/bugwatch">
130
 
        <span tal:attributes="id string:assignee-picker-${row_id}">
 
120
      <tal:has_no_watch condition="not: bugwatch">
 
121
        <span tal:attributes="id string:assignee-picker-${data/row_id}"
 
122
              tal:define="assignee context/assignee">
131
123
          <span class="yui3-activator-data-box">
132
 
            <a tal:condition="context/assignee"
133
 
               tal:attributes="href context/assignee/fmt:url;
134
 
                               class context/assignee/image:sprite_css"
135
 
               tal:content="context/assignee/fmt:displayname" />
136
 
            <tal:unassigned condition="not: context/assignee">
 
124
            <a tal:condition="assignee"
 
125
               tal:attributes="href assignee/fmt:url;
 
126
                               class assignee/image:sprite_css"
 
127
               tal:content="assignee/fmt:displayname" />
 
128
            <tal:unassigned condition="not: assignee">
137
129
              Unassigned
138
130
            </tal:unassigned>
139
131
          </span>
147
139
 
148
140
    <td style="width: 20%; vertical-align: middle">
149
141
      <div class="milestone-content"
150
 
           tal:condition="view/target_has_milestones"
 
142
           tal:condition="data/target_has_milestones"
151
143
           style="width: 100%; float: left">
152
144
        <a tal:condition="view/user_can_edit_milestone"
153
145
           class="nulltext addicon js-action sprite add"
154
 
           tal:attributes="href editstatus_url;
 
146
           tal:attributes="href data/edit_link;
155
147
                           style view/style_for_add_milestone">
156
148
          Target to milestone
157
149
        </a>
159
151
           tal:attributes="href context/milestone/fmt:url | nothing"
160
152
           tal:content="context/milestone/title | nothing" />
161
153
        <a tal:condition="view/user_can_edit_milestone"
162
 
           tal:attributes="href editstatus_url"
 
154
           tal:attributes="href data/edit_link"
163
155
          ><img class="editicon" src="/@@/edit"
164
156
                tal:attributes="style view/style_for_edit_milestone"
165
157
          /></a>
178
170
          Y.lp.bugs.bugtask_index.setup_bugtask_row(${view/js_config});
179
171
 
180
172
          // Set-up the expander on the bug task summary row.
181
 
          var icon_node = Y.one('tr#${row_id} a.bugtask-expander');
182
 
          var row_node = Y.one('tr#${form_row_id}');
 
173
          var icon_node = Y.one('tr#${data/row_id} a.bugtask-expander');
 
174
          var row_node = Y.one('tr#${data/form_row_id}');
183
175
          if (Y.Lang.isValue(row_node)) {
184
176
            // When no row is present, this is bug task on a project with
185
177
            // multiple per-series tasks, so we do not need to set
195
187
 
196
188
  <tal:form condition="view/displayEditForm">
197
189
    <tr
198
 
      tal:attributes="id form_row_id"
199
 
      tal:condition="expandable"
 
190
      tal:attributes="id data/form_row_id"
 
191
      tal:condition="data/expandable"
200
192
      class="bugtask-collapsible-content unseen"
201
193
    >
202
194
     <td colspan="7" tal:content="structure view/edit_view" />