{{template "base/head" .}}
<div class="admin user">
	<div class="ui container">
		<div class="ui grid">
			{{template "admin/navbar" .}}
			<div class="twelve wide column content">
				{{template "base/alert" .}}
				<h4 class="ui top attached header">
					Repository Manage Panel (Total: {{.Total}}) 📁
				</h4>
				<div class="ui attached segment">
					{{template "admin/base/search" .}}
				</div>
				<div class="ui unstackable attached table segment">
					<table class="ui unstackable very basic striped table">
						<thead>
							<tr>
								<th>ID</th>
								<th>Owner</th>
								<th>Name</th>
								<th>Private</th>
								<th>Watches</th>
								<th>Stars</th>
								<th>Issues</th>
								<th>Size</th>
								<th>Created</th>
								<th>Op.</th>
							</tr>
						</thead>
						<tbody>
							{{range .Repos}}
								<tr>
									<td>{{.ID}}</td>
									<td>
										<a class="ui image label" href="{{AppSubURL}}/{{.Owner.Name}}">
											<img src="{{AppendAvatarSize .Owner.RelAvatarLink 40}}"> {{.Owner.Name}}
										</a>
									</td>
									<td>
										<a class="ui image label" href="{{AppSubURL}}/{{.Owner.Name}}/{{.Name}}">
											{{.Name}}
										</a>
									</td>
									<td class="admin indication">{{if .IsPrivate}}✔️{{else}}❌{{end}}</td>
									<td>{{.NumWatches}}</td>
									<td>{{.NumStars}}</td>
									<td>{{.NumIssues}}</td>
									<td>{{.Size | FileSize}}</td>
									<td><span title="{{DateFmtLong .Created}}">{{DateFmtShort .Created}}</span></td>
									<td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Current}}" data-id="{{.ID}}">🗑</a></td>
								</tr>
							{{end}}
						</tbody>
					</table>
				</div>

				{{template "admin/base/page" .}}
			</div>
		</div>
	</div>
</div>

<div class="ui small basic delete modal">
	<div class="ui icon header">
		<i class="trash icon"></i>
		Delete This Repository
	</div>
	<div class="content">
		<p>Once you delete a repository, there is no going back. Please be certain.</p>
		- This operation will permanently delete everything in this repository, including Git data, issues, comments and collaborator access.<br>
		- All forks will become independent after deletion.<br>
	</div>
	{{template "base/delete_modal_actions" .}}
</div>
{{template "base/footer" .}}
