forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.tmpl
273 lines (253 loc) · 9.54 KB
/
home.tmpl
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
{{template "base/head" .}}
<div class="repository file list">
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
<p id="repo-desc">
{{if .Repository.DescriptionHTML}}<span class="description has-emoji">{{.Repository.DescriptionHTML}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
</p>
<div class="ui secondary menu">
{{if .PullRequestCtx.Allowed}}
<div class="fitted item">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .SignedUser.HasForkedRepo .BaseRepo.ID }}{{.SignedUser.Name}}:{{end}}{{.BranchName}}">
<button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
</a>
</div>
{{end}}
{{template "repo/branch_dropdown" .}}
{{ $n := len .TreeNames}}
{{ $l := Subtract $n 1}}
<div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchName}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span></div>
<div class="right fitted item">
{{if .Repository.CanEnableEditor}}
<div id="file-buttons" class="ui tiny blue buttons">
{{if .CanAddFile}}
<a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
{{.i18n.Tr "repo.editor.new_file"}}
</a>
{{end}}
{{if .CanUploadFile}}
<a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
{{.i18n.Tr "repo.editor.upload_file"}}
</a>
{{end}}
</div>
{{end}}
<!-- Only show clone panel in repository home page -->
{{if eq $n 0}}
<div class="ui action tiny input" id="clone-panel">
{{if not $.DisableHTTP}}
<button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
{{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
</button>
{{end}}
{{if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
<button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
SSH
</button>
{{end}}
{{if not $.DisableHTTP}}
<input id="repo-clone-url" value="{{$.CloneLink.HTTPS}}" readonly>
{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
<input id="repo-clone-url" value="{{$.CloneLink.SSH}}" readonly>
{{end}}
{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
<i class="octicon octicon-clippy"></i>
</button>
{{end}}
<div class="ui basic jump dropdown icon button poping up" data-content="{{.i18n.Tr "repo.download_archive"}}" data-variation="tiny inverted" data-position="top right">
<i class="download icon"></i>
<div class="menu">
<a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
<a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
</div>
</div>
</div>
{{end}}
</div>
</div>
{{if .IsViewFile}}
{{template "repo/view_file" .}}
{{else}}
<style>
/*
*******************************************************************************
TODO:
this inline stylesheet here is TEMPORARY
please show me where/how to move this into the public/less or public/css folder
=)
-tso
*******************************************************************************
*/
.statistics {
position: relative;
height: 2.6667em;
border: 1px solid #dedede;
border-radius: 5px;
background: #fff;
}
/**
* 3D box effect technique
*
* http://codepen.io/rachsmith/pen/cojza
*/
.statistics-box {
perspective: 1000px;
overflow: hidden;
border-radius: 5px 5px 0 0;
padding: 0 1.5em;
}
.statistics-box__toppanel, .statistics-box__bottompanel {
transform-origin: 50% 0;
transition-delay: 125ms;
/**
* this timing function from
* http://codepen.io/sbchewitt/pen/KpPZMx
*/
transition: all 0.5s cubic-bezier(.57,-0.42,.46,1.4);
}
.statistics-box__toppanel {
position: relative;
transform-style: preserve-3d;
background: #fff;
}
.statistics-box__bottompanel {
transform: rotateX(-90deg) translateZ(0);
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 100%;
background: #999;
}
.statistics-box__focusstate .statistics-box__toppanel {
transform: rotateX(90deg) translateY(-22px);
transition-delay: 0s;
}
.statistics-box__focusstate .statistics-box__bottompanel {
background: #fff;
transition-delay: 0s;
}
/*ul*/.statistics-nav {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: space-around;
padding: 0.5em;
}
/*li*/.statistics-nav__item {
flex: 0 1 auto;
}
/*li*/.statistics-nav__item a {
color: #222;
text-decoration: none;
}
.statistics-box__repo /*li*/.statistics-nav__item:hover a {
color: #4183c4;
}
.statistics-box__lang /*li*/.statistics-nav__item::before {
background-color: currentColor;
content: '';
display: inline-block;
width: 0.75em;
height: 0.75em;
border-radius: 50%;
vertical-align: middle;
margin: 0 0.25em 2px 0;
cursor: pointer;
}
/*li*/.statistics-nav__item::after {
content: attr(data-percent);
margin-left: 0.5em;
color: #555;
}
.statistics-underbar {
position: absolute;
left: 0;
bottom: -5px;
height: 5px;
width: 100%;
bottom: 0;
display: flex;
cursor: pointer;
border-radius: 0 0 5px 5px;
overflow: hidden;
opacity: 0.6;
transition: all 0.5s cubic-bezier(.57,-0.42,.46,1.4);
}
.statistics-box__focusstate ~ .statistics-underbar,
.statistics-underbar:hover {
opacity: 1;
padding: 0;
height: 7px;
padding-top: 3px;
}
.statistics-underbar:hover {
opacity: 0.8;
}
.statistics-underbar span {
font-size: 0;
background-color: currentColor;
}
/*
*******************************************************************************
TODO:
this inline stylesheet here is TEMPORARY
please show me where/how to move this into the public/less or public/css folder
=)
-tso
*******************************************************************************
*/
</style>
<div class="statistics">
<div class="statistics-box">
<div class="statistics-box__toppanel statistics-box__repo">
<ul class="statistics-nav">
<li class="statistics-nav__item">
<i class="octicon octicon-history"></i>
<a href="#">{{.CommitsCount}} Commit(s)</a>
</li>
<li class="statistics-nav__item">
<i class="octicon octicon-git-branch"></i>
<a href="#">(TODO) Branches</a>
</li>
<li class="statistics-nav__item">
<i class="octicon octicon-tag"></i>
<a href="#">{{.Repository.NumReleases}} Release(s)</a>
</li>
<li class="statistics-nav__item">
<i class="octicon octicon-organization"></i>
<a href="#">(TODO) Contributors</a>
</li>
</ul>
<div class="statistics-box__bottompanel statistics-box__lang">
<ul class="statistics-nav">
{{range .Repository.Linguist}}
<li class="statistics-nav__item" style="color:{{.Color}}" data-percent="{{.Percentage}}%">
<a href="#">{{.Language}}</a>
</li>
{{end}}
</ul>
</div>
</div>
</div>
<div class="statistics-underbar" title="Language Statistics" onclick="document.querySelector('.statistics-box').classList.toggle('statistics-box__focusstate')">
<!--
would prefer not to use inline styles for this
in favor of data-* attributes + attr() in css
however browsers do not support this yet
and JavaScript cannot target ::before, ::after
-->
{{range .Repository.Linguist}}
<span style="color:{{.Color}};flex-basis:{{.Percentage}}%">{{.Language}}</span>
{{end}}
</div>
</div>
{{template "repo/view_list" .}}
{{end}}
</div>
</div>
{{template "base/footer" .}}