diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-10-10 21:40:51 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-10-10 21:40:51 -0400 |
commit | b2632dec099cb2727933149d2d59cc5e46baa15f (patch) | |
tree | 0339b98dcd6a38bf9a02e3681d4e22a024ceaa9f /templates/repo/diff.tmpl | |
parent | 54930c001df8316d8dfda450b5c39379df2cc1b1 (diff) | |
download | gitea-b2632dec099cb2727933149d2d59cc5e46baa15f.tar.gz gitea-b2632dec099cb2727933149d2d59cc5e46baa15f.zip |
Page: Compare 2 commits
Diffstat (limited to 'templates/repo/diff.tmpl')
-rw-r--r-- | templates/repo/diff.tmpl | 76 |
1 files changed, 41 insertions, 35 deletions
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" .}} |