mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-10 15:35:59 +01:00
Implement repository url selector
This commit is contained in:
@@ -32,8 +32,29 @@
|
|||||||
<a href="@{url(repository)}/archive/@{encodeRefName(branch)}.zip" class="btn btn-sm btn-default">Download ZIP</a>
|
<a href="@{url(repository)}/archive/@{encodeRefName(branch)}.zip" class="btn btn-sm btn-default">Download ZIP</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div style="width: 200px; margin-top: 2px; margin-right: 5px; margin-left: 5px;">
|
<div style="width: 240px; margin-top: 2px; margin-right: 5px; margin-left: 5px;">
|
||||||
@helper.html.copy("repository-url-copy", repository.httpUrl){
|
@helper.html.copy("repository-url-copy", repository.httpUrl){
|
||||||
|
@if(repository.sshUrl.isDefined){
|
||||||
|
<div class="btn-group input-group-btn">
|
||||||
|
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
<span id="repository-url-proto">HTTP</span> <span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" id="repository-url-http">
|
||||||
|
<strong>HTTP (recommended)</strong><br>
|
||||||
|
Clone with Git using the repository's web address.
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" id="repository-url-ssh">
|
||||||
|
<strong>SSH</strong><br>
|
||||||
|
Clone with an SSH key and passphrase from your GitBucket settings.
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<input type="text" value="@repository.httpUrl" id="repository-url" class="form-control input-sm" readonly>
|
<input type="text" value="@repository.httpUrl" id="repository-url" class="form-control input-sm" readonly>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -158,3 +179,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
<script>
|
||||||
|
@repository.sshUrl.map { sshUrl =>
|
||||||
|
$('#repository-url-http').click(function(){
|
||||||
|
$('#repository-url-proto').text('HTTP');
|
||||||
|
$('#repository-url').val('@repository.httpUrl');
|
||||||
|
$('#repository-clone-url').attr('href', '@openRepoUrl(repository.httpUrl)')
|
||||||
|
$('#repository-url-copy').attr('data-clipboard-text', $('#repository-url').val());
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#repository-url-ssh').click(function(){
|
||||||
|
$('#repository-url-proto').text('SSH');
|
||||||
|
$('#repository-url').val('@sshUrl');
|
||||||
|
$('#repository-clone-url').attr('href', '@openRepoUrl(sshUrl)');
|
||||||
|
$('#repository-url-copy').attr('data-clipboard-text', $('#repository-url').val());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -1185,18 +1185,6 @@ a.absent {
|
|||||||
color: #c00;
|
color: #c00;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
div.wiki-index-header {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
color: #333333;
|
|
||||||
margin: 0;
|
|
||||||
border-top-left-radius: 3px;
|
|
||||||
border-top-right-radius: 3px;
|
|
||||||
border: 1px solid #d8d8d8;
|
|
||||||
padding: 8px 8px 8px 8px;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
div.wiki-sidebar {
|
div.wiki-sidebar {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border: 1px solid #d8d8d8;
|
border: 1px solid #d8d8d8;
|
||||||
@@ -1226,18 +1214,6 @@ div.wiki-footer {
|
|||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
div.wiki-index-content {
|
|
||||||
background-color: white;
|
|
||||||
border: 1px solid #d8d8d8;
|
|
||||||
padding: 0px;
|
|
||||||
border-bottom-left-radius: 3px;
|
|
||||||
border-bottom-right-radius: 3px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
border-top: none;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* Commit */
|
/* Commit */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user