2014-10-11 07:10:51 +05:30
|
|
|
{{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>
|
2014-08-26 17:50:18 +05:30
|
|
|
</div>
|
|
|
|
<div class="panel-body compare">
|
2014-10-11 07:10:51 +05:30
|
|
|
{{template "repo/commits_table" .}}
|
2014-08-26 17:50:18 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2014-10-11 07:10:51 +05:30
|
|
|
{{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>
|
2014-03-26 09:23:01 +05:30
|
|
|
<h4>{{.Commit.Message}}</h4>
|
2014-03-24 18:57:19 +05:30
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<span class="pull-right">
|
2014-10-11 07:10:51 +05:30
|
|
|
<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 18:57:19 +05:30
|
|
|
</span>
|
|
|
|
<p class="author">
|
2014-10-11 07:10:51 +05:30
|
|
|
<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>
|
2014-03-24 18:57:19 +05:30
|
|
|
</p>
|
2014-10-11 07:10:51 +05:30
|
|
|
</div>
|
2014-03-24 18:57:19 +05:30
|
|
|
</div>
|
2014-10-11 07:10:51 +05:30
|
|
|
{{end}}
|
2014-04-12 11:15:43 +05:30
|
|
|
{{if .DiffNotAvailable}}
|
2014-10-11 07:10:51 +05:30
|
|
|
<h4>{{.i18n.Tr "repo.diff.data_not_available"}}</h4>
|
2014-04-12 11:15:43 +05:30
|
|
|
{{else}}
|
2014-03-24 18:57:19 +05:30
|
|
|
<div class="diff-detail-box diff-box">
|
2014-10-11 07:10:51 +05:30
|
|
|
<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 18:57:19 +05:30
|
|
|
<p class="showing">
|
|
|
|
<i class="fa fa-retweet"></i>
|
2014-10-11 07:10:51 +05:30
|
|
|
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
|
2014-03-24 18:57:19 +05:30
|
|
|
</p>
|
2014-10-15 09:14:34 +05:30
|
|
|
<ol class="detail-files collapse hide" id="diff-files">
|
2014-03-26 09:23:01 +05:30
|
|
|
{{range .Diff.Files}}
|
2014-03-24 18:57:19 +05:30
|
|
|
<li>
|
|
|
|
<div class="diff-counter count pull-right">
|
2014-04-16 05:31:20 +05:30
|
|
|
{{if not .IsBin}}
|
2014-03-26 09:23:01 +05:30
|
|
|
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
|
2014-03-24 18:57:19 +05:30
|
|
|
<span class="bar">
|
|
|
|
<span class="pull-left add"></span>
|
|
|
|
<span class="pull-left del"></span>
|
|
|
|
</span>
|
2014-03-26 09:23:01 +05:30
|
|
|
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
|
2014-04-11 07:33:31 +05:30
|
|
|
{{else}}
|
2014-10-11 07:10:51 +05:30
|
|
|
<span>{{$.i18n.Tr "repo.diff.bin"}}</span>
|
2014-04-11 07:33:31 +05:30
|
|
|
{{end}}
|
2014-03-24 18:57:19 +05:30
|
|
|
</div>
|
|
|
|
<!-- todo finish all file status, now modify, add, delete and rename -->
|
2014-03-26 16:54:20 +05:30
|
|
|
<span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}"> </span>
|
2014-05-13 22:10:32 +05:30
|
|
|
<a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
|
2014-03-24 18:57:19 +05:30
|
|
|
</li>
|
2014-03-26 09:23:01 +05:30
|
|
|
{{end}}
|
2014-03-24 18:57:19 +05:30
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
|
2014-03-26 09:23:01 +05:30
|
|
|
{{range .Diff.Files}}
|
2014-10-12 03:50:07 +05:30
|
|
|
<div class="panel panel-radius diff-file-box diff-box file-content" id="diff-{{.Index}}">
|
2014-10-11 07:10:51 +05:30
|
|
|
<div class="panel-header">
|
2014-03-24 18:57:19 +05:30
|
|
|
<div class="diff-counter count pull-left">
|
2014-04-16 05:31:20 +05:30
|
|
|
{{if not .IsBin}}
|
2014-03-26 09:23:01 +05:30
|
|
|
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
|
2014-03-24 18:57:19 +05:30
|
|
|
<span class="bar">
|
|
|
|
<span class="pull-left add"></span>
|
|
|
|
<span class="pull-left del"></span>
|
|
|
|
</span>
|
2014-03-26 09:23:01 +05:30
|
|
|
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
|
2014-04-11 07:33:31 +05:30
|
|
|
{{else}}
|
2014-10-11 07:10:51 +05:30
|
|
|
{{$.i18n.Tr "repo.diff.bin"}}
|
2014-04-11 07:33:31 +05:30
|
|
|
{{end}}
|
2014-03-24 18:57:19 +05:30
|
|
|
</div>
|
2014-10-11 07:10:51 +05:30
|
|
|
<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>
|
2014-03-26 09:23:01 +05:30
|
|
|
<span class="file">{{.Name}}</span>
|
2014-03-24 18:57:19 +05:30
|
|
|
</div>
|
2014-03-27 22:47:09 +05:30
|
|
|
{{$isImage := (call $.IsImageFile .Name)}}
|
2014-03-24 18:57:19 +05:30
|
|
|
<div class="panel-body file-body file-code code-view code-diff">
|
2014-03-27 22:47:09 +05:30
|
|
|
{{if $isImage}}
|
|
|
|
<div class="text-center">
|
|
|
|
<img src="{{$.RawPath}}/{{.Name}}">
|
|
|
|
</div>
|
|
|
|
{{else}}
|
2014-03-24 18:57:19 +05:30
|
|
|
<table>
|
|
|
|
<tbody>
|
2014-03-26 15:32:08 +05:30
|
|
|
{{range .Sections}}
|
2014-10-04 22:49:14 +05:30
|
|
|
Test: {{ .NumLines}}
|
2014-03-26 15:32:08 +05:30
|
|
|
{{range .Lines}}
|
2014-03-27 02:11:16 +05:30
|
|
|
<tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1">
|
2014-03-26 09:23:01 +05:30
|
|
|
<td class="lines-num lines-num-old">
|
2014-03-27 02:11:16 +05:30
|
|
|
<span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span>
|
2014-03-26 09:23:01 +05:30
|
|
|
</td>
|
|
|
|
<td class="lines-num lines-num-new">
|
2014-03-27 02:11:16 +05:30
|
|
|
<span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span>
|
2014-03-26 09:23:01 +05:30
|
|
|
</td>
|
2014-10-04 22:49:14 +05:30
|
|
|
|
2014-03-26 09:23:01 +05:30
|
|
|
<td class="lines-code">
|
2014-09-17 09:33:03 +05:30
|
|
|
<pre>{{ToUtf8 .Content}}</pre>
|
2014-03-26 09:23:01 +05:30
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
2014-03-26 15:32:08 +05:30
|
|
|
{{end}}
|
2014-03-24 18:57:19 +05:30
|
|
|
</tbody>
|
|
|
|
</table>
|
2014-03-27 22:47:09 +05:30
|
|
|
{{end}}
|
2014-03-24 18:57:19 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2014-10-11 07:10:51 +05:30
|
|
|
<br>
|
2014-03-26 09:23:01 +05:30
|
|
|
{{end}}
|
2014-04-12 11:15:43 +05:30
|
|
|
{{end}}
|
2014-03-24 18:57:19 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2014-10-11 07:10:51 +05:30
|
|
|
{{template "ng/base/footer" .}}
|