Fixed issue 101, better information for the Subversion login/password.
A nice little help icon is providing more information for the checkout. This for all the backends.
This commit is contained in:
parent
6b32413e69
commit
cadbc040a1
@ -37,6 +37,24 @@ class IDF_Views_Source
|
||||
'pl', 'pm', 'rb', 'js', 'html',
|
||||
'html', 'xhtml', 'xml', 'xsl');
|
||||
|
||||
/**
|
||||
* Display help on how to checkout etc.
|
||||
*/
|
||||
public $help_precond = array('IDF_Precondition::accessSource');
|
||||
public function help($request, $match)
|
||||
{
|
||||
$title = sprintf(__('%s Source Help'), (string) $request->project);
|
||||
$scm = IDF_Scm::get($request->project);
|
||||
$scmConf = $request->conf->getVal('scm', 'git');
|
||||
$params = array(
|
||||
'page_title' => $title,
|
||||
'title' => $title,
|
||||
'scm' => $scmConf,
|
||||
);
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/source/'.$scmConf.'/help.html',
|
||||
$params, $request);
|
||||
}
|
||||
|
||||
public $changeLog_precond = array('IDF_Precondition::accessSource');
|
||||
public function changeLog($request, $match)
|
||||
{
|
||||
@ -82,7 +100,7 @@ class IDF_Views_Source
|
||||
$branches = $scm->getBranches();
|
||||
if (count($branches) == 0) {
|
||||
// Redirect to the project home
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Project::home',
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::help',
|
||||
array($request->project->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
@ -164,6 +164,12 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/view/attachment/(\d+)/(.*)$#',
|
||||
|
||||
// ---------- SCM ----------------------------------------
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/source/help/$#',
|
||||
'base' => $base,
|
||||
'priority' => 4,
|
||||
'model' => 'IDF_Views_Source',
|
||||
'method' => 'help');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/source/tree/([^/]+)/$#',
|
||||
'base' => $base,
|
||||
'priority' => 4,
|
||||
|
36
src/IDF/templates/idf/source/git/help.html
Normal file
36
src/IDF/templates/idf/source/git/help.html
Normal file
@ -0,0 +1,36 @@
|
||||
{extends "idf/source/base.html"}
|
||||
{block docclass}yui-t2{/block}
|
||||
{block body}
|
||||
|
||||
<p>{blocktrans}The team behind {$project} is using
|
||||
the <strong>git</strong> software to manage the source
|
||||
code.{/blocktrans}</p>
|
||||
|
||||
<h3>{trans 'Command-Line Access'}</h3>
|
||||
|
||||
<p><kbd>git clone {$project.getRemoteAccessUrl()}</kbd></p>
|
||||
|
||||
|
||||
{if $isOwner or $isMember}
|
||||
<h3>{trans 'First Commit'}</h3>
|
||||
|
||||
<p>{blocktrans}To make a first commit in the repository, perform the following steps:{/blocktrans}</p>
|
||||
|
||||
<pre>
|
||||
git init
|
||||
git add .
|
||||
git commit -m "initial import"
|
||||
git remote add repo {$project.getRemoteAccessUrl()}
|
||||
git push repo master
|
||||
</pre>
|
||||
|
||||
{/if}
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
<p>{blocktrans}Find here more details on how to access {$project} source code.{/blocktrans}</p>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
{aurl 'url', 'IDF_Views_Source::download', array($project.shortname, $commit)}
|
||||
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this version'}</a> {trans 'or'} <kbd>git clone {$project.getRemoteAccessUrl()}</kbd></p>
|
||||
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this version'}</a> {trans 'or'} <kbd>git clone {$project.getRemoteAccessUrl()}</kbd> <a href="{url 'IDF_Views_Source::help', array($project.shortname)}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/help.png'}" alt="{trans 'Help'}" /></a></p>
|
||||
|
||||
|
||||
{/block}
|
||||
|
31
src/IDF/templates/idf/source/mercurial/help.html
Normal file
31
src/IDF/templates/idf/source/mercurial/help.html
Normal file
@ -0,0 +1,31 @@
|
||||
{extends "idf/source/base.html"}
|
||||
{block docclass}yui-t2{/block}
|
||||
{block body}
|
||||
|
||||
<p>{blocktrans}The team behind {$project} is using
|
||||
the <strong>Mercurial</strong> software to manage the source
|
||||
code.{/blocktrans}</p>
|
||||
|
||||
<h3>{trans 'Command-Line Access'}</h3>
|
||||
|
||||
<p><kbd>hg clone {$project.getRemoteAccessUrl()}</kbd></p>
|
||||
|
||||
|
||||
{if $isOwner or $isMember}
|
||||
<h3>{trans 'Write Access Authentication'}</h3>
|
||||
|
||||
{aurl 'url', 'IDF_Views_User::myAccount'}
|
||||
<p>{blocktrans}To get write access to the repository, you need to use your username and your <a href="{$url}">extra password</a>.{/blocktrans}</p>
|
||||
|
||||
<p><kbd>hg clone {$project.getRemoteAccessUrl()}</kbd></p>
|
||||
|
||||
{/if}
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
<p>{blocktrans}Find here more details on how to access {$project} source code.{/blocktrans}</p>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
{aurl 'url', 'IDF_Views_Source::download', array($project.shortname, $commit)}
|
||||
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this version'}</a> {trans 'or'} <kbd>hg clone {$project.getRemoteAccessUrl()}</kbd></p>
|
||||
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this version'}</a> {trans 'or'} <kbd>hg clone {$project.getRemoteAccessUrl()}</kbd> <a href="{url 'IDF_Views_Source::help', array($project.shortname)}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/help.png'}" alt="{trans 'Help'}" /></a></p>
|
||||
{/block}
|
||||
|
||||
{block context}
|
||||
|
31
src/IDF/templates/idf/source/svn/help.html
Normal file
31
src/IDF/templates/idf/source/svn/help.html
Normal file
@ -0,0 +1,31 @@
|
||||
{extends "idf/source/base.html"}
|
||||
{block docclass}yui-t2{/block}
|
||||
{block body}
|
||||
|
||||
<p>{blocktrans}The team behind {$project} is using
|
||||
the <strong>subversion</strong> software to manage the source
|
||||
code.{/blocktrans}</p>
|
||||
|
||||
<h3>{trans 'Command-Line Access'}</h3>
|
||||
|
||||
<p><kbd>svn co {$project.getRemoteAccessUrl()}</kbd></p>
|
||||
|
||||
|
||||
{if $isOwner or $isMember}
|
||||
<h3>{trans 'Write Access Authentication'}</h3>
|
||||
|
||||
{aurl 'url', 'IDF_Views_User::myAccount'}
|
||||
<p>{blocktrans}To get write access to the repository, you need to use your username and your <a href="{$url}">extra password</a>.{/blocktrans}</p>
|
||||
|
||||
<p><kbd>svn co {$project.getRemoteAccessUrl()} --username {$user.login}</kbd></p>
|
||||
|
||||
{/if}
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
<p>{blocktrans}Find here more details on how to access {$project} source code.{/blocktrans}</p>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="right soft"><kbd>svn co -r {$commit} {$project.getRemoteAccessUrl()}</kbd></p>
|
||||
<p class="right soft"><kbd>svn co -r {$commit} {$project.getRemoteAccessUrl()}</kbd> <a href="{url 'IDF_Views_Source::help', array($project.shortname)}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/help.png'}" alt="{trans 'Help'}" /></a></p>
|
||||
|
||||
|
||||
{/block}
|
||||
|
BIN
www/media/idf/img/help.png
Normal file
BIN
www/media/idf/img/help.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 932 B |
Loading…
Reference in New Issue
Block a user