2015-08-20 07:18:49 -05:00
|
|
|
{{template "base/head" .}}
|
|
|
|
<div class="repository diff">
|
|
|
|
{{template "repo/header" .}}
|
|
|
|
<div class="ui container">
|
|
|
|
{{if .IsDiffCompare }}
|
2014-10-10 20:40:51 -05:00
|
|
|
<div class="panel panel-info panel-radius compare-head-box">
|
|
|
|
<div class="panel-header">
|
2015-07-28 11:51:40 -05:00
|
|
|
<a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{EscapePound .SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
|
2014-10-10 20:40:51 -05:00
|
|
|
<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>
|
2014-08-26 07:20:18 -05:00
|
|
|
</div>
|
|
|
|
<div class="panel-body compare">
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-08-20 07:18:49 -05:00
|
|
|
{{template "repo/commits_table" .}}
|
|
|
|
{{else}}
|
2014-10-10 20:40:51 -05:00
|
|
|
<div class="panel panel-info panel-radius diff-head-box">
|
|
|
|
<div class="panel-header">
|
2015-07-28 11:51:40 -05:00
|
|
|
<a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{EscapePound .SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
|
2015-01-30 18:05:20 -05:00
|
|
|
<h4 class="commit-message">{{RenderCommitMessage .Commit.Message $.RepoLink}}</h4>
|
2014-03-24 08:27:19 -05:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<span class="pull-right">
|
2014-10-10 20:40:51 -05:00
|
|
|
<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>
|
2014-03-24 08:27:19 -05:00
|
|
|
</span>
|
|
|
|
<p class="author">
|
2014-10-10 20:40:51 -05:00
|
|
|
{{if .Author}}
|
2014-11-21 10:58:08 -05:00
|
|
|
<img class="avatar-30" src="{{.Author.AvatarLink}}" />
|
|
|
|
<a href="{{AppSubUrl}}/{{.Author.Name}}"><strong>{{.Commit.Author.Name}}</strong></a>
|
2014-10-10 20:40:51 -05:00
|
|
|
{{else}}
|
2014-11-21 10:58:08 -05:00
|
|
|
<img class="avatar-30" src="{{AvatarLink .Commit.Author.Email}}" />
|
2014-10-10 20:40:51 -05:00
|
|
|
<strong>{{.Commit.Author.Name}}</strong>
|
|
|
|
{{end}}
|
2015-07-28 11:51:40 -05:00
|
|
|
<span class="text-grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span>
|
2014-03-24 08:27:19 -05:00
|
|
|
</p>
|
2014-10-10 20:40:51 -05:00
|
|
|
</div>
|
2014-03-24 08:27:19 -05:00
|
|
|
</div>
|
2015-08-20 07:18:49 -05:00
|
|
|
{{end}}
|
|
|
|
|
2014-04-12 00:45:43 -05:00
|
|
|
{{if .DiffNotAvailable}}
|
2014-10-10 20:40:51 -05:00
|
|
|
<h4>{{.i18n.Tr "repo.diff.data_not_available"}}</h4>
|
2014-04-12 00:45:43 -05:00
|
|
|
{{else}}
|
2014-03-24 08:27:19 -05:00
|
|
|
<div class="diff-detail-box diff-box">
|
2014-10-10 20:40:51 -05:00
|
|
|
<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>
|
2014-03-24 08:27:19 -05:00
|
|
|
<p class="showing">
|
|
|
|
<i class="fa fa-retweet"></i>
|
2014-10-10 20:40:51 -05:00
|
|
|
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
|
2014-03-24 08:27:19 -05:00
|
|
|
</p>
|
2014-10-14 22:44:34 -05:00
|
|
|
<ol class="detail-files collapse hide" id="diff-files">
|
2014-03-25 22:53:01 -05:00
|
|
|
{{range .Diff.Files}}
|
2014-03-24 08:27:19 -05:00
|
|
|
<li>
|
|
|
|
<div class="diff-counter count pull-right">
|
2014-04-15 19:01:20 -05:00
|
|
|
{{if not .IsBin}}
|
2014-03-25 22:53:01 -05:00
|
|
|
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
|
2014-03-24 08:27:19 -05:00
|
|
|
<span class="bar">
|
|
|
|
<span class="pull-left add"></span>
|
|
|
|
<span class="pull-left del"></span>
|
|
|
|
</span>
|
2014-03-25 22:53:01 -05:00
|
|
|
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
|
2014-04-10 21:03:31 -05:00
|
|
|
{{else}}
|
2014-10-10 20:40:51 -05:00
|
|
|
<span>{{$.i18n.Tr "repo.diff.bin"}}</span>
|
2014-04-10 21:03:31 -05:00
|
|
|
{{end}}
|
2014-03-24 08:27:19 -05:00
|
|
|
</div>
|
|
|
|
<!-- todo finish all file status, now modify, add, delete and rename -->
|
2014-03-26 06:24:20 -05:00
|
|
|
<span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}"> </span>
|
2014-05-13 11:40:32 -05:00
|
|
|
<a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
|
2014-03-24 08:27:19 -05:00
|
|
|
</li>
|
2014-03-25 22:53:01 -05:00
|
|
|
{{end}}
|
2014-03-24 08:27:19 -05:00
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
|
2015-02-04 13:54:45 -05:00
|
|
|
{{range $i, $file := .Diff.Files}}
|
2014-10-11 17:20:07 -05:00
|
|
|
<div class="panel panel-radius diff-file-box diff-box file-content" id="diff-{{.Index}}">
|
2014-10-10 20:40:51 -05:00
|
|
|
<div class="panel-header">
|
2014-03-24 08:27:19 -05:00
|
|
|
<div class="diff-counter count pull-left">
|
2015-02-04 13:54:45 -05:00
|
|
|
{{if not $file.IsBin}}
|
2014-03-25 22:53:01 -05:00
|
|
|
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
|
2014-03-24 08:27:19 -05:00
|
|
|
<span class="bar">
|
|
|
|
<span class="pull-left add"></span>
|
|
|
|
<span class="pull-left del"></span>
|
|
|
|
</span>
|
2014-03-25 22:53:01 -05:00
|
|
|
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
|
2014-04-10 21:03:31 -05:00
|
|
|
{{else}}
|
2014-10-10 20:40:51 -05:00
|
|
|
{{$.i18n.Tr "repo.diff.bin"}}
|
2014-04-10 21:03:31 -05:00
|
|
|
{{end}}
|
2014-03-24 08:27:19 -05:00
|
|
|
</div>
|
2015-02-06 04:02:32 -05:00
|
|
|
{{if $file.IsDeleted}}
|
2015-07-28 11:51:40 -05:00
|
|
|
<a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
|
2015-02-06 04:02:32 -05:00
|
|
|
{{else}}
|
2015-07-28 11:51:40 -05:00
|
|
|
<a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
|
2015-02-06 04:02:32 -05:00
|
|
|
{{end}}
|
2015-02-04 13:54:45 -05:00
|
|
|
<span class="file">{{$file.Name}}</span>
|
2014-03-24 08:27:19 -05:00
|
|
|
</div>
|
2015-02-04 13:54:45 -05:00
|
|
|
{{$isImage := (call $.IsImageFile $file.Name)}}
|
2014-03-24 08:27:19 -05:00
|
|
|
<div class="panel-body file-body file-code code-view code-diff">
|
2014-03-27 12:17:09 -05:00
|
|
|
{{if $isImage}}
|
|
|
|
<div class="text-center">
|
2015-07-28 11:51:40 -05:00
|
|
|
<img src="{{$.RawPath}}/{{EscapePound .Name}}">
|
2014-03-27 12:17:09 -05:00
|
|
|
</div>
|
|
|
|
{{else}}
|
2014-03-24 08:27:19 -05:00
|
|
|
<table>
|
|
|
|
<tbody>
|
2015-02-18 16:55:17 -05:00
|
|
|
{{range .Sections}}
|
|
|
|
{{range $k, $line := .Lines}}
|
|
|
|
<tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$k}} ol-{{$k}}">
|
2014-03-25 22:53:01 -05:00
|
|
|
<td class="lines-num lines-num-old">
|
2015-02-19 02:19:10 -05:00
|
|
|
<span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
|
2014-03-25 22:53:01 -05:00
|
|
|
</td>
|
|
|
|
<td class="lines-num lines-num-new">
|
2015-02-18 16:52:22 -05:00
|
|
|
<span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
|
2014-03-25 22:53:01 -05:00
|
|
|
</td>
|
2015-07-28 11:51:40 -05:00
|
|
|
|
2014-03-25 22:53:01 -05:00
|
|
|
<td class="lines-code">
|
2015-02-03 15:53:34 -05:00
|
|
|
<pre>{{$line.Content}}</pre>
|
2014-03-25 22:53:01 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
2014-03-26 05:02:08 -05:00
|
|
|
{{end}}
|
2014-03-24 08:27:19 -05:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2014-03-27 12:17:09 -05:00
|
|
|
{{end}}
|
2014-03-24 08:27:19 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-07-28 11:51:40 -05:00
|
|
|
<br>
|
2014-03-25 22:53:01 -05:00
|
|
|
{{end}}
|
2014-04-12 00:45:43 -05:00
|
|
|
{{end}}
|
2015-08-20 07:18:49 -05:00
|
|
|
</div>
|
2014-03-24 08:27:19 -05:00
|
|
|
</div>
|
2015-08-20 07:18:49 -05:00
|
|
|
{{template "base/footer" .}}
|