aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-12-07 00:18:12 +0100
committerAdam Strzelecki <ono@java.pl>2015-12-07 01:50:45 +0100
commite2ca53029e0c4c28c0796d3d55bfecf28c132d2e (patch)
treef3815745e988911a34edb7524b69048ee4f9c17c /templates
parentb5f6206a659eaa76382774675f2e3f2664d0f501 (diff)
downloadgitea-e2ca53029e0c4c28c0796d3d55bfecf28c132d2e.tar.gz
gitea-e2ca53029e0c4c28c0796d3d55bfecf28c132d2e.zip
Render commit msg as header + verbatim description
Most commit in Git are expected to follow standard of single header line, followed by description paragraphs, separated by empty line from previous block. Previously Gogs were treating everything as single header. Now we are trying to render only first line as header, but following lines (description chunks) as a verbatim.
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/commits_table.tmpl2
-rw-r--r--templates/repo/diff.tmpl14
-rw-r--r--templates/repo/view_list.tmpl4
3 files changed, 9 insertions, 11 deletions
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 2adc1770f9..8bab2be00f 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -37,7 +37,7 @@
</td>
<td class="message collapsing">
<a rel="nofollow" class="ui sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSha .ID.String}}</a>
- {{RenderCommitMessage .Summary $.RepoLink $.Repository.ComposeMetas}}
+ {{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}}
</td>
<td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
</tr>
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index ba1322e437..18de976ebc 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -5,14 +5,12 @@
{{if .IsDiffCompare }}
{{template "repo/commits_table" .}}
{{else}}
- <h4 class="ui top attached info header">
- <div class="ui right">
- <a class="ui blue tiny button" href="{{EscapePound .SourcePath}}">
- {{.i18n.Tr "repo.diff.browse_source"}}
- </a>
- </div>
- {{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
- </h4>
+ <div class="ui top attached info clearing segment">
+ <a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}">
+ {{.i18n.Tr "repo.diff.browse_source"}}
+ </a>
+ {{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
+ </div>
<div class="ui attached info segment">
{{if .Author}}
<img class="ui avatar image" src="{{.Author.AvatarLink}}" />
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
index 9fb71908aa..887ce8e251 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -10,7 +10,7 @@
<strong>{{.LastCommit.Author.Name}}</strong>
{{end}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.LastCommit.ID}}" rel="nofollow">{{ShortSha .LastCommit.ID.String}}</a>
- <span class="grey">{{RenderCommitMessage .LastCommit.Summary .RepoLink $.Repository.ComposeMetas}}</span>
+ <span class="grey">{{RenderCommitMessage false .LastCommit.Summary .RepoLink $.Repository.ComposeMetas}}</span>
</th>
<th class="nine wide">
</th>
@@ -44,7 +44,7 @@
{{end}}
<td class="message collapsing">
<a rel="nofollow" class="ui sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.ID}}">{{ShortSha $commit.ID.String}}</a>
- {{RenderCommitMessage $commit.Summary $.RepoLink $.Repository.ComposeMetas}}
+ {{RenderCommitMessage false $commit.Summary $.RepoLink $.Repository.ComposeMetas}}
</td>
<td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
</tr>