Browse Source

more on #1319

pull/1414/head
Unknwon 10 years ago
parent
commit
a24141ec9c
  1. 1
      conf/locale/locale_en-US.ini
  2. 3
      models/issue.go
  3. 8
      modules/bindata/bindata.go
  4. 8
      templates/repo/issue/view_content.tmpl

1
conf/locale/locale_en-US.ini

@ -400,6 +400,7 @@ issues.filter_type.assigned_to_you = Assigned to you
issues.filter_type.created_by_you = Created by you
issues.filter_type.mentioning_you = Mentioning you
issues.opened_by = opened %[1]s by <a href="/%[2]s">%[2]s</a>
issues.opened_by_fake = opened %[1]s by %[2]s
issues.previous = Previous
issues.next = Next
issues.open_title = Open

3
models/issue.go

@ -108,7 +108,8 @@ func (i *Issue) IsPoster(uid int64) bool {
func (i *Issue) GetPoster() (err error) {
i.Poster, err = GetUserByID(i.PosterID)
if IsErrUserNotExist(err) {
i.Poster = &User{Name: "Someone"}
i.PosterID = -1
i.Poster = NewFakeUser()
return nil
}
return err

8
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long

8
templates/repo/issue/view_content.tmpl

@ -13,7 +13,11 @@
{{end}}
{{ $createdStr:= TimeSince .Issue.Created $.Lang }}
<span class="time-desc">
{{if gt .Issue.Poster.Id 0}}
{{$.i18n.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.Name | Safe}}
{{else}}
{{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.Name | Safe}}
{{end}}
·
{{$.i18n.Tr "repo.issues.num_comments" .Issue.NumComments}}
</span>
@ -22,12 +26,12 @@
<div class="twelve wide column comment-list">
<ui class="ui comments">
<div class="comment">
<a class="avatar" href="{{.Issue.Poster.HomeLink}}">
<a class="avatar" {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
<img src="{{.Issue.Poster.AvatarLink}}">
</a>
<div class="content">
<div class="ui top attached header">
<span class="text grey"><a href="{{.Issue.Poster.HomeLink}}">{{.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.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
<div class="ui right actions">
</div>
</div>

Loading…
Cancel
Save