← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/unused-productseries-macros into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/unused-productseries-macros into lp:launchpad.

Commit message:
Remove unused productseries-macros.pt, and related code that existed only for its benefit.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/unused-productseries-macros/+merge/148347

== Summary ==

I noticed some more unused macros in lp.registry, with various associated tentacles.  This branch excises them in the hope of lightening Launchpad's ZPT load just a little bit.

== Tests ==

bin/test -vvct registry
-- 
https://code.launchpad.net/~cjwatson/launchpad/unused-productseries-macros/+merge/148347
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/unused-productseries-macros into lp:launchpad.
=== modified file 'lib/lp/app/browser/tales.py'
--- lib/lp/app/browser/tales.py	2013-02-06 04:22:43 +0000
+++ lib/lp/app/browser/tales.py	2013-02-13 23:35:26 +0000
@@ -778,7 +778,6 @@
 
             return "sprite %s" % sprite_string
 
-
     def default_logo_resource(self, context):
         # XXX: mars 2008-08-22 bug=260468
         # This should be refactored.  We shouldn't have to do type-checking
@@ -1041,7 +1040,7 @@
 
         if self._context.priority:
             priority = self._context.priority.title.lower()
-            sprite_str = sprite_str +  "-%s" % priority
+            sprite_str = sprite_str + "-%s" % priority
 
         if self._context.private:
             sprite_str = sprite_str + ' private'
@@ -1618,7 +1617,7 @@
     """Adapter for IBranch objects to a formatted string."""
 
     traversable_names = {
-        'link': 'link', 'url': 'url', 'project-link': 'projectLink',
+        'link': 'link', 'url': 'url',
         'title-link': 'titleLink', 'bzr-link': 'bzrLink',
         'api_url': 'api_url'}
 
@@ -1644,14 +1643,6 @@
         # Defer to link.
         return self.link(view_name)
 
-    def projectLink(self, view_name):
-        """A hyperlinked branch icon with the name and title."""
-        return structured(
-            '<a href="%(url)s" title="%(display_name)s">'
-            '<img src="/@@/branch" alt=""/>'
-            '&nbsp;%(name)s</a>: %(title)s',
-            **self._args(view_name)).escapedtext
-
     def titleLink(self, view_name):
         """A hyperlinked branch name with following title."""
         return structured(

=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml	2013-01-25 04:58:47 +0000
+++ lib/lp/registry/browser/configure.zcml	2013-02-13 23:35:26 +0000
@@ -1,4 +1,4 @@
-<!-- Copyright 2009-2012 Canonical Ltd.  This software is licensed under the
+<!-- Copyright 2009-2013 Canonical Ltd.  This software is licensed under the
      GNU Affero General Public License version 3 (see the file LICENSE).
 -->
 
@@ -1641,9 +1641,6 @@
             name="+timeline-graph"
             template="../templates/object-timeline-graph.pt"/>
         <browser:page
-            name="+macros"
-            template="../templates/productseries-macros.pt"/>
-        <browser:page
             name="+portlet-packages"
             template="../templates/productseries-portlet-packages.pt"/>
     </browser:pages>

=== modified file 'lib/lp/registry/templates/product-series.pt'
--- lib/lp/registry/templates/product-series.pt	2012-06-11 00:03:25 +0000
+++ lib/lp/registry/templates/product-series.pt	2013-02-13 23:35:26 +0000
@@ -33,7 +33,6 @@
       <div tal:repeat="series batch">
         <div style="margin-top: 1em;
                     border-bottom: 1px solid #ccc; max-width: 60em;"
-          tal:define="is_focus series/is_development_focus"
           tal:attributes="class string:${series/css_class} series;
                           id series/name/fmt:css-id/series-;">
           <tal:status replace="structure series/series/@@+status" />

=== removed file 'lib/lp/registry/templates/productseries-macros.pt'
--- lib/lp/registry/templates/productseries-macros.pt	2012-11-08 03:55:11 +0000
+++ lib/lp/registry/templates/productseries-macros.pt	1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
-<tal:root
-  xmlns:tal="http://xml.zope.org/namespaces/tal";
-  xmlns:metal="http://xml.zope.org/namespaces/metal";
-  xmlns:i18n="http://xml.zope.org/namespaces/i18n";
-  omit-tag="">
-
-<metal:branch_display define-macro="branch_display">
-  <tal:comment condition="nothing">
-    This macro expects two variables to be defined:
-      - 'series': The ProductSeries
-      - 'is_focus': A boolean saying whether this is the series in which
-                    development is focused.
-  </tal:comment>
-
-  <table>
-    <tbody>
-      <tal:edit-link define="series_link series/fmt:url;
-                             edit_link string:${series_link}/+setbranch">
-      <tr>
-        <th>Series:</th>
-        <tal:comment condition="nothing">
-          In order to make the Series column as small as possible, tell the
-          right column to take up as much space as it can.  This keeps the
-          Series: in line for all series displayed.
-        </tal:comment>
-        <td style="width: 99%">
-          <strong>
-            <a tal:attributes="href series/fmt:url"
-               tal:content="series/name" >
-              1.0
-            </a>
-          </strong>
-          <em tal:condition="is_focus">Focus of Development</em>
-        </td>
-      </tr>
-
-      <tal:has_branch condition="series/branch">
-        <tr>
-          <th>Branch:</th>
-          <td>
-            <tal:branch replace="structure series/branch/fmt:project-link"/>
-            <tal:edit-link condition="series/required:launchpad.Edit">
-              (<a tal:attributes="href edit_link"
-              >change</a>)
-            </tal:edit-link>
-          </td>
-        </tr>
-
-        <tr>
-          <td></td>
-          <td>
-            To get a copy of this branch, use the command:<br/>
-            <tt class="command">
-                bzr branch
-                <tal:dev-focus condition="is_focus">
-                  lp:<tal:product replace="context/name"/>
-                </tal:dev-focus>
-                <tal:not-dev-focus condition="not: is_focus">
-                  lp:<tal:product replace="context/name"/>/<tal:series replace="series/name"/>
-                </tal:not-dev-focus>
-            </tt>
-          </td>
-        </tr>
-      </tal:has_branch>
-
-      <tal:no_branch condition="not: series/branch">
-        <tr>
-          <th>Branch:</th>
-          <td>
-            None specified
-            <tal:edit-link condition="series/required:launchpad.Edit">
-              (<a tal:attributes="href edit_link"
-              >set</a>)
-            </tal:edit-link>
-          </td>
-        </tr>
-      </tal:no_branch>
-      </tal:edit-link>
-    </tbody>
-  </table>
-
-</metal:branch_display>
-
-</tal:root>

=== modified file 'lib/lp/registry/templates/productseries-status.pt'
--- lib/lp/registry/templates/productseries-status.pt	2010-08-12 20:54:48 +0000
+++ lib/lp/registry/templates/productseries-status.pt	2013-02-13 23:35:26 +0000
@@ -3,10 +3,7 @@
   xmlns:tal="http://xml.zope.org/namespaces/tal";
   xmlns:metal="http://xml.zope.org/namespaces/metal";
   xmlns:i18n="http://xml.zope.org/namespaces/i18n";
-  tal:define="
-    series context;
-    is_focus context/is_development_focus;
-    spec_count_status view/specification_status_counts;"
+  tal:define="spec_count_status view/specification_status_counts"
   >
   <div tal:replace="structure context/@@+detailed-display"/>
       <div>
@@ -39,6 +36,6 @@
         </tal:no-statuses>
       </div>
       <tal:summary
-        condition="series/summary"
+        condition="context/summary"
         content="structure context/summary/fmt:text-to-html" />
 </div>