1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +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 ### Fixed
- Shutdown hang in retention scanner - Shutdown hang in retention scanner
- Display empty subject as `(No Subject)`
## [1.1.0-rc1] - 2016-03-04 ## [1.1.0-rc1] - 2016-03-04
### Added ### Added

View File

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

View File

@@ -15,9 +15,10 @@ $(document).ready(function() {
<script type="text/html" id="list-entry-template"> <script type="text/html" id="list-entry-template">
<button data-id="id" type="button" class="message-list-entry list-group-item"> <button data-id="id" type="button" class="message-list-entry list-group-item">
<div class="row"> <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="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> </div>
</button> </button>
</script> </script>