Fix the branch links users of the Subversion frontend get when they enter

a wrong revision and only display this list if there are any branches
available for all SCMs.
This commit is contained in:
Thomas Keller 2011-06-11 00:47:54 +02:00
parent 2f30e4e2f6
commit 11a234e135
7 changed files with 42 additions and 1 deletions

View File

@ -31,6 +31,8 @@ or newer to properly run this version of Indefero!
a new project or monotone key, in case an error popped up in the middle (issue 697) a new project or monotone key, in case an error popped up in the middle (issue 697)
- Better error detection and reporting in the SyncMonotone plugin - Better error detection and reporting in the SyncMonotone plugin
ATTENTION: This needs Pluf 46b7f251 or newer! ATTENTION: This needs Pluf 46b7f251 or newer!
- Fix the branch links users of the Subversion frontend get when they enter a wrong revision
and only display this list if there are any branches available for all SCMs
## Documentation ## Documentation

View File

@ -66,7 +66,8 @@ class IDF_Views_Source
'commit' => $commit, 'commit' => $commit,
'branches' => $branches, 'branches' => $branches,
); );
return Pluf_Shortcuts_RenderToResponse('idf/source/invalid_revision.html', $scmConf = $request->conf->getVal('scm', 'git');
return Pluf_Shortcuts_RenderToResponse('idf/source/'.$scmConf.'/invalid_revision.html',
$params, $request); $params, $request);
} }

View File

@ -0,0 +1,2 @@
{extends "idf/source/invalid_revision.html"}

View File

@ -5,6 +5,7 @@
<p>{blocktrans}The branch or revision <b>{$commit}</b> is not valid or does not exist <p>{blocktrans}The branch or revision <b>{$commit}</b> is not valid or does not exist
in this repository.{/blocktrans}</p> in this repository.{/blocktrans}</p>
{if count($branches) > 0}
<p>{blocktrans}The following list shows all available branches:{/blocktrans}</p> <p>{blocktrans}The following list shows all available branches:{/blocktrans}</p>
<ul> <ul>
{foreach $branches as $branch => $path} {foreach $branches as $branch => $path}
@ -14,6 +15,7 @@ in this repository.{/blocktrans}</p>
</li> </li>
{/foreach} {/foreach}
</ul> </ul>
{/if}
{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)}

View File

@ -0,0 +1,2 @@
{extends "idf/source/invalid_revision.html"}

View File

@ -0,0 +1,2 @@
{extends "idf/source/invalid_revision.html"}

View File

@ -0,0 +1,30 @@
{extends "idf/source/base.html"}
{block docclass}yui-t2{assign $inError=true}{/block}
{block body}
<p>{blocktrans}The revision <b>{$commit}</b> is not valid or does not exist
in this repository.{/blocktrans}</p>
{if count($branches) > 0}
<p>{blocktrans}The following list shows all available branches:{/blocktrans}</p>
<ul>
{foreach $branches as $branch => $path}
{if $path}{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, 'HEAD', $path)}
{else}{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, 'HEAD')}{/if}
<li class="label">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</ul>
{/if}
{if $isOwner or $isMember}
{aurl 'url', 'IDF_Views_Source::help', array($project.shortname)}
<p>{blocktrans}If this is a new repository, the reason for this error
could be that you have not committed and / or pushed any change so far.
In this case please take a look at the <a href="{$url}">Help</a> page
how to access your repository.{/blocktrans}</p>
{/if}
{/block}