Unknwon 9 years ago
parent
commit
a24141ec9c

+ 1 - 0
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

+ 2 - 1
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

File diff suppressed because it is too large
+ 2 - 2
modules/bindata/bindata.go


+ 6 - 2
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>

Some files were not shown because too many files changed in this diff