diff options
author | Giovane <giovaneliberato@gmail.com> | 2015-11-11 16:55:51 -0200 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2015-11-11 16:55:51 -0200 |
commit | c032520f8f979a139b858df8272aa6511c41244a (patch) | |
tree | ff1463a562c73329c5377dae2254ab06801c692e /web-ui | |
parent | 8da08bab434d7ee713399edb4cba147caa6354f7 (diff) |
toggle no mails available message when it's an empty search #503
Diffstat (limited to 'web-ui')
3 files changed, 11 insertions, 1 deletions
diff --git a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js index 624020be..baa54fe3 100644 --- a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js +++ b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js @@ -36,6 +36,7 @@ define( this.render = function() { this.attr.tag = this.attr.tag.toUpperCase(); + this.attr.forSearch = this.attr.forSearch.toUpperCase(); this.$node.html(templates.noMailsAvailable(this.attr)); }; diff --git a/web-ui/app/templates/compose/no_mails_available.hbs b/web-ui/app/templates/compose/no_mails_available.hbs index ce887267..6388d7db 100644 --- a/web-ui/app/templates/compose/no_mails_available.hbs +++ b/web-ui/app/templates/compose/no_mails_available.hbs @@ -1,3 +1,7 @@ <div class="scene"> - <div class="text">{{t 'NO EMAILS IN'}} '{{ tag }}'.</div> + {{#if forSearch }} + <div class="text">{{t 'NO RESULTS FOR'}}: '{{ forSearch }}'.</div> + {{else}} + <div class="text">{{t 'NO EMAILS IN'}} '{{ tag }}'.</div> + {{/if}} </div> diff --git a/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js b/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js index 2fee45ac..868efc76 100644 --- a/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js +++ b/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js @@ -6,5 +6,10 @@ describeComponent('mail_view/ui/no_mails_available_pane', function () { this.setupComponent({tag: 'inbox'}); expect(this.$node.html()).toMatch('<div class="text">NO EMAILS IN \'INBOX\'.</div>'); }); + + it('show different message for search with no results', function () { + this.setupComponent({tag: 'all', forSearch: 'search'}); + expect(this.$node.html()).toMatch('<div class="text">NO RESULTS FOR: \'SEARCH\'.</div>'); + }); }); }); |