66@import gitbucket.core.view.helpers
77@gitbucket.core.html.main(gistUser.map(user => s"${user.userName}'s Snippets").getOrElse("Snippets")){
88 @gitbucket.gist.html.style()
9- < div class ="container head ">
10- @if(gistUser.isEmpty){
11- < div class ="pull-right ">
12- < a href ="@context.path/gist/_new " class ="btn btn-success "> New snippet</ a >
13- </ div >
14- < h1 style ="margin-top: 0px; "> Discover Snippets</ h1 >
15- } else {
16- @helpers.avatar(gistUser.get.userName, 24)
17- < span class ="strong "> @gistUser.get.fullName</ span >
18- < div class ="pull-right ">
19- < a href ="@context.path/@gistUser.get.userName " class ="btn btn-default "> @gistUser.get.userName on GitBucket</ a >
20- </ div >
21- < div class ="muted " style ="margin-top: -10px; margin-left: 30px; ">
22- @gistUser.get.userName
9+ < div class ="content-wrapper main-center ">
10+ < div class ="head ">
11+ @if(gistUser.isEmpty){
12+ < div class ="pull-right ">
13+ < a href ="@context.path/gist/_new " class ="btn btn-success "> New snippet</ a >
14+ </ div >
15+ < h1 style ="margin-top: 0px; "> Discover Snippets</ h1 >
16+ } else {
17+ @helpers.avatar(gistUser.get.userName, 24)
18+ < span class ="strong "> @gistUser.get.fullName</ span >
19+ < div class ="pull-right ">
20+ < a href ="@context.path/@gistUser.get.userName " class ="btn btn-default "> @gistUser.get.userName on GitBucket</ a >
21+ </ div >
22+ < div class ="muted " style ="margin-top: -10px; margin-left: 30px; ">
23+ @gistUser.get.userName
24+ </ div >
25+ }
2326 </ div >
24- }
25- </ div >
26- < hr style ="margin-bottom: 20px; "/>
27- < div class ="container body ">
28- @gists.map { case (gist, gistInfo) =>
29- < div class ="panel panel-default ">
30- < div class ="panel-heading ">
31- @helpers.avatar(gist.userName, 20)
32- < a class ="strong " href ="@context.path/gist/@gist.userName "> @gist.userName</ a > /
33- < a class ="strong " href ="@context.path/gist/@gist.userName/@gist.repositoryName "> @gist.title</ a >
34- < span class ="muted small "> Created at @gist.registeredDate</ span >
35- @if(gist.mode == Mode.Secret.code){
36- < span class ="label label-warning "> Secret</ span >
37- }
38- @if(gist.mode == Mode.Private.code){
39- < span class ="label label-warning "> Private</ span >
40- }
41- < div class ="pull-right ">
42- < a href ="@context.path/gist/@gist.userName/@gist.repositoryName " class ="header-link ">
43- < i class ="octicon octicon-gist "> </ i > < strong > @gistInfo.fileCount @helpers.plural(gistInfo.fileCount, "file")</ strong >
44- </ a >
45-
46- < a href ="@context.path/gist/@gist.userName/@gist.repositoryName/forks " class ="header-link ">
47- < i class ="octicon octicon-git-branch "> </ i > < strong > @gistInfo.forkedCount @helpers.plural(gistInfo.forkedCount, "fork")</ strong >
48- </ a >
49-
50- < a href ="@context.path/gist/@gist.userName/@gist.repositoryName " class ="header-link ">
51- < i class ="octicon octicon-comment "> </ i > < strong > @gistInfo.commentCount @helpers.plural(gistInfo.commentCount, "comment")</ strong >
52- </ a >
53- </ div >
54- </ div >
55- < div class ="panel-body ">
56- < div style ="margin-bottom: 10px; ">
57- @gist.description
58- </ div >
59- < div >
60- @if(helpers.isRenderable(gistInfo.fileName)){
61- < div class ="list-markup box-content markdown-body ">
62- @helpers.renderMarkup(List(gistInfo.fileName), gistInfo.source, "master", gist.toRepositoryInfo, false, false, false)
63- </ div >
64- } else {
65- < pre class ="list-code box-content prettyprint linenums "> @gistInfo.source</ pre >
27+ < hr style ="margin-bottom: 20px; "/>
28+ < div class ="content body ">
29+ @gists.map { case (gist, gistInfo) =>
30+ < div class ="panel panel-default ">
31+ < div class ="panel-heading ">
32+ @helpers.avatar(gist.userName, 20)
33+ < a class ="strong " href ="@context.path/gist/@gist.userName "> @gist.userName</ a > /
34+ < a class ="strong " href ="@context.path/gist/@gist.userName/@gist.repositoryName "> @gist.title</ a >
35+ < span class ="muted small "> Created at @gist.registeredDate</ span >
36+ @if(gist.mode == Mode.Secret.code){
37+ < span class ="label label-warning "> Secret</ span >
6638 }
39+ @if(gist.mode == Mode.Private.code){
40+ < span class ="label label-warning "> Private</ span >
41+ }
42+ < div class ="pull-right ">
43+ < a href ="@context.path/gist/@gist.userName/@gist.repositoryName " class ="header-link ">
44+ < i class ="octicon octicon-gist "> </ i > < strong > @gistInfo.fileCount @helpers.plural(gistInfo.fileCount, "file")</ strong >
45+ </ a >
46+
47+ < a href ="@context.path/gist/@gist.userName/@gist.repositoryName/forks " class ="header-link ">
48+ < i class ="octicon octicon-git-branch "> </ i > < strong > @gistInfo.forkedCount @helpers.plural(gistInfo.forkedCount, "fork")</ strong >
49+ </ a >
50+
51+ < a href ="@context.path/gist/@gist.userName/@gist.repositoryName " class ="header-link ">
52+ < i class ="octicon octicon-comment "> </ i > < strong > @gistInfo.commentCount @helpers.plural(gistInfo.commentCount, "comment")</ strong >
53+ </ a >
54+ </ div >
55+ </ div >
56+ < div class ="panel-body ">
57+ < div style ="margin-bottom: 10px; ">
58+ @gist.description
59+ </ div >
60+ < div >
61+ @if(helpers.isRenderable(gistInfo.fileName)){
62+ < div class ="list-markup box-content markdown-body ">
63+ @helpers.renderMarkup(List(gistInfo.fileName), gistInfo.source, "master", gist.toRepositoryInfo, false, false, false)
64+ </ div >
65+ } else {
66+ < pre class ="list-code box-content prettyprint linenums "> @gistInfo.source</ pre >
67+ }
68+ </ div >
6769 </ div >
6870 </ div >
71+ }
72+ < div class ="btn-group ">
73+ < button class ="btn btn-default " onclick ="location.href='?page=@{page - 1}' "@if(page < = 1){ disabled ="true "} > Newer</ button >
74+ < button class ="btn btn-default " onclick ="location.href='?page=@{page + 1}' "@if(!hasNext){ disabled ="true "} > Older</ button >
6975 </ div >
70- }
71- < div class ="btn-group ">
72- < button class ="btn btn-default " onclick ="location.href='?page=@{page - 1}' "@if(page < = 1){ disabled ="true "} > Newer</ button >
73- < button class ="btn btn-default " onclick ="location.href='?page=@{page + 1}' "@if(!hasNext){ disabled ="true "} > Older</ button >
7476 </ div >
7577 </ div >
7678}
0 commit comments