1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/templates/list.tmpl

102 lines
3.3 KiB
Cheetah
Raw Normal View History

2016-02-09 14:45:43 +03:00
<!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">
2016-02-09 19:35:37 +03:00
<style>
.yue ul {
padding: 0;
list-style-type: none;
}
2016-03-31 18:03:00 +03:00
span { cursor: pointer; }
2016-02-09 19:35:37 +03:00
</style>
2016-02-09 14:45:43 +03:00
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<!-- <div class="navbar-header">
2016-02-09 14:45:43 +03:00
<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> -->
2016-02-09 14:45:43 +03:00
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
2016-02-11 00:40:21 +03:00
<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>
2016-04-07 17:15:46 +03:00
<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>
2016-04-07 17:15:46 +03:00
<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>
2016-04-07 17:15:46 +03:00
<li><a href="/Help/view"> Help</a></li>
<li><a href="/PrivacyPolicy/view"> Privacy Policy</a></li>
</ul>
</li>
2016-02-09 14:45:43 +03:00
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
<div class="yue">
<ul>
{{ range $index, $element := .ListItems }}
2016-03-31 18:03:00 +03:00
{{ $element }}
2016-02-09 14:45:43 +03:00
{{ 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);
}
});
});
2016-02-11 04:43:51 +03:00
$(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";
}
});
2016-02-09 14:45:43 +03:00
</script>
</body>
</html>