summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-10-10 21:40:51 -0400
committerUnknwon <joe2010xtmf@163.com>2014-10-10 21:40:51 -0400
commitb2632dec099cb2727933149d2d59cc5e46baa15f (patch)
tree0339b98dcd6a38bf9a02e3681d4e22a024ceaa9f /templates
parent54930c001df8316d8dfda450b5c39379df2cc1b1 (diff)
downloadgitea-b2632dec099cb2727933149d2d59cc5e46baa15f.tar.gz
gitea-b2632dec099cb2727933149d2d59cc5e46baa15f.zip
Page: Compare 2 commits
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/commits_table.tmpl4
-rw-r--r--templates/repo/diff.tmpl76
-rw-r--r--templates/user/dashboard/feeds.tmpl1
3 files changed, 45 insertions, 36 deletions
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 032299b102..5b9761b165 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -1,10 +1,12 @@
<div id="commits-list">
<div class="panel panel-radius">
<div class="panel-header">
+ {{if not .IsDiffCompare}}
<form class="search pull-right" action="{{.RepoLink}}/commits/{{.BranchName}}/search" method="get" id="commits-search-form">
<input class="ipt ipt-radius" type="search" name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" />
<button class="btn btn-black btn-small btn-radius">{{.i18n.Tr "repo.commits.find"}}</button>
</form>
+ {{end}}
<h4>{{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}}</h4>
</div>
<table class="panel-body table commit-list table-striped">
@@ -31,7 +33,7 @@
</tbody>
</table>
</div>
- {{if not .IsSearchPage}}
+ {{if and (not .IsSearchPage) (not .IsDiffCompare)}}
<ul class="pagination">
{{if .LastPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.LastPageNum}}" rel="nofollow">&laquo; {{.i18n.Tr "repo.commits.newer"}}</a></li>{{end}}
{{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.NextPageNum}}" rel="nofollow">&raquo; {{.i18n.Tr "repo.commits.older"}}</a></li>{{end}}
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index 8e5efd146f..30a983ac90 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -1,49 +1,54 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-<div id="body" class="container" data-page="repo">
- <div id="source">
- {{if .IsDiffCompare }}
- <div class="panel panel-info diff-box diff-head-box">
- <div class="panel-heading">
- <a class="pull-right btn btn-primary btn-sm" rel="nofollow" href="{{.SourcePath}}">Browse Source</a>
- <h4><a href="{{$.RepoLink}}/commit/{{.BeforeCommitId}}" class="label label-success">{{ShortSha .BeforeCommitId}}</a> ... <a href="{{$.RepoLink}}/commit/{{.AfterCommitId}}" class="label label-success">{{ShortSha .AfterCommitId}}</a></h4>
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ {{template "repo/header" .}}
+ <div class="container clear" id="diff-page">
+ {{if .IsDiffCompare }}
+ <div class="panel panel-info panel-radius compare-head-box">
+ <div class="panel-header">
+ <a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{.SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
+ <h4><a href="{{$.RepoLink}}/commit/{{.BeforeCommitId}}" class="label label-green">{{ShortSha .BeforeCommitId}}</a> ... <a href="{{$.RepoLink}}/commit/{{.AfterCommitId}}" class="label label-green">{{ShortSha .AfterCommitId}}</a></h4>
</div>
<div class="panel-body compare">
- {{template "repo/commits_table" .}}
+ {{template "repo/commits_table" .}}
</div>
</div>
- {{else}}
- <div class="panel panel-info diff-box diff-head-box">
- <div class="panel-heading">
- <a class="pull-right btn btn-primary btn-sm" rel="nofollow" href="{{.SourcePath}}">Browse Source</a>
+ {{else}}
+ <div class="panel panel-info panel-radius diff-head-box">
+ <div class="panel-header">
+ <a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{.SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
<h4>{{.Commit.Message}}</h4>
</div>
<div class="panel-body">
<span class="pull-right">
- <ul class="list-unstyled">
- {{range .Parents}}
- <li>parent <a href="{{$.RepoLink}}/commit/{{.}}"><span class="label label-default sha">{{ShortSha .}}</span></a></li>
- {{end}}
- <li>commit <span class="label label-default sha">{{ShortSha .CommitId}}</span></li>
- </ul>
+ <ul class="list-unstyled">
+ <li class="inline">{{.i18n.Tr "repo.diff.parent"}}</li>
+ {{range .Parents}}
+ <li class="inline"><a href="{{$.RepoLink}}/commit/{{.}}"><span class="label label-blue">{{ShortSha .}}</span></a></li>
+ {{end}}
+ <li class="inline">{{.i18n.Tr "repo.diff.commit"}} <span class="label label-blue">{{ShortSha .CommitId}}</span></li>
+ </ul>
</span>
<p class="author">
- <img class="avatar" src="{{AvatarLink .Commit.Author.Email}}" alt=""/>
- <a class="name" href="{{AppSubUrl}}/user/email2user?email={{.Commit.Author.Email}}"><strong>{{.Commit.Author.Name}}</strong></a>
- <span class="time">{{TimeSince .Commit.Author.When $.Lang}}</span>
+ <img class="avatar-30" src="{{AvatarLink .Commit.Author.Email}}" />
+ {{if .Author}}
+ <a href="{{AppSubUrl}}/{{.Author}}"><strong>{{.Commit.Author.Name}}</strong></a>
+ {{else}}
+ <strong>{{.Commit.Author.Name}}</strong>
+ {{end}}
+ <span class="text-grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span>
</p>
- </div>
+ </div>
</div>
- {{end}}
+ {{end}}
{{if .DiffNotAvailable}}
- <h4>Diff Data Not Available.</h4>
+ <h4>{{.i18n.Tr "repo.diff.data_not_available"}}</h4>
{{else}}
<div class="diff-detail-box diff-box">
- <a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a>
+ <a class="pull-right btn btn-gray btn-header btn-radius text-black" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
<p class="showing">
<i class="fa fa-retweet"></i>
- <strong> {{.Diff.NumFiles}} changed files</strong> with <strong>{{.Diff.TotalAddition}} additions</strong> and <strong>{{.Diff.TotalDeletion}} deletions</strong>.
+ {{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
</p>
<ol class="detail-files collapse" id="diff-files">
{{range .Diff.Files}}
@@ -57,7 +62,7 @@
</span>
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
{{else}}
- <span>BIN</span>
+ <span>{{$.i18n.Tr "repo.diff.bin"}}</span>
{{end}}
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
@@ -69,8 +74,8 @@
</div>
{{range .Diff.Files}}
- <div class="panel panel-default diff-file-box diff-box file-content" id="diff-{{.Index}}">
- <div class="panel-heading">
+ <div class="panel diff-file-box diff-box file-content" id="diff-{{.Index}}">
+ <div class="panel-header">
<div class="diff-counter count pull-left">
{{if not .IsBin}}
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
@@ -80,10 +85,10 @@
</span>
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
{{else}}
- BIN
+ {{$.i18n.Tr "repo.diff.bin"}}
{{end}}
</div>
- <a class="btn btn-default btn-sm pull-right" rel="nofollow" href="{{$.SourcePath}}/{{.Name}}">View File</a>
+ <a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{$.SourcePath}}/{{.Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
<span class="file">{{.Name}}</span>
</div>
{{$isImage := (call $.IsImageFile .Name)}}
@@ -115,8 +120,9 @@
{{end}}
</div>
</div>
+ <br>
{{end}}
{{end}}
</div>
</div>
-{{template "base/footer" .}}
+{{template "ng/base/footer" .}}
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
index 4c05440b1e..a805802b1d 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -28,6 +28,7 @@
{{range $push.Commits}}
<li><img class="avatar-16" src="{{AvatarLink .AuthorEmail}}?s=16"> <a href="{{AppSubUrl}}/{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text-truncate grid-4-5">{{.Message}}</span></li>
{{end}}
+ {{if $push.CompareUrl}}<li><a href="{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} ยป</a></li>{{end}}
</ul>
</div>
{{else if eq .GetOpType 6}}