diff options
Diffstat (limited to 'templates/user/dashboard')
-rw-r--r-- | templates/user/dashboard/dashboard.tmpl | 218 | ||||
-rw-r--r-- | templates/user/dashboard/feeds.tmpl | 136 | ||||
-rw-r--r-- | templates/user/dashboard/issues.tmpl | 164 | ||||
-rw-r--r-- | templates/user/dashboard/navbar.tmpl | 94 |
4 files changed, 306 insertions, 306 deletions
diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index 3bc6f9f6ca..eb7fa02fc1 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -1,115 +1,115 @@ {{template "base/head" .}} <div class="dashboard feeds"> - {{template "user/dashboard/navbar" .}} - <div class="ui container"> - <div class="ui grid"> - <div class="ten wide column"> - {{template "user/dashboard/feeds" .}} - </div> - <div class="six wide column"> - <div class="ui {{if not .ContextUser.IsOrganization}}three{{else}}two{{end}} item tabable menu"> - <a class="item active" data-tab="repos">{{.i18n.Tr "repository"}}</a> - {{if not .ContextUser.IsOrganization}} - <a class="item" data-tab="orgs">{{.i18n.Tr "organization"}}</a> - {{end}} - <a class="item" data-tab="mirrors">{{.i18n.Tr "mirror"}}</a> - </div> - <div class="ui tab active list" data-tab="repos"> - <h4 class="ui top attached header"> - {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">{{.ContextUser.NumRepos}}</span> - <div class="ui right"> - <a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/repo/create">{{.i18n.Tr "new_repo"}}</a> - </div> - </h4> - <div class="ui attached table segment"> - <ul> - {{range .Repos}} - <li {{if .IsPrivate}}class="private"{{end}}> - <a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> - <i class="icon octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> - <strong>{{.Name}}</strong> - <span class="ui right text light grey"> - <i class="octicon octicon-star"></i>{{.NumStars}} - </span> - </a> - </li> - {{end}} - </ul> - </div> + {{template "user/dashboard/navbar" .}} + <div class="ui container"> + <div class="ui grid"> + <div class="ten wide column"> + {{template "user/dashboard/feeds" .}} + </div> + <div class="six wide column"> + <div class="ui {{if not .ContextUser.IsOrganization}}three{{else}}two{{end}} item tabable menu"> + <a class="item active" data-tab="repos">{{.i18n.Tr "repository"}}</a> + {{if not .ContextUser.IsOrganization}} + <a class="item" data-tab="orgs">{{.i18n.Tr "organization"}}</a> + {{end}} + <a class="item" data-tab="mirrors">{{.i18n.Tr "mirror"}}</a> + </div> + <div class="ui tab active list" data-tab="repos"> + <h4 class="ui top attached header"> + {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">{{.ContextUser.NumRepos}}</span> + <div class="ui right"> + <a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/repo/create">{{.i18n.Tr "new_repo"}}</a> + </div> + </h4> + <div class="ui attached table segment"> + <ul> + {{range .Repos}} + <li {{if .IsPrivate}}class="private"{{end}}> + <a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> + <i class="icon octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> + <strong>{{.Name}}</strong> + <span class="ui right text light grey"> + <i class="octicon octicon-star"></i>{{.NumStars}} + </span> + </a> + </li> + {{end}} + </ul> + </div> - {{if not .ContextUser.IsOrganization}} - <h4 class="ui top attached header"> - {{.i18n.Tr "home.collaborative_repos"}} <span class="ui grey label">{{.CollaborateCount}}</span> - </h4> - <div class="ui attached table segment"> - <ul> - {{range .CollaborativeRepos}} - <li {{if .IsPrivate}}class="private"{{end}}> - <a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}"> - <i class="icon octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> - {{.Owner.Name}} / <strong>{{.Name}}</strong> - <span class="ui right text light grey"> - <i class="octicon octicon-star"></i>{{.NumStars}} - </span> - </a> - </li> - {{end}} - </ul> - </div> - {{end}} - </div> + {{if not .ContextUser.IsOrganization}} + <h4 class="ui top attached header"> + {{.i18n.Tr "home.collaborative_repos"}} <span class="ui grey label">{{.CollaborateCount}}</span> + </h4> + <div class="ui attached table segment"> + <ul> + {{range .CollaborativeRepos}} + <li {{if .IsPrivate}}class="private"{{end}}> + <a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}"> + <i class="icon octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> + {{.Owner.Name}} / <strong>{{.Name}}</strong> + <span class="ui right text light grey"> + <i class="octicon octicon-star"></i>{{.NumStars}} + </span> + </a> + </li> + {{end}} + </ul> + </div> + {{end}} + </div> - {{if not .ContextUser.IsOrganization}} - <div class="ui tab list" data-tab="orgs"> - <h4 class="ui top attached header"> - {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">{{.ContextUser.GetOrganizationCount}}</span> - <div class="ui right"> - <a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/org/create">{{.i18n.Tr "new_org"}}</a> - </div> - </h4> - <div class="ui attached table segment"> - <ul> - {{range .ContextUser.Orgs}} - <li> - <a href="{{AppSubUrl}}/{{.Name}}"> - <i class="icon octicon octicon-organization"></i> - <strong>{{.ShortName 20}}</strong> - <span class="ui right text light grey"> - <i class="octicon octicon-repo"></i>{{.NumRepos}} - </span> - </a> - </li> - {{end}} - </ul> - </div> - </div> - {{end}} + {{if not .ContextUser.IsOrganization}} + <div class="ui tab list" data-tab="orgs"> + <h4 class="ui top attached header"> + {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">{{.ContextUser.GetOrganizationCount}}</span> + <div class="ui right"> + <a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/org/create">{{.i18n.Tr "new_org"}}</a> + </div> + </h4> + <div class="ui attached table segment"> + <ul> + {{range .ContextUser.Orgs}} + <li> + <a href="{{AppSubUrl}}/{{.Name}}"> + <i class="icon octicon octicon-organization"></i> + <strong>{{.ShortName 20}}</strong> + <span class="ui right text light grey"> + <i class="octicon octicon-repo"></i>{{.NumRepos}} + </span> + </a> + </li> + {{end}} + </ul> + </div> + </div> + {{end}} - <div class="ui tab list" data-tab="mirrors"> - <h4 class="ui top attached header"> - {{.i18n.Tr "home.my_mirrors"}} <span class="ui grey label">{{.MirrorCount}}</span> - <div class="ui right"> - <a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/repo/migrate">{{.i18n.Tr "new_migrate"}}</a> - </div> - </h4> - <div class="ui attached table segment"> - <ul> - {{range .Mirrors}} - <li {{if .IsPrivate}}class="private"{{end}}> - <a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> - <i class="icon octicon octicon-repo-clone"></i> - <strong>{{.Name}}</strong> - <span class="ui right text light grey"> - <i class="octicon octicon-sync"></i>{{.Interval}}H - </span> - </a> - </li> - {{end}} - </ul> - </div> - </div> - </div> - </div> - </div> + <div class="ui tab list" data-tab="mirrors"> + <h4 class="ui top attached header"> + {{.i18n.Tr "home.my_mirrors"}} <span class="ui grey label">{{.MirrorCount}}</span> + <div class="ui right"> + <a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/repo/migrate">{{.i18n.Tr "new_migrate"}}</a> + </div> + </h4> + <div class="ui attached table segment"> + <ul> + {{range .Mirrors}} + <li {{if .IsPrivate}}class="private"{{end}}> + <a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> + <i class="icon octicon octicon-repo-clone"></i> + <strong>{{.Name}}</strong> + <span class="ui right text light grey"> + <i class="octicon octicon-sync"></i>{{.Interval}}H + </span> + </a> + </li> + {{end}} + </ul> + </div> + </div> + </div> + </div> + </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index fff1e16f60..e45fb4cfea 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -1,69 +1,69 @@ {{range .Feeds}} -<div class="news"> - <div class="ui left"> - <img class="ui avatar image" src="{{.ActAvatar}}" alt=""> - </div> - <div class="ui grid"> - <div class="ui fifteen wide column"> - <div class="{{if eq .GetOpType 5}}push news{{end}}"> - <p> - <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.GetActUserName}}</a> - {{if eq .GetOpType 1}} - {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}} - {{else if eq .GetOpType 2}} - {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} - {{else if eq .GetOpType 5}} - {{ $branchLink := .GetBranch | EscapePound}} - {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .GetRepoPath | Str2html}} - {{else if eq .GetOpType 6}} - {{ $index := index .GetIssueInfos 0}} - {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}} - {{else if eq .GetOpType 7}} - {{ $index := index .GetIssueInfos 0}} - {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} - {{else if eq .GetOpType 8}} - {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} - {{else if eq .GetOpType 9}} - {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} - {{else if eq .GetOpType 10}} - {{ $index := index .GetIssueInfos 0}} - {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}} - {{else if eq .GetOpType 11}} - {{ $index := index .GetIssueInfos 0}} - {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} - {{end}} - </p> - {{if eq .GetOpType 5}} - <div class="content"> - <ul> - {{ $push := ActionContent2Commits .}} - {{ $repoLink := .GetRepoLink}} - {{if $push.Commits}} - {{range $push.Commits}} - <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li> - {{end}} - {{end}} - {{if $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}} - </ul> - </div> - {{else if eq .GetOpType 6}} - <span class="text truncate issue title">{{index .GetIssueInfos 1}}</span> - <p class="text light grey">{{.GetIssueContent}}</p> - {{else if eq .GetOpType 7}} - <p class="text light grey">{{index .GetIssueInfos 1}}</p> - {{else if eq .GetOpType 10}} - <span class="text truncate issue title">{{.GetIssueTitle}}</span> - <p class="text light grey">{{index .GetIssueInfos 1}}</p> - {{else if eq .GetOpType 11}} - <p class="text light grey">{{index .GetIssueInfos 1}}</p> - {{end}} - <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p> - </div> - </div> - <div class="ui one wide column"> - <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i> - </div> - </div> - <div class="ui divider"></div> -</div> -{{end}}
\ No newline at end of file + <div class="news"> + <div class="ui left"> + <img class="ui avatar image" src="{{.ActAvatar}}" alt=""> + </div> + <div class="ui grid"> + <div class="ui fifteen wide column"> + <div class="{{if eq .GetOpType 5}}push news{{end}}"> + <p> + <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.GetActUserName}}</a> + {{if eq .GetOpType 1}} + {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}} + {{else if eq .GetOpType 2}} + {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} + {{else if eq .GetOpType 5}} + {{ $branchLink := .GetBranch | EscapePound}} + {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .GetRepoPath | Str2html}} + {{else if eq .GetOpType 6}} + {{ $index := index .GetIssueInfos 0}} + {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}} + {{else if eq .GetOpType 7}} + {{ $index := index .GetIssueInfos 0}} + {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} + {{else if eq .GetOpType 8}} + {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} + {{else if eq .GetOpType 9}} + {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} + {{else if eq .GetOpType 10}} + {{ $index := index .GetIssueInfos 0}} + {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}} + {{else if eq .GetOpType 11}} + {{ $index := index .GetIssueInfos 0}} + {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} + {{end}} + </p> + {{if eq .GetOpType 5}} + <div class="content"> + <ul> + {{ $push := ActionContent2Commits .}} + {{ $repoLink := .GetRepoLink}} + {{if $push.Commits}} + {{range $push.Commits}} + <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li> + {{end}} + {{end}} + {{if $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}} + </ul> + </div> + {{else if eq .GetOpType 6}} + <span class="text truncate issue title">{{index .GetIssueInfos 1}}</span> + <p class="text light grey">{{.GetIssueContent}}</p> + {{else if eq .GetOpType 7}} + <p class="text light grey">{{index .GetIssueInfos 1}}</p> + {{else if eq .GetOpType 10}} + <span class="text truncate issue title">{{.GetIssueTitle}}</span> + <p class="text light grey">{{index .GetIssueInfos 1}}</p> + {{else if eq .GetOpType 11}} + <p class="text light grey">{{index .GetIssueInfos 1}}</p> + {{end}} + <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p> + </div> + </div> + <div class="ui one wide column"> + <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i> + </div> + </div> + <div class="ui divider"></div> + </div> +{{end}} diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 678dfecfc6..a99a478170 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -1,43 +1,43 @@ {{template "base/head" .}} <div class="dashboard issues"> - {{template "user/dashboard/navbar" .}} - <div class="ui container"> - <div class="ui grid"> - <div class="four wide column"> - <div class="ui secondary vertical filter menu"> - <a class="{{if eq .ViewType "all"}}ui basic blue button{{end}} item" href="{{.Link}}?repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}"> - {{.i18n.Tr "home.issues.in_your_repos"}} - <strong class="ui right">{{.IssueStats.AllCount}}</strong> - </a> - {{if not .ContextUser.IsOrganization}} - <a class="{{if eq .ViewType "assigned"}}ui basic blue button{{end}} item" href="{{.Link}}?type=assigned&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}"> - {{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}} - <strong class="ui right">{{.IssueStats.AssignCount}}</strong> - </a> - <a class="{{if eq .ViewType "created_by"}}ui basic blue button{{end}} item" href="{{.Link}}?type=created_by&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}"> - {{.i18n.Tr "repo.issues.filter_type.created_by_you"}} - <strong class="ui right">{{.IssueStats.CreateCount}}</strong> - </a> - {{end}} - <div class="ui divider"></div> - {{range .Repos}} - <a class="{{if eq $.RepoID .ID}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}{{if not (eq $.RepoID .ID)}}&repo={{.ID}}{{end}}&sort={{$.SortType}}&state={{$.State}}"> - <span class="text truncate">{{$.ContextUser.Name}}/{{.Name}}</span> - <div class="floating ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</div> - </a> - {{end}} - </div> - </div> + {{template "user/dashboard/navbar" .}} + <div class="ui container"> + <div class="ui grid"> + <div class="four wide column"> + <div class="ui secondary vertical filter menu"> + <a class="{{if eq .ViewType "all"}}ui basic blue button{{end}} item" href="{{.Link}}?repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}"> + {{.i18n.Tr "home.issues.in_your_repos"}} + <strong class="ui right">{{.IssueStats.AllCount}}</strong> + </a> + {{if not .ContextUser.IsOrganization}} + <a class="{{if eq .ViewType "assigned"}}ui basic blue button{{end}} item" href="{{.Link}}?type=assigned&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}"> + {{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}} + <strong class="ui right">{{.IssueStats.AssignCount}}</strong> + </a> + <a class="{{if eq .ViewType "created_by"}}ui basic blue button{{end}} item" href="{{.Link}}?type=created_by&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}"> + {{.i18n.Tr "repo.issues.filter_type.created_by_you"}} + <strong class="ui right">{{.IssueStats.CreateCount}}</strong> + </a> + {{end}} + <div class="ui divider"></div> + {{range .Repos}} + <a class="{{if eq $.RepoID .ID}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}{{if not (eq $.RepoID .ID)}}&repo={{.ID}}{{end}}&sort={{$.SortType}}&state={{$.State}}"> + <span class="text truncate">{{$.ContextUser.Name}}/{{.Name}}</span> + <div class="floating ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</div> + </a> + {{end}} + </div> + </div> <div class="twelve wide column content"> <div class="ui tiny basic status buttons"> - <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=open"> - <i class="octicon octicon-issue-opened"></i> - {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}} - </a> - <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=closed"> - <i class="octicon octicon-issue-closed"></i> - {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}} - </a> + <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=open"> + <i class="octicon octicon-issue-opened"></i> + {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}} + </a> + <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=closed"> + <i class="octicon octicon-issue-closed"></i> + {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}} + </a> </div> <div class="ui right floated secondary filter menu"> <!-- Sort --> @@ -46,63 +46,63 @@ {{.i18n.Tr "repo.issues.filter_sort"}} <i class="dropdown icon"></i> </span> - <div class="menu"> - <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=latest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> - <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=oldest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> - <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=recentupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> - <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> - <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=mostcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a> - <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a> + <div class="menu"> + <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=latest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=oldest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=recentupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> + <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> + <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=mostcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a> + <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a> </div> </div> </div> <div class="issue list"> {{range .Issues}} - {{ $timeStr:= TimeSince .Created $.Lang }} - <li class="item"> - <div class="ui label">{{if not $.RepoID}}{{.Repo.Name}}{{end}}#{{.Index}}</div> - <a class="title" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a> + {{ $timeStr:= TimeSince .Created $.Lang }} + <li class="item"> + <div class="ui label">{{if not $.RepoID}}{{.Repo.Name}}{{end}}#{{.Index}}</div> + <a class="title" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a> - {{if .NumComments}} - <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span> - {{end}} - - <p class="desc"> - {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} - {{if .Assignee}} - <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center"> - <img class="ui avatar image" src="{{.Assignee.AvatarLink}}"> - </a> - {{end}} - </p> - </li> - {{end}} - - {{with .Page}} - {{if gt .TotalPages 1}} - <div class="center page buttons"> - <div class="ui borderless pagination menu"> - <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}> - <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} - </a> - {{range .Pages}} - {{if eq .Num -1}} - <a class="disabled item">...</a> - {{else}} - <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a> - {{end}} + {{if .NumComments}} + <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span> {{end}} - <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}> - {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> - </a> - </div> - </div> + + <p class="desc"> + {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} + {{if .Assignee}} + <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center"> + <img class="ui avatar image" src="{{.Assignee.AvatarLink}}"> + </a> + {{end}} + </p> + </li> {{end}} + + {{with .Page}} + {{if gt .TotalPages 1}} + <div class="center page buttons"> + <div class="ui borderless pagination menu"> + <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}> + <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} + </a> + {{range .Pages}} + {{if eq .Num -1}} + <a class="disabled item">...</a> + {{else}} + <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a> + {{end}} + {{end}} + <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}> + {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> + </a> + </div> + </div> + {{end}} {{end}} </div> - </div> - </div> + </div> + </div> </div> </div> {{template "base/footer" .}} diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index eb74191702..c31f0b5542 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -1,53 +1,53 @@ <div class="ui container"> - <div class="ui floating dropdown link jump"> - <span class="text"> - <img class="ui avatar image" src="{{.ContextUser.AvatarLink}}"> - {{.ContextUser.ShortName 20}} - <i class="dropdown icon"></i> - </span> - <div class="context user overflow menu" tabindex="-1"> + <div class="ui floating dropdown link jump"> + <span class="text"> + <img class="ui avatar image" src="{{.ContextUser.AvatarLink}}"> + {{.ContextUser.ShortName 20}} + <i class="dropdown icon"></i> + </span> + <div class="context user overflow menu" tabindex="-1"> <div class="ui header"> {{.i18n.Tr "home.switch_dashboard_context"}} </div> - <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}}"> - <img class="ui avatar image" src="{{.SignedUser.AvatarLink}}"> - {{.SignedUser.Name}} - </a> - {{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}}"> - <img class="ui avatar image" src="{{.AvatarLink}}"> - {{.ShortName 20}} - </a> - {{end}} - </div> - <a class="item" href="{{AppSubUrl}}/org/create"> - <i class="octicon octicon-repo-create"></i> {{.i18n.Tr "new_org"}} - </a> - </div> - </div> + <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}}"> + <img class="ui avatar image" src="{{.SignedUser.AvatarLink}}"> + {{.SignedUser.Name}} + </a> + {{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}}"> + <img class="ui avatar image" src="{{.AvatarLink}}"> + {{.ShortName 20}} + </a> + {{end}} + </div> + <a class="item" href="{{AppSubUrl}}/org/create"> + <i class="octicon octicon-repo-create"></i> {{.i18n.Tr "new_org"}} + </a> + </div> + </div> - {{if .ContextUser.IsOrganization}} - <div class="ui right"> - <div class="ui secondary head menu"> - <a class="{{if .PageIsNews}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/dashboard"> - <i class="octicon octicon-rss"></i> {{.i18n.Tr "news_feed"}} - </a> - <a class="{{if .PageIsIssues}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/issues"> - <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "issues"}} - </a> - <a class="{{if .PageIsPulls}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/pulls"> - <i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "pull_requests"}} - </a> - <div class="right menu"> - <div class="item"> - <a class="ui blue basic button" href="{{.ContextUser.HomeLink}}"> - {{.i18n.Tr "home.view_home" (.ContextUser.ShortName 10)}} - </a> - </div> - </div> - </div> - </div> - {{end}} + {{if .ContextUser.IsOrganization}} + <div class="ui right"> + <div class="ui secondary head menu"> + <a class="{{if .PageIsNews}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/dashboard"> + <i class="octicon octicon-rss"></i> {{.i18n.Tr "news_feed"}} + </a> + <a class="{{if .PageIsIssues}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/issues"> + <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "issues"}} + </a> + <a class="{{if .PageIsPulls}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/pulls"> + <i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "pull_requests"}} + </a> + <div class="right menu"> + <div class="item"> + <a class="ui blue basic button" href="{{.ContextUser.HomeLink}}"> + {{.i18n.Tr "home.view_home" (.ContextUser.ShortName 10)}} + </a> + </div> + </div> + </div> + </div> + {{end}} </div> -<div class="ui divider"></div>
\ No newline at end of file +<div class="ui divider"></div> |