|
7 | 7 | @gitbucket.core.html.main(gistUser.map(user => s"${user.userName}'s Snippets").getOrElse("Snippets")){
|
8 | 8 | <link href="@context.path/plugin-assets/gist/style.css" rel="stylesheet">
|
9 | 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;"> |
| 10 | + <div class="gist-content"> |
| 11 | + <div class="head"> |
| 12 | + @if(gistUser.isEmpty){ |
| 13 | + <div class="pull-right"> |
| 14 | + <a href="@context.path/gist/_new" class="btn btn-success">New snippet</a> |
| 15 | + </div> |
| 16 | + <h1 style="margin-top: 0px;">Discover Snippets</h1> |
| 17 | + } else { |
| 18 | + @helpers.avatar(gistUser.get.userName, 24) |
| 19 | + <span class="strong">@gistUser.get.fullName</span> |
| 20 | + <div class="pull-right"> |
| 21 | + <a href="@context.path/@gistUser.get.userName" class="btn btn-default">@gistUser.get.userName on GitBucket</a> |
| 22 | + </div> |
| 23 | + <div class="muted" style="margin-top: -10px; margin-left: 30px;"> |
23 | 24 | @gistUser.get.userName
|
| 25 | + </div> |
| 26 | + } |
24 | 27 | </div>
|
25 |
| - } |
26 |
| - </div> |
27 |
| - <div class="content 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> |
| 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> |
66 | 38 | }
|
| 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;">@gist.description</div> |
| 58 | + <div> |
| 59 | + @if(helpers.isRenderable(gistInfo.fileName)){ |
| 60 | + <div class="list-markup box-content markdown-body"> |
| 61 | + @helpers.renderMarkup(List(gistInfo.fileName), gistInfo.source, "master", gist.toRepositoryInfo, false, false, false) |
| 62 | + </div> |
| 63 | + } else { |
| 64 | + <pre class="list-code box-content prettyprint linenums">@gistInfo.source</pre> |
| 65 | + } |
| 66 | + </div> |
67 | 67 | </div>
|
68 | 68 | </div>
|
| 69 | + } |
| 70 | + <div class="btn-group"> |
| 71 | + <button class="btn btn-default" onclick="location.href='?page=@{page - 1}'"@if(page <= 1){ disabled="true"}>Newer</button> |
| 72 | + <button class="btn btn-default" onclick="location.href='?page=@{page + 1}'"@if(!hasNext){ disabled="true"}>Older</button> |
69 | 73 | </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> |
74 | 74 | </div>
|
75 | 75 | </div>
|
76 | 76 | </div>
|
|
0 commit comments