mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-20 11:07:01 +00:00
Load message list over JSON
- Add jquery-load-template to bower
- Add moment (date rendering) to bower
- Load message list JSON via /api/v1/mailbox
- Render message list using jquery template
- Fix resize related problems with message list height caused by
2092949dbc
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
<script src="/public/bower_components/jquery/dist/jquery.min.js"></script>
|
||||
<script src="/public/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="/public/bower_components/clipboard/dist/clipboard.min.js"></script>
|
||||
<script src="/public/bower_components/jquery-load-template/dist/jquery.loadTemplate-1.5.6.min.js"></script>
|
||||
<script src="/public/bower_components/moment/min/moment.min.js"></script>
|
||||
{{template "script" .}}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{{$name := .name}}
|
||||
{{range .messages}}
|
||||
<button id="{{.ID}}" type="button" class="listEntry list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-md-12 text-primary">{{.Subject}}</div>
|
||||
<div class="col-sm-4 col-md-12 small">{{.From}}</div>
|
||||
<div class="col-sm-4 col-md-12 small">{{friendlyTime .Date}}</div>
|
||||
</div>
|
||||
</button>
|
||||
{{else}}
|
||||
<div class="list-group-item disabled">No messages!</div>
|
||||
{{end}}
|
||||
@@ -12,6 +12,15 @@ $(document).ready(function() {
|
||||
onDocumentReady();
|
||||
});
|
||||
</script>
|
||||
<script type="text/html" id="list-entry-template">
|
||||
<button data-id="id" type="button" class="listEntry list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-md-12 text-primary" data-content="subject"/>
|
||||
<div class="col-sm-4 col-md-12 small" data-content="from"/>
|
||||
<div class="col-sm-4 col-md-12 small" data-content="date" data-format="DateFormatter"/>
|
||||
</div>
|
||||
</button>
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
@@ -23,7 +32,7 @@ $(document).ready(function() {
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="text-center">
|
||||
<a href="javascript:reloadList()">
|
||||
<a href="javascript:loadList()">
|
||||
<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
|
||||
Refresh
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user