Browse Source

Refactoring: rename Signed -> Logged

pull/3974/merge
Unknwon 8 years ago
parent
commit
ac43eab51f
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 10
      pkg/context/auth.go
  2. 26
      pkg/context/context.go
  3. 4
      pkg/context/org.go
  4. 12
      pkg/context/repo.go
  5. 8
      routers/api/v1/api.go
  6. 2
      routers/api/v1/repo/repo.go
  7. 4
      routers/api/v1/user/user.go
  8. 2
      routers/home.go
  9. 18
      routers/repo/issue.go
  10. 2
      routers/repo/pull.go
  11. 4
      routers/user/home.go
  12. 4
      routers/user/profile.go
  13. 12
      templates/base/head.tmpl
  14. 2
      templates/explore/users.tmpl
  15. 6
      templates/org/member/members.tmpl
  16. 2
      templates/org/settings/options.tmpl
  17. 2
      templates/org/team/members.tmpl
  18. 6
      templates/org/team/sidebar.tmpl
  19. 6
      templates/org/team/teams.tmpl
  20. 6
      templates/repo/create.tmpl
  21. 2
      templates/repo/diff/page.tmpl
  22. 2
      templates/repo/editor/commit_form.tmpl
  23. 2
      templates/repo/header.tmpl
  24. 4
      templates/repo/issue/new_form.tmpl
  25. 8
      templates/repo/issue/view_content.tmpl
  26. 6
      templates/repo/migrate.tmpl
  27. 8
      templates/repo/pulls/fork.tmpl
  28. 2
      templates/repo/settings/nav.tmpl
  29. 2
      templates/repo/settings/navbar.tmpl
  30. 4
      templates/user/auth/activate.tmpl
  31. 6
      templates/user/dashboard/navbar.tmpl
  32. 4
      templates/user/meta/header.tmpl
  33. 8
      templates/user/profile.tmpl
  34. 6
      templates/user/settings/avatar.tmpl
  35. 2
      templates/user/settings/password.tmpl
  36. 4
      templates/user/settings/profile.tmpl
  37. 2
      templates/user/settings/repositories.tmpl

10
pkg/context/auth.go

