Author: JonNeal Date: 2008-09-29 15:04:59 -0400 (Mon, 29 Sep 2008) New Revision: 1373
Modified: trunk/pysoy/docs/templates/genindex.html Log: Ticket #964: * Attempted to fix genindex.html, making my brain hurt!! Modified: trunk/pysoy/docs/templates/genindex.html =================================================================== --- trunk/pysoy/docs/templates/genindex.html 2008-09-29 01:19:49 UTC (rev 1372) +++ trunk/pysoy/docs/templates/genindex.html 2008-09-29 19:04:59 UTC (rev 1373) @@ -18,48 +18,62 @@ <hr /> - {% for key, entries in genindexentries %} -<h2 id="{{ key }}">{{ key }}</h2> + <py:for each="key, entries in genindexentries"> +<h2 id="${key}">${key}</h2> <table width="100%" class="indextable"><tr><td width="33%" valign="top"> +<tr><td> + <dl> + <?python + breakat = genindexcounts[loop.index0] // 2 + numcols = 1 + numitems = 0 + ?> + <py:for each="entryname, (links, subitems) in entries"> + <dt> + <py:choose links=""> + <py:when links="True"> + <a href="${links[0]}">${entryname}</a> + <a href="${link}" py:for="link in links[1:]">, [Link]</a> + </py:when> + <py:otherwise>${entryname}</py:otherwise> + </py:choose> + </dt> + <dd py:if="subitems"> + <dl> + <py:for each="subentryname, subentrylinks in subitems"> + <dt> + <a href="${subentrylinks[0]}">${subentryname|e}</a> + <py:for each="link in subentrylinks[1:]">, <a href="${link}">[Link]</a></py:for> + </dt> + </py:for> + </dl> + </dd> + <?python + numitems = numitems + 1 + len(subitems) + ?> + <py:if test="numcols < 2 and numitems > breakat"> + <?python + numcols = numcols+1 + ?> + </py:if> + </py:for> + </dl> +</td></tr> +<tr><td width="33%" valign="top"> <dl> -{%- set breakat = genindexcounts[loop.index0] // 2 %} -{%- set numcols = 1 %} -{%- set numitems = 0 %} -{% for entryname, (links, subitems) in entries %} -<dt>{%- if links -%}<a href="{{ links[0] }}">{{ entryname|e }}</a> - {%- for link in links[1:] %}, <a href="{{ link }}">[Link]</a>{% endfor -%} - {%- else -%} -{{ entryname|e }} - {%- endif -%}</dt> - {%- if subitems %} - <dd><dl> - {%- for subentryname, subentrylinks in subitems %} - <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> - {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[Link]</a>{% endfor -%} - </dt> - {%- endfor %} - </dl></dd> - {%- endif -%} -{%- set numitems = numitems + 1 + len(subitems) -%} -{%- if numcols < 2 and numitems > breakat -%} -{%- set numcols = numcols+1 -%} -</dl></td><td width="33%" valign="top"><dl> -{%- endif -%} -{%- endfor %} -</dl></td></tr></table> -{% endfor %} +<py:if test="split_index"> + <h4>Index</h4> + <p> + <py:for each="key, dummy in genindexentries"> + <a href="${pathto('genindex-' + key)}"><strong>${key}</strong></a> + <py:if test="not loop.last">| </py:if> + </py:for> + </p> + <p><a href="${pathto('genindex-all')}"><strong>Full index on one page</strong></a></p> +</py:if> +</dl> +</td></tr> -{% endblock %} - -{% block sidebarrel %} -{% if split_index %} - <h4>Index</h4> - <p>{% for key, dummy in genindexentries -%} - <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a> - {% if not loop.last %}| {% endif %} - {%- endfor %}</p> - - <p><a href="{{ pathto('genindex-all') }}"><strong>Full index on one page</strong></a></p> -{% endif %} - </py:match> +</table> +</py:for> </html> _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn