Enhancement of the invalid revision handler

Show the list of available branch
This commit is contained in:
William MARTIN 2011-02-23 18:12:29 +01:00
parent 266c297632
commit 3e238bea0b
2 changed files with 14 additions and 0 deletions

View File

@ -56,11 +56,15 @@ class IDF_Views_Source
public function invalidRevision($request, $match) public function invalidRevision($request, $match)
{ {
$title = sprintf(__('%s Invalid Revision'), (string) $request->project); $title = sprintf(__('%s Invalid Revision'), (string) $request->project);
$scm = IDF_Scm::get($request->project);
$branches = $scm->getBranches();
$commit = $match[2]; $commit = $match[2];
$params = array( $params = array(
'page_title' => $title, 'page_title' => $title,
'title' => $title, 'title' => $title,
'commit' => $commit, 'commit' => $commit,
'branches' => $branches,
); );
return Pluf_Shortcuts_RenderToResponse('idf/source/invalid_revision.html', return Pluf_Shortcuts_RenderToResponse('idf/source/invalid_revision.html',
$params, $request); $params, $request);

View File

@ -5,6 +5,16 @@
<p>{blocktrans}The revision <b>{$commit}</b> is not valid or does not exist <p>{blocktrans}The revision <b>{$commit}</b> is not valid or does not exist
in this repository.{/blocktrans}</p> in this repository.{/blocktrans}</p>
<p>{blocktrans}List of available branch are listed below :{/blocktrans}</p>
<ul>
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<li class="label">
<a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a>
</li>
{/foreach}
</ul>
{if $isOwner or $isMember} {if $isOwner or $isMember}
{aurl 'url', 'IDF_Views_Source::help', array($project.shortname)} {aurl 'url', 'IDF_Views_Source::help', array($project.shortname)}
<p>{blocktrans}If this is a new repository, the reason for this error <p>{blocktrans}If this is a new repository, the reason for this error