From cadbc040a10a6b7473b53e1b4ab820ed180b611f Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Thu, 22 Jan 2009 11:12:41 +0100 Subject: [PATCH] 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. --- src/IDF/Views/Source.php | 20 +++++++++- src/IDF/conf/urls.php | 6 +++ src/IDF/templates/idf/source/git/help.html | 36 ++++++++++++++++++ src/IDF/templates/idf/source/git/tree.html | 2 +- .../templates/idf/source/mercurial/help.html | 31 +++++++++++++++ .../templates/idf/source/mercurial/tree.html | 2 +- src/IDF/templates/idf/source/svn/help.html | 31 +++++++++++++++ src/IDF/templates/idf/source/svn/tree.html | 2 +- www/media/idf/img/help.png | Bin 0 -> 932 bytes 9 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 src/IDF/templates/idf/source/git/help.html create mode 100644 src/IDF/templates/idf/source/mercurial/help.html create mode 100644 src/IDF/templates/idf/source/svn/help.html create mode 100644 www/media/idf/img/help.png diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index 85f21e2..73ac571 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -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); } diff --git a/src/IDF/conf/urls.php b/src/IDF/conf/urls.php index 969151f..07e8bce 100644 --- a/src/IDF/conf/urls.php +++ b/src/IDF/conf/urls.php @@ -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, diff --git a/src/IDF/templates/idf/source/git/help.html b/src/IDF/templates/idf/source/git/help.html new file mode 100644 index 0000000..c6f2146 --- /dev/null +++ b/src/IDF/templates/idf/source/git/help.html @@ -0,0 +1,36 @@ +{extends "idf/source/base.html"} +{block docclass}yui-t2{/block} +{block body} + +

{blocktrans}The team behind {$project} is using +the git software to manage the source +code.{/blocktrans}

+ +

{trans 'Command-Line Access'}

+ +

git clone {$project.getRemoteAccessUrl()}

+ + +{if $isOwner or $isMember} +

{trans 'First Commit'}

+ +

{blocktrans}To make a first commit in the repository, perform the following steps:{/blocktrans}

+ +
+git init
+git add .
+git commit -m "initial import"
+git remote add repo {$project.getRemoteAccessUrl()}
+git push repo master
+
+ +{/if} + +{/block} +{block context} +
+

{blocktrans}Find here more details on how to access {$project} source code.{/blocktrans}

+
+{/block} + + diff --git a/src/IDF/templates/idf/source/git/tree.html b/src/IDF/templates/idf/source/git/tree.html index ec9fb21..a8b664d 100644 --- a/src/IDF/templates/idf/source/git/tree.html +++ b/src/IDF/templates/idf/source/git/tree.html @@ -43,7 +43,7 @@ {aurl 'url', 'IDF_Views_Source::download', array($project.shortname, $commit)} -

{trans 'Archive'} {trans 'Download this version'} {trans 'or'} git clone {$project.getRemoteAccessUrl()}

+

{trans 'Archive'} {trans 'Download this version'} {trans 'or'} git clone {$project.getRemoteAccessUrl()} {trans 'Help'}

{/block} diff --git a/src/IDF/templates/idf/source/mercurial/help.html b/src/IDF/templates/idf/source/mercurial/help.html new file mode 100644 index 0000000..d8108c3 --- /dev/null +++ b/src/IDF/templates/idf/source/mercurial/help.html @@ -0,0 +1,31 @@ +{extends "idf/source/base.html"} +{block docclass}yui-t2{/block} +{block body} + +

{blocktrans}The team behind {$project} is using +the Mercurial software to manage the source +code.{/blocktrans}

+ +

{trans 'Command-Line Access'}

+ +

hg clone {$project.getRemoteAccessUrl()}

+ + +{if $isOwner or $isMember} +

{trans 'Write Access Authentication'}

+ +{aurl 'url', 'IDF_Views_User::myAccount'} +

{blocktrans}To get write access to the repository, you need to use your username and your extra password.{/blocktrans}

+ +

hg clone {$project.getRemoteAccessUrl()}

+ +{/if} + +{/block} +{block context} +
+

{blocktrans}Find here more details on how to access {$project} source code.{/blocktrans}

