Skip to content

Commit

Permalink
Merge branch 'dufferzafar/loading-preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlecat committed Mar 15, 2015
2 parents 33c612c + 3b941d8 commit 50dae67
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions critiquebrainz/frontend/templates/review/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ <h2>{{ _('Editing review') }}</h2>
if (e.target.hash.substring(1) == "preview") {
var text = $("#review-content").val();
if (!text) {
$("#preview").html('<em class="text-muted">{{ _('Review is empty.') }}</em>');
$("#preview").html('<em class="text-muted">' + {{ _('Review is empty.') | tojson }} + '</em>');
} else {
$.ajax({
type: "POST",
url: "{{ url_for('review.preview') }}",
data: { text: text },
success: function(data) { $("#preview").html(data); },
error: function() { $("#preview").html('<em class="text-danger">{{ _('Failed to load preview.') }}</em>'); }
error: function() { $("#preview").html('<em class="text-danger">' + {{ _('Failed to load preview.') | tojson }} + '</em>'); }
});
}
} else {
$("#preview").html('<em class="text-muted">{{ _('Loading preview...') }}</em>');
$("#preview").html('<em class="text-muted">' + {{ _('Loading preview...') | tojson }} + '</em>');
}
});
});
Expand Down
6 changes: 3 additions & 3 deletions critiquebrainz/frontend/templates/review/entity.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ <h3>{{ _('Review by %(user)s', user = ('<img class="avatar" src="%s&s=24" /> '|s
success: function(result) {
resultBlock.removeClass('text-muted');
if (result.success) {
resultBlock.text("{{ _('Review reported!') }}");
resultBlock.text({{ _('Review reported!') | tojson }});
resultBlock.addClass('text-success');
} else {
if (result.error == "reported") {
resultBlock.text("{{ _('You have already reported this review!') }}");
resultBlock.text({{ _('You have already reported this review!') | tojson }});
} else {
resultBlock.text("{{ _('Unknown error occurred!') }}");
resultBlock.text({{ _('Unknown error occurred!') | tojson }});
console.log(result.error)
}
resultBlock.addClass('text-danger');
Expand Down
6 changes: 3 additions & 3 deletions critiquebrainz/frontend/templates/review/write.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ <h2>{{ _('Write review') }}</h2>
if (e.target.hash.substring(1) == "preview") {
var text = $("#review-content").val();
if (!text) {
$("#preview").html('<em class="text-muted">{{ _('Review is empty.') }}</em>');
$("#preview").html('<em class="text-muted">' + {{ _('Review is empty.') | tojson }} + '</em>');
} else {
$.ajax({
type: "POST",
url: "{{ url_for('review.preview') }}",
data: { text: text },
success: function(data) { $("#preview").html(data); },
error: function() { $("#preview").html('<em class="text-danger">{{ _('Failed to load preview.') }}</em>'); }
error: function() { $("#preview").html('<em class="text-danger">' + {{ _('Failed to load preview.') | tojson }} + '</em>'); }
});
}
} else {
$("#preview").html('<em class="text-muted">{{ _('Loading preview...') }}</em>');
$("#preview").html('<em class="text-muted">' + {{ _('Loading preview...') | tojson }} + '</em>');
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion critiquebrainz/frontend/templates/search/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h3>{{ _('Search') }}</h3>
if (data.more === true) more_button.show();
})
.fail(function() {
alert("{{ _('Failed to load more search results!') }}");
alert({{ _('Failed to load more search results!') | tojson }});
});
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion critiquebrainz/frontend/templates/search/selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h3>{{ _('Release group selection') }}</h3>
if (data.more === true) more_button.show();
})
.fail(function() {
alert("{{ _('Failed to load more search results!') }}");
alert({{ _('Failed to load more search results!') | tojson }});
});
}
</script>
Expand Down

0 comments on commit 50dae67

Please sign in to comment.