-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7f7580
commit 1bac13f
Showing
4 changed files
with
71 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,77 @@ | ||
{{define "nav"}} | ||
<nav class="navbar nav-shadow" role="navigation" aria-label="main navigation" id="nav"> | ||
<div class="container"> | ||
<div class="navbar-brand"> | ||
<a class="navbar-item is-size-5" href="/" style="font-weight: bold"> | ||
{{.option.WebsiteName}} | ||
</a> | ||
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" | ||
data-target="mainNavbar"> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
</a> | ||
<nav class="navbar nav-shadow" role="navigation" aria-label="main navigation" id="nav"> | ||
<div class="container"> | ||
<div class="navbar-brand"> | ||
<a class="navbar-item is-size-5" href="/" style="font-weight: bold"> | ||
{{.option.WebsiteName}} | ||
</a> | ||
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" | ||
data-target="mainNavbar"> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
</a> | ||
</div> | ||
<div id="mainNavbar" class="navbar-menu"> | ||
<div class="navbar-start"> | ||
<a class="navbar-item" href="/"> 首页 </a> | ||
<a class="navbar-item" href="/explorer"> 文件 </a> | ||
<a class="navbar-item" href="/image"> 图床 </a> | ||
<a class="navbar-item" href="/video"> 视频 </a> | ||
<a class="navbar-item" href="/help"> 帮助 </a> | ||
</div> | ||
<div id="mainNavbar" class="navbar-menu"> | ||
<div class="navbar-start"> | ||
<a class="navbar-item" href="/"> 首页 </a> | ||
<a class="navbar-item" href="/explorer"> 文件 </a> | ||
<a class="navbar-item" href="/image"> 图床 </a> | ||
<a class="navbar-item" href="/video"> 视频 </a> | ||
<a class="navbar-item" href="/manage"> 管理 </a> | ||
<a class="navbar-item" href="/help"> 帮助 </a> | ||
</div> | ||
<div class="navbar-end"> | ||
<div class="navbar-item"> | ||
<p class="control is-expanded is-light"> | ||
<input class="input" type="search" id="searchInput" autocomplete="nope" | ||
autofocus="" style="cursor: text;" placeholder="搜索文件..."/> | ||
</p> | ||
<script> | ||
const input = document.getElementById("searchInput"); | ||
input.addEventListener("keyup", function (event) { | ||
if (event.key === 'Enter') { | ||
let value = input.value.trim(); | ||
value = encodeURIComponent(value); | ||
if (value === "") { | ||
location.href = "/"; | ||
}else { | ||
location.href = "/?query="+value; | ||
} | ||
<div class="navbar-end"> | ||
<div class="navbar-item" > | ||
<p class="control is-expanded is-light flex-grow"> | ||
<input class="input flex-grow" type="search" id="searchInput" autocomplete="nope" | ||
autofocus="" style="cursor: text;" placeholder="搜索文件..."/> | ||
</p> | ||
<script> | ||
const input = document.getElementById("searchInput"); | ||
input.addEventListener("keyup", function (event) { | ||
if (event.key === 'Enter') { | ||
let value = input.value.trim(); | ||
value = encodeURIComponent(value); | ||
if (value === "") { | ||
location.href = "/"; | ||
} else { | ||
location.href = "/?query=" + value; | ||
} | ||
}); | ||
</script> | ||
} | ||
}); | ||
</script> | ||
</div> | ||
<div class="navbar-item"> | ||
<div class="buttons"> | ||
<a class="button is-light" onclick="showUploadModal()">上传</a> | ||
{{if not $.username}} | ||
<a class="button is-light" href="/login">登录</a> | ||
{{end}} | ||
</div> | ||
<div class="navbar-item"> | ||
<div class="buttons"> | ||
<a class="button is-light" onclick="showUploadModal()">上传</a> | ||
<!-- <a class="button is-light" href="/logout">注销</a>--> | ||
</div> | ||
</div> | ||
{{if $.username}} | ||
<div class="navbar-item has-dropdown is-hoverable"> | ||
<a class="navbar-link"> | ||
{{$.username}} | ||
</a> | ||
<div class="navbar-dropdown"> | ||
<a class="navbar-item" href="/manage"> | ||
系统管理 | ||
</a> | ||
<a class="navbar-item" href="https://github.com/songquanpeng/go-file#readme" target="_blank"> | ||
项目地址 | ||
</a> | ||
<hr class="navbar-divider"> | ||
<a class="navbar-item" href="/logout"> | ||
退出登录 | ||
</a> | ||
</div> | ||
</div> | ||
{{end}} | ||
</div> | ||
</div> | ||
</nav> | ||
</div> | ||
</nav> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters