aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user/dashboard/dashboard.tmpl
blob: b14b79e3204629ba48516515257d41457082536d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
{{template "user/dashboard/nav" .}}
<div id="dashboard-wrapper">
    <div id="dashboard" class="container">
        {{template "ng/base/alert" .}}
        <div id="dashboard-news" class="left grid-2-3">
            {{range .Feeds}}
            <div class="news clear">
                <div class="avatar left">
                    <img class="avatar-30" src="{{AvatarLink .GetActEmail}}" alt="">
                </div>
                <div class="content left {{if eq .GetOpType 5}}push-news{{end}} grid-4-5">
                    <p class="text-bold">
                        <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.GetActUserName}}</a>
                        {{if eq .GetOpType 1}}
                        {{$.i18n.Tr "action.create_repo" AppSubUrl .GetRepoLink .GetRepoLink | Str2html}}
                        {{else if eq .GetOpType 5}}
                        {{$.i18n.Tr "action.commit_repo" AppSubUrl .GetRepoLink .GetBranch .GetBranch AppSubUrl .GetRepoLink .GetRepoLink | Str2html}}
                        {{else if eq .GetOpType 6}}
                        {{ $index := index .GetIssueInfos 0}}
                        {{$.i18n.Tr "action.create_issue" AppSubUrl .GetRepoLink $index .GetRepoLink $index | Str2html}}
                        {{else if eq .GetOpType 8}}
                        {{$.i18n.Tr "action.transfer_repo" .GetRepoName AppSubUrl .GetRepoLink .GetRepoLink | Str2html}}
                        {{else if eq .GetOpType 10}}
                        {{ $index := index .GetIssueInfos 0}}
                        {{$.i18n.Tr "action.comment_issue" AppSubUrl .GetRepoLink $index .GetRepoLink $index | Str2html}}
                        {{end}}
                    </p>
                    {{if eq .GetOpType 5}}
                    <div class="news-content content">
                        <ul class="list-no-style">
                            {{ $push := ActionContent2Commits .}}
                            {{ $repoLink := .GetRepoLink}}
                            {{range $push.Commits}}
                            <li><img class="avatar-16" src="{{AvatarLink .AuthorEmail}}?s=16"> <a href="{{AppSubUrl}}/{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text-truncate grid-4-5">{{.Message}}</span></li>
                            {{end}}
                        </ul>
                    </div>
                    {{else if eq .GetOpType 6}}
                    <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
                    {{else if eq .GetOpType 10}}
                    <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
                    {{end}}
                    <p class="news-time text-italic">{{TimeSince .GetCreate $.i18n.Lang}}</p>
                </div>
                <i class="mega-octicon octicon-{{ActionIcon .GetOpType}} right"></i>
            </div>
            {{end}}
        </div>
        <div class="right grid-1-3" id="dashboard-sidebar">
            <ul id="dashboard-sidebar-menu" class="menu menu-line">
                <li class="js-tab-nav js-tab-nav-show first" data-tab-target="#dashboard-my-repo"><a href="#">{{.i18n.Tr "repository"}}</a></li>
                {{if not .ContextUser.IsOrganization}}
                <li class="js-tab-nav" data-tab-target="#dashboard-my-org"><a href="#">{{.i18n.Tr "organization"}}</a></li>
                {{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>
                    &nbsp;
                </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="{{.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>
            {{end}}
            <div class="panel" id="dashboard-my-mirror">
                <div class="panel-header">
                    <h4 class="text-bold">{{.i18n.Tr "home.my_mirrors"}}
                        <span class="repo-count label label-gray label-radius">{{.MirrorCount}}</span>
                    </h4>
                </div>
                <div class="panel-body">
                    <ul class="list-no-style">
                        {{range .Mirrors}}
                        <li {{if .IsPrivate}}class="private"{{end}}>
                            <a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}">
                                <i class="octicon octicon-repo-clone"></i>
                                <span class="repo-name">
                                    <strong class="repo">{{.Name}}</strong>
                                </span>
                                <span class="right repo-star">
                                    <i class="octicon octicon-sync"></i>{{.Interval}}H
                                </span>
                            </a>
                        </li>
                        {{end}}
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
{{template "ng/base/footer" .}}