mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add a message to home when no libraries have been created (#798)
* Add a prompt to home when no libraries exist Resolves: #642 * Replace let with var in homesection.js * Use centerMessage class in "no library" prompt * Fix invalid closing tag * Change \"no library\" prompt description for admins
This commit is contained in:
parent
7e6cbe685c
commit
805394d9a3
2 changed files with 40 additions and 16 deletions
|
@ -40,6 +40,7 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
|||
return getUserViews(apiClient, user.Id).then(function (userViews) {
|
||||
var html = '';
|
||||
|
||||
if (userViews.length) {
|
||||
var sectionCount = 7;
|
||||
for (var i = 0; i < sectionCount; i++) {
|
||||
html += '<div class="verticalSection section' + i + '"></div>';
|
||||
|
@ -60,6 +61,27 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
|||
returnPromise: false
|
||||
});
|
||||
});
|
||||
} else {
|
||||
var noLibDescription;
|
||||
if (user['Policy'] && user['Policy']['IsAdministrator']) {
|
||||
noLibDescription = Globalize.translate("NoCreatedLibraries", '<a id="button-createLibrary" class="button-link">', '</a>')
|
||||
} else {
|
||||
noLibDescription = Globalize.translate("AskAdminToCreateLibrary");
|
||||
}
|
||||
|
||||
html += '<div class="centerMessage padded-left padded-right">';
|
||||
html += '<h2>' + Globalize.translate("MessageNothingHere") + '</h2>';
|
||||
html += '<p>' + noLibDescription + '</p>'
|
||||
html += '</div>';
|
||||
elem.innerHTML = html;
|
||||
|
||||
var createNowLink = elem.querySelector("#button-createLibrary")
|
||||
if (createNowLink) {
|
||||
createNowLink.addEventListener("click", () => {
|
||||
Dashboard.navigate("library.html");
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
"Artists": "Artists",
|
||||
"AsManyAsPossible": "As many as possible",
|
||||
"Ascending": "Ascending",
|
||||
"AskAdminToCreateLibrary": "Ask an administrator to create a library.",
|
||||
"AspectRatio": "Aspect Ratio",
|
||||
"AttributeNew": "New",
|
||||
"Audio": "Audio",
|
||||
|
@ -1032,6 +1033,7 @@
|
|||
"Next": "Next",
|
||||
"NextUp": "Next Up",
|
||||
"No": "No",
|
||||
"NoCreatedLibraries": "Seems like you haven't created any libraries yet. {0}Would you like to create one now?{1}",
|
||||
"NoNewDevicesFound": "No new devices found. To add a new tuner, close this dialog and enter the device information manually.",
|
||||
"NoNextUpItemsMessage": "None found. Start watching your shows!",
|
||||
"NoPluginConfigurationMessage": "This plugin has no settings to configure.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue