add browse functionality
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#fff">
|
||||
<title>{{ .Title }}</title>
|
||||
<title>{{ .Name }}</title>
|
||||
|
||||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="/admin/assets/css/main.min.css">
|
||||
@@ -14,18 +14,16 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/"><i class="fa fa-home fa-lg"></i> Home</a></li>
|
||||
<li><a href="/admin/browse/content"><i class="fa fa-newspaper-o"></i> Content</a></li>
|
||||
<li><a href="/admin/browse"><i class="fa fa-folder-o"></i> Browse</a></li>
|
||||
<li><a href="/admin/settings"><i class="fa fa-cog"></i> Settings</a></li>
|
||||
<li><a id="logout" href="#logout"><i class="fa fa-sign-out"></i> Logout</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<div id="container">
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/"><i class="fa fa-home fa-lg"></i> Home</a></li>
|
||||
<li><a href="/admin/browse/content"><i class="fa fa-newspaper-o"></i> Content</a></li>
|
||||
<li><a href="/admin/browse"><i class="fa fa-folder-o"></i> Browse</a></li>
|
||||
<li><a href="/admin/settings"><i class="fa fa-cog"></i> Settings</a></li>
|
||||
<li><a id="logout" href="#logout"><i class="fa fa-sign-out"></i> Logout</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="main" id="container">
|
||||
{{ template "content" . }}
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
@@ -1,5 +1,61 @@
|
||||
{{ define "content" }}
|
||||
<header>
|
||||
<div class="content">
|
||||
<h1>{{.Path}}</h1>
|
||||
{{ $path := .Path }}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<a href="/admin/settings">Settings</a>
|
||||
<div class="content">
|
||||
{{if .CanGoUp}}
|
||||
<a href=".." class="up" title="Up one level">⬑</a>
|
||||
{{else}}
|
||||
<div class="up"> </div>
|
||||
{{end}}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
{{if and (eq .Sort "name") (ne .Order "desc")}}
|
||||
<a href="?sort=name&order=desc">Name ▲</a>
|
||||
{{else if and (eq .Sort "name") (ne .Order "asc")}}
|
||||
<a href="?sort=name&order=asc">Name ▼</a>
|
||||
{{else}}
|
||||
<a href="?sort=name&order=asc">Name</a>
|
||||
{{end}}
|
||||
</th>
|
||||
<th>
|
||||
{{if and (eq .Sort "size") (ne .Order "desc")}}
|
||||
<a href="?sort=size&order=desc">Size ▲</a>
|
||||
{{else if and (eq .Sort "size") (ne .Order "asc")}}
|
||||
<a href="?sort=size&order=asc">Size ▼</a>
|
||||
{{else}}
|
||||
<a href="?sort=size&order=asc">Size</a>
|
||||
{{end}}
|
||||
</th>
|
||||
<th class="hideable">
|
||||
{{if and (eq .Sort "time") (ne .Order "desc")}}
|
||||
<a href="?sort=time&order=desc">Modified ▲</a>
|
||||
{{else if and (eq .Sort "time") (ne .Order "asc")}}
|
||||
<a href="?sort=time&order=asc">Modified ▼</a>
|
||||
{{else}}
|
||||
<a href="?sort=time&order=asc">Modified</a>
|
||||
{{end}}
|
||||
</th>
|
||||
</tr>
|
||||
{{range .Items}}
|
||||
<tr>
|
||||
<td>
|
||||
{{if .IsDir}}📂<a href="{{.URL}}">{{.Name}}</a>{{else}}
|
||||
📄<a href="/admin/edit{{ $path }}{{.URL}}">{{.Name}}</a>{{end}}
|
||||
|
||||
</td>
|
||||
<td>{{.HumanSize}}</td>
|
||||
<td class="hideable">{{.HumanModTime "01/02/2006 3:04:05 PM -0700"}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user