Show 'Message not sent' only if 'Some recipients failed' not showing

Also switch up the visual style for 'Some recipients failed' text to
match the more-visible 'Message not sent' text and the 'Resend' link.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-07-10 17:53:31 -07:00
parent 25243ad9de
commit 4124d5cb9b
3 changed files with 23 additions and 13 deletions

View file

@ -20,9 +20,17 @@
tagName: 'span',
className: 'hasRetry',
templateName: 'hasRetry',
render_attributes: {
messageNotSent: i18n('messageNotSent'),
resend: i18n('resend')
render_attributes: function() {
var messageNotSent;
if (!this.model.someRecipientsFailed()) {
messageNotSent = i18n('messageNotSent');
}
return {
messageNotSent: messageNotSent,
resend: i18n('resend')
};
}
});
var SomeFailedView = Whisper.View.extend({
@ -248,11 +256,13 @@
}
this.$('.meta .hasRetry').remove();
if (this.model.hasNetworkError()) {
this.$('.meta').prepend(new NetworkErrorView().render().el);
var networkErrorView = new NetworkErrorView({model: this.model});
this.$('.meta').prepend(networkErrorView.render().el);
}
this.$('.meta .some-failed').remove();
if (this.model.someRecipientsFailed()) {
this.$('.meta').prepend(new SomeFailedView().render().el);
var someFailedView = new SomeFailedView();
this.$('.meta').prepend(someFailedView.render().el);
}
},
renderControl: function() {

View file

@ -410,13 +410,14 @@ li.entry .error-icon-container {
float: left;
margin-left: 6px;
margin-right: 6px;
cursor: pointer;
}
.hasRetry, .timestamp, .status, .timer {
float: left;
}
.timestamp, .status, .some-failed {
.timestamp, .status {
cursor: pointer;
opacity: 0.5;

View file

@ -1336,23 +1336,22 @@ li.entry .error-icon-container {
.message-list .meta .some-failed {
float: left;
margin-left: 6px;
margin-right: 6px; }
margin-right: 6px;
cursor: pointer; }
.message-container .meta .hasRetry, .message-container .meta .timestamp, .message-container .meta .status, .message-container .meta .timer,
.message-list .meta .hasRetry,
.message-list .meta .timestamp,
.message-list .meta .status,
.message-list .meta .timer {
float: left; }
.message-container .meta .timestamp, .message-container .meta .status, .message-container .meta .some-failed,
.message-container .meta .timestamp, .message-container .meta .status,
.message-list .meta .timestamp,
.message-list .meta .status,
.message-list .meta .some-failed {
.message-list .meta .status {
cursor: pointer;
opacity: 0.5; }
.message-container .meta .timestamp:hover, .message-container .meta .status:hover, .message-container .meta .some-failed:hover,
.message-container .meta .timestamp:hover, .message-container .meta .status:hover,
.message-list .meta .timestamp:hover,
.message-list .meta .status:hover,
.message-list .meta .some-failed:hover {
.message-list .meta .status:hover {
opacity: 1.0; }
.message-container .status,
.message-list .status {