Create valid HTML for the branch and tag list headings (no block

elements inside headings) and also use a lower heading, h3 and not h1
for the subheadings.
Reduce the amount of code duplication with include's for each VCS.
This commit is contained in:
Thomas Keller 2011-01-27 14:12:42 +01:00
parent 2908e28999
commit 7bcfb806b0
16 changed files with 139 additions and 426 deletions

View File

@ -0,0 +1,39 @@
{if !$view_url}
{assign $view_url = 'IDF_Views_Source::treeBase'}
{/if}
<div class="expander">
<div class="gradient"></div>
<h3>
{trans 'Branches'}
<span class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</span>
</h3>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', $view_url, array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h3>
{trans 'Tags'}
<span class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</span>
</h3>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', $view_url, array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a>
</li>
{/foreach}
</ul>
{/if}
</div>

View File

@ -1,38 +1,5 @@
{extends "idf/source/changelog.html"} {extends "idf/source/changelog.html"}
{block context} {block context}
<div class="expander"> {assign $view_url = 'IDF_Views_Source::changeLog'}
<div class="gradient"></div> {include 'idf/source/git/branch_tag_list.html'}
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -1,39 +1,5 @@
{extends "idf/source/commit.html"} {extends "idf/source/commit.html"}
{block context} {block context}
<div class="expander"> {include 'idf/source/git/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -22,41 +22,7 @@
{/block} {/block}
{block context} {block context}
<div class="expander"> {include 'idf/source/git/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}
{block javascript} {block javascript}

View File

@ -52,39 +52,5 @@
{/block} {/block}
{block context} {block context}
<div class="expander"> {include 'idf/source/git/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -0,0 +1,39 @@
{if !$view_url}
{assign $view_url = 'IDF_Views_Source::treeBase'}
{/if}
<div class="expander">
<div class="gradient"></div>
<h3>
{trans 'Branches'}
<span class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</span>
</h3>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', $view_url, array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h3>
{trans 'Tags'}
<span class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</span>
</h3>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', $view_url, array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>

View File

@ -1,39 +1,6 @@
{extends "idf/source/changelog.html"} {extends "idf/source/changelog.html"}
{block context} {block context}
<div class="expander"> {assign $view_url = 'IDF_Views_Source::changeLog'}
<div class="gradient"></div> {include 'idf/source/mercurial/branch_tag_list.html'}
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -1,39 +1,5 @@
{extends "idf/source/commit.html"} {extends "idf/source/commit.html"}
{block context} {block context}
<div class="expander"> {include 'idf/source/mercurial/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{if $path}{$path}{else}{$tag}{/if}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -23,40 +23,7 @@
{/block} {/block}
{block context} {block context}
<div class="expander"> {include 'idf/source/mercurial/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, 'HEAD', $path)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}
{block javascript} {block javascript}

View File

@ -47,40 +47,6 @@
{/block} {/block}
{block context} {block context}
<div class="expander"> {include 'idf/source/mercurial/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<li class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<li class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -0,0 +1,39 @@
{if !$view_url}
{assign $view_url = 'IDF_Views_Source::treeBase'}
{/if}
<div class="expander">
<div class="gradient"></div>
<h3>
{trans 'Branches'}
<span class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</span>
</h3>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{aurl 'url', $view_url, array($project.shortname, $selector)}
<li class="{if in_array($selector, $tree_in)}active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h3>
{trans 'Tags'}
<span class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</span>
</h3>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{aurl 'url', $view_url, array($project.shortname, $selector)}
<li class="{if in_array($selector, $tags_in)}active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>

View File

@ -1,38 +1,5 @@
{extends "idf/source/changelog.html"} {extends "idf/source/changelog.html"}
{block context} {block context}
<div class="expander"> {assign $view_url = 'IDF_Views_Source::changeLog'}
<div class="gradient"></div> {include 'idf/source/mtn/branch_tag_list.html'}
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tree_in)}active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tags_in)}active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -1,38 +1,4 @@
{extends "idf/source/commit.html"} {extends "idf/source/commit.html"}
{block context} {block context}
<div class="expander"> {include 'idf/source/mtn/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tree_in)}active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tags_in)}active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -25,40 +25,6 @@
<script type="text/javascript">prettyPrint();</script> <script type="text/javascript">prettyPrint();</script>
{/block} {/block}
{block context} {block context}
<div class="expander"> {include 'idf/source/mtn/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tree_in)}active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tags_in)}active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -53,40 +53,6 @@
</p> </p>
{/block} {/block}
{block context} {block context}
<div class="expander"> {include 'idf/source/mtn/branch_tag_list.html'}
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tree_in)}active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{if $tags}
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($selector, $tags_in)}active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
{/block} {/block}

View File

@ -863,7 +863,7 @@ ol > li {
*/ */
.context {} .context {}
.context h1 { .context h3 {
font-size: 13px; font-size: 13px;
font-weight: bold; font-weight: bold;
margin: 10px 0 5px; margin: 10px 0 5px;
@ -918,7 +918,7 @@ ol > li {
display: none; display: none;
} }
.context > .expander div.input-with-delete { .context > .expander span.input-with-delete {
padding: 1px; padding: 1px;
border: 1px dotted #474747; border: 1px dotted #474747;
display: none; display: none;
@ -927,11 +927,11 @@ ol > li {
margin-top: -3px; margin-top: -3px;
} }
.context > .expander div.input-with-delete * { .context > .expander span.input-with-delete * {
vertical-align: middle; vertical-align: middle;
} }
.context > .expander div.input-with-delete span { .context > .expander span.input-with-delete span {
display: inline-block; display: inline-block;
width: 13px; width: 13px;
height: 12px; height: 12px;
@ -939,7 +939,7 @@ ol > li {
cursor: pointer; cursor: pointer;
} }
.context > .expander div.input-with-delete input.filter-list { .context > .expander span.input-with-delete input.filter-list {
font-size: 11px; font-size: 11px;
font-weight: normal; font-weight: normal;
color: #333; color: #333;
@ -948,8 +948,8 @@ ol > li {
height: 11px; height: 11px;
} }
.context > .expander:hover div.input-with-delete.activated, .context > .expander:hover span.input-with-delete.activated,
.context > .expander.activated div.input-with-delete.activated { .context > .expander.activated span.input-with-delete.activated {
display: block; display: block;
} }