Show full name if DefaultShowFullName setting activated (#6710)

Adds a new key DEFAULT_SHOW_FULL_NAME (default false) to the [ui] section.
If enabled the full name will be shown (unless it's empty, then
the default username will be used)
This commit is contained in:
Wim 2019-05-08 10:41:35 +02:00 committed by Lauris BH
parent a84f10ad1a
commit 4508380cf7
16 changed files with 84 additions and 49 deletions

View File

@ -97,6 +97,8 @@ SHOW_USER_EMAIL = true
DEFAULT_THEME = gitea DEFAULT_THEME = gitea
; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`. ; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`.
THEMES = gitea,arc-green THEMES = gitea,arc-green
; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
DEFAULT_SHOW_FULL_NAME = false
[ui.admin] [ui.admin]
; Number of users that are displayed on one page ; Number of users that are displayed on one page

View File

@ -85,6 +85,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install. - `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
- `THEMES`: **gitea,arc-green**: All available themes. Allow users select personalized themes - `THEMES`: **gitea,arc-green**: All available themes. Allow users select personalized themes
regardless of the value of `DEFAULT_THEME`. regardless of the value of `DEFAULT_THEME`.
- `DEFAULT_SHOW_FULL_NAME`: false: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
### UI - Admin (`ui.admin`) ### UI - Admin (`ui.admin`)

View File

@ -144,6 +144,22 @@ func (a *Action) ShortActUserName() string {
return base.EllipsisString(a.GetActUserName(), 20) return base.EllipsisString(a.GetActUserName(), 20)
} }
// GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME
func (a *Action) GetDisplayName() string {
if setting.UI.DefaultShowFullName {
return a.GetActFullName()
}
return a.ShortActUserName()
}
// GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
func (a *Action) GetDisplayNameTitle() string {
if setting.UI.DefaultShowFullName {
return a.ShortActUserName()
}
return a.GetActFullName()
}
// GetActAvatar the action's user's avatar link // GetActAvatar the action's user's avatar link
func (a *Action) GetActAvatar() string { func (a *Action) GetActAvatar() string {
a.loadActUser() a.loadActUser()

View File

@ -661,6 +661,16 @@ func (u *User) DisplayName() string {
return u.Name return u.Name
} }
// GetDisplayName returns full name if it's not empty and DEFAULT_SHOW_FULL_NAME is set,
// returns username otherwise.
func (u *User) GetDisplayName() string {
trimmed := strings.TrimSpace(u.FullName)
if len(trimmed) > 0 && setting.UI.DefaultShowFullName {
return trimmed
}
return u.Name
}
func gitSafeName(name string) string { func gitSafeName(name string) string {
return strings.TrimSpace(strings.NewReplacer("\n", "", "<", "", ">", "").Replace(name)) return strings.TrimSpace(strings.NewReplacer("\n", "", "<", "", ">", "").Replace(name))
} }

View File

@ -176,6 +176,7 @@ var (
ThemeColorMetaTag string ThemeColorMetaTag string
MaxDisplayFileSize int64 MaxDisplayFileSize int64
ShowUserEmail bool ShowUserEmail bool
DefaultShowFullName bool
DefaultTheme string DefaultTheme string
Themes []string Themes []string
@ -918,6 +919,7 @@ func NewContext() {
ShowFooterTemplateLoadTime = Cfg.Section("other").Key("SHOW_FOOTER_TEMPLATE_LOAD_TIME").MustBool(true) ShowFooterTemplateLoadTime = Cfg.Section("other").Key("SHOW_FOOTER_TEMPLATE_LOAD_TIME").MustBool(true)
UI.ShowUserEmail = Cfg.Section("ui").Key("SHOW_USER_EMAIL").MustBool(true) UI.ShowUserEmail = Cfg.Section("ui").Key("SHOW_USER_EMAIL").MustBool(true)
UI.DefaultShowFullName = Cfg.Section("ui").Key("DEFAULT_SHOW_FULL_NAME").MustBool(false)
HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt")) HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt"))

View File

@ -63,6 +63,9 @@ func NewFuncMap() []template.FuncMap {
"DisableGravatar": func() bool { "DisableGravatar": func() bool {
return setting.DisableGravatar return setting.DisableGravatar
}, },
"DefaultShowFullName": func() bool {
return setting.UI.DefaultShowFullName
},
"ShowFooterTemplateLoadTime": func() bool { "ShowFooterTemplateLoadTime": func() bool {
return setting.ShowFooterTemplateLoadTime return setting.ShowFooterTemplateLoadTime
}, },

View File

@ -7,7 +7,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> {{$.root.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.GetDisplayName}}</a> {{$.root.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
<div class="ui right actions"> <div class="ui right actions">
{{if and .Review}} {{if and .Review}}
{{if eq .Review.Type 0}} {{if eq .Review.Type 0}}

View File

@ -72,7 +72,7 @@
<div class="menu"> <div class="menu">
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a> <a class="item" href="{{$.Link}}?q={{$.Keyword}}&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}}"> {{.GetDisplayName}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>
@ -183,7 +183,7 @@
</div> </div>
{{range .Assignees}} {{range .Assignees}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee"> <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
<img src="{{.RelAvatarLink}}"> {{.Name}} <img src="{{.RelAvatarLink}}"> {{.GetDisplayName}}
</div> </div>
{{end}} {{end}}
</div> </div>
@ -228,9 +228,9 @@
{{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }} {{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }}
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
{{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}} {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName | Escape) | Safe}}
{{else}} {{else}}
{{$.i18n.Tr .GetLastEventLabelFake $timeStr .Poster.Name | Safe}} {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}}
{{end}} {{end}}
{{$tasks := .GetTasks}} {{$tasks := .GetTasks}}

View File

@ -74,7 +74,7 @@
<div class="menu"> <div class="menu">
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a> <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}">{{.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}}&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}}&assignee={{.ID}}"><img src="{{.RelAvatarLink}}"> {{.GetDisplayName}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>
@ -166,7 +166,7 @@
</div> </div>
{{range .Assignees}} {{range .Assignees}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee"> <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
<img src="{{.RelAvatarLink}}"> {{.Name}} <img src="{{.RelAvatarLink}}"> {{.GetDisplayName}}
</div> </div>
{{end}} {{end}}
</div> </div>
@ -204,9 +204,9 @@
<p class="desc"> <p class="desc">
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
{{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}} {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}}
{{else}} {{else}}
{{$.i18n.Tr .GetLastEventLabelFake $timeStr .Poster.Name | Safe}} {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}}
{{end}} {{end}}
{{$tasks := .GetTasks}} {{$tasks := .GetTasks}}
{{if gt $tasks 0}} {{if gt $tasks 0}}

View File

@ -112,7 +112,7 @@
<a class="item" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}"> <a class="item" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
<span class="octicon"></span> <span class="octicon"></span>
<span class="text"> <span class="text">
<img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.Name}} <img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.GetDisplayName}}
</span> </span>
</a> </a>
{{end}} {{end}}
@ -124,7 +124,7 @@
</span> </span>
{{range .Assignees}} {{range .Assignees}}
<a style="padding: 5px;color:rgba(0, 0, 0, 0.87);" class="hide item" id="assignee_{{.ID}}" href="{{$.RepoLink}}/issues?assignee={{.ID}}"> <a style="padding: 5px;color:rgba(0, 0, 0, 0.87);" class="hide item" id="assignee_{{.ID}}" href="{{$.RepoLink}}/issues?assignee={{.ID}}">
<img class="ui avatar image" src="{{.RelAvatarLink}}" style="vertical-align: middle;">&nbsp;{{.Name}} <img class="ui avatar image" src="{{.RelAvatarLink}}" style="vertical-align: middle;">&nbsp;{{.GetDisplayName}}
</a> </a>
{{end}} {{end}}
</div> </div>

View File

@ -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.GetDisplayName}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
{{if not $.Repository.IsArchived}} {{if not $.Repository.IsArchived}}
<div class="ui right actions"> <div class="ui right actions">
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }}

View File

@ -14,7 +14,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.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
{{if not $.Repository.IsArchived}} {{if not $.Repository.IsArchived}}
<div class="ui right actions"> <div class="ui right actions">
{{if gt .ShowTag 0}} {{if gt .ShowTag 0}}
@ -78,7 +78,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.reopened_at" .EventTag $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}</span>
</div> </div>
{{else if eq .Type 2}} {{else if eq .Type 2}}
<div class="event"> <div class="event">
@ -86,7 +86,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.closed_at" .EventTag $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}</span>
</div> </div>
{{else if eq .Type 4}} {{else if eq .Type 4}}
<div class="event"> <div class="event">
@ -94,7 +94,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.GetDisplayName}}</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>
@ -108,7 +108,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape) $createdStr | Safe}}{{end}}</span> {{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape) $createdStr | Safe}}{{end}}</span>
</div> </div>
{{end}} {{end}}
@ -118,7 +118,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}</span> {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}</span>
</div> </div>
{{else if eq .Type 9}} {{else if eq .Type 9}}
@ -130,11 +130,11 @@
<img src="{{.Assignee.RelAvatarLink}}"> <img src="{{.Assignee.RelAvatarLink}}">
</a> </a>
<span class="text grey"> <span class="text grey">
<a href="{{.Assignee.HomeLink}}">{{.Assignee.Name}}</a> <a href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a>
{{ if eq .Poster.ID .Assignee.ID }} {{ if eq .Poster.ID .Assignee.ID }}
{{$.i18n.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
{{ else }} {{ else }}
{{$.i18n.Tr "repo.issues.remove_assignee_at" .Poster.Name $createdStr | Safe}} {{$.i18n.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
{{ end }} {{ end }}
</span> </span>
{{else}} {{else}}
@ -142,11 +142,11 @@
<img src="{{.Assignee.RelAvatarLink}}"> <img src="{{.Assignee.RelAvatarLink}}">
</a> </a>
<span class="text grey"> <span class="text grey">
<a href="{{.Assignee.HomeLink}}">{{.Assignee.Name}}</a> <a href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a>
{{if eq .Poster.ID .AssigneeID}} {{if eq .Poster.ID .AssigneeID}}
{{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
{{else}} {{else}}
{{$.i18n.Tr "repo.issues.add_assignee_at" .Poster.Name $createdStr | Safe}} {{$.i18n.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
{{end}} {{end}}
</span> </span>
{{end}} {{end}}
@ -158,7 +158,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.change_title_at" (.OldTitle|Escape) (.NewTitle|Escape) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.change_title_at" (.OldTitle|Escape) (.NewTitle|Escape) $createdStr | Safe}}
</span> </span>
</div> </div>
@ -168,7 +168,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.delete_branch_at" (.CommitSHA|Escape) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.delete_branch_at" (.CommitSHA|Escape) $createdStr | Safe}}
</span> </span>
</div> </div>
@ -178,7 +178,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.start_tracking_history" $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}</span>
</div> </div>
{{else if eq .Type 13}} {{else if eq .Type 13}}
<div class="event"> <div class="event">
@ -186,7 +186,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.stop_tracking_history" $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}</span>
<div class="detail"> <div class="detail">
<span class="octicon octicon-clock"></span> <span class="octicon octicon-clock"></span>
@ -199,7 +199,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.add_time_history" $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.add_time_history" $createdStr | Safe}}</span>
<div class="detail"> <div class="detail">
<span class="octicon octicon-clock"></span> <span class="octicon octicon-clock"></span>
<span class="text grey">{{.Content}}</span> <span class="text grey">{{.Content}}</span>
@ -211,7 +211,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.cancel_tracking_history" $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}</span>
</div> </div>
{{else if eq .Type 16}} {{else if eq .Type 16}}
<div class="event"> <div class="event">
@ -219,7 +219,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}} {{$.i18n.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}}
</span> </span>
</div> </div>
@ -229,7 +229,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.due_date_modified" (.Content | ParseDeadline) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.due_date_modified" (.Content | ParseDeadline) $createdStr | Safe}}
</span> </span>
</div> </div>
@ -239,7 +239,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}} {{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}}
</span> </span>
</div> </div>
@ -250,7 +250,7 @@
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<span class="text grey"> <span class="text grey">
{{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink .Poster.Name $createdStr | Safe}} {{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
</span> </span>
<div class="detail"> <div class="detail">
<span class="octicon octicon-plus"></span> <span class="octicon octicon-plus"></span>
@ -264,7 +264,7 @@
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<span class="text grey"> <span class="text grey">
{{$.i18n.Tr "repo.issues.dependency.removed_dependency" .Poster.HomeLink .Poster.Name $createdStr | Safe}} {{$.i18n.Tr "repo.issues.dependency.removed_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
</span> </span>
<div class="detail"> <div class="detail">
<span class="text grey octicon octicon-trashcan"></span> <span class="text grey octicon octicon-trashcan"></span>
@ -277,7 +277,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> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if eq .Review.Type 1}} {{if eq .Review.Type 1}}
{{$.i18n.Tr "repo.issues.review.approve" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.review.approve" $createdStr | Safe}}
{{else if eq .Review.Type 2}} {{else if eq .Review.Type 2}}
@ -335,7 +335,7 @@
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<div class="content"> <div class="content">
<a class="author" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> <a class="author" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
<div class="metadata"> <div class="metadata">
<span class="date">{{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdSubStr | Safe}}</span> <span class="date">{{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdSubStr | Safe}}</span>
</div> </div>
@ -368,11 +368,11 @@
</a> </a>
{{ if .Content }} {{ if .Content }}
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}} {{$.i18n.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
</span> </span>
{{ else }} {{ else }}
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.lock_no_reason" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
</span> </span>
{{ end }} {{ end }}
@ -385,7 +385,7 @@
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.i18n.Tr "repo.issues.unlock_comment" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.unlock_comment" $createdStr | Safe}}
</span> </span>
</div> </div>

View File

@ -89,7 +89,7 @@
{{end}} {{end}}
{{end}}"></span> {{end}}"></span>
<span class="text"> <span class="text">
<img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.Name}} <img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.GetDisplayName}}
</span> </span>
</a> </a>
{{end}} {{end}}
@ -100,7 +100,7 @@
<div class="selected"> <div class="selected">
{{range .Issue.Assignees}} {{range .Issue.Assignees}}
<div class="item" style="margin-bottom: 10px;"> <div class="item" style="margin-bottom: 10px;">
<a href="{{$.RepoLink}}/issues?assignee={{.ID}}"><img class="ui avatar image" src="{{.RelAvatarLink}}">&nbsp;{{.Name}}</a> <a href="{{$.RepoLink}}/issues?assignee={{.ID}}"><img class="ui avatar image" src="{{.RelAvatarLink}}">&nbsp;{{.GetDisplayName}}</a>
</div> </div>
{{end}} {{end}}
</div> </div>
@ -113,7 +113,7 @@
<div> <div>
{{range .Participants}} {{range .Participants}}
<a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}}> <a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}}>
<img class="ui avatar image poping up" src="{{.RelAvatarLink}}" data-content="{{.DisplayName}}" data-position="top center" data-variation="small inverted"> <img class="ui avatar image poping up" src="{{.RelAvatarLink}}" data-content="{{.GetDisplayName}}" data-position="top center" data-variation="small inverted">
</a> </a>
{{end}} {{end}}
</div> </div>

View File

@ -27,19 +27,19 @@
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
{{if .Issue.PullRequest.HasMerged}} {{if .Issue.PullRequest.HasMerged}}
{{ $mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.Lang }} {{ $mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.Lang }}
<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.Name}}</a> <a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.GetDisplayName}}</a>
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span> <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span>
{{else}} {{else}}
<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> <a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a>
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span> <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span>
{{end}} {{end}}
{{else}} {{else}}
{{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }} {{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
<span class="time-desc"> <span class="time-desc">
{{if gt .Issue.Poster.ID 0}} {{if gt .Issue.Poster.ID 0}}
{{$.i18n.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.Name | Safe}} {{$.i18n.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink (.Issue.Poster.GetDisplayName|Escape) | Safe}}
{{else}} {{else}}
{{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.Name | Safe}} {{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}}
{{end}} {{end}}
· ·
{{$.i18n.Tr "repo.issues.num_comments" .Issue.NumComments}} {{$.i18n.Tr "repo.issues.num_comments" .Issue.NumComments}}

View File

@ -8,7 +8,7 @@
<div class="{{if or (eq .GetOpType 5) (eq .GetOpType 18)}}push news{{end}}"> <div class="{{if or (eq .GetOpType 5) (eq .GetOpType 18)}}push news{{end}}">
<p> <p>
{{if gt .ActUser.ID 0}} {{if gt .ActUser.ID 0}}
<a href="{{AppSubUrl}}/{{.GetActUserName}}" title="{{.GetActFullName}}">{{.ShortActUserName}}</a> <a href="{{AppSubUrl}}/{{.GetActUserName}}" title="{{.GetDisplayNameTitle}}">{{.GetDisplayName}}</a>
{{else}} {{else}}
{{.ShortActUserName}} {{.ShortActUserName}}
{{end}} {{end}}

View File

@ -61,6 +61,7 @@
<div class="issue list"> <div class="issue list">
{{range .Issues}} {{range .Issues}}
{{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }} {{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }}
<li class="item"> <li class="item">
<div class="ui label">{{if not $.RepoID}}{{.Repo.FullName}}{{end}}#{{.Index}}</div> <div class="ui label">{{if not $.RepoID}}{{.Repo.FullName}}{{end}}#{{.Index}}</div>
@ -93,12 +94,12 @@
<p class="desc"> <p class="desc">
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
{{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}} {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}}
{{else}} {{else}}
{{$.i18n.Tr .GetLastEventLabelFake $timeStr .Poster.Name | Safe}} {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}}
{{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.GetDisplayName}}" 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}}