1{{template "base/head" .}} 2<div class="page-content user settings repos"> 3 {{template "user/settings/navbar" .}} 4 <div class="ui container"> 5 {{template "base/alert" .}} 6 <h4 class="ui top attached header"> 7 {{.i18n.Tr "settings.repos"}} 8 </h4> 9 <div class="ui attached segment"> 10 {{if or .allowAdopt .allowDelete}} 11 {{if .Dirs}} 12 <div class="ui middle aligned divided list"> 13 {{range $dirI, $dir := .Dirs}} 14 {{ $repo := index $.ReposMap $dir}} 15 <div class="item"> 16 <div class="content"> 17 {{if $repo}} 18 {{if $repo.IsPrivate}} 19 <span class="text gold icon">{{svg "octicon-lock"}}</span> 20 {{else if $repo.IsFork}} 21 <span class="icon">{{svg "octicon-repo-forked"}}</span> 22 {{else if $repo.IsMirror}} 23 <span class="icon">{{svg "octicon-mirror"}}</span> 24 {{else if $repo.IsTemplate}} 25 <span class="icon">{{svg "octicon-repo-template"}}</span> 26 {{else}} 27 <span class="icon">{{svg "octicon-repo"}}</span> 28 {{end}} 29 <a class="name" href="{{$repo.Link}}">{{$repo.OwnerName}}/{{$repo.Name}}</a> 30 <span>{{FileSize $repo.Size}}</span> 31 {{if $repo.IsFork}} 32 {{$.i18n.Tr "repo.forked_from"}} 33 <span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span> 34 {{end}} 35 {{else}} 36 <span class="icon">{{svg "octicon-file-directory"}}</span> 37 <span class="name">{{$.Owner.Name}}/{{$dir}}</span> 38 <div class="right floated content"> 39 {{if $.allowAdopt}} 40 <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">{{$.i18n.Tr "repo.adopt_preexisting_label"}}</span></button> 41 <div class="ui basic modal" id="adopt-unadopted-modal-{{$dirI}}"> 42 {{svg "octicon-x" 16 "close inside"}} 43 <div class="header"> 44 <span class="label">{{$.i18n.Tr "repo.adopt_preexisting"}}</span> 45 </div> 46 <div class="content"> 47 <p>{{$.i18n.Tr "repo.adopt_preexisting_content" $dir}}</p> 48 </div> 49 <form class="ui form" method="POST" action="{{AppSubUrl}}/user/settings/repos/unadopted"> 50 {{$.CsrfTokenHtml}} 51 <input type="hidden" name="id" value="{{$dir}}"> 52 <input type="hidden" name="action" value="adopt"> 53 <div class="actions"> 54 <div class="ui red basic inverted cancel button"> 55 <i class="remove icon"></i> 56 {{$.i18n.Tr "modal.no"}} 57 </div> 58 <button class="ui green basic inverted ok button"> 59 <i class="checkmark icon"></i> 60 {{$.i18n.Tr "modal.yes"}} 61 </button> 62 </div> 63 </form> 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">{{$.i18n.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">{{$.i18n.Tr "repo.delete_preexisting"}}</span> 72 </div> 73 <div class="content"> 74 <p>{{$.i18n.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 <div class="actions"> 81 <div class="ui red basic inverted cancel button"> 82 <i class="remove icon"></i> 83 {{$.i18n.Tr "modal.no"}} 84 </div> 85 <button class="ui green basic inverted ok button"> 86 <i class="checkmark icon"></i> 87 {{$.i18n.Tr "modal.yes"}} 88 </button> 89 </div> 90 </form> 91 </div> 92 {{end}} 93 </div> 94 {{end}} 95 </div> 96 </div> 97 {{end}} 98 </div> 99 {{template "base/paginate" .}} 100 {{else}} 101 <div class="item"> 102 {{.i18n.Tr "settings.repos_none"}} 103 </div> 104 {{end}} 105 {{else}} 106 {{if .Repos}} 107 <div class="ui middle aligned divided list"> 108 {{range .Repos}} 109 <div class="item"> 110 <div class="content"> 111 {{if .IsPrivate}} 112 <span class="text gold iconFloat">{{svg "octicon-lock"}}</span> 113 {{else if .IsFork}} 114 <span class="iconFloat">{{svg "octicon-repo-forked"}}</span> 115 {{else if .IsMirror}} 116 <span class="iconFloat">{{svg "octicon-mirror"}}</span> 117 {{else if .IsTemplate}} 118 <span class="iconFloat">{{svg "octicon-repo-template"}}</span> 119 {{else}} 120 <span class="iconFloat">{{svg "octicon-repo"}}</span> 121 {{end}} 122 <a class="name" href="{{.Link}}">{{.OwnerName}}/{{.Name}}</a> 123 <span>{{FileSize .Size}}</span> 124 {{if .IsFork}} 125 {{$.i18n.Tr "repo.forked_from"}} 126 <span><a href="{{.BaseRepo.Link}}">{{.BaseRepo.OwnerName}}/{{.BaseRepo.Name}}</a></span> 127 {{end}} 128 </div> 129 </div> 130 {{end}} 131 </div> 132 {{template "base/paginate" .}} 133 {{else}} 134 <div class="item"> 135 {{.i18n.Tr "settings.repos_none"}} 136 </div> 137 {{end}} 138 {{end}} 139 </div> 140 </div> 141</div> 142 143<div class="ui small basic delete modal"> 144 <div class="ui icon header"> 145 {{svg "octicon-trash"}} 146 {{.i18n.Tr "settings.remove_account_link"}} 147 </div> 148 <div class="content"> 149 <p>{{.i18n.Tr "settings.remove_account_link_desc"}}</p> 150 </div> 151 {{template "base/delete_modal_actions" .}} 152</div> 153{{template "base/footer" .}} 154