mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
show a "no requests yet" message on the requests page (for each cateogory)
This commit is contained in:
parent
0b1a589a70
commit
14d1d279bb
2 changed files with 33 additions and 11 deletions
|
@ -9,6 +9,8 @@ var searchSource = $("#search-template").html();
|
|||
var searchTemplate = Handlebars.compile(searchSource);
|
||||
var movieTimer = 0;
|
||||
var tvimer = 0;
|
||||
var noResultsHtml = "<div class='no-search-results'>" +
|
||||
"<i class='fa fa-film no-search-results-icon'></i><div class='no-search-results-text'>Sorry, there are no {0} requests yet!</div></div>";
|
||||
var mixItUpDefault = {
|
||||
animation: { enable: true },
|
||||
load: {
|
||||
|
@ -393,11 +395,16 @@ function movieLoad() {
|
|||
$ml.html("");
|
||||
|
||||
$.ajax("/requests/movies/").success(function (results) {
|
||||
results.forEach(function (result) {
|
||||
var context = buildRequestContext(result, "movie");
|
||||
var html = searchTemplate(context);
|
||||
$ml.append(html);
|
||||
});
|
||||
if (results.length > 0) {
|
||||
results.forEach(function (result) {
|
||||
var context = buildRequestContext(result, "movie");
|
||||
var html = searchTemplate(context);
|
||||
$ml.append(html);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$ml.html(noResultsHtml.format("movie"));
|
||||
}
|
||||
$ml.mixItUp(mixItUpConfig());
|
||||
});
|
||||
};
|
||||
|
@ -411,11 +418,16 @@ function tvLoad() {
|
|||
$tvl.html("");
|
||||
|
||||
$.ajax("/requests/tvshows/").success(function (results) {
|
||||
results.forEach(function (result) {
|
||||
var context = buildRequestContext(result, "tv");
|
||||
var html = searchTemplate(context);
|
||||
$tvl.append(html);
|
||||
});
|
||||
if (results.length > 0) {
|
||||
results.forEach(function (result) {
|
||||
var context = buildRequestContext(result, "tv");
|
||||
var html = searchTemplate(context);
|
||||
$tvl.append(html);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$tvl.html(noResultsHtml.format("tv show"));
|
||||
}
|
||||
$tvl.mixItUp(mixItUpConfig());
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
function generateNotify(message, type) {
|
||||
String.prototype.format = String.prototype.f = function () {
|
||||
var s = this,
|
||||
i = arguments.length;
|
||||
|
||||
while (i--) {
|
||||
s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function generateNotify(message, type) {
|
||||
// type = danger, warning, info, successs
|
||||
$.notify({
|
||||
// options
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue