mirror of https://github.com/gogits/gogs.git
Unknwon
9 years ago
8 changed files with 353 additions and 267 deletions
@ -1,131 +1,112 @@ |
|||||||
{{template "ng/base/head" .}} |
{{template "base/head" .}} |
||||||
{{template "ng/base/header" .}} |
<div class="dashboard feeds"> |
||||||
{{template "user/dashboard/nav" .}} |
{{template "user/dashboard/navbar" .}} |
||||||
<div id="dashboard-wrapper"> |
<div class="ui container"> |
||||||
<div id="dashboard" class="container"> |
<div class="ui grid"> |
||||||
{{template "ng/base/alert" .}} |
<div class="ten wide column"> |
||||||
<div id="dashboard-news" class="left grid-2-3"> |
{{template "user/dashboard/feeds" .}} |
||||||
{{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> |
||||||
<div class="right grid-1-3" id="dashboard-sidebar"> |
<div class="ui tab active list" data-tab="repos"> |
||||||
<ul id="dashboard-sidebar-menu" class="menu menu-line"> |
<h4 class="ui top attached header"> |
||||||
<li class="js-tab-nav js-tab-nav-show first" data-tab-target="#dashboard-my-repo"><a href="#">{{.i18n.Tr "repository"}}</a></li> |
{{.i18n.Tr "home.my_repos"}} <span class="ui grey label">{{.ContextUser.NumRepos}}</span> |
||||||
{{if not .ContextUser.IsOrganization}} |
<div class="ui right"> |
||||||
<li class="js-tab-nav" data-tab-target="#dashboard-my-org"><a href="#">{{.i18n.Tr "organization"}}</a></li> |
<a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/repo/create">{{.i18n.Tr "new_repo"}}</a> |
||||||
{{end}} |
|
||||||
<li class="js-tab-nav last" data-tab-target="#dashboard-my-mirror"><a href="#">{{.i18n.Tr "mirror"}}</a></li> |
|
||||||
<li class="drop right"> |
|
||||||
<button class="btn btn-green text-bold" id="dashboard-new-repo"> |
|
||||||
<i class="octicon octicon-plus"></i> |
|
||||||
</button> |
|
||||||
<ul class="menu menu-vertical drop-down" id="dashboard-new-repo-menu"> |
|
||||||
<li><a href="{{AppSubUrl}}/repo/create"><i class="octicon octicon-repo-create"></i>{{.i18n.Tr "new_repo"}}</a></li> |
|
||||||
<li><a href="{{AppSubUrl}}/repo/migrate"><i class="octicon octicon-repo-clone"></i>{{.i18n.Tr "new_migrate"}}</a></li> |
|
||||||
<li><a href="{{AppSubUrl}}/org/create"><i class="octicon octicon-organization"></i>{{.i18n.Tr "new_org"}}</a></li> |
|
||||||
</ul> |
|
||||||
</li> |
|
||||||
</ul> |
|
||||||
<div class="panel" id="dashboard-my-repo"> |
|
||||||
<div class="panel-header"> |
|
||||||
<h4 class="left">{{.i18n.Tr "home.my_repos"}} |
|
||||||
<span class="repo-count label label-gray label-radius">{{.ContextUser.NumRepos}}</span> |
|
||||||
</h4> |
|
||||||
|
|
||||||
</div> |
|
||||||
<div class="panel-body"> |
|
||||||
<ul class="list-no-style"> |
|
||||||
{{range .Repos}} |
|
||||||
<li {{if .IsPrivate}}class="private"{{end}}> |
|
||||||
<a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> |
|
||||||
<i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> |
|
||||||
<span class="repo-name"> |
|
||||||
<strong class="repo">{{.Name}}</strong> |
|
||||||
</span> |
|
||||||
<span class="right repo-star"> |
|
||||||
<i class="octicon octicon-star"></i>{{.NumStars}} |
|
||||||
</span> |
|
||||||
</a> |
|
||||||
</li> |
|
||||||
{{end}} |
|
||||||
</ul> |
|
||||||
</div> |
|
||||||
{{if not .ContextUser.IsOrganization}} |
|
||||||
<div class="panel-header repo-contrib-header"> |
|
||||||
<h4 class="text-bold">{{.i18n.Tr "home.collaborative_repos"}} |
|
||||||
<span class="repo-count label label-gray label-radius">{{.CollaborateCount}}</span> |
|
||||||
</h4> |
|
||||||
</div> |
|
||||||
<div class="panel-body"> |
|
||||||
<ul class="list-no-style"> |
|
||||||
{{range .CollaborativeRepos}} |
|
||||||
<li {{if .IsPrivate}}class="private"{{end}}> |
|
||||||
<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}"> |
|
||||||
<i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> |
|
||||||
<span class="repo-name"> |
|
||||||
<span class="repo-name-prefix">{{.Owner.Name}} / </span> |
|
||||||
<strong class="repo">{{.Name}}</strong> |
|
||||||
</span> |
|
||||||
<span class="right repo-star"> |
|
||||||
<i class="octicon octicon-star"></i>{{.NumStars}} |
|
||||||
</span> |
|
||||||
</a> |
|
||||||
</li> |
|
||||||
{{end}} |
|
||||||
</ul> |
|
||||||
</div> |
|
||||||
{{end}} |
|
||||||
</div> |
|
||||||
{{if not .ContextUser.IsOrganization}} |
|
||||||
<div class="panel" id="dashboard-my-org"> |
|
||||||
<div class="panel-header"> |
|
||||||
<h4 class="text-bold">{{.i18n.Tr "home.my_orgs"}} |
|
||||||
<span class="repo-count label label-gray label-radius">{{.ContextUser.GetOrganizationCount}}</span> |
|
||||||
</h4> |
|
||||||
</div> |
|
||||||
<div class="panel-body"> |
|
||||||
<ul class="list-no-style"> |
|
||||||
{{range .ContextUser.Orgs}} |
|
||||||
<li> |
|
||||||
<a href="{{AppSubUrl}}/{{.Name}}"> |
|
||||||
<i class="octicon octicon-organization"></i> |
|
||||||
<span class="repo-name"> |
|
||||||
<strong class="repo">{{.Name}}</strong> |
|
||||||
</span> |
|
||||||
<span class="right repo-star"> |
|
||||||
<i class="octicon octicon-repo"></i>{{.NumRepos}} |
|
||||||
</span> |
|
||||||
</a> |
|
||||||
</li> |
|
||||||
{{end}} |
|
||||||
</ul> |
|
||||||
</div> |
|
||||||
</div> |
</div> |
||||||
{{end}} |
</h4> |
||||||
<div class="panel" id="dashboard-my-mirror"> |
<div class="ui attached table segment"> |
||||||
<div class="panel-header"> |
<ul> |
||||||
<h4 class="text-bold">{{.i18n.Tr "home.my_mirrors"}} |
{{range .Repos}} |
||||||
<span class="repo-count label label-gray label-radius">{{.MirrorCount}}</span> |
<li {{if .IsPrivate}}class="private"{{end}}> |
||||||
</h4> |
<a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> |
||||||
</div> |
<i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> |
||||||
<div class="panel-body"> |
<strong>{{.Name}}</strong> |
||||||
<ul class="list-no-style"> |
<span class="ui right text light grey"> |
||||||
{{range .Mirrors}} |
<i class="octicon octicon-star"></i>{{.NumStars}} |
||||||
<li {{if .IsPrivate}}class="private"{{end}}> |
</span> |
||||||
<a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> |
</a> |
||||||
<i class="octicon octicon-repo-clone"></i> |
</li> |
||||||
<span class="repo-name"> |
{{end}} |
||||||
<strong class="repo">{{.Name}}</strong> |
</ul> |
||||||
</span> |
</div> |
||||||
<span class="right repo-star"> |
|
||||||
<i class="octicon octicon-sync"></i>{{.Interval}}H |
{{if not .ContextUser.IsOrganization}} |
||||||
</span> |
<h4 class="ui top attached header"> |
||||||
</a> |
{{.i18n.Tr "home.collaborative_repos"}} <span class="ui grey label">{{.CollaborateCount}}</span> |
||||||
</li> |
</h4> |
||||||
{{end}} |
<div class="ui attached table segment"> |
||||||
</ul> |
<ul> |
||||||
</div> |
{{range .CollaborativeRepos}} |
||||||
|
<li {{if .IsPrivate}}class="private"{{end}}> |
||||||
|
<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}"> |
||||||
|
<i class="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> |
</div> |
||||||
|
</h4> |
||||||
|
<div class="ui attached table segment"> |
||||||
|
<ul> |
||||||
|
{{range .ContextUser.Orgs}} |
||||||
|
<li> |
||||||
|
<a href="{{AppSubUrl}}/{{.Name}}"> |
||||||
|
<i class="octicon octicon-organization"></i> |
||||||
|
<strong>{{.Name}}</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> |
||||||
|
</h4> |
||||||
|
<div class="ui attached table segment"> |
||||||
|
<ul> |
||||||
|
{{range .Mirrors}} |
||||||
|
<li {{if .IsPrivate}}class="private"{{end}}> |
||||||
|
<a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}"> |
||||||
|
<i class="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> |
||||||
|
</div> |
||||||
</div> |
</div> |
||||||
{{template "ng/base/footer" .}} |
{{template "base/footer" .}} |
@ -1,59 +1,67 @@ |
|||||||
{{range .Feeds}} |
{{range .Feeds}} |
||||||
<div class="news clear"> |
<div class="news"> |
||||||
<div class="avatar left"> |
<div class="ui left"> |
||||||
<img class="avatar-30" src="{{.ActAvatar}}" alt=""> |
<img class="ui avatar image" src="{{.ActAvatar}}" alt=""> |
||||||
</div> |
</div> |
||||||
<div class="content left {{if eq .GetOpType 5}}push-news{{end}} grid-4-5"> |
<div class="ui grid"> |
||||||
<p class="text-bold"> |
<div class="ui fifteen wide column"> |
||||||
<a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.GetActUserName}}</a> |
<div class="{{if eq .GetOpType 5}}push news{{end}}"> |
||||||
{{if eq .GetOpType 1}} |
<p> |
||||||
{{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}} |
<a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.GetActUserName}}</a> |
||||||
{{else if eq .GetOpType 2}} |
{{if eq .GetOpType 1}} |
||||||
{{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} |
{{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}} |
||||||
{{else if eq .GetOpType 5}} |
{{else if eq .GetOpType 2}} |
||||||
{{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} |
{{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} |
||||||
{{else if eq .GetOpType 6}} |
{{else if eq .GetOpType 5}} |
||||||
{{ $index := index .GetIssueInfos 0}} |
{{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} |
||||||
{{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}} |
{{else if eq .GetOpType 6}} |
||||||
{{else if eq .GetOpType 7}} |
{{ $index := index .GetIssueInfos 0}} |
||||||
{{ $index := index .GetIssueInfos 0}} |
{{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}} |
||||||
{{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} |
{{else if eq .GetOpType 7}} |
||||||
{{else if eq .GetOpType 8}} |
{{ $index := index .GetIssueInfos 0}} |
||||||
{{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} |
{{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} |
||||||
{{else if eq .GetOpType 9}} |
{{else if eq .GetOpType 8}} |
||||||
{{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} |
{{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} |
||||||
{{else if eq .GetOpType 10}} |
{{else if eq .GetOpType 9}} |
||||||
{{ $index := index .GetIssueInfos 0}} |
{{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} |
||||||
{{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}} – {{.GetIssueTitle}} |
{{else if eq .GetOpType 10}} |
||||||
{{else if eq .GetOpType 11}} |
{{ $index := index .GetIssueInfos 0}} |
||||||
{{ $index := index .GetIssueInfos 0}} |
{{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}} |
||||||
{{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} |
{{else if eq .GetOpType 11}} |
||||||
{{end}} |
{{ $index := index .GetIssueInfos 0}} |
||||||
|
{{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} |
||||||
|
{{end}} |
||||||
</p> |
</p> |
||||||
{{if eq .GetOpType 5}} |
{{if eq .GetOpType 5}} |
||||||
<div class="news-content content"> |
<div class="content"> |
||||||
<ul class="list-no-style"> |
<ul> |
||||||
{{ $push := ActionContent2Commits .}} |
{{ $push := ActionContent2Commits .}} |
||||||
{{ $repoLink := .GetRepoLink}} |
{{ $repoLink := .GetRepoLink}} |
||||||
{{if $push.Commits}} |
{{if $push.Commits}} |
||||||
{{range $push.Commits}} |
{{range $push.Commits}} |
||||||
<li><img class="avatar-16" src="{{AvatarLink .AuthorEmail}}?s=16"> <a href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text-truncate grid-4-5">{{.Message}}</span></li> |
<li><img class="img-8" src="{{AvatarLink .AuthorEmail}}"> <a href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li> |
||||||
{{end}} |
{{end}} |
||||||
{{end}} |
{{end}} |
||||||
{{if $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}} |
{{if $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}} |
||||||
</ul> |
</ul> |
||||||
</div> |
</div> |
||||||
{{else if eq .GetOpType 6}} |
{{else if eq .GetOpType 6}} |
||||||
<p class="news-content comment-news">{{index .GetIssueInfos 1}}</p> |
<p class="text light grey">{{index .GetIssueInfos 1}}</p> |
||||||
{{else if eq .GetOpType 7}} |
{{else if eq .GetOpType 7}} |
||||||
<p class="news-content comment-news">{{index .GetIssueInfos 1}}</p> |
<p class="text light grey">{{index .GetIssueInfos 1}}</p> |
||||||
{{else if eq .GetOpType 10}} |
{{else if eq .GetOpType 10}} |
||||||
<p class="news-content comment-news">{{index .GetIssueInfos 1}}</p> |
<span class="text truncate issue title">{{.GetIssueTitle}}</span> |
||||||
|
<p class="text light grey">{{index .GetIssueInfos 1}}</p> |
||||||
{{else if eq .GetOpType 11}} |
{{else if eq .GetOpType 11}} |
||||||
<p class="news-content comment-news">{{index .GetIssueInfos 1}}</p> |
<p class="text light grey">{{index .GetIssueInfos 1}}</p> |
||||||
{{end}} |
{{end}} |
||||||
<p class="news-time text-italic">{{TimeSince .GetCreate $.i18n.Lang}}</p> |
<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> |
||||||
<i class="mega-octicon octicon-{{ActionIcon .GetOpType}} right"></i> |
</div> |
||||||
|
<div class="ui divider"></div> |
||||||
</div> |
</div> |
||||||
{{end}} |
{{end}} |
@ -1,46 +0,0 @@ |
|||||||
<div id="dashboard-header"> |
|
||||||
<ul class="menu menu-line container"> |
|
||||||
<li id="dashboard-selection-menu" class="down drop"> |
|
||||||
<a href="#" class="text-bold radius"> |
|
||||||
<img class="avatar-30" src="{{.ContextUser.AvatarLink}}" alt="user-avatar" /> |
|
||||||
{{.ContextUser.Name}} |
|
||||||
</a> |
|
||||||
<div class="drop-down panel panel-radius"> |
|
||||||
<p class="panel-header"><strong>{{.i18n.Tr "home.switch_dashboard_context"}}</strong></p> |
|
||||||
<ul class="menu menu-vertical switching-list" id="dashboard-switch-menu"> |
|
||||||
<li class="org {{if eq .ContextUser.Id .SignedUser.Id}}checked{{end}}"> |
|
||||||
<a href="{{AppSubUrl}}/"> |
|
||||||
<i class="octicon octicon-check"></i> |
|
||||||
<img class="avatar-24" src="{{.SignedUser.AvatarLink}}" alt="user-avatar" /> |
|
||||||
{{.SignedUser.Name}} |
|
||||||
</a> |
|
||||||
</li> |
|
||||||
{{range .Orgs}} |
|
||||||
<li class="org {{if eq $.ContextUser.Id .Id}}checked{{end}}"> |
|
||||||
<a href="{{.DashboardLink}}"> |
|
||||||
<i class="octicon octicon-check"></i> |
|
||||||
<img class="avatar-24" src="{{.AvatarLink}}" alt="user-avatar" /> |
|
||||||
{{.Name}} |
|
||||||
</a> |
|
||||||
</li> |
|
||||||
{{end}} |
|
||||||
<!-- <li> |
|
||||||
<a href="{{AppSubUrl}}/user/settings/orgs"><i class="octicon octicon-organization"></i>{{.i18n.Tr "manage_org"}}</a> |
|
||||||
</li> --> |
|
||||||
<li> |
|
||||||
<a href="{{AppSubUrl}}/org/create"><i class="octicon octicon-plus"></i>{{.i18n.Tr "new_org"}}</a> |
|
||||||
</li> |
|
||||||
</ul> |
|
||||||
</div> |
|
||||||
</li> |
|
||||||
<li class="right"> |
|
||||||
<a {{if $.PageIsIssues}}class="current"{{end}} href="{{AppSubUrl}}/{{if .ContextUser.IsOrganization}}org/{{.ContextUser.Name}}/{{end}}issues"><i class="octicon octicon-issue-opened"></i>{{.i18n.Tr "issues"}}</a> |
|
||||||
</li> |
|
||||||
<!-- <li class="right"> |
|
||||||
<a {{if .PageIsPulls}}class="current"{{end}} href="{{.ContextUser.DashboardLink}}pulls"><i class="octicon octicon-git-pull-request"></i>{{.i18n.Tr "pull_requests"}}</a> |
|
||||||
</li> --> |
|
||||||
<li class="right"> |
|
||||||
<a {{if $.PageIsNews}}class="current"{{end}} href="{{.ContextUser.DashboardLink}}"><i class="octicon octicon-rss"></i>{{.i18n.Tr "news_feed"}}</a> |
|
||||||
</li> |
|
||||||
</ul> |
|
||||||
</div> |
|
Loading…
Reference in new issue