@ -30,20 +30,20 @@ func Toggle(options *ToggleOptions) macaron.Handler {
} }
// Check prohibit login users. // Check prohibit login users.
if ctx.IsSigned && ctx.User.ProhibitLogin { if ctx.IsLogged && ctx.User.ProhibitLogin {
ctx.Data["Title"] = ctx.Tr("auth.prohibit_login") ctx.Data["Title"] = ctx.Tr("auth.prohibit_login")
ctx.HTML(200, "user/auth/prohibit_login") ctx.HTML(200, "user/auth/prohibit_login")
return return
} }
// Check non-logged users landing page. // Check non-logged users landing page.
if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LANDING_PAGE_HOME { if !ctx.IsLogged && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LANDING_PAGE_HOME {
ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL)) ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL))
return return
} }
// Redirect to dashboard if user tries to visit any non-login page. // Redirect to dashboard if user tries to visit any non-login page.
if options.SignOutRequired && ctx.IsSigned && ctx.Req.RequestURI != "/" { if options.SignOutRequired && ctx.IsLogged && ctx.Req.RequestURI != "/" {
ctx.Redirect(setting.AppSubURL + "/") ctx.Redirect(setting.AppSubURL + "/")
return return
} }
@ -56,7 +56,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
} }
if options.SignInRequired { if options.SignInRequired {
if !ctx.IsSigned { if !ctx.IsLogged {
// Restrict API calls with error message. // Restrict API calls with error message.
if auth.IsAPIPath(ctx.Req.URL.Path) { if auth.IsAPIPath(ctx.Req.URL.Path) {
ctx.JSON(403, map[string]string{ ctx.JSON(403, map[string]string{
@ -76,7 +76,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
} }
// Redirect to log in page if auto-signin info is provided and has not signed in. // Redirect to log in page if auto-signin info is provided and has not signed in.
if !options.SignOutRequired && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) && if !options.SignOutRequired && !ctx.IsLogged && !auth.IsAPIPath(ctx.Req.URL.Path) &&
len(ctx.GetCookie(setting.CookieUserName)) > 0 { len(ctx.GetCookie(setting.CookieUserName)) > 0 {
ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL) ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL)
ctx.Redirect(setting.AppSubURL + "/user/login") ctx.Redirect(setting.AppSubURL + "/user/login")

26
pkg/context/context.go

@ -34,18 +34,20 @@ type Context struct {
Session session.Store Session session.Store
User *models.User User *models.User
IsSigned bool IsLogged bool
IsBasicAuth bool IsBasicAuth bool
Repo *Repository Repo *Repository
Org *Organization Org *Organization
} }
func (ctx *Context) UserID() int64 { // UserID returns ID of current logged in user.
if !ctx.IsSigned { // It returns 0 if visitor is anonymous.
func (c *Context) UserID() int64 {
if !c.IsLogged {
return 0 return 0
} }
return ctx.User.ID return c.User.ID
} }
// HasError returns true if error occurs in form validation. // HasError returns true if error occurs in form validation.
@ -112,7 +114,7 @@ func (ctx *Context) Handle(status int, title string, err error) {
case http.StatusInternalServerError: case http.StatusInternalServerError:
ctx.Data["Title"] = "Internal Server Error" ctx.Data["Title"] = "Internal Server Error"
log.Error(2, "%s: %v", title, err) log.Error(2, "%s: %v", title, err)
if !setting.ProdMode || (ctx.IsSigned && ctx.User.IsAdmin) { if !setting.ProdMode || (ctx.IsLogged && ctx.User.IsAdmin) {
ctx.Data["ErrorMsg"] = err ctx.Data["ErrorMsg"] = err
} }
} }
@ -193,15 +195,15 @@ func Contexter() macaron.Handler {
ctx.User, ctx.IsBasicAuth = auth.SignedInUser(ctx.Context, ctx.Session) ctx.User, ctx.IsBasicAuth = auth.SignedInUser(ctx.Context, ctx.Session)
if ctx.User != nil { if ctx.User != nil {
ctx.IsSigned = true ctx.IsLogged = true
ctx.Data["IsSigned"] = ctx.IsSigned ctx.Data["IsLogged"] = ctx.IsLogged
ctx.Data["SignedUser"] = ctx.User ctx.Data["LoggedUser"] = ctx.User
ctx.Data["SignedUserID"] = ctx.User.ID ctx.Data["LoggedUserID"] = ctx.User.ID
ctx.Data["SignedUserName"] = ctx.User.Name ctx.Data["LoggedUserName"] = ctx.User.Name
ctx.Data["IsAdmin"] = ctx.User.IsAdmin ctx.Data["IsAdmin"] = ctx.User.IsAdmin
} else { } else {
ctx.Data["SignedUserID"] = 0 ctx.Data["LoggedUserID"] = 0
ctx.Data["SignedUserName"] = "" ctx.Data["LoggedUserName"] = ""
} }
// If request sends files, parse them here otherwise the Query() can't be parsed and the CsrfToken will be invalid. // If request sends files, parse them here otherwise the Query() can't be parsed and the CsrfToken will be invalid.

4
pkg/context/org.go

@ -63,12 +63,12 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
} }
// Admin has super access. // Admin has super access.
if ctx.IsSigned && ctx.User.IsAdmin { if ctx.IsLogged && ctx.User.IsAdmin {
ctx.Org.IsOwner = true ctx.Org.IsOwner = true
ctx.Org.IsMember = true ctx.Org.IsMember = true
ctx.Org.IsTeamMember = true ctx.Org.IsTeamMember = true
ctx.Org.IsTeamAdmin = true ctx.Org.IsTeamAdmin = true
} else if ctx.IsSigned { } else if ctx.IsLogged {
ctx.Org.IsOwner = org.IsOwnedBy(ctx.User.ID) ctx.Org.IsOwner = org.IsOwnedBy(ctx.User.ID)
if ctx.Org.IsOwner { if ctx.Org.IsOwner {
ctx.Org.IsMember = true ctx.Org.IsMember = true

12
pkg/context/repo.go

@ -151,7 +151,7 @@ func RepoAssignment(pages ...bool) macaron.Handler {
} }
// Check if the user is the same as the repository owner // Check if the user is the same as the repository owner
if ctx.IsSigned && ctx.User.LowerName == strings.ToLower(ownerName) { if ctx.IsLogged && ctx.User.LowerName == strings.ToLower(ownerName) {
owner = ctx.User owner = ctx.User
} else { } else {
owner, err = models.GetUserByName(ownerName) owner, err = models.GetUserByName(ownerName)
@ -194,7 +194,7 @@ func RepoAssignment(pages ...bool) macaron.Handler {
ctx.Data["RepoRelPath"] = ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name ctx.Data["RepoRelPath"] = ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name
// Admin has super access. // Admin has super access.
if ctx.IsSigned && ctx.User.IsAdmin { if ctx.IsLogged && ctx.User.IsAdmin {
ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER
} else { } else {
mode, err := models.AccessLevel(ctx.UserID(), repo) mode, err := models.AccessLevel(ctx.UserID(), repo)
@ -278,7 +278,7 @@ func RepoAssignment(pages ...bool) macaron.Handler {
ctx.Data["CloneLink"] = repo.CloneLink() ctx.Data["CloneLink"] = repo.CloneLink()
ctx.Data["WikiCloneLink"] = repo.WikiCloneLink() ctx.Data["WikiCloneLink"] = repo.WikiCloneLink()
if ctx.IsSigned { if ctx.IsLogged {
ctx.Data["IsWatchingRepo"] = models.IsWatching(ctx.User.ID, repo.ID) ctx.Data["IsWatchingRepo"] = models.IsWatching(ctx.User.ID, repo.ID)
ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.ID, repo.ID) ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.ID, repo.ID)
} }
@ -424,7 +424,7 @@ func RepoRef() macaron.Handler {
ctx.Data["IsViewCommit"] = ctx.Repo.IsViewCommit ctx.Data["IsViewCommit"] = ctx.Repo.IsViewCommit
// People who have push access or have fored repository can propose a new pull request. // People who have push access or have fored repository can propose a new pull request.
if ctx.Repo.IsWriter() || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) { if ctx.Repo.IsWriter() || (ctx.IsLogged && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {
// Pull request is allowed if this is a fork repository // Pull request is allowed if this is a fork repository
// and base repository accepts pull requests. // and base repository accepts pull requests.
if ctx.Repo.Repository.BaseRepo != nil { if ctx.Repo.Repository.BaseRepo != nil {
@ -459,7 +459,7 @@ func RepoRef() macaron.Handler {
func RequireRepoAdmin() macaron.Handler { func RequireRepoAdmin() macaron.Handler {
return func(ctx *Context) { return func(ctx *Context) {
if !ctx.IsSigned || (!ctx.Repo.IsAdmin() && !ctx.User.IsAdmin) { if !ctx.IsLogged || (!ctx.Repo.IsAdmin() && !ctx.User.IsAdmin) {
ctx.NotFound() ctx.NotFound()
return return
} }
@ -468,7 +468,7 @@ func RequireRepoAdmin() macaron.Handler {
func RequireRepoWriter() macaron.Handler { func RequireRepoWriter() macaron.Handler {
return func(ctx *Context) { return func(ctx *Context) {
if !ctx.IsSigned || (!ctx.Repo.IsWriter() && !ctx.User.IsAdmin) { if !ctx.IsLogged || (!ctx.Repo.IsWriter() && !ctx.User.IsAdmin) {
ctx.NotFound() ctx.NotFound()
return return
} }

8
routers/api/v1/api.go

@ -34,7 +34,7 @@ func repoAssignment() macaron.Handler {
) )
// Check if the user is the same as the repository owner. // Check if the user is the same as the repository owner.
if ctx.IsSigned && ctx.User.LowerName == strings.ToLower(userName) { if ctx.IsLogged && ctx.User.LowerName == strings.ToLower(userName) {
owner = ctx.User owner = ctx.User
} else { } else {
owner, err = models.GetUserByName(userName) owner, err = models.GetUserByName(userName)
@ -63,7 +63,7 @@ func repoAssignment() macaron.Handler {
return return
} }
if ctx.IsSigned && ctx.User.IsAdmin { if ctx.IsLogged && ctx.User.IsAdmin {
ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER
} else { } else {
mode, err := models.AccessLevel(ctx.User.ID, repo) mode, err := models.AccessLevel(ctx.User.ID, repo)
@ -86,7 +86,7 @@ func repoAssignment() macaron.Handler {
// Contexter middleware already checks token for user sign in process. // Contexter middleware already checks token for user sign in process.
func reqToken() macaron.Handler { func reqToken() macaron.Handler {
return func(ctx *context.Context) { return func(ctx *context.Context) {
if !ctx.IsSigned { if !ctx.IsLogged {
ctx.Error(401) ctx.Error(401)
return return
} }
@ -104,7 +104,7 @@ func reqBasicAuth() macaron.Handler {
func reqAdmin() macaron.Handler { func reqAdmin() macaron.Handler {
return func(ctx *context.Context) { return func(ctx *context.Context) {
if !ctx.IsSigned || !ctx.User.IsAdmin { if !ctx.IsLogged || !ctx.User.IsAdmin {
ctx.Error(403) ctx.Error(403)
return return
} }

2
routers/api/v1/repo/repo.go

@ -28,7 +28,7 @@ func Search(ctx *context.APIContext) {
} }
// Check visibility. // Check visibility.
if ctx.IsSigned && opts.OwnerID > 0 { if ctx.IsLogged && opts.OwnerID > 0 {
if ctx.User.ID == opts.OwnerID { if ctx.User.ID == opts.OwnerID {
opts.Private = true opts.Private = true
} else { } else {

4
routers/api/v1/user/user.go

@ -41,7 +41,7 @@ func Search(ctx *context.APIContext) {
AvatarUrl: users[i].AvatarLink(), AvatarUrl: users[i].AvatarLink(),
FullName: users[i].FullName, FullName: users[i].FullName,
} }
if ctx.IsSigned { if ctx.IsLogged {
results[i].Email = users[i].Email results[i].Email = users[i].Email
} }
} }
@ -64,7 +64,7 @@ func GetInfo(ctx *context.APIContext) {
} }
// Hide user e-mail when API caller isn't signed in. // Hide user e-mail when API caller isn't signed in.
if !ctx.IsSigned { if !ctx.IsLogged {
u.Email = "" u.Email = ""
} }
ctx.JSON(200, u.APIFormat()) ctx.JSON(200, u.APIFormat())

2
routers/home.go

@ -21,7 +21,7 @@ const (
) )
func Home(ctx *context.Context) { func Home(ctx *context.Context) {
if ctx.IsSigned { if ctx.IsLogged {
if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm {
ctx.Data["Title"] = ctx.Tr("auth.active_your_account") ctx.Data["Title"] = ctx.Tr("auth.active_your_account")
ctx.HTML(200, user.ACTIVATE) ctx.HTML(200, user.ACTIVATE)

18
routers/repo/issue.go

@ -70,7 +70,7 @@ func MustAllowPulls(ctx *context.Context) {
} }
// User can send pull request if owns a forked repository. // User can send pull request if owns a forked repository.
if ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID) { if ctx.IsLogged && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID) {
ctx.Repo.PullRequest.Allowed = true ctx.Repo.PullRequest.Allowed = true
ctx.Repo.PullRequest.HeadInfo = ctx.User.Name + ":" + ctx.Repo.BranchName ctx.Repo.PullRequest.HeadInfo = ctx.User.Name + ":" + ctx.Repo.BranchName
} }
@ -115,7 +115,7 @@ func issues(ctx *context.Context, isPullList bool) {
} }
// Must sign in to see issues about you. // Must sign in to see issues about you.
if viewType != "all" && !ctx.IsSigned { if viewType != "all" && !ctx.IsLogged {
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL) ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL)
ctx.Redirect(setting.AppSubURL + "/user/login") ctx.Redirect(setting.AppSubURL + "/user/login")
return return
@ -138,7 +138,7 @@ func issues(ctx *context.Context, isPullList bool) {
} }
var uid int64 = -1 var uid int64 = -1
if ctx.IsSigned { if ctx.IsLogged {
uid = ctx.User.ID uid = ctx.User.ID
} }
@ -197,7 +197,7 @@ func issues(ctx *context.Context, isPullList bool) {
// Get posters. // Get posters.
for i := range issues { for i := range issues {
if !ctx.IsSigned { if !ctx.IsLogged {
issues[i].IsRead = true issues[i].IsRead = true
continue continue
} }
@ -587,7 +587,7 @@ func viewIssue(ctx *context.Context, isPullList bool) {
} }
} }
if ctx.IsSigned { if ctx.IsLogged {
// Update issue-user. // Update issue-user.
if err = issue.ReadBy(ctx.User.ID); err != nil { if err = issue.ReadBy(ctx.User.ID); err != nil {
ctx.Handle(500, "ReadBy", err) ctx.Handle(500, "ReadBy", err)
@ -652,7 +652,7 @@ func viewIssue(ctx *context.Context, isPullList bool) {
ctx.Data["Participants"] = participants ctx.Data["Participants"] = participants
ctx.Data["NumParticipants"] = len(participants) ctx.Data["NumParticipants"] = len(participants)
ctx.Data["Issue"] = issue ctx.Data["Issue"] = issue
ctx.Data["IsIssueOwner"] = ctx.Repo.IsWriter() || (ctx.IsSigned && issue.IsPoster(ctx.User.ID)) ctx.Data["IsIssueOwner"] = ctx.Repo.IsWriter() || (ctx.IsLogged && issue.IsPoster(ctx.User.ID))
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + ctx.Data["Link"].(string) ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + ctx.Data["Link"].(string)
ctx.HTML(200, ISSUE_VIEW) ctx.HTML(200, ISSUE_VIEW)
} }
@ -687,7 +687,7 @@ func UpdateIssueTitle(ctx *context.Context) {
return return
} }
if !ctx.IsSigned || (!issue.IsPoster(ctx.User.ID) && !ctx.Repo.IsWriter()) { if !ctx.IsLogged || (!issue.IsPoster(ctx.User.ID) && !ctx.Repo.IsWriter()) {
ctx.Error(403) ctx.Error(403)
return return
} }
@ -714,7 +714,7 @@ func UpdateIssueContent(ctx *context.Context) {
return return
} }
if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.IsWriter()) { if !ctx.IsLogged || (ctx.User.ID != issue.PosterID && !ctx.Repo.IsWriter()) {
ctx.Error(403) ctx.Error(403)
return return
} }
@ -843,7 +843,7 @@ func NewComment(ctx *context.Context, f form.CreateComment) {
var comment *models.Comment var comment *models.Comment
defer func() { defer func() {
// Check if issue admin/poster changes the status of issue. // Check if issue admin/poster changes the status of issue.
if (ctx.Repo.IsWriter() || (ctx.IsSigned && issue.IsPoster(ctx.User.ID))) && if (ctx.Repo.IsWriter() || (ctx.IsLogged && issue.IsPoster(ctx.User.ID))) &&
(f.Status == "reopen" || f.Status == "close") && (f.Status == "reopen" || f.Status == "close") &&
!(issue.IsPull && issue.PullRequest.HasMerged) { !(issue.IsPull && issue.PullRequest.HasMerged) {

2
routers/repo/pull.go

@ -153,7 +153,7 @@ func checkPullInfo(ctx *context.Context) *models.Issue {
return nil return nil
} }
if ctx.IsSigned { if ctx.IsLogged {
// Update issue-user. // Update issue-user.
if err = issue.ReadBy(ctx.User.ID); err != nil { if err = issue.ReadBy(ctx.User.ID); err != nil {
ctx.Handle(500, "ReadBy", err) ctx.Handle(500, "ReadBy", err)

4
routers/user/home.go

@ -379,7 +379,7 @@ func showOrgProfile(ctx *context.Context) {
count int64 count int64
err error err error
) )
if ctx.IsSigned && !ctx.User.IsAdmin { if ctx.IsLogged && !ctx.User.IsAdmin {
repos, count, err = org.GetUserRepositories(ctx.User.ID, page, setting.UI.User.RepoPagingNum) repos, count, err = org.GetUserRepositories(ctx.User.ID, page, setting.UI.User.RepoPagingNum)
if err != nil { if err != nil {
ctx.Handle(500, "GetUserRepositories", err) ctx.Handle(500, "GetUserRepositories", err)
@ -387,7 +387,7 @@ func showOrgProfile(ctx *context.Context) {
} }
ctx.Data["Repos"] = repos ctx.Data["Repos"] = repos
} else { } else {
showPrivate := ctx.IsSigned && ctx.User.IsAdmin showPrivate := ctx.IsLogged && ctx.User.IsAdmin
repos, err = models.GetUserRepositories(&models.UserRepoOptions{ repos, err = models.GetUserRepositories(&models.UserRepoOptions{
UserID: org.ID, UserID: org.ID,
Private: showPrivate, Private: showPrivate,

4
routers/user/profile.go

@ -73,7 +73,7 @@ func Profile(ctx *context.Context) {
ctx.Data["PageIsUserProfile"] = true ctx.Data["PageIsUserProfile"] = true
ctx.Data["Owner"] = ctxUser ctx.Data["Owner"] = ctxUser
orgs, err := models.GetOrgsByUserID(ctxUser.ID, ctx.IsSigned && (ctx.User.IsAdmin || ctx.User.ID == ctxUser.ID)) orgs, err := models.GetOrgsByUserID(ctxUser.ID, ctx.IsLogged && (ctx.User.IsAdmin || ctx.User.ID == ctxUser.ID))
if err != nil { if err != nil {
ctx.Handle(500, "GetOrgsByUserIDDesc", err) ctx.Handle(500, "GetOrgsByUserIDDesc", err)
return return
@ -95,7 +95,7 @@ func Profile(ctx *context.Context) {
page = 1 page = 1
} }
showPrivate := ctx.IsSigned && (ctxUser.ID == ctx.User.ID || ctx.User.IsAdmin) showPrivate := ctx.IsLogged && (ctxUser.ID == ctx.User.ID || ctx.User.IsAdmin)
ctx.Data["Repos"], err = models.GetUserRepositories(&models.UserRepoOptions{ ctx.Data["Repos"], err = models.GetUserRepositories(&models.UserRepoOptions{
UserID: ctxUser.ID, UserID: ctxUser.ID,
Private: showPrivate, Private: showPrivate,

12
templates/base/head.tmpl

@ -90,7 +90,7 @@
<img class="ui mini image" src="{{AppSubURL}}/img/favicon.png"> <img class="ui mini image" src="{{AppSubURL}}/img/favicon.png">
</a> </a>
{{if .IsSigned}} {{if .IsLogged}}
<a class="item{{if .PageIsDashboard}} active{{end}}" href="{{AppSubURL}}/">{{.i18n.Tr "dashboard"}}</a> <a class="item{{if .PageIsDashboard}} active{{end}}" href="{{AppSubURL}}/">{{.i18n.Tr "dashboard"}}</a>
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubURL}}/issues">{{.i18n.Tr "issues"}}</a> <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubURL}}/issues">{{.i18n.Tr "issues"}}</a>
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubURL}}/pulls">{{.i18n.Tr "pull_requests"}}</a> <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubURL}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
@ -106,7 +106,7 @@
</div> </div>
</div>*/}} </div>*/}}
{{if .IsSigned}} {{if .IsLogged}}
<div class="right menu"> <div class="right menu">
<div class="ui dropdown head link jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted"> <div class="ui dropdown head link jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
<span class="text"> <span class="text">
@ -120,7 +120,7 @@
<a class="item" href="{{AppSubURL}}/repo/migrate"> <a class="item" href="{{AppSubURL}}/repo/migrate">
<i class="octicon octicon-repo-clone"></i> {{.i18n.Tr "new_migrate"}} <i class="octicon octicon-repo-clone"></i> {{.i18n.Tr "new_migrate"}}
</a> </a>
{{if .SignedUser.CanCreateOrganization}} {{if .LoggedUser.CanCreateOrganization}}
<a class="item" href="{{AppSubURL}}/org/create"> <a class="item" href="{{AppSubURL}}/org/create">
<i class="octicon octicon-organization"></i> {{.i18n.Tr "new_org"}} <i class="octicon octicon-organization"></i> {{.i18n.Tr "new_org"}}
</a> </a>
@ -130,17 +130,17 @@
<div class="ui dropdown head link jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted"> <div class="ui dropdown head link jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
<span class="text avatar"> <span class="text avatar">
<img class="ui small rounded image" src="{{.SignedUser.RelAvatarLink}}"> <img class="ui small rounded image" src="{{.LoggedUser.RelAvatarLink}}">
<span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span> <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
<i class="octicon octicon-triangle-down" tabindex="-1"></i> <i class="octicon octicon-triangle-down" tabindex="-1"></i>
</span> </span>
<div class="menu" tabindex="-1"> <div class="menu" tabindex="-1">
<div class="ui header"> <div class="ui header">
{{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> {{.i18n.Tr "signed_in_as"}} <strong>{{.LoggedUser.Name}}</strong>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
<a class="item" href="{{AppSubURL}}/{{.SignedUser.Name}}"> <a class="item" href="{{AppSubURL}}/{{.LoggedUser.Name}}">
<i class="octicon octicon-person"></i> <i class="octicon octicon-person"></i>
{{.i18n.Tr "your_profile"}}<!-- Your profile --> {{.i18n.Tr "your_profile"}}<!-- Your profile -->
</a> </a>

2
templates/explore/users.tmpl

@ -16,7 +16,7 @@
{{if .Location}} {{if .Location}}
<i class="octicon octicon-location"></i> {{.Location}} <i class="octicon octicon-location"></i> {{.Location}}
{{end}} {{end}}
{{if and .Email $.IsSigned}} {{if and .Email $.IsLogged}}
<i class="octicon octicon-mail"></i> <i class="octicon octicon-mail"></i>
<a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</a> <a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</a>
{{end}} {{end}}

6
templates/org/member/members.tmpl

@ -28,10 +28,10 @@
{{ $isPublic := .IsPublicMember $.Org.ID}} {{ $isPublic := .IsPublicMember $.Org.ID}}
{{if $isPublic}} {{if $isPublic}}
<strong>{{$.i18n.Tr "org.members.public"}}</strong> <strong>{{$.i18n.Tr "org.members.public"}}</strong>
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a href="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.i18n.Tr "org.members.public_helper"}}</a>){{end}} {{if or (eq $.LoggedUser.ID .ID) $.IsOrganizationOwner}}(<a href="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.i18n.Tr "org.members.public_helper"}}</a>){{end}}
{{else}} {{else}}
<strong>{{$.i18n.Tr "org.members.private"}}</strong> <strong>{{$.i18n.Tr "org.members.private"}}</strong>
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a href="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{$.i18n.Tr "org.members.private_helper"}}</a>){{end}} {{if or (eq $.LoggedUser.ID .ID) $.IsOrganizationOwner}}(<a href="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{$.i18n.Tr "org.members.private_helper"}}</a>){{end}}
{{end}} {{end}}
</div> </div>
</div> </div>
@ -45,7 +45,7 @@
</div> </div>
<div class="ui four wide column"> <div class="ui four wide column">
<div class="text right"> <div class="text right">
{{if eq $.SignedUser.ID .ID}} {{if eq $.LoggedUser.ID .ID}}
<a class="ui red small button" href="{{$.OrgLink}}/members/action/leave?uid={{.ID}}">{{$.i18n.Tr "org.members.leave"}}</a> <a class="ui red small button" href="{{$.OrgLink}}/members/action/leave?uid={{.ID}}">{{$.i18n.Tr "org.members.leave"}}</a>
{{else if $.IsOrganizationOwner}} {{else if $.IsOrganizationOwner}}
<a class="ui red small button" href="{{$.OrgLink}}/members/action/remove?uid={{.ID}}">{{$.i18n.Tr "org.members.remove"}}</a> <a class="ui red small button" href="{{$.OrgLink}}/members/action/remove?uid={{.ID}}">{{$.i18n.Tr "org.members.remove"}}</a>

2
templates/org/settings/options.tmpl

@ -33,7 +33,7 @@
<input id="location" name="location" value="{{.Org.Location}}"> <input id="location" name="location" value="{{.Org.Location}}">
</div> </div>
{{if .SignedUser.IsAdmin}} {{if .LoggedUser.IsAdmin}}
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}"> <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">

2
templates/org/team/members.tmpl

@ -26,7 +26,7 @@
<div class="ui bottom attached segment"> <div class="ui bottom attached segment">
<form class="ui form" id="add-member-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/add" method="post"> <form class="ui form" id="add-member-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/add" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<input type="hidden" name="uid" value="{{.SignedUser.ID}}"> <input type="hidden" name="uid" value="{{.LoggedUser.ID}}">
<div class="inline field ui left"> <div class="inline field ui left">
<div id="search-user-box"> <div id="search-user-box">
<div class="ui input"> <div class="ui input">

6
templates/org/team/sidebar.tmpl

@ -2,10 +2,10 @@
<h4 class="ui top attached header"> <h4 class="ui top attached header">
<strong>{{.Team.Name}}</strong> <strong>{{.Team.Name}}</strong>
<div class="ui right"> <div class="ui right">
{{if .Team.IsMember $.SignedUser.ID}} {{if .Team.IsMember $.LoggedUser.ID}}
<a class="ui red tiny button" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/leave?uid={{$.SignedUser.ID}}&page=team">{{$.i18n.Tr "org.teams.leave"}}</a> <a class="ui red tiny button" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/leave?uid={{$.LoggedUser.ID}}&page=team">{{$.i18n.Tr "org.teams.leave"}}</a>
{{else if .IsOrganizationOwner}} {{else if .IsOrganizationOwner}}
<a class="ui blue tiny button" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/join?uid={{$.SignedUser.ID}}&page=team">{{$.i18n.Tr "org.teams.join"}}</a> <a class="ui blue tiny button" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/join?uid={{$.LoggedUser.ID}}&page=team">{{$.i18n.Tr "org.teams.join"}}</a>
{{end}} {{end}}
</div> </div>
</h4> </h4>

6
templates/org/team/teams.tmpl

@ -16,10 +16,10 @@
<div class="ui top attached header"> <div class="ui top attached header">
<a class="text black" href="{{$.OrgLink}}/teams/{{.LowerName}}"><strong>{{.Name}}</strong></a> <a class="text black" href="{{$.OrgLink}}/teams/{{.LowerName}}"><strong>{{.Name}}</strong></a>
<div class="ui right"> <div class="ui right">
{{if .IsMember $.SignedUser.ID}} {{if .IsMember $.LoggedUser.ID}}
<a class="ui red small button" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/leave?uid={{$.SignedUser.ID}}">{{$.i18n.Tr "org.teams.leave"}}</a> <a class="ui red small button" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/leave?uid={{$.LoggedUser.ID}}">{{$.i18n.Tr "org.teams.leave"}}</a>
{{else if $.IsOrganizationOwner}} {{else if $.IsOrganizationOwner}}
<a class="ui blue small button" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/join?uid={{$.SignedUser.ID}}">{{$.i18n.Tr "org.teams.join"}}</a> <a class="ui blue small button" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/join?uid={{$.LoggedUser.ID}}">{{$.i18n.Tr "org.teams.join"}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>

6
templates/repo/create.tmpl

@ -19,9 +19,9 @@
</span> </span>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu"> <div class="menu">
<div class="item" data-value="{{.SignedUser.ID}}"> <div class="item" data-value="{{.LoggedUser.ID}}">
<img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}"> <img class="ui mini image" src="{{.LoggedUser.RelAvatarLink}}">
{{.SignedUser.ShortName 20}} {{.LoggedUser.ShortName 20}}
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">

2
templates/repo/diff/page.tmpl

@ -14,7 +14,7 @@
<div class="ui attached info segment"> <div class="ui attached info segment">
{{if .Author}} {{if .Author}}
<img class="ui avatar image" src="{{.Author.RelAvatarLink}}" /> <img class="ui avatar image" src="{{.Author.RelAvatarLink}}" />
<a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a> {{if .IsSigned}}<{{.Commit.Author.Email}}>{{end}} <a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a> {{if .IsLogged}}<{{.Commit.Author.Email}}>{{end}}
{{else}} {{else}}
<img class="ui avatar image" src="{{AvatarLink .Commit.Author.Email}}" /> <img class="ui avatar image" src="{{AvatarLink .Commit.Author.Email}}" />
<strong>{{.Commit.Author.Name}}</strong> <strong>{{.Commit.Author.Name}}</strong>

2
templates/repo/editor/commit_form.tmpl

@ -1,5 +1,5 @@
<div class="commit-form-wrapper"> <div class="commit-form-wrapper">
<img width="48" height="48" class="ui image commit-avatar" src="{{.SignedUser.RelAvatarLink}}"> <img width="48" height="48" class="ui image commit-avatar" src="{{.LoggedUser.RelAvatarLink}}">
<div class="commit-form"> <div class="commit-form">
<h3>{{.i18n.Tr "repo.editor.commit_changes"}}</h3> <h3>{{.i18n.Tr "repo.editor.commit_changes"}}</h3>
<div class="field"> <div class="field">

2
templates/repo/header.tmpl

@ -33,7 +33,7 @@
</div> </div>
{{if .CanBeForked}} {{if .CanBeForked}}
<div class="ui labeled button" tabindex="0"> <div class="ui labeled button" tabindex="0">
<a class="ui basic button {{if eq .OwnerID $.SignedUserID}}poping up{{end}}" href="{{AppSubURL}}/repo/fork/{{.ID}}"> <a class="ui basic button {{if eq .OwnerID $.LoggedUserID}}poping up{{end}}" href="{{AppSubURL}}/repo/fork/{{.ID}}">
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}} <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
</a> </a>
<a class="ui basic label" href="{{.Link}}/forks"> <a class="ui basic label" href="{{.Link}}/forks">

4
templates/repo/issue/new_form.tmpl

@ -8,8 +8,8 @@
<div class="twelve wide column"> <div class="twelve wide column">
<div class="ui comments"> <div class="ui comments">
<div class="comment"> <div class="comment">
<a class="avatar" href="{{.SignedUser.HomeLink}}"> <a class="avatar" href="{{.LoggedUser.HomeLink}}">
<img src="{{.SignedUser.RelAvatarLink}}"> <img src="{{.LoggedUser.RelAvatarLink}}">
</a> </a>
<div class="ui segment content"> <div class="ui segment content">
<div class="field"> <div class="field">

8
templates/repo/issue/view_content.tmpl

@ -79,7 +79,7 @@
{{end}} {{end}}
</div> </div>
{{end}} {{end}}
{{if or $.IsRepositoryAdmin (eq .Poster.ID $.SignedUserID)}} {{if or $.IsRepositoryAdmin (eq .Poster.ID $.LoggedUserID)}}
<div class="item action"> <div class="item action">
<a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a> <a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
<a class="delete-comment" href="#" data-comment-id={{.HashTag}} data-url="{{$.RepoLink}}/comments/{{.ID}}/delete" data-locale="{{$.i18n.Tr "repo.issues.delete_comment_confirm"}}"><i class="octicon octicon-x"></i></a> <a class="delete-comment" href="#" data-comment-id={{.HashTag}} data-url="{{$.RepoLink}}/comments/{{.ID}}/delete" data-locale="{{$.i18n.Tr "repo.issues.delete_comment_confirm"}}"><i class="octicon octicon-x"></i></a>
@ -216,10 +216,10 @@
</div> </div>
{{end}} {{end}}
{{if .IsSigned}} {{if .IsLogged}}
<div class="comment form"> <div class="comment form">
<a class="avatar" href="{{.SignedUser.HomeLink}}"> <a class="avatar" href="{{.LoggedUser.HomeLink}}">
<img src="{{.SignedUser.RelAvatarLink}}"> <img src="{{.LoggedUser.RelAvatarLink}}">
</a> </a>
<div class="content"> <div class="content">
<form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post"> <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">

6
templates/repo/migrate.tmpl

@ -50,9 +50,9 @@
</span> </span>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu"> <div class="menu">
<div class="item" data-value="{{.SignedUser.ID}}"> <div class="item" data-value="{{.LoggedUser.ID}}">
<img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}"> <img class="ui mini image" src="{{.LoggedUser.RelAvatarLink}}">
{{.SignedUser.ShortName 20}} {{.LoggedUser.ShortName 20}}
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">

8
templates/repo/pulls/fork.tmpl

@ -19,12 +19,12 @@
</span> </span>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu"> <div class="menu">
<div class="item" data-value="{{.SignedUser.ID}}"> <div class="item" data-value="{{.LoggedUser.ID}}">
<img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}"> <img class="ui mini image" src="{{.LoggedUser.RelAvatarLink}}">
{{.SignedUser.ShortName 20}} {{.LoggedUser.ShortName 20}}
</div> </div>
{{range .Orgs}} {{range .Orgs}}
{{if .IsOwnedBy $.SignedUser.ID}} {{if .IsOwnedBy $.LoggedUser.ID}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">
<img class="ui mini image" src="{{.RelAvatarLink}}"> <img class="ui mini image" src="{{.RelAvatarLink}}">
{{.ShortName 20}} {{.ShortName 20}}

2
templates/repo/settings/nav.tmpl

@ -5,7 +5,7 @@
<li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings.options"}}</a></li> <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings.options"}}</a></li>
<li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.i18n.Tr "repo.settings.collaboration"}}</a></li> <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.i18n.Tr "repo.settings.collaboration"}}</a></li>
<li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.i18n.Tr "repo.settings.hooks"}}</a></li> <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.i18n.Tr "repo.settings.hooks"}}</a></li>
{{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}} {{if or .LoggedUser.AllowGitHook .LoggedUser.IsAdmin}}
<li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.i18n.Tr "repo.settings.githooks"}}</a></li> <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.i18n.Tr "repo.settings.githooks"}}</a></li>
{{end}} {{end}}
<li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li> <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li>

2
templates/repo/settings/navbar.tmpl

@ -15,7 +15,7 @@
<a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks"> <a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks">
{{.i18n.Tr "repo.settings.hooks"}} {{.i18n.Tr "repo.settings.hooks"}}
</a> </a>
{{if .SignedUser.CanEditGitHook}} {{if .LoggedUser.CanEditGitHook}}
<a class="{{if .PageIsSettingsGitHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks/git"> <a class="{{if .PageIsSettingsGitHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks/git">
{{.i18n.Tr "repo.settings.githooks"}} {{.i18n.Tr "repo.settings.githooks"}}
</a> </a>

4
templates/user/auth/activate.tmpl

@ -15,7 +15,7 @@
{{else if .ResendLimited}} {{else if .ResendLimited}}
<p class="center">{{.i18n.Tr "auth.resent_limit_prompt"}}</p> <p class="center">{{.i18n.Tr "auth.resent_limit_prompt"}}</p>
{{else}} {{else}}
<p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .SignedUser.Email .Hours | Str2html}}</p> <p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .LoggedUser.Email .Hours | Str2html}}</p>
{{end}} {{end}}
{{else}} {{else}}
{{if .IsSendRegisterMail}} {{if .IsSendRegisterMail}}
@ -23,7 +23,7 @@
{{else if .IsActivateFailed}} {{else if .IsActivateFailed}}
<p>{{.i18n.Tr "auth.invalid_code"}}</p> <p>{{.i18n.Tr "auth.invalid_code"}}</p>
{{else}} {{else}}
<p>{{.i18n.Tr "auth.has_unconfirmed_mail" .SignedUser.Name .SignedUser.Email | Str2html}}</p> <p>{{.i18n.Tr "auth.has_unconfirmed_mail" .LoggedUser.Name .LoggedUser.Email | Str2html}}</p>
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="text right"> <div class="text right">
<button class="ui blue button">{{.i18n.Tr "auth.resend_mail"}}</button> <button class="ui blue button">{{.i18n.Tr "auth.resend_mail"}}</button>

6
templates/user/dashboard/navbar.tmpl

@ -10,9 +10,9 @@
{{.i18n.Tr "home.switch_dashboard_context"}} {{.i18n.Tr "home.switch_dashboard_context"}}
</div> </div>
<div class="items"> <div class="items">
<a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item" href="{{AppSubURL}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{end}}"> <a class="{{if eq .ContextUser.ID .LoggedUser.ID}}active selected{{end}} item" href="{{AppSubURL}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{end}}">
<img class="ui avatar image" src="{{.SignedUser.RelAvatarLink}}"> <img class="ui avatar image" src="{{.LoggedUser.RelAvatarLink}}">
{{.SignedUser.Name}} {{.LoggedUser.Name}}
</a> </a>
{{range .Orgs}} {{range .Orgs}}
<a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" href="{{AppSubURL}}/org/{{.Name}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else}}dashboard{{end}}"> <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" href="{{AppSubURL}}/org/{{.Name}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else}}dashboard{{end}}">

4
templates/user/meta/header.tmpl

@ -8,9 +8,9 @@
<div class="ui right"> <div class="ui right">
{{if or $.PageIsFollowers $.PageIsFollowing}} {{if or $.PageIsFollowers $.PageIsFollowing}}
{{if and $.IsSigned (ne $.SignedUserName .Name)}} {{if and $.IsLogged (ne $.LoggedUserName .Name)}}
<div class="follow"> <div class="follow">
{{if $.SignedUser.IsFollowing .ID}} {{if $.LoggedUser.IsFollowing .ID}}
<a class="ui small basic red button" href="{{.HomeLink}}/action/unfollow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{$.i18n.Tr "user.unfollow"}}</a> <a class="ui small basic red button" href="{{.HomeLink}}/action/unfollow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{$.i18n.Tr "user.unfollow"}}</a>
{{else}} {{else}}
<a class="ui small basic green button" href="{{.HomeLink}}/action/follow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{$.i18n.Tr "user.follow"}}</a> <a class="ui small basic green button" href="{{.HomeLink}}/action/follow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{$.i18n.Tr "user.follow"}}</a>

8
templates/user/profile.tmpl

@ -4,7 +4,7 @@
<div class="ui grid"> <div class="ui grid">
<div class="ui five wide column"> <div class="ui five wide column">
<div class="ui card"> <div class="ui card">
{{if eq .SignedUserName .Owner.Name}} {{if eq .LoggedUserName .Owner.Name}}
<a class="image poping up" href="{{AppSubURL}}/user/settings/avatar" id="profile-avatar" data-content="{{.i18n.Tr "user.change_avatar"}}" data-variation="inverted tiny" data-position="bottom center"> <a class="image poping up" href="{{AppSubURL}}/user/settings/avatar" id="profile-avatar" data-content="{{.i18n.Tr "user.change_avatar"}}" data-variation="inverted tiny" data-position="bottom center">
<img src="{{.Owner.RelAvatarLink}}?s=290" title="{{.Owner.Name}}"/> <img src="{{.Owner.RelAvatarLink}}?s=290" title="{{.Owner.Name}}"/>
</a> </a>
@ -22,7 +22,7 @@
{{if .Owner.Location}} {{if .Owner.Location}}
<li><i class="octicon octicon-location"></i> {{.Owner.Location}}</li> <li><i class="octicon octicon-location"></i> {{.Owner.Location}}</li>
{{end}} {{end}}
{{if and .Owner.Email .IsSigned}} {{if and .Owner.Email .IsLogged}}
<li> <li>
<i class="octicon octicon-mail"></i> <i class="octicon octicon-mail"></i>
<a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a> <a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>
@ -60,9 +60,9 @@
{{end}} {{end}}
</li> </li>
{{end}} {{end}}
{{if and .IsSigned (ne .SignedUserName .Owner.Name)}} {{if and .IsLogged (ne .LoggedUserName .Owner.Name)}}
<li class="follow"> <li class="follow">
{{if .SignedUser.IsFollowing .Owner.ID}} {{if .LoggedUser.IsFollowing .Owner.ID}}
<a class="ui basic red button" href="{{.Link}}/action/unfollow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.unfollow"}}</a> <a class="ui basic red button" href="{{.Link}}/action/unfollow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.unfollow"}}</a>
{{else}} {{else}}
<a class="ui basic green button" href="{{.Link}}/action/follow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.follow"}}</a> <a class="ui basic green button" href="{{.Link}}/action/follow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.follow"}}</a>

6
templates/user/settings/avatar.tmpl

@ -15,19 +15,19 @@
{{if not DisableGravatar}} {{if not DisableGravatar}}
<div class="inline field"> <div class="inline field">
<div class="ui radio checkbox"> <div class="ui radio checkbox">
<input name="source" value="lookup" type="radio" {{if not .SignedUser.UseCustomAvatar}}checked{{end}}> <input name="source" value="lookup" type="radio" {{if not .LoggedUser.UseCustomAvatar}}checked{{end}}>
<label>{{.i18n.Tr "settings.lookup_avatar_by_mail"}}</label> <label>{{.i18n.Tr "settings.lookup_avatar_by_mail"}}</label>
</div> </div>
</div> </div>
<div class="field {{if .Err_Gravatar}}error{{end}}"> <div class="field {{if .Err_Gravatar}}error{{end}}">
<label for="gravatar">Avatar {{.i18n.Tr "email"}}</label> <label for="gravatar">Avatar {{.i18n.Tr "email"}}</label>
<input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}" /> <input id="gravatar" name="gravatar" value="{{.LoggedUser.AvatarEmail}}" />
</div> </div>
{{end}} {{end}}
<div class="inline field"> <div class="inline field">
<div class="ui radio checkbox"> <div class="ui radio checkbox">
<input name="source" value="local" type="radio" {{if .SignedUser.UseCustomAvatar}}checked{{end}}> <input name="source" value="local" type="radio" {{if .LoggedUser.UseCustomAvatar}}checked{{end}}>
<label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label> <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
</div> </div>
</div> </div>

2
templates/user/settings/password.tmpl

@ -9,7 +9,7 @@
{{.i18n.Tr "settings.change_password"}} {{.i18n.Tr "settings.change_password"}}
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
{{if .SignedUser.IsLocal}} {{if .LoggedUser.IsLocal}}
<form class="ui form" action="{{.Link}}" method="post"> <form class="ui form" action="{{.Link}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="required field {{if .Err_OldPassword}}error{{end}}"> <div class="required field {{if .Err_OldPassword}}error{{end}}">

4
templates/user/settings/profile.tmpl

@ -14,8 +14,8 @@
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="required field {{if .Err_Name}}error{{end}}"> <div class="required field {{if .Err_Name}}error{{end}}">
<label for="username">{{.i18n.Tr "username"}}<span class="text red {{if eq .name .origin_name}}hide{{end}}" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label> <label for="username">{{.i18n.Tr "username"}}<span class="text red {{if eq .name .origin_name}}hide{{end}}" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label>
<input id="username" name="name" value="{{.name}}" data-name="{{.origin_name}}" autofocus required {{if not .SignedUser.IsLocal}}readonly{{end}}> <input id="username" name="name" value="{{.name}}" data-name="{{.origin_name}}" autofocus required {{if not .LoggedUser.IsLocal}}readonly{{end}}>
{{if not .SignedUser.IsLocal}} {{if not .LoggedUser.IsLocal}}
<p class="help text blue">{{$.i18n.Tr "settings.password_username_disabled"}}</p> <p class="help text blue">{{$.i18n.Tr "settings.password_username_disabled"}}</p>
{{end}} {{end}}
</div> </div>

2
templates/user/settings/repositories.tmpl

@ -28,7 +28,7 @@
{{.Owner.Name}}/{{.Name}} {{.Owner.Name}}/{{.Name}}
</a> </a>
<span class="ui text light grey">{{.Size | FileSize}}</span> <span class="ui text light grey">{{.Size | FileSize}}</span>
{{if not (eq .OwnerID $.SignedUserID)}} {{if not (eq .OwnerID $.LoggedUserID)}}
<div class="right floated content"> <div class="right floated content">
<a class="ui red tiny button inline text-thin delete-button" href="" data-url="{{$.Link}}/leave" data-id="{{.ID}}">{{$.i18n.Tr "settings.repos.leave"}}</a> <a class="ui red tiny button inline text-thin delete-button" href="" data-url="{{$.Link}}/leave" data-id="{{.ID}}">{{$.i18n.Tr "settings.repos.leave"}}</a>
</div> </div>

Loading…
Cancel
Save