mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 16:35:52 +01:00
Change package name
This commit is contained in:
134
src/main/twirl/gitbucket/core/repo/blob.scala.html
Normal file
134
src/main/twirl/gitbucket/core/repo/blob.scala.html
Normal file
@@ -0,0 +1,134 @@
|
||||
@(branch: String,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
pathList: List[String],
|
||||
content: gitbucket.core.util.JGitUtil.ContentInfo,
|
||||
latestCommit: gitbucket.core.util.JGitUtil.CommitInfo,
|
||||
hasWritePermission: Boolean)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository){
|
||||
<div class="head">
|
||||
@helper.html.branchcontrol(
|
||||
branch,
|
||||
repository,
|
||||
hasWritePermission
|
||||
){
|
||||
@repository.branchList.map { x =>
|
||||
<li><a href="@url(repository)/blob/@encodeRefName(x)/@pathList.mkString("/")">@helper.html.checkicon(x == branch) @x</a></li>
|
||||
}
|
||||
}
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
|
||||
@pathList.zipWithIndex.map { case (section, i) =>
|
||||
@if(i == pathList.length - 1){
|
||||
@section
|
||||
} else {
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered blobview">
|
||||
<tr>
|
||||
<th style="font-weight: normal;">
|
||||
<div class="pull-left">
|
||||
@avatar(latestCommit, 20)
|
||||
@user(latestCommit.authorName, latestCommit.authorEmailAddress, "username strong")
|
||||
<span class="muted">@helper.html.datetimeago(latestCommit.commitTime)</span>
|
||||
<a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a>
|
||||
</div>
|
||||
<div class="btn-group pull-right">
|
||||
@if(hasWritePermission && content.viewType == "text" && repository.branchList.contains(branch)){
|
||||
<a class="btn btn-mini" href="@url(repository)/edit/@encodeRefName(branch)/@pathList.mkString("/")">Edit</a>
|
||||
}
|
||||
<a class="btn btn-mini" href="?raw=true">Raw</a>
|
||||
<a class="btn btn-mini" href="@url(repository)/commits/@encodeRefName(branch)/@pathList.mkString("/")">History</a>
|
||||
@if(hasWritePermission){
|
||||
<a class="btn btn-mini btn-danger" href="@url(repository)/remove/@encodeRefName(branch)/@pathList.mkString("/")">Delete</a>
|
||||
}
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@if(content.viewType == "text"){
|
||||
@defining(pathList.reverse.head) { file =>
|
||||
@if(renderableSuffixes.find(suffix => file.toLowerCase.endsWith(suffix))) {
|
||||
<div class="box-content markdown-body" style="border: none; padding-left: 16px; padding-right: 16px;">
|
||||
@renderMarkup(pathList, content.content.get, branch, repository, false, false)
|
||||
</div>
|
||||
} else {
|
||||
<pre class="prettyprint linenums blob">@content.content.get</pre>
|
||||
}
|
||||
}
|
||||
}
|
||||
@if(content.viewType == "image"){
|
||||
<img src="?raw=true"/>
|
||||
}
|
||||
@if(content.viewType == "large" || content.viewType == "binary"){
|
||||
<div style="text-align: center; padding-top: 20px; padding-bottom: 20px;">
|
||||
<a href="?raw=true">View Raw</a><br>
|
||||
<br>
|
||||
(Sorry about that, but we can't show files that are this big right now)
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
}
|
||||
<script src="@assets/vendors/jquery/jquery.ba-hashchange.js"></script>
|
||||
<script>
|
||||
$(window).load(function(){
|
||||
$(window).hashchange(function(){
|
||||
updateHighlighting();
|
||||
}).hashchange();
|
||||
|
||||
$('pre.prettyprint ol.linenums li').each(function(i, e){
|
||||
var pre = $('pre.prettyprint');
|
||||
pre.append($('<div class="source-line-num">')
|
||||
.data('line', (i + 1))
|
||||
.css({
|
||||
cursor : 'pointer',
|
||||
position: 'absolute',
|
||||
top : $(e).position().top + 'px',
|
||||
left : pre.position().left + 'px',
|
||||
width : ($(e).position().left - pre.position().left) + 'px',
|
||||
height : '16px'
|
||||
}));
|
||||
});
|
||||
|
||||
$('div.source-line-num').click(function(e){
|
||||
var line = $(e.target).data('line');
|
||||
var hash = location.hash;
|
||||
if(e.shiftKey == true && hash.match(/#L\d+(-L\d+)?/)){
|
||||
var lines = hash.split('-');
|
||||
location.hash = lines[0] + '-L' + line;
|
||||
} else {
|
||||
location.hash = '#L' + line;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Hightlight lines which are specified by URL hash.
|
||||
*/
|
||||
function updateHighlighting(){
|
||||
var hash = location.hash;
|
||||
if(hash.match(/#L\d+(-L\d+)?/)){
|
||||
$('li.highlight').removeClass('highlight');
|
||||
var lines = hash.substr(1).split('-');
|
||||
if(lines.length == 1){
|
||||
$('#' + lines[0]).addClass('highlight');
|
||||
$(window).scrollTop($('#' + lines[0]).offset().top - 40);
|
||||
} else if(lines.length > 1){
|
||||
var start = parseInt(lines[0].substr(1));
|
||||
var end = parseInt(lines[1].substr(1));
|
||||
for(var i = start; i <= end; i++){
|
||||
$('#L' + i).addClass('highlight');
|
||||
}
|
||||
$(window).scrollTop($('#L' + start).offset().top - 40);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
83
src/main/twirl/gitbucket/core/repo/branches.scala.html
Normal file
83
src/main/twirl/gitbucket/core/repo/branches.scala.html
Normal file
@@ -0,0 +1,83 @@
|
||||
@(branchInfo: Seq[(gitbucket.core.util.JGitUtil.BranchInfo, Option[(gitbucket.core.model.PullRequest, gitbucket.core.model.Issue)])],
|
||||
hasWritePermission: Boolean,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository){
|
||||
<h1>Branches</h1>
|
||||
<table class="table table-bordered table-hover table-issues branches">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="background: #f5f5f5;color: #666;">All branches</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@branchInfo.map { case (branch, prs) =>
|
||||
<tr><td style="padding: 12px;">
|
||||
<div class="branch-action">
|
||||
@branch.mergeInfo.map{ info =>
|
||||
@prs.map{ case (pull, issue) =>
|
||||
<a href="@url(repository)/pull/@issue.issueId" title="@issue.title">#@issue.issueId</a>
|
||||
@if(issue.closed) {
|
||||
@if(info.isMerged){
|
||||
<a href="@url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-info">Merged</a>
|
||||
}else{
|
||||
<a href="@url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-important">Closed</a>
|
||||
}
|
||||
} else {
|
||||
<a href="@url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-success">Open</a>
|
||||
}
|
||||
}.getOrElse{
|
||||
@if(context.loginAccount.isDefined){
|
||||
<a href="@url(repository)/compare/@{encodeRefName(repository.repository.defaultBranch)}...@{encodeRefName(branch.name)}?expand=1" class="btn btn-small">New Pull Request</a>
|
||||
}else{
|
||||
<a href="@url(repository)/compare/@{encodeRefName(repository.repository.defaultBranch)}...@{encodeRefName(branch.name)}" class="btn btn-small">Compare</a>
|
||||
}
|
||||
}
|
||||
@if(hasWritePermission){
|
||||
@if(prs.map(!_._2.closed).getOrElse(false)){
|
||||
<a class="btn disabled btn-mini" data-toggle="tooltip" title="You can’t delete this branch because it has an open pull request"><i class="icon icon-trash icon-white"></i></a>
|
||||
}else{
|
||||
<a href="@url(repository)/delete/@encodeRefName(branch.name)" class="btn @if(info.isMerged){ btn-warning }else{ btn-danger } delete-branch btn-mini" data-name="@branch.name" @if(info.isMerged){ data-toggle="tooltip" title="this branch is merged" }><i class="icon icon-trash icon-white"></i></a>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="branch-details">
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch.name)" class="branch-name">@branch.name</a>
|
||||
<span class="branch-meta">
|
||||
<span>Updated @helper.html.datetimeago(branch.commitTime, false)
|
||||
by <span>@user(branch.committerName, branch.committerEmailAddress, "muted-link")</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="branch-a-b-count">
|
||||
@if(branch.mergeInfo.isEmpty){
|
||||
<span class="label">Default</span>
|
||||
}else{
|
||||
@branch.mergeInfo.map{ info =>
|
||||
<div data-toggle="tooltip" title="@info.ahead commits ahead, @info.behind commits behind @repository.repository.defaultBranch">
|
||||
<div class="a-b-count-widget">
|
||||
<div class="count-half"><div class="count-value">@info.ahead</div></div>
|
||||
<div class="count-half"><div class="count-value">@info.behind</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('.delete-branch').click(function(e){
|
||||
var branchName = $(e.target).data('name');
|
||||
return confirm('Are you sure you want to remove the ' + branchName + ' branch?');
|
||||
});
|
||||
$('*[data-toggle=tooltip]').tooltip().css("white-space","nowrap");
|
||||
});
|
||||
</script>
|
||||
71
src/main/twirl/gitbucket/core/repo/commentform.scala.html
Normal file
71
src/main/twirl/gitbucket/core/repo/commentform.scala.html
Normal file
@@ -0,0 +1,71 @@
|
||||
@(commitId: String,
|
||||
fileName: Option[String] = None,
|
||||
oldLineNumber: Option[Int] = None,
|
||||
newLineNumber: Option[Int] = None,
|
||||
issueId: Option[Int] = None,
|
||||
hasWritePermission: Boolean,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@if(loginAccount.isDefined){
|
||||
@if(!fileName.isDefined){<hr/><br/>}
|
||||
<form method="POST" validate="true" style="max-width: 874px;">
|
||||
@if(!fileName.isDefined){
|
||||
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
||||
}
|
||||
<div class="box issue-comment-box">
|
||||
<div class="box-content">
|
||||
@helper.html.preview(repository, "", false, true, true, hasWritePermission, "width: 635px; height: 100px; max-height: 150px;", elastic = true)
|
||||
</div>
|
||||
@if(fileName.isDefined){
|
||||
<div class="pull-right" style="margin-top: 10px;">
|
||||
<input type="button" class="btn btn-default" value="Cancel"/>
|
||||
<input type="submit" class="btn btn-success btn-inline-comment" formaction="@url(repository)/commit/@commitId/comment/new" value="Comment"/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if(!fileName.isDefined){
|
||||
<div class="pull-right">
|
||||
<input type="submit" class="btn btn-success" formaction="@url(repository)/commit/@commitId/comment/new" value="Comment on this commit"/>
|
||||
</div>
|
||||
}
|
||||
@issueId.map { issueId => <input type="hidden" name="issueId" value="@issueId"> }
|
||||
@fileName.map { fileName => <input type="hidden" name="fileName" value="@fileName"> }
|
||||
@oldLineNumber.map { oldLineNumber => <input type="hidden" name="oldLineNumber" value="@oldLineNumber"> }
|
||||
@newLineNumber.map { newLineNumber => <input type="hidden" name="newLineNumber" value="@newLineNumber"> }
|
||||
</form>
|
||||
<script>
|
||||
$('.btn-inline-comment').click(function(e) {
|
||||
e.preventDefault();
|
||||
$form = $(e.target).attr('disabled', 'disabled').closest('form');
|
||||
var param = {};
|
||||
$($form.serializeArray()).each(function(i, v) {
|
||||
param[v.name] = v.value;
|
||||
});
|
||||
$.ajax({
|
||||
url: '@url(repository)/commit/@commitId/comment/_data/new',
|
||||
type: 'POST',
|
||||
data: param
|
||||
}).done(function(data) {
|
||||
var tmp;
|
||||
if (window.viewType == 0) {
|
||||
tmp = '@(oldLineNumber, newLineNumber) match {
|
||||
case (Some(_), None) => {<td colspan="2" class="comment-box-container"></td><td colspan="2"></td>}
|
||||
case (None, Some(_)) => {<td colspan="2"></td><td colspan="2" class="comment-box-container"></td>}
|
||||
case _ => {<td colspan="3" class="comment-box-container"></td>}
|
||||
}'
|
||||
} else {
|
||||
tmp = '<td colspan="3" class="comment-box-container"></td>'
|
||||
}
|
||||
$form.closest('tr').removeClass('inline-comment-form').html(tmp).find('.comment-box-container').html(data);
|
||||
$('#comment-list').append(data);
|
||||
if (typeof $('#show-notes')[0] !== 'undefined' && !$('#show-notes')[0].checked) {
|
||||
$('#comment-list').children('.inline-comment').hide();
|
||||
}
|
||||
}).fail(function(req) {
|
||||
$('.btn-inline-comment').removeAttr('disabled');
|
||||
$('#error-content', $form).html($.parseJSON(req.responseText).content);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
}
|
||||
154
src/main/twirl/gitbucket/core/repo/commit.scala.html
Normal file
154
src/main/twirl/gitbucket/core/repo/commit.scala.html
Normal file
@@ -0,0 +1,154 @@
|
||||
@(commitId: String,
|
||||
commit: gitbucket.core.util.JGitUtil.CommitInfo,
|
||||
branches: List[String],
|
||||
tags: List[String],
|
||||
comments: List[gitbucket.core.model.Comment],
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
diffs: Seq[gitbucket.core.util.JGitUtil.DiffInfo],
|
||||
oldCommitId: Option[String],
|
||||
hasWritePermission: Boolean)(implicit context: gitbucket.core.controller.Context)
|
||||
@import gitbucket.core.util.Implicits._
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(commit.shortMessage, Some(repository)){
|
||||
@html.menu("code", repository){
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>
|
||||
<div class="pull-right align-right">
|
||||
<a href="@url(repository)/tree/@commit.id" class="btn btn-small">Browse code</a>
|
||||
</div>
|
||||
<div class="commit-log">@link(commit.summary, repository)</div>
|
||||
@if(commit.description.isDefined){
|
||||
<pre class="commit-description">@link(commit.description.get, repository)</pre>
|
||||
}
|
||||
<div class="small" style="font-weight: normal;">
|
||||
@if(branches.nonEmpty){
|
||||
<span class="muted">
|
||||
<img src="@assets/common/images/branch.png"/>
|
||||
@branches.zipWithIndex.map { case (branch, i) =>
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)" class="branch" id="branch-@i">@branch</a>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@if(tags.nonEmpty){
|
||||
<span class="muted">
|
||||
<img src="@assets/common/images/tag.png"/>
|
||||
@tags.zipWithIndex.map { case (tag, i) =>
|
||||
<a href="@url(repository)/tree/@tag" class="tag" id="tag-@i">@tag</a>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="pull-right monospace small" style="text-align: right;">
|
||||
<div>
|
||||
@if(commit.parents.size == 0){
|
||||
<span class="muted">0 parent</span>
|
||||
}
|
||||
@if(commit.parents.size == 1){
|
||||
<span class="muted">1 parent</span>
|
||||
<a href="@url(repository)/commit/@commit.parents(0)" class="commit-id">@commit.parents(0).substring(0, 7)</a>
|
||||
}
|
||||
<span class="muted">commit</span> @commit.id
|
||||
</div>
|
||||
@if(commit.parents.size > 1){
|
||||
<div>
|
||||
<span class="muted">@commit.parents.size parents
|
||||
@commit.parents.map { parent =>
|
||||
<a href="@url(repository)/commit/@parent" class="commit-id">@parent.substring(0, 7)</a>
|
||||
}.mkHtml(" + ")
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="author-info">
|
||||
<div class="author">
|
||||
@avatar(commit, 20)
|
||||
<span>@user(commit.authorName, commit.authorEmailAddress, "username strong")</span>
|
||||
<span class="muted">authored @helper.html.datetimeago(commit.authorTime)</span>
|
||||
</div>
|
||||
@if(commit.isDifferentFromAuthor) {
|
||||
<div class="committer">
|
||||
<span class="icon-arrow-right"></span>
|
||||
<span>@user(commit.committerName, commit.committerEmailAddress, "username strong")</span>
|
||||
<span class="muted"> committed @helper.html.datetimeago(commit.commitTime)</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@helper.html.diff(diffs, repository, Some(commit.id), oldCommitId, true, None, hasWritePermission, true)
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" id="show-notes"> Show line notes below
|
||||
</label>
|
||||
<div id="comment-list">
|
||||
@issues.html.commentlist(None, comments, hasWritePermission, repository, None)
|
||||
</div>
|
||||
@commentform(commitId = commitId, hasWritePermission = hasWritePermission, repository = repository)
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('a.branch:first, a.tag:first').css({
|
||||
'font-weight': 'bold',
|
||||
'color': '#555555'
|
||||
});
|
||||
|
||||
@if(branches.size > 5){
|
||||
// hide branches
|
||||
@for(i <- 1 to branches.size - 2){
|
||||
$('#branch-@i').hide();
|
||||
}
|
||||
// add omit link
|
||||
$('#branch-@(branches.size - 1)').before(
|
||||
$('<a href="javascript:void(0);" class="omit">...</a>').click(function(){
|
||||
@for(i <- 1 to branches.size - 2){
|
||||
$('#branch-@i').show();
|
||||
this.remove();
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@if(tags.size > 5){
|
||||
// hide tags
|
||||
@for(i <- 1 to tags.size - 2){
|
||||
$('#tag-@i').hide();
|
||||
}
|
||||
// add omit link
|
||||
$('#tag-@(tags.size - 1)').before(
|
||||
$('<a href="javascript:void(0);" class="omit">...</a>').click(function(){
|
||||
@for(i <- 1 to tags.size - 2){
|
||||
$('#tag-@i').show();
|
||||
this.remove();
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
$('#show-notes').change(function() {
|
||||
if (this.checked) {
|
||||
$('.inline-comment').show();
|
||||
} else {
|
||||
$('.inline-comment').hide();
|
||||
$('.diff .inline-comment').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
a.branch, a.tag {
|
||||
color: #888888;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
a.omit {
|
||||
margin-right: 4px;
|
||||
}
|
||||
</style>
|
||||
81
src/main/twirl/gitbucket/core/repo/commits.scala.html
Normal file
81
src/main/twirl/gitbucket/core/repo/commits.scala.html
Normal file
@@ -0,0 +1,81 @@
|
||||
@(pathList: List[String],
|
||||
branch: String,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
commits: Seq[Seq[gitbucket.core.util.JGitUtil.CommitInfo]],
|
||||
page: Int,
|
||||
hasNext: Boolean,
|
||||
hasWritePermission: Boolean)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository){
|
||||
<div class="head">
|
||||
@helper.html.branchcontrol(
|
||||
branch,
|
||||
repository,
|
||||
hasWritePermission
|
||||
){
|
||||
@repository.branchList.map { x =>
|
||||
<li><a href="@url(repository)/commits/@encodeRefName(x)">@helper.html.checkicon(x == branch) @x</a></li>
|
||||
}
|
||||
}
|
||||
@if(pathList.isEmpty){
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / Commit History
|
||||
}
|
||||
@if(pathList.nonEmpty){
|
||||
<span class="muted">History for</span>
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
|
||||
@pathList.zipWithIndex.map { case (section, i) =>
|
||||
@if(i == pathList.length - 1){
|
||||
@section
|
||||
} else {
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@commits.map { day =>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>@date(day.head.commitTime)</th>
|
||||
</tr>
|
||||
@day.map { commit =>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="pull-right align-right">
|
||||
<a href="@url(repository)/commit/@commit.id" class="btn btn-small monospace">@commit.id.substring(0, 10)</a><br>
|
||||
<a href="@url(repository)/tree/@commit.id" class="small">Browse code</a>
|
||||
</div>
|
||||
<div>
|
||||
<div class="commit-avatar-image">@avatar(commit, 40)</div>
|
||||
<div class="commit-message-box">
|
||||
<a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a>
|
||||
@if(commit.description.isDefined){
|
||||
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a>
|
||||
}
|
||||
<br>
|
||||
@if(commit.description.isDefined){
|
||||
<pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre>
|
||||
}
|
||||
<div class="small">
|
||||
@user(commit.authorName, commit.authorEmailAddress, "username")
|
||||
<span class="muted">authored @helper.html.datetimeago(commit.authorTime)</span>
|
||||
@if(commit.isDifferentFromAuthor) {
|
||||
<span class="icon-arrow-right" style="margin-top : -2px ;"></span>
|
||||
@user(commit.committerName, commit.committerEmailAddress, "username")
|
||||
<span class="muted">committed @helper.html.datetimeago(commit.authorTime)</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
<div class="btn-group">
|
||||
<button class="btn" onclick="location.href='?page=@{page - 1}'"@if(page <= 1){ disabled="true"}>< Newer</button>
|
||||
<button class="btn" onclick="location.href='?page=@{page + 1}'"@if(!hasNext){ disabled="true"}>Older ></button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
61
src/main/twirl/gitbucket/core/repo/delete.scala.html
Normal file
61
src/main/twirl/gitbucket/core/repo/delete.scala.html
Normal file
@@ -0,0 +1,61 @@
|
||||
@(branch: String,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
pathList: List[String],
|
||||
fileName: String,
|
||||
content: gitbucket.core.util.JGitUtil.ContentInfo)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"Deleting ${path} at ${fileName} - ${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository){
|
||||
<form method="POST" action="@url(repository)/remove" validate="true">
|
||||
<div class="head">
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
|
||||
@pathList.zipWithIndex.map { case (section, i) =>
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
|
||||
}
|
||||
@fileName
|
||||
<input type="hidden" name="fileName" id="fileName" value="@fileName"/>
|
||||
<input type="hidden" name="branch" id="branch" value="@branch"/>
|
||||
<input type="hidden" name="path" id="path" value="@pathList.mkString("/")"/>
|
||||
</div>
|
||||
<table class="table table-bordered">
|
||||
<th style="font-weight: normal;" class="box-header">
|
||||
@fileName
|
||||
<div class="pull-right align-right">
|
||||
<a href="@url(repository)/blob/@branch/@{(pathList ::: List(fileName)).mkString("/")}" class="btn btn-small">View</a>
|
||||
</div>
|
||||
</th>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="diffText"></div>
|
||||
<textarea id="newText" style="display: none;"></textarea>
|
||||
<textarea id="oldText" style="display: none;">@content.content</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
||||
<div class="box issue-comment-box">
|
||||
<div class="box-content">
|
||||
<div>
|
||||
<strong>Commit changes</strong>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" name="message" style="width: 98%;"/>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<a href="@url(repository)/blob/@encodeRefName(branch)/@pathList.mkString("/")" class="btn btn-danger">Cancel</a>
|
||||
<input type="submit" id="commit" class="btn btn-success" value="Commit changes"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
}
|
||||
<script type="text/javascript" src="@assets/vendors/jsdifflib/difflib.js"></script>
|
||||
<script type="text/javascript" src="@assets/vendors/jsdifflib/diffview.js"></script>
|
||||
<link href="@assets/vendors/jsdifflib/diffview.css" type="text/css" rel="stylesheet" />
|
||||
<script>
|
||||
$(function(){
|
||||
diffUsingJS('oldText', 'newText', 'diffText', 1);
|
||||
});
|
||||
</script>
|
||||
45
src/main/twirl/gitbucket/core/repo/editcomment.scala.html
Normal file
45
src/main/twirl/gitbucket/core/repo/editcomment.scala.html
Normal file
@@ -0,0 +1,45 @@
|
||||
@(content: String, commentId: Int, owner: String, repository: String)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
<span class="error-edit-content-@commentId error"></span>
|
||||
@helper.html.attached(owner, repository){
|
||||
<textarea style="width: 635px; height: 100px;" id="edit-content-@commentId">@content</textarea>
|
||||
}
|
||||
<div>
|
||||
<input type="button" class="cancel-comment-@commentId btn btn-small btn-danger" value="Cancel"/>
|
||||
<input type="button" class="update-comment-@commentId btn btn-small pull-right" value="Update comment"/>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
var curriedCallback = function($box) {
|
||||
return function(data){
|
||||
$('.update-comment-@commentId, .cancel-comment-@commentId', $box).removeAttr('disabled');
|
||||
$('.commit-commentContent-@commentId').empty().html(data.content);
|
||||
prettyPrint();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click', '.update-comment-@commentId', function(){
|
||||
$box = $(this).closest('.box');
|
||||
$('.update-comment-@commentId, .cancel-comment-@commentId', $box).attr('disabled', 'disabled');
|
||||
$.ajax({
|
||||
url: '@path/@owner/@repository/commit_comments/edit/@commentId',
|
||||
type: 'POST',
|
||||
data: {
|
||||
content : $('#edit-content-@commentId', $box).val()
|
||||
}
|
||||
}).done(
|
||||
curriedCallback($box)
|
||||
).fail(function(req) {
|
||||
$('.update-comment-@commentId, .cancel-comment-@commentId', $box).removeAttr('disabled');
|
||||
$('.error-edit-content-@commentId', $box).text($.parseJSON(req.responseText).content);
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.cancel-comment-@commentId', function(){
|
||||
$box = $(this).closest('.box');
|
||||
$('.update-comment-@commentId, .cancel-comment-@commentId', $box).attr('disabled', 'disabled');
|
||||
$.get('@path/@owner/@repository/commit_comments/_data/@commentId', curriedCallback($box));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
147
src/main/twirl/gitbucket/core/repo/editor.scala.html
Normal file
147
src/main/twirl/gitbucket/core/repo/editor.scala.html
Normal file
@@ -0,0 +1,147 @@
|
||||
@(branch: String,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
pathList: List[String],
|
||||
fileName: Option[String],
|
||||
content: gitbucket.core.util.JGitUtil.ContentInfo)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(if(fileName.isEmpty) "New File" else s"Editing ${fileName.get} at ${branch} - ${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository){
|
||||
<form method="POST" action="@url(repository)/@if(fileName.isEmpty){create}else{update}" validate="true">
|
||||
<span class="error" id="error-newFileName"></span>
|
||||
<div class="head">
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
|
||||
@pathList.zipWithIndex.map { case (section, i) =>
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
|
||||
}
|
||||
<input type="text" name="newFileName" id="newFileName" placeholder="Name your file..." value="@fileName"/>
|
||||
<input type="hidden" name="oldFileName" id="oldFileName" value="@fileName"/>
|
||||
<input type="hidden" name="branch" id="branch" value="@branch"/>
|
||||
<input type="hidden" name="path" id="path" value="@pathList.mkString("/")"/>
|
||||
</div>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>
|
||||
<div class="pull-right">
|
||||
<select id="wrap" class="input-medium" style="margin-bottom: 0px; height: 26px; padding: 0px;">
|
||||
<optgroup label="Line Wrap Mode">
|
||||
<option value="false">No wrap</option>
|
||||
<option value="true">Soft wrap</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<input type="button" id="btn-code" class="btn btn-default btn-small active" value="Code">
|
||||
<input type="button" id="btn-preview" class="btn btn-default btn-small" value="Preview">
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="editor" style="width: 100%; height: 600px;"></div>
|
||||
<div id="preview" style="width: 100%; display: none;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
||||
<div class="box issue-comment-box">
|
||||
<div class="box-content">
|
||||
<div>
|
||||
<strong>Commit changes</strong>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" name="message" style="width: 98%;"/>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
@if(fileName.isEmpty){
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)/@{pathList.mkString("/")}" class="btn btn-danger">Cancel</a>
|
||||
} else {
|
||||
<a href="@url(repository)/blob/@encodeRefName(branch)/@{(pathList ++ Seq(fileName.get)).mkString("/")}" class="btn btn-danger">Cancel</a>
|
||||
}
|
||||
<input type="submit" id="commit" class="btn btn-success" value="Commit changes" disabled="true"/>
|
||||
<input type="hidden" id="charset" name="charset" value="@content.charset"/>
|
||||
<input type="hidden" id="lineSeparator" name="lineSeparator" value="@content.lineSeparator"/>
|
||||
<input type="hidden" id="content" name="content" value=""/>
|
||||
<input type="hidden" id="initial" value="@content.content"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
}
|
||||
<script src="@assets/vendors/ace/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="@assets/vendors/jsdifflib/difflib.js"></script>
|
||||
<script type="text/javascript" src="@assets/vendors/jsdifflib/diffview.js"></script>
|
||||
<link href="@assets/vendors/jsdifflib/diffview.css" type="text/css" rel="stylesheet" />
|
||||
<script>
|
||||
$(function(){
|
||||
$('#editor').text($('#initial').val());
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/monokai");
|
||||
//editor.getSession().setUseWrapMode(false);
|
||||
|
||||
@if(fileName.isDefined){
|
||||
editor.getSession().setMode("ace/mode/@editorType(fileName.get)");
|
||||
}
|
||||
|
||||
editor.on('change', function(){
|
||||
updateCommitButtonStatus();
|
||||
});
|
||||
|
||||
function updateCommitButtonStatus(){
|
||||
if(editor.getValue() == $('#initial').val() && $('#newFileName').val() == $('#oldFileName').val()){
|
||||
$('#commit').attr('disabled', true);
|
||||
} else {
|
||||
$('#commit').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
$('#wrap').change(function(){
|
||||
if($('#wrap option:selected').val() == 'true'){
|
||||
editor.getSession().setUseWrapMode(true);
|
||||
} else {
|
||||
editor.getSession().setUseWrapMode(false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#newFileName').watch(function(){
|
||||
updateCommitButtonStatus();
|
||||
});
|
||||
|
||||
$('#commit').click(function(){
|
||||
$('#content').val(editor.getValue());
|
||||
});
|
||||
|
||||
$('#btn-code').click(function(){
|
||||
$('#editor').show();
|
||||
$('#preview').hide();
|
||||
});
|
||||
|
||||
$('#btn-preview').click(function(){
|
||||
$('#editor').hide();
|
||||
$('#preview').show()
|
||||
|
||||
@if(renderableSuffixes.find(suffix => fileName.map(_.toLowerCase.endsWith(suffix)).getOrElse(false))) {
|
||||
// update preview
|
||||
$('#preview').html('<img src="@assets/common/images/indicator.gif"> Previewing...');
|
||||
$.post('@url(repository)/_preview', {
|
||||
content : editor.getValue(),
|
||||
enableWikiLink : false,
|
||||
enableRefsLink : false,
|
||||
enableTaskList : false
|
||||
}, function(data){
|
||||
$('#preview').empty().append(
|
||||
$('<div class="markdown-body" style="padding-left: 16px; padding-right: 16px;">').html(data));
|
||||
prettyPrint();
|
||||
});
|
||||
} else {
|
||||
// Show diff
|
||||
$('#preview').empty()
|
||||
.append($('<div id="diffText">'))
|
||||
.append($('<textarea id="newText" style="display: none;">').html(editor.getValue()))
|
||||
.append($('<textarea id="oldText" style="display: none;">').html($('#initial').val()));
|
||||
diffUsingJS('oldText', 'newText', 'diffText', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
123
src/main/twirl/gitbucket/core/repo/files.scala.html
Normal file
123
src/main/twirl/gitbucket/core/repo/files.scala.html
Normal file
@@ -0,0 +1,123 @@
|
||||
@(branch: String,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
pathList: List[String],
|
||||
groupNames: List[String],
|
||||
latestCommit: gitbucket.core.util.JGitUtil.CommitInfo,
|
||||
files: List[gitbucket.core.util.JGitUtil.FileInfo],
|
||||
readme: Option[(List[String], String)],
|
||||
hasWritePermission: Boolean,
|
||||
info: Option[Any] = None,
|
||||
error: Option[Any] = None)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository, Some(branch), pathList.isEmpty, groupNames.isEmpty, info, error){
|
||||
<div class="head">
|
||||
@helper.html.branchcontrol(
|
||||
branch,
|
||||
repository,
|
||||
hasWritePermission
|
||||
){
|
||||
@repository.branchList.map { x =>
|
||||
<li><a href="@url(repository)/tree/@encodeRefName(x)">@helper.html.checkicon(x == branch) @x</a></li>
|
||||
}
|
||||
}
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
|
||||
@pathList.zipWithIndex.map { case (section, i) =>
|
||||
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
|
||||
}
|
||||
@if(hasWritePermission){
|
||||
<a href="@url(repository)/new/@encodeRefName(branch)/@pathList.mkString("/")"><img src="@assets/common/images/newfile.png"/></a>
|
||||
}
|
||||
</div>
|
||||
<table class="table table-file-list">
|
||||
<tr>
|
||||
<th colspan="4" style="font-weight: normal;">
|
||||
<a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a>
|
||||
@if(latestCommit.description.isDefined){
|
||||
<a href="javascript:void(0)" onclick="$('#description-@latestCommit.id').toggle();" class="omit">...</a>
|
||||
<pre id="description-@latestCommit.id" class="commit-description" style="display: none;">@link(latestCommit.description.get, repository)</pre>
|
||||
}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="latest-commit">
|
||||
<div>
|
||||
<div class="pull-right align-right monospace" style="line-height: 18px;">
|
||||
<a href="@url(repository)/commit/@latestCommit.id" class="commit-id"><span class="muted">latest commit</span> @latestCommit.id.substring(0, 10)</a>
|
||||
</div>
|
||||
<div class="author-info">
|
||||
<div class="author">
|
||||
@avatar(latestCommit, 20)
|
||||
<span>@user(latestCommit.authorName, latestCommit.authorEmailAddress, "username strong")</span>
|
||||
<span class="muted"> authored @helper.html.datetimeago(latestCommit.authorTime)</span>
|
||||
</div>
|
||||
@if(latestCommit.isDifferentFromAuthor) {
|
||||
<div class="committer">
|
||||
<span class="icon-arrow-right"></span>
|
||||
<span>@user(latestCommit.committerName, latestCommit.committerEmailAddress, "username strong")</span>
|
||||
<span class="muted"> committed @helper.html.datetimeago(latestCommit.commitTime)</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@if(pathList.size > 0){
|
||||
<tr>
|
||||
<td width="16"></td>
|
||||
<td><a href="@url(repository)@if(pathList.size > 1){/tree/@encodeRefName(branch)/@pathList.init.mkString("/")}">..</a></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
}
|
||||
@files.map { file =>
|
||||
<tr>
|
||||
<td width="16">
|
||||
@if(file.isDirectory){
|
||||
@if(file.linkUrl.isDefined){
|
||||
<img src="@assets/common/images/folder_link.png"/>
|
||||
} else {
|
||||
<img src="@assets/common/images/folder.png"/>
|
||||
}
|
||||
} else {
|
||||
<img src="@assets/common/images/file.png"/>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if(file.isDirectory){
|
||||
@if(file.linkUrl.isDefined){
|
||||
<a href="@file.linkUrl">
|
||||
<span class="simplified-path">@file.name.split("/").toList.init match {
|
||||
case Nil => {}
|
||||
case list => {@list.mkString("", "/", "/")}
|
||||
}</span>@file.name.split("/").toList.last
|
||||
</a>
|
||||
} else {
|
||||
<a href="@url(repository)/tree@{(encodeRefName(branch) :: pathList).mkString("/", "/", "/")}@file.name">
|
||||
<span class="simplified-path">@file.name.split("/").toList.init match {
|
||||
case Nil => {}
|
||||
case list => {@list.mkString("", "/", "/")}
|
||||
}</span>@file.name.split("/").toList.last
|
||||
</a>
|
||||
}
|
||||
} else {
|
||||
<a href="@url(repository)/blob@{(encodeRefName(branch) :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a>
|
||||
}
|
||||
</td>
|
||||
<td class="mute">
|
||||
<a href="@url(repository)/commit/@file.commitId" class="commit-message">@link(file.message, repository)</a>
|
||||
[@user(file.author, file.mailAddress)]
|
||||
</td>
|
||||
<td style="text-align: right;">@helper.html.datetimeago(file.time, false)</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
@readme.map { case(filePath, content) =>
|
||||
<div id="readme">
|
||||
<div class="box-header">@filePath.reverse.head</div>
|
||||
<div class="box-content markdown-body">@renderMarkup(filePath, content, branch, repository, false, false)</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
35
src/main/twirl/gitbucket/core/repo/forked.scala.html
Normal file
35
src/main/twirl/gitbucket/core/repo/forked.scala.html
Normal file
@@ -0,0 +1,35 @@
|
||||
@(originRepository: Option[gitbucket.core.service.RepositoryService.RepositoryInfo],
|
||||
members: List[(String, String)],
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("network", repository){
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="@url(repository)/network/members">Members</a></li>
|
||||
</ul>
|
||||
<h3>Members of the @repository.name Network</h3>
|
||||
<div class="block">
|
||||
@if(originRepository.isDefined){
|
||||
@avatar(originRepository.get.owner, 20)
|
||||
<span@if(repository.owner == originRepository.get.owner){ class="highlight"}>
|
||||
<a href="@url(originRepository.get)">@originRepository.get.owner</a> / <a href="@path/@originRepository.get.owner/@originRepository.get.name">@originRepository.get.name</a>
|
||||
</span>
|
||||
} else {
|
||||
@avatar(repository.repository.originUserName.get, 20)
|
||||
<span class="highlight">
|
||||
@repository.repository.originUserName / @repository.repository.originRepositoryName
|
||||
</span>
|
||||
}
|
||||
(origin)
|
||||
</div>
|
||||
@members.map { case (owner, name) =>
|
||||
<div class="block">
|
||||
@avatar(owner, 20)
|
||||
<span@if(repository.owner == owner){ class="highlight"}>
|
||||
<a href="@url(owner)">@owner</a> / <a href="@path/@owner/@name">@name</a>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
43
src/main/twirl/gitbucket/core/repo/guide.scala.html
Normal file
43
src/main/twirl/gitbucket/core/repo/guide.scala.html
Normal file
@@ -0,0 +1,43 @@
|
||||
@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
hasWritePermission: Boolean)(implicit context: gitbucket.core.controller.Context)
|
||||
@import gitbucket.core.service.SystemSettingsService
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository){
|
||||
@if(!hasWritePermission){
|
||||
<h3>This is an empty repository</h3>
|
||||
} else {
|
||||
<h3><strong>Quick setup</strong> — if you've done this kind of thing before</h3>
|
||||
<div class="empty-repo-options">
|
||||
via <a href="@repository.httpUrl" class="git-protocol-selector">HTTP</a>
|
||||
@if(settings.ssh && loginAccount.isDefined){
|
||||
or
|
||||
<a href="@repository.sshUrl(settings.sshPort.getOrElse(SystemSettingsService.DefaultSshPort), loginAccount.get.userName)" class="git-protocol-selector">SSH</a>
|
||||
}
|
||||
</div>
|
||||
<h3 style="margin-top: 30px;">Create a new repository on the command line</h3>
|
||||
@pre {
|
||||
touch README.md
|
||||
git init
|
||||
git add README.md
|
||||
git commit -m "first commit"
|
||||
git remote add origin <span class="live-clone-url">@repository.httpUrl</span>
|
||||
git push -u origin master
|
||||
}
|
||||
<h3 style="margin-top: 30px;">Push an existing repository from the command line</h3>
|
||||
@pre {
|
||||
git remote add origin <span class="live-clone-url">@repository.httpUrl</span>
|
||||
git push -u origin master
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('.git-protocol-selector').click(function(e){
|
||||
e.preventDefault();
|
||||
$('.live-clone-url').text($(e.target).attr('href'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
}
|
||||
}
|
||||
27
src/main/twirl/gitbucket/core/repo/tags.scala.html
Normal file
27
src/main/twirl/gitbucket/core/repo/tags.scala.html
Normal file
@@ -0,0 +1,27 @@
|
||||
@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@html.menu("code", repository){
|
||||
<h1>Tags</h1>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th width="40%">Tag</th>
|
||||
<th width="20%">Date</th>
|
||||
<th width="20%">Commit</th>
|
||||
<th width="20%">Download</th>
|
||||
</tr>
|
||||
@repository.tags.reverse.map { tag =>
|
||||
<tr>
|
||||
<td><a href="@url(repository)/tree/@encodeRefName(tag.name)">@tag.name</a></td>
|
||||
<td>@helper.html.datetimeago(tag.time, false)</td>
|
||||
<td class="monospace"><a href="@url(repository)/commit/@tag.id">@tag.id.substring(0, 10)</a></td>
|
||||
<td>
|
||||
<a href="@url(repository)/archive/@{encodeRefName(tag.name)}.zip">ZIP</a>
|
||||
<a href="@url(repository)/archive/@{encodeRefName(tag.name)}.tar.gz">TAR.GZ</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user