[Catalog-sig] Tab Title customization and Tal to Django/Jinja transition

anatoly techtonik techtonik at gmail.com
Fri Jul 1 08:30:31 CEST 2011


On Fri, Jul 1, 2011 at 3:01 AM, Richard Jones <richard at python.org> wrote:
> On 30 June 2011 04:57, anatoly techtonik <techtonik at gmail.com> wrote:
>> Index: pypi/templates/standard_template.pt
>> ===================================================================
>> -      <title tal:content="string:Python Package Index : ${data/title}" />
>> +      <title tal:content="string:${data/title} : Python Package Index" />
>
> Seems like a good idea. I've double-checked that the easy_install
> "API" doesn't depend on this HTML. Done.

Have you seen the second patch? It should be more cool. I've reattached it.

> Can we stop the rather pointless arguing over templating engines now?

Sure. Pointless arguing is a waste of time. I hoped to get an answer
about superior features of TAL, which didn't seem as popular as
Django/Jinja for me. Now I see that majority of PyPI devs are more
familiar with TAL.

So far my biggest concern is template readability. It will help if my
editor had syntax highlighting for this XML language. All I need for
that is XSD schema. Unfortunately, references contain only EBNF
notation.
--
anatoly t.
-------------- next part --------------
Index: pypi/templates/display.pt
===================================================================
--- pypi/templates/display.pt	(revision 925)
+++ pypi/templates/display.pt	(working copy)
@@ -4,6 +4,8 @@
       xmlns:metal="http://xml.zope.org/namespaces/metal"
       metal:use-macro="standard_template/macros/page">
 
+<metal:fill fill-slot="title" tal:content="string:${data/name} ${data/version}: Python Package Index" />
+
 <metal:fill fill-slot="head">
  <meta tal:condition="data/release/keywords | nothing"
        name="keywords"
Index: pypi/templates/standard_template.pt
===================================================================
--- pypi/templates/standard_template.pt	(revision 925)
+++ pypi/templates/standard_template.pt	(working copy)
@@ -8,7 +8,7 @@
       <META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW" tal:condition="data/norobots"/>
       <meta content="text/html; charset=utf-8" http-equiv="content-type" />
       <base tal:attributes="href data/FULL_PATH_INFO"/>
-      <title tal:content="string:Python Package Index : ${data/title}" />
+      <title metal:define-slot="title" tal:content="Python Package Index : string:${data/title}" />
       <meta tal:attributes="content data/keywords" />
       <meta tal:attributes="content data/description" />
        <link rel="alternate" type="application/rss+xml" title="RSS: 30 latest updates" href="http://www.python.org/pypi?:action=rss"/>
Index: pypi/webui.py
===================================================================
--- pypi/webui.py	(revision 925)
+++ pypi/webui.py	(working copy)
@@ -1348,7 +1348,6 @@
                             name=name, version=version, release=release,
                             description=release.get('summary') or name,
                             keywords=release.get('keywords', ''),
-                            title=name + " " +version,
                             requires=values('requires'),
                             provides=values('provides'),
                             obsoletes=values('obsoletes'),


More information about the Catalog-SIG mailing list