Use the branch / tag name shortener in two other templates as well.

This commit is contained in:
Thomas Keller 2010-04-30 02:11:40 +02:00
parent 445c90fefe
commit 601e894935
2 changed files with 15 additions and 8 deletions

View File

@ -2,15 +2,19 @@
{block context} {block context}
<p><strong>{trans 'Branches:'}</strong><br/> <p><strong>{trans 'Branches:'}</strong><br/>
{foreach $branches as $branch => $path} {foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $branch)} {aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a></span><br/> <span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label" title="{if $path}{$path}{else}{$branch}{/if}">
{if $path}{$path|shorten:25}{else}{$branch|shorten:25}{/if}
</a></span><br/>
{/foreach} {/foreach}
</p> </p>
{if $tags} {if $tags}
<p><strong>{trans 'Tags:'}</strong><br/> <p><strong>{trans 'Tags:'}</strong><br/>
{foreach $tags as $tag => $path} {foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $tag)} {aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a></span><br/> <span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label" title="{if $path}{$path}{else}{$tag}{/if}">
{if $path}{$path|shorten:25}{else}{$tag|shorten:25}{/if}
</a></span><br/>
{/foreach} {/foreach}
</p> </p>
{/if} {/if}

View File

@ -6,7 +6,7 @@
<table class="code" summary=" "> <table class="code" summary=" ">
{if !$tree_in and !$tags_in} {if !$tree_in and !$tags_in}
{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $commit)} {aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $commit)}
<tfoot> <tfoot>
<tr><th colspan="2">{blocktrans}Source at commit <a class="mono" href="{$url}">{$commit}</a> created {$cobject.date|dateago}.{/blocktrans}<br/> <tr><th colspan="2">{blocktrans}Source at commit <a class="mono" href="{$url}">{$commit}</a> created {$cobject.date|dateago}.{/blocktrans}<br/>
<span class="smaller">{blocktrans}By {$cobject.author|strip_tags|trim}, {$cobject.title}{/blocktrans}</span> <span class="smaller">{blocktrans}By {$cobject.author|strip_tags|trim}, {$cobject.title}{/blocktrans}</span>
@ -25,19 +25,22 @@
<p><strong>{trans 'Branches:'}</strong><br/> <p><strong>{trans 'Branches:'}</strong><br/>
{foreach $branches as $branch => $path} {foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)} {aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a></span><br/> <span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label" title="{if $path}{$path}{else}{$branch}{/if}">
{if $path}{$path|shorten:25}{else}{$branch|shorten:25}{/if}
</a></span><br/>
{/foreach} {/foreach}
</p> </p>
{if $tags} {if $tags}
<p><strong>{trans 'Tags:'}</strong><br/> <p><strong>{trans 'Tags:'}</strong><br/>
{foreach $tags as $tag => $path} {foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)} {aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a></span><br/> <span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label" title="{if $path}{$path}{else}{$tag}{/if}">
{if $path}{$path|shorten:25}{else}{$tag|shorten:25}{/if}
</a></span><br/>
{/foreach} {/foreach}
</p> </p>
{/if} {/if}
{/block} {/block}
{block javascript} {block javascript}
<script type="text/javascript" src="{media '/idf/js/prettify.js'}"></script> <script type="text/javascript" src="{media '/idf/js/prettify.js'}"></script>
<script type="text/javascript">prettyPrint();</script> <script type="text/javascript">prettyPrint();</script>