|
1 | 1 | {{template "base/head" .}}
|
2 | 2 | <div role="main" aria-label="{{.Title}}" class="page-content user settings repos">
|
3 | 3 | <div class="ui container">
|
4 |
| - {{template "base/alert" .}} |
5 |
| - <h4 class="ui top attached header"> |
6 |
| - {{.locale.Tr "settings.repos"}} |
7 |
| - </h4> |
8 |
| - <div class="ui attached segment"> |
9 |
| - {{if or .allowAdopt .allowDelete}} |
10 |
| - {{if .Dirs}} |
11 |
| - <div class="ui middle aligned divided list"> |
12 |
| - {{range $dirI, $dir := .Dirs}} |
13 |
| - {{$repo := index $.ReposMap $dir}} |
14 |
| - <div class="item"> |
15 |
| - <div class="content"> |
16 |
| - {{if $repo}} |
17 |
| - {{if $repo.IsPrivate}} |
18 |
| - <span class="text gold icon">{{svg "octicon-lock"}}</span> |
19 |
| - {{else if $repo.IsFork}} |
20 |
| - <span class="icon">{{svg "octicon-repo-forked"}}</span> |
21 |
| - {{else if $repo.IsMirror}} |
22 |
| - <span class="icon">{{svg "octicon-mirror"}}</span> |
23 |
| - {{else if $repo.IsTemplate}} |
24 |
| - <span class="icon">{{svg "octicon-repo-template"}}</span> |
25 |
| - {{else}} |
26 |
| - <span class="icon">{{svg "octicon-repo"}}</span> |
27 |
| - {{end}} |
28 |
| - <a class="name" href="{{$repo.Link}}">{{$repo.OwnerName}}/{{$repo.Name}}</a> |
29 |
| - <span>{{FileSize $repo.Size}}</span> |
30 |
| - {{if $repo.IsFork}} |
31 |
| - {{$.locale.Tr "repo.forked_from"}} |
32 |
| - <span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span> |
33 |
| - {{end}} |
34 |
| - {{else}} |
35 |
| - <span class="icon">{{svg "octicon-file-directory-fill"}}</span> |
36 |
| - <span class="name">{{$.ContextUser.Name}}/{{$dir}}</span> |
37 |
| - <div class="right floated content"> |
38 |
| - {{if $.allowAdopt}} |
39 |
| - <button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button> |
40 |
| - <div class="ui basic modal" id="adopt-unadopted-modal-{{$dirI}}"> |
41 |
| - {{svg "octicon-x" 16 "close inside"}} |
42 |
| - <div class="header"> |
43 |
| - <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> |
44 |
| - </div> |
45 |
| - <div class="content"> |
46 |
| - <p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p> |
47 |
| - </div> |
48 |
| - <form class="ui form" method="POST" action="{{AppSubUrl}}/user/settings/repos/unadopted"> |
49 |
| - {{$.CsrfTokenHtml}} |
50 |
| - <input type="hidden" name="id" value="{{$dir}}"> |
51 |
| - <input type="hidden" name="action" value="adopt"> |
52 |
| - <div class="actions"> |
53 |
| - <button class="ui red basic inverted cancel button"> |
54 |
| - {{svg "octicon-x"}} |
55 |
| - {{$.locale.Tr "modal.no"}} |
56 |
| - </button> |
57 |
| - <button class="ui green basic inverted ok button"> |
58 |
| - {{svg "octicon-check"}} |
59 |
| - {{$.locale.Tr "modal.yes"}} |
60 |
| - </button> |
61 |
| - </div> |
62 |
| - {{end}} |
63 |
| - {{if $.allowDelete}} |
64 |
| - <button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button> |
65 |
| - <div class="ui basic modal" id="delete-unadopted-modal-{{$dirI}}"> |
| 4 | + <div class="ui grid"> |
| 5 | + {{template "user/settings/navbar" .}} |
| 6 | + <div class="twelve wide column content"> |
| 7 | + {{template "base/alert" .}} |
| 8 | + <h4 class="ui top attached header"> |
| 9 | + {{.locale.Tr "settings.repos"}} |
| 10 | + </h4> |
| 11 | + <div class="ui attached segment"> |
| 12 | + {{if or .allowAdopt .allowDelete}} |
| 13 | + {{if .Dirs}} |
| 14 | + <div class="ui middle aligned divided list"> |
| 15 | + {{range $dirI, $dir := .Dirs}} |
| 16 | + {{$repo := index $.ReposMap $dir}} |
| 17 | + <div class="item"> |
| 18 | + <div class="content"> |
| 19 | + {{if $repo}} |
| 20 | + {{if $repo.IsPrivate}} |
| 21 | + <span class="text gold icon">{{svg "octicon-lock"}}</span> |
| 22 | + {{else if $repo.IsFork}} |
| 23 | + <span class="icon">{{svg "octicon-repo-forked"}}</span> |
| 24 | + {{else if $repo.IsMirror}} |
| 25 | + <span class="icon">{{svg "octicon-mirror"}}</span> |
| 26 | + {{else if $repo.IsTemplate}} |
| 27 | + <span class="icon">{{svg "octicon-repo-template"}}</span> |
| 28 | + {{else}} |
| 29 | + <span class="icon">{{svg "octicon-repo"}}</span> |
| 30 | + {{end}} |
| 31 | + <a class="name" href="{{$repo.Link}}">{{$repo.OwnerName}}/{{$repo.Name}}</a> |
| 32 | + <span>{{FileSize $repo.Size}}</span> |
| 33 | + {{if $repo.IsFork}} |
| 34 | + {{$.locale.Tr "repo.forked_from"}} |
| 35 | + <span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span> |
| 36 | + {{end}} |
| 37 | + {{else}} |
| 38 | + <span class="icon">{{svg "octicon-file-directory-fill"}}</span> |
| 39 | + <span class="name">{{$.ContextUser.Name}}/{{$dir}}</span> |
| 40 | + <div class="right floated content"> |
| 41 | + {{if $.allowAdopt}} |
| 42 | + <button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button> |
| 43 | + <div class="ui basic modal" id="adopt-unadopted-modal-{{$dirI}}"> |
66 | 44 | {{svg "octicon-x" 16 "close inside"}}
|
67 | 45 | <div class="header">
|
68 |
| - <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> |
| 46 | + <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> |
69 | 47 | </div>
|
70 | 48 | <div class="content">
|
71 |
| - <p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p> |
| 49 | + <p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p> |
72 | 50 | </div>
|
73 | 51 | <form class="ui form" method="POST" action="{{AppSubUrl}}/user/settings/repos/unadopted">
|
74 | 52 | {{$.CsrfTokenHtml}}
|
75 | 53 | <input type="hidden" name="id" value="{{$dir}}">
|
76 |
| - <input type="hidden" name="action" value="delete"> |
77 |
| - {{template "base/delete_modal_actions" $}} |
78 |
| - </form> |
| 54 | + <input type="hidden" name="action" value="adopt"> |
| 55 | + <div class="actions"> |
| 56 | + <button class="ui red basic inverted cancel button"> |
| 57 | + {{svg "octicon-x"}} |
| 58 | + {{$.locale.Tr "modal.no"}} |
| 59 | + </button> |
| 60 | + <button class="ui green basic inverted ok button"> |
| 61 | + {{svg "octicon-check"}} |
| 62 | + {{$.locale.Tr "modal.yes"}} |
| 63 | + </button> |
| 64 | + </div> |
| 65 | + {{end}} |
| 66 | + {{if $.allowDelete}} |
| 67 | + <button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button> |
| 68 | + <div class="ui basic modal" id="delete-unadopted-modal-{{$dirI}}"> |
| 69 | + {{svg "octicon-x" 16 "close inside"}} |
| 70 | + <div class="header"> |
| 71 | + <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> |
| 72 | + </div> |
| 73 | + <div class="content"> |
| 74 | + <p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p> |
| 75 | + </div> |
| 76 | + <form class="ui form" method="POST" action="{{AppSubUrl}}/user/settings/repos/unadopted"> |
| 77 | + {{$.CsrfTokenHtml}} |
| 78 | + <input type="hidden" name="id" value="{{$dir}}"> |
| 79 | + <input type="hidden" name="action" value="delete"> |
| 80 | + {{template "base/delete_modal_actions" $}} |
| 81 | + </form> |
| 82 | + </div> |
| 83 | + {{end}} |
79 | 84 | </div>
|
80 | 85 | {{end}}
|
81 | 86 | </div>
|
82 |
| - {{end}} |
83 |
| - </div> |
| 87 | + </div> |
| 88 | + {{end}} |
| 89 | + </div> |
| 90 | + {{template "base/paginate" .}} |
| 91 | + {{else}} |
| 92 | + <div class="item"> |
| 93 | + {{.locale.Tr "settings.repos_none"}} |
84 | 94 | </div>
|
85 | 95 | {{end}}
|
86 |
| - </div> |
87 |
| - {{template "base/paginate" .}} |
88 |
| - {{else}} |
89 |
| - <div class="item"> |
90 |
| - {{.locale.Tr "settings.repos_none"}} |
91 |
| - </div> |
92 |
| - {{end}} |
93 |
| - {{else}} |
94 |
| - {{if .Repos}} |
95 |
| - <div class="ui middle aligned divided list"> |
96 |
| - {{range .Repos}} |
| 96 | + {{else}} |
| 97 | + {{if .Repos}} |
| 98 | + <div class="ui middle aligned divided list"> |
| 99 | + {{range .Repos}} |
| 100 | + <div class="item"> |
| 101 | + <div class="content"> |
| 102 | + {{if .IsPrivate}} |
| 103 | + {{svg "octicon-lock" 16 "gt-mr-2 iconFloat text gold"}} |
| 104 | + {{else if .IsFork}} |
| 105 | + {{svg "octicon-repo-forked" 16 "gt-mr-2 iconFloat"}} |
| 106 | + {{else if .IsMirror}} |
| 107 | + {{svg "octicon-mirror" 16 "gt-mr-2 iconFloat"}} |
| 108 | + {{else if .IsTemplate}} |
| 109 | + {{svg "octicon-repo-template" 16 "gt-mr-2 iconFloat"}} |
| 110 | + {{else}} |
| 111 | + {{svg "octicon-repo" 16 "gt-mr-2 iconFloat"}} |
| 112 | + {{end}} |
| 113 | + <a class="name" href="{{.Link}}">{{.OwnerName}}/{{.Name}}</a> |
| 114 | + <span>{{FileSize .Size}}</span> |
| 115 | + {{if .IsFork}} |
| 116 | + {{$.locale.Tr "repo.forked_from"}} |
| 117 | + <span><a href="{{.BaseRepo.Link}}">{{.BaseRepo.OwnerName}}/{{.BaseRepo.Name}}</a></span> |
| 118 | + {{end}} |
| 119 | + </div> |
| 120 | + </div> |
| 121 | + {{end}} |
| 122 | + </div> |
| 123 | + {{template "base/paginate" .}} |
| 124 | + {{else}} |
97 | 125 | <div class="item">
|
98 |
| - <div class="content"> |
99 |
| - {{if .IsPrivate}} |
100 |
| - {{svg "octicon-lock" 16 "gt-mr-2 iconFloat text gold"}} |
101 |
| - {{else if .IsFork}} |
102 |
| - {{svg "octicon-repo-forked" 16 "gt-mr-2 iconFloat"}} |
103 |
| - {{else if .IsMirror}} |
104 |
| - {{svg "octicon-mirror" 16 "gt-mr-2 iconFloat"}} |
105 |
| - {{else if .IsTemplate}} |
106 |
| - {{svg "octicon-repo-template" 16 "gt-mr-2 iconFloat"}} |
107 |
| - {{else}} |
108 |
| - {{svg "octicon-repo" 16 "gt-mr-2 iconFloat"}} |
109 |
| - {{end}} |
110 |
| - <a class="name" href="{{.Link}}">{{.OwnerName}}/{{.Name}}</a> |
111 |
| - <span>{{FileSize .Size}}</span> |
112 |
| - {{if .IsFork}} |
113 |
| - {{$.locale.Tr "repo.forked_from"}} |
114 |
| - <span><a href="{{.BaseRepo.Link}}">{{.BaseRepo.OwnerName}}/{{.BaseRepo.Name}}</a></span> |
115 |
| - {{end}} |
116 |
| - </div> |
| 126 | + {{.locale.Tr "settings.repos_none"}} |
117 | 127 | </div>
|
118 | 128 | {{end}}
|
119 |
| - </div> |
120 |
| - {{template "base/paginate" .}} |
121 |
| - {{else}} |
122 |
| - <div class="item"> |
123 |
| - {{.locale.Tr "settings.repos_none"}} |
124 |
| - </div> |
125 |
| - {{end}} |
126 |
| - {{end}} |
| 129 | + {{end}} |
| 130 | + </div> |
| 131 | + </div> |
127 | 132 | </div>
|
128 | 133 | </div>
|
129 | 134 | </div>
|
|
0 commit comments