1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

Handle empty subject lines in bootstrap

This commit is contained in:
James Hillyerd
2016-03-06 16:30:51 -08:00
parent ff460309e5
commit f16debebbf
3 changed files with 15 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Shutdown hang in retention scanner
- Display empty subject as `(No Subject)`
## [1.1.0-rc1] - 2016-03-04
### Added

View File

@@ -107,10 +107,17 @@ function onDocumentReady() {
// Prevent search and resize handlers being called too often
var searchDelay = makeDelay(200);
var resizeDelay = makeDelay(100);
$.addTemplateFormatter("DateFormatter",
function(value, template) {
return moment(value).calendar();
});
$.addTemplateFormatter({
"date": function(value, template) {
return moment(value).calendar();
},
"subject": function(value, template) {
if (value == null || value.length == 0) {
return "(No Subject)";
}
return value;
}
});
$("#message-list").hide();
onWindowResize();
$(window).resize(function() {

View File

@@ -15,9 +15,10 @@ $(document).ready(function() {
<script type="text/html" id="list-entry-template">
<button data-id="id" type="button" class="message-list-entry 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 text-primary" data-content="subject"
data-format="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 class="col-sm-4 col-md-12 small" data-content="date" data-format="date"/>
</div>
</button>
</script>