Issue 150: Show public git url for projects

master
Nathan Adams 2016-04-04 19:59:52 -05:00
parent 4e94e60934
commit 1fdddf2501
3 changed files with 14 additions and 3 deletions

View File

@ -383,8 +383,8 @@ class IDF_Scm_Git extends IDF_Scm
public static function getAuthAccessUrl($project, $user, $commit=null)
{
// if the user haven't registred a public ssh key,
// he can't use the write url which use the SSH authentification
// if the user haven't registered a public ssh key,
// he can't use the write url which use the SSH authentication
if ($user != null) {
$keys = $user->get_idf_key_list();
if (count ($keys) == 0)

View File

@ -28,6 +28,16 @@ git push origin master
{/if}
{if !$project.private}
<h3>Public access</h3>
<p>The following URL provides anonymous public access to the repository.</p>
<p>The URL will not work if your project is private.</p>
<kbd>git clone {$project.getRemoteAccessUrl()}</kbd>
{/if}
{/block}
{block context}
<div class="issue-submit-info">

View File

@ -50,7 +50,8 @@
</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.getSourceAccessUrl($user)}</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>
<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.getSourceAccessUrl($user)}</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}