1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/templates/list.tmpl
Zack Scholl 24ce00aff9 Added Recent to see recently edited/viewed things
Former-commit-id: f915533dc401cb532111a12ee550438b6265239a [formerly ff18889a0c2dfaca85a44fb0a39c0ab811eb7a2f] [formerly 5063cff7610e06e8e6f9c1dfb333e5d57b2c0cf6 [formerly c07807a85674865be3224fa0492a44efea18b690 [formerly 6987950b78]]]
Former-commit-id: a6b81d4b3d0027fce4ad88bb084a1edcac8b68a6 [formerly a8e46c713549b3dd79febbd58255b1ce66b6f5fb]
Former-commit-id: 413d956e82465767fb93961fb997efabda41b402
Former-commit-id: ee01e10499
2016-04-10 09:50:18 -04:00

102 lines
3.3 KiB
Cheetah

<!DOCTYPE html>
<html>
<head>
<title>{{ .Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> {{ template "header" }}
<link rel="stylesheet" type="text/css" href="/static/css/view.css">
<style>
.yue ul {
padding: 0;
list-style-type: none;
}
span { cursor: pointer; }
</style>
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<!-- <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">{{ .Title }}</a>
</div> -->
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/{{ .Title }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit</a></li>
<li><a href="/{{ .Title }}/view"><span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span> View</a></li>
<li class="active"><a href="/{{ .Title }}/list"><span class="glyphicon glyphicon-align-left" aria-hidden="true"></span> List</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" class="active"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> More &nbsp; <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
<a class="trigger right-caret">Recent</a>
<ul class="dropdown-menu sub-menu">
{{ range .RecentlyEdited}}
<li><a href="/{{.}}/view"> {{.}}</a></li>
{{ end }}
</ul>
</li>
<li><a href="/Help/view"> Help</a></li>
<li><a href="/PrivacyPolicy/view"> Privacy Policy</a></li>
</ul>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
<div class="yue">
<ul>
{{ range $index, $element := .ListItems }}
{{ $element }}
{{ end }}
</ul>
</div>
<script>
$('.deletable').click(function(event) {
event.preventDefault();
var lineNum = $(this).attr('id')
$.ajax({
url: "/listitem" + '?' + $.param({
"lineNum": lineNum,
"title": "{{ .Title }}"
}),
type: 'DELETE',
success: function() {
window.location.reload(true);
}
});
});
$(document).keydown(function(e){
if( e.which === 69 && e.ctrlKey && e.shiftKey ){
console.log('control + shift + e');
window.location = "/{{ .Title }}";
}
});
$(document).keydown(function(e){
if( e.which === 90 && e.ctrlKey && e.shiftKey ){
console.log('control + shift + z');
window.location = "/{{ .Title }}/view";
}
});
</script>
</body>
</html>