mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 18:47:15 -07:00
parent
05bdfcd550
commit
55f1309140
41 changed files with 494 additions and 261 deletions
|
@ -10,7 +10,7 @@
|
|||
$(function () {
|
||||
|
||||
// Check for update
|
||||
var url = createBaseUrl(urlBase, '/updatechecker');
|
||||
var url = createBaseUrl(urlBase, '/layout');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
|
@ -20,7 +20,7 @@
|
|||
var status = createBaseUrl(urlBase, '/admin/status');
|
||||
$('#updateAvailable').html("<i class='fa fa-cloud-download' aria-hidden='true'></i> @UI.Layout_UpdateAvailablePart1 <a style='color: white' href='" + status + "'>@UI.Layout_UpdateAvailablePart2</a>");
|
||||
$('#updateAvailable').removeAttr("hidden");
|
||||
$('body').addClass('update-available');
|
||||
//$('body').addClass('update-available');
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
|
@ -29,6 +29,7 @@
|
|||
});
|
||||
// End Check for update
|
||||
|
||||
checkCacheInProgress();
|
||||
|
||||
// Scroller
|
||||
$(document).on('scroll', function () {
|
||||
|
@ -43,9 +44,6 @@
|
|||
$('.scroll-top-wrapper').on('click', scrollToTop);
|
||||
// End Scroller
|
||||
|
||||
|
||||
|
||||
|
||||
// Get Issue count
|
||||
var issueUrl = createBaseUrl(urlBase, '/issues/issuecount');
|
||||
$.ajax({
|
||||
|
@ -66,6 +64,8 @@
|
|||
// End issue count
|
||||
|
||||
|
||||
|
||||
|
||||
$('#donate').click(function () {
|
||||
ga('send', 'event', 'Navbar', 'Donate', 'Donate Clicked');
|
||||
});
|
||||
|
@ -80,4 +80,23 @@
|
|||
offsetTop = offset.top;
|
||||
$('html, body').animate({ scrollTop: offsetTop }, 500, 'linear');
|
||||
}
|
||||
|
||||
function checkCacheInProgress() {
|
||||
|
||||
var url = createBaseUrl(urlBase, '/layout/cacher');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.currentlyRunning) {
|
||||
$('#cacherRunning').html("@UI.Layout_CacherRunning");
|
||||
$('#cacherRunning').removeAttr("hidden");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
|
@ -35,21 +35,21 @@
|
|||
@Html.GetNavbarUrl(Context, "/search", UI.Layout_Search, "search")
|
||||
@Html.GetNavbarUrl(Context, "/requests", UI.Layout_Requests, "plus-circle")
|
||||
@Html.GetNavbarUrl(Context, "/issues", UI.Layout_Issues, "exclamation", "<span id=\"issueCount\"></span>")
|
||||
@if (Context.CurrentUser.IsAuthenticated()) // TODO replace with IsAdmin
|
||||
@*@if (Context.CurrentUser.IsAuthenticated()) // TODO replace with IsAdmin*@
|
||||
@if (Html.IsAdmin())
|
||||
{
|
||||
<li><a id="donate" href="https://www.paypal.me/PlexRequestsNet" target="_blank"><i class="fa fa-heart" style="color: red"></i> @UI.Layout_Donate</a></li>
|
||||
}
|
||||
<li id="customDonate" style="display: none"><a id="customDonateHref" href="https://www.paypal.me/PlexRequestsNet" target="_blank"><i class="fa fa-heart" style="color: yellow;"></i> <span id="donationText">@UI.Custom_Donation_Default</span></a></li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
|
||||
|
||||
@if (!Context.CurrentUser.IsAuthenticated() && Context.Request.Session[SessionKeys.UsernameKey] == null) // TODO replace with IsAdmin
|
||||
@*@if (!Context.CurrentUser.IsAuthenticated() && Context.Request.Session[SessionKeys.UsernameKey] == null) // TODO replace with IsAdmin*@
|
||||
@if (!Html.IsLoggedIn(Context))
|
||||
{
|
||||
|
||||
<li><a href="@url/login?redirect=@Context.Request.Path"><i class="fa fa-user"></i> @UI.Layout_Admin</a></li>
|
||||
}
|
||||
@if (Context.CurrentUser.IsAuthenticated()) // TODO replace with IsAdmin
|
||||
@*@if (Context.CurrentUser.IsAuthenticated()) // TODO replace with IsAdmin*@
|
||||
@if (Html.IsAdmin())
|
||||
{
|
||||
<li><a>@UI.Layout_Welcome @Context.Request.Session[SessionKeys.UsernameKey]</a></li>
|
||||
<li class="dropdown">
|
||||
|
@ -63,7 +63,8 @@
|
|||
</ul>
|
||||
</li>
|
||||
}
|
||||
@if (Context.Request.Session[SessionKeys.UsernameKey] != null && !Context.CurrentUser.IsAuthenticated())
|
||||
@*@if (Context.Request.Session[SessionKeys.UsernameKey] != null && !Context.CurrentUser.IsAuthenticated())*@
|
||||
else if (Html.IsLoggedIn(Context)) // Logged in but not admin
|
||||
{
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> @UI.Layout_Welcome @Context.Request.Session[SessionKeys.UsernameKey] <span class="caret"></span></a>
|
||||
|
@ -77,19 +78,19 @@
|
|||
}
|
||||
<li class="dropdown">
|
||||
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-language" aria-hidden="true"><span class="caret"></span></i></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="@url/culture?l=en&u=@Context.Request.Path">@UI.Layout_English</a></li>
|
||||
<li><a href="@url/culture?l=fr&u=@Context.Request.Path">@UI.Layout_French</a></li>
|
||||
<li><a href="@url/culture?l=nl&u=@Context.Request.Path">@UI.Layout_Dutch</a></li>
|
||||
<li><a href="@url/culture?l=es&u=@Context.Request.Path">@UI.Layout_Spanish</a></li>
|
||||
<li><a href="@url/culture?l=de&u=@Context.Request.Path">@UI.Layout_German</a></li>
|
||||
<li><a href="@url/culture?l=da&u=@Context.Request.Path">@UI.Layout_Danish</a></li>
|
||||
<li><a href="@url/culture?l=pt&u=@Context.Request.Path">@UI.Layout_Portuguese</a></li>
|
||||
<li><a href="@url/culture?l=sv&u=@Context.Request.Path">@UI.Layout_Swedish</a></li>
|
||||
<li><a href="@url/culture?l=it&u=@Context.Request.Path">@UI.Layout_Italian</a></li>
|
||||
</ul>
|
||||
<li/>
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-language" aria-hidden="true"><span class="caret"></span></i></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="@url/culture?l=en&u=@Context.Request.Path">@UI.Layout_English</a></li>
|
||||
<li><a href="@url/culture?l=fr&u=@Context.Request.Path">@UI.Layout_French</a></li>
|
||||
<li><a href="@url/culture?l=nl&u=@Context.Request.Path">@UI.Layout_Dutch</a></li>
|
||||
<li><a href="@url/culture?l=es&u=@Context.Request.Path">@UI.Layout_Spanish</a></li>
|
||||
<li><a href="@url/culture?l=de&u=@Context.Request.Path">@UI.Layout_German</a></li>
|
||||
<li><a href="@url/culture?l=da&u=@Context.Request.Path">@UI.Layout_Danish</a></li>
|
||||
<li><a href="@url/culture?l=pt&u=@Context.Request.Path">@UI.Layout_Portuguese</a></li>
|
||||
<li><a href="@url/culture?l=sv&u=@Context.Request.Path">@UI.Layout_Swedish</a></li>
|
||||
<li><a href="@url/culture?l=it&u=@Context.Request.Path">@UI.Layout_Italian</a></li>
|
||||
</ul>
|
||||
<li />
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -104,16 +105,17 @@
|
|||
var donateLink = $("#customDonateHref");
|
||||
var donationText = $("#donationText");
|
||||
donateLink.attr("href", result.url);
|
||||
if(result.message) {
|
||||
if (result.message) {
|
||||
donationText.text(result.message);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
error: function (xhr, status, error) {
|
||||
console.log("error " + error);
|
||||
$("#customDonate").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div id="updateAvailable" hidden="hidden"></div>
|
||||
<div id="cacherRunning" hidden="hidden"></div>
|
||||
</nav>
|
|
@ -16,8 +16,6 @@
|
|||
<i class="fa fa-2x fa-arrow-circle-up"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@*@MiniProfiler.RenderIncludes()*@
|
||||
</body>
|
||||
|
||||
@Html.GetInformationalVersion()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue