Browse Source

fix some link

slene 11 years ago
parent
commit
4c70249f75
3 changed files with 4 additions and 4 deletions
  1. 1 1
      models/user.go
  2. 1 1
      modules/middleware/context.go
  3. 2 2
      templates/user/profile.tmpl

+ 1 - 1
models/user.go

@@ -67,7 +67,7 @@ type User struct {
 
 // HomeLink returns the user home page link.
 func (user *User) HomeLink() string {
-	return "/user/" + user.LowerName
+	return "/user/" + user.Name
 }
 
 // AvatarLink returns the user gravatar link.

+ 1 - 1
modules/middleware/context.go

@@ -269,7 +269,7 @@ func InitContext() martini.Handler {
 		if user != nil {
 			ctx.Data["SignedUser"] = user
 			ctx.Data["SignedUserId"] = user.Id
-			ctx.Data["SignedUserName"] = user.LowerName
+			ctx.Data["SignedUserName"] = user.Name
 			ctx.Data["IsAdmin"] = ctx.User.IsAdmin
 		}
 

+ 2 - 2
templates/user/profile.tmpl

@@ -51,7 +51,7 @@
                     <li>
                         <div class="meta pull-right"><!-- <i class="fa fa-star"></i> {{.NumStars}} --> <i class="fa fa-code-fork"></i> {{.NumForks}}</div>
                         <h4>
-                            <a href="/{{$owner.Name}}/{{.LowerName}}">{{.LowerName}}</a>
+                            <a href="/{{$owner.Name}}/{{.Name}}">{{.Name}}</a>
                         </h4>
                         <p class="desc">{{.Description}}</p>
                         <div class="info">Last updated {{.Updated|TimeSince}}</div>
@@ -63,4 +63,4 @@
         </div>
     </div>
 </div>
-{{template "base/footer" .}}
+{{template "base/footer" .}}