+
+{/block} + + diff --git a/src/IDF/templates/idf/source/mercurial/tree.html b/src/IDF/templates/idf/source/mercurial/tree.html index 9d0ba7a..6077f33 100644 --- a/src/IDF/templates/idf/source/mercurial/tree.html +++ b/src/IDF/templates/idf/source/mercurial/tree.html @@ -43,7 +43,7 @@ {aurl 'url', 'IDF_Views_Source::download', array($project.shortname, $commit)} -

{trans 'Archive'} {trans 'Download this version'} {trans 'or'} hg clone {$project.getRemoteAccessUrl()}

+

{trans 'Archive'} {trans 'Download this version'} {trans 'or'} hg clone {$project.getRemoteAccessUrl()} {trans 'Help'}

{/block} {block context} diff --git a/src/IDF/templates/idf/source/svn/help.html b/src/IDF/templates/idf/source/svn/help.html new file mode 100644 index 0000000..bb54f68 --- /dev/null +++ b/src/IDF/templates/idf/source/svn/help.html @@ -0,0 +1,31 @@ +{extends "idf/source/base.html"} +{block docclass}yui-t2{/block} +{block body} + +

{blocktrans}The team behind {$project} is using +the subversion software to manage the source +code.{/blocktrans}

+ +

{trans 'Command-Line Access'}

+ +

svn co {$project.getRemoteAccessUrl()}

+ + +{if $isOwner or $isMember} +

{trans 'Write Access Authentication'}

+ +{aurl 'url', 'IDF_Views_User::myAccount'} +

{blocktrans}To get write access to the repository, you need to use your username and your extra password.{/blocktrans}

+ +

svn co {$project.getRemoteAccessUrl()} --username {$user.login}

+ +{/if} + +{/block} +{block context} +
+

{blocktrans}Find here more details on how to access {$project} source code.{/blocktrans}

+
+{/block} + + diff --git a/src/IDF/templates/idf/source/svn/tree.html b/src/IDF/templates/idf/source/svn/tree.html index fa5cc24..3ce66c3 100644 --- a/src/IDF/templates/idf/source/svn/tree.html +++ b/src/IDF/templates/idf/source/svn/tree.html @@ -56,7 +56,7 @@ {/foreach} -

svn co -r {$commit} {$project.getRemoteAccessUrl()}

+

svn co -r {$commit} {$project.getRemoteAccessUrl()} {trans 'Help'}

{/block} diff --git a/www/media/idf/img/help.png b/www/media/idf/img/help.png new file mode 100644 index 0000000000000000000000000000000000000000..f25fc3fbf106af60de59581bf2e6fba58d489bf8 GIT binary patch literal 932 zcmV;V16%xwP)n<^0M7t*KyZHC1w??>xEt=fabLR*P`s^00F8@s%vX0ly3W2Q;1iYQ`2d{1 zn56SU!aH>A*UV&krU`gE?uNYufcfLL`>KjUEiXOnoQe)`qCG}W|1bb+O7eK1#?QvJ zs|dgU_0&(D106tZ+zosBJd?&v>qnWFmUKydqeslSKE)YIWlRZ)Gjda>n*%4R*)(?6s}$J0tF zrB0rXshXW1sfM?{P>GRo72Li*T~yy3kh%V?FTe2QhE1d6Y3FzU6LKF3;uj?|T^;O;NgH2_-9*%2UxlCj?MeRpHZ4w8sFjOr1-Y$4FjHVOs`O z6+Qs2{*%TqbaEVv&fkX!tu7E!h&mkz2FsQcy_m!>B&KO#Sq7GA5DFBqd&fqUQXD+m zfn!?;p^>;U$?D=fJf(uyMMMYXO4>Md`aVN{(Y9gut;(G&D3o z09{?N%Y*_27>1l9_a8%EHtR(M(E9O_Gnox*SF!%CmFQBU zOF`};huu%zOT%N;EOv}x2@;w%)hg>aX0MU5~e$Dv-j=Valc(v;nT_sm!fGJ@x&;<^^bV( zeDYmpd~&)e>v=ba>Hp#^rKnR%1p%a#U9+>