Browse Source

template: use DisplayName of users when possible (#4187)

pull/3853/merge
Unknwon 8 years ago
parent
commit
68b231bd89
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 6
      templates/repo/issue/list.tmpl
  2. 12
      templates/repo/issue/view_content.tmpl
  3. 2
      templates/repo/release/list.tmpl

6
templates/repo/issue/list.tmpl

@ -61,7 +61,7 @@
<div class="menu"> <div class="menu">
<a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a> <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a>
{{range .Assignees}} {{range .Assignees}}
<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.ID}}"><img src="{{.RelAvatarLink}}"> {{.Name}}</a> <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.ID}}"><img src="{{.RelAvatarLink}}"> {{.DisplayName}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>
@ -113,14 +113,14 @@
{{end}} {{end}}
<p class="desc"> <p class="desc">
{{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.DisplayName | Safe}}
{{if .Milestone}} {{if .Milestone}}
<a class="milestone" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}"> <a class="milestone" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
<span class="octicon octicon-milestone"></span> {{.Milestone.Name | Sanitize}} <span class="octicon octicon-milestone"></span> {{.Milestone.Name | Sanitize}}
</a> </a>
{{end}} {{end}}
{{if .Assignee}} {{if .Assignee}}
<a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center"> <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.DisplayName}}" data-variation="inverted" data-position="left center">
<img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}"> <img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}">
</a> </a>
{{end}} {{end}}

12
templates/repo/issue/view_content.tmpl

@ -17,7 +17,7 @@
</a> </a>
<div class="content"> <div class="content">
<div class="ui top attached header"> <div class="ui top attached header">
<span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span> <span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.DisplayName}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
<div class="ui right actions"> <div class="ui right actions">
{{if .IsIssueOwner}} {{if .IsIssueOwner}}
<div class="item action"> <div class="item action">
@ -66,7 +66,7 @@
</a> </a>
<div class="content"> <div class="content">
<div class="ui top attached header"> <div class="ui top attached header">
<span class="text grey"><a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span> <span class="text grey"><a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.DisplayName}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
<div class="ui right actions"> <div class="ui right actions">
{{if gt .ShowTag 0}} {{if gt .ShowTag 0}}
<div class="item tag"> <div class="item tag">
@ -90,7 +90,7 @@
<div class="ui attached segment"> <div class="ui attached segment">
<div class="render-content markdown has-emoji"> <div class="render-content markdown has-emoji">
{{if .RenderedContent}} {{if .RenderedContent}}
{{.RenderedContent|Str2html}} {{.RenderedContent | Str2html}}
{{else}} {{else}}
<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span> <span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
{{end}} {{end}}
@ -137,7 +137,7 @@
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.DisplayName}}</a> {{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}</span>
<div class="detail"> <div class="detail">
<span class="octicon octicon-git-commit"></span> <span class="octicon octicon-git-commit"></span>
<span class="text grey">{{.Content | Str2html}}</span> <span class="text grey">{{.Content | Str2html}}</span>
@ -328,7 +328,7 @@
<div class="menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/assignee"> <div class="menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/assignee">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div> <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div>
{{range .Assignees}} {{range .Assignees}}
<div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?assignee={{.ID}}" data-avatar="{{.RelAvatarLink}}"><img src="{{.RelAvatarLink}}"> {{.Name}}</div> <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?assignee={{.ID}}" data-avatar="{{.RelAvatarLink}}"><img src="{{.RelAvatarLink}}"> {{.DisplayName}}</div>
{{end}} {{end}}
</div> </div>
</div> </div>
@ -336,7 +336,7 @@
<span class="no-select item {{if .Issue.Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignee"}}</span> <span class="no-select item {{if .Issue.Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignee"}}</span>
<div class="selected"> <div class="selected">
{{if .Issue.Assignee}} {{if .Issue.Assignee}}
<a class="item" href="{{$.RepoLink}}/issues?assignee={{.Issue.Assignee.ID}}"><img class="ui avatar image" src="{{.Issue.Assignee.RelAvatarLink}}"> {{.Issue.Assignee.Name}}</a> <a class="item" href="{{$.RepoLink}}/issues?assignee={{.Issue.Assignee.ID}}"><img class="ui avatar image" src="{{.Issue.Assignee.RelAvatarLink}}"> {{.Issue.Assignee.DisplayName}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>

2
templates/repo/release/list.tmpl

@ -42,7 +42,7 @@
<p class="text grey"> <p class="text grey">
<span class="author"> <span class="author">
<img class="img-10" src="{{.Publisher.RelAvatarLink}}"> <img class="img-10" src="{{.Publisher.RelAvatarLink}}">
<a href="{{AppSubUrl}}/{{.Publisher.Name}}">{{.Publisher.Name}}</a> <a href="{{AppSubUrl}}/{{.Publisher.Name}}">{{.Publisher.DisplayName}}</a>
</span> </span>
{{if .Created}}<span class="time">{{TimeSince .Created $.Lang}}</span>{{end}} {{if .Created}}<span class="time">{{TimeSince .Created $.Lang}}</span>{{end}}
<span class="ahead">{{$.i18n.Tr "repo.release.ahead" .NumCommitsBehind .Target | Str2html}}</span> <span class="ahead">{{$.i18n.Tr "repo.release.ahead" .NumCommitsBehind .Target | Str2html}}</span>

Loading…
Cancel
Save