mirror of https://github.com/Ombi-app/Ombi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
160 lines
6.0 KiB
160 lines
6.0 KiB
8 years ago
|
@Html.Partial("Shared/Partial/_Sidebar")
|
||
|
@using Ombi.UI.Helpers
|
||
|
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.LandingPageSettings>
|
||
8 years ago
|
@Html.LoadDateTimePickerAsset()
|
||
9 years ago
|
<div class="col-sm-8 col-sm-push-1">
|
||
|
<form class="form-horizontal" method="POST" id="mainForm">
|
||
|
<fieldset>
|
||
|
<legend>Landing Page Settings</legend>
|
||
|
|
||
|
|
||
|
<div class="form-group">
|
||
|
<div class="checkbox">
|
||
|
@if (Model.Enabled)
|
||
|
{
|
||
|
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||
|
}
|
||
|
</div>
|
||
9 years ago
|
<small>If enabled then all users will be redirected to the landing page instead of the login page.</small>
|
||
9 years ago
|
</div>
|
||
9 years ago
|
<div class="form-group">
|
||
|
<div class="checkbox">
|
||
|
@if (Model.BeforeLogin)
|
||
|
{
|
||
|
<input type="checkbox" id="BeforeLogin" name="BeforeLogin" checked="checked"><label for="BeforeLogin">Show before the login</label>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input type="checkbox" id="BeforeLogin" name="BeforeLogin"><label for="BeforeLogin">Show before the login</label>
|
||
|
}
|
||
|
</div>
|
||
|
<small>If enabled then this will show the landing page before the login page, if this is disabled the user will log in first and then see the landing page.</small>
|
||
|
</div>
|
||
9 years ago
|
|
||
|
<br/>
|
||
|
<div class="form-group">
|
||
|
<div class="checkbox">
|
||
|
|
||
|
@if (Model.NoticeEnable)
|
||
|
{
|
||
|
<input type="checkbox" id="NoticeEnable" name="NoticeEnable" checked="checked"><label for="NoticeEnable">Enable a notice</label>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input type="checkbox" id="NoticeEnable" name="NoticeEnable"><label for="NoticeEnable">Enable a notice</label>
|
||
|
}
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<p class="form-group">Notice Message</p>
|
||
|
<div class="form-group">
|
||
|
<div>
|
||
8 years ago
|
<textarea rows="4" type="text" class="form-control-custom form-control " id="NoticeMessage" name="NoticeMessage" placeholder="e.g. Plex will be down for maintaince (HTML is allowed)" value="@Model.NoticeMessage">@Model.NoticeMessage</textarea>
|
||
9 years ago
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group">
|
||
|
<div class="checkbox">
|
||
|
|
||
|
@if (Model.EnabledNoticeTime)
|
||
|
{
|
||
|
<input type="checkbox" id="EnabledNoticeTime" name="EnabledNoticeTime" checked="checked"><label for="EnabledNoticeTime">Enable a time limit for the notices</label>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input type="checkbox" id="EnabledNoticeTime" name="EnabledNoticeTime"><label for="EnabledNoticeTime">Enable a time limit for the notices</label>
|
||
|
}
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="form-group">
|
||
9 years ago
|
<div class='input-group date' id='startDate'>
|
||
9 years ago
|
<input type='text' class="form-control" value="@Model.NoticeStart"/>
|
||
9 years ago
|
<span class="input-group-addon">
|
||
|
<span class="glyphicon glyphicon-calendar"></span>
|
||
|
</span>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group">
|
||
9 years ago
|
<div class='input-group date' id='endDate'>
|
||
9 years ago
|
<input type='text' class="form-control" value="@Model.NoticeEnd"/>
|
||
9 years ago
|
<span class="input-group-addon">
|
||
|
<span class="glyphicon glyphicon-calendar"></span>
|
||
|
</span>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="form-group">
|
||
|
<div>
|
||
|
<button type="submit" id="save" class="btn btn-primary-outline">Submit</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</fieldset>
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
$(function () {
|
||
9 years ago
|
var $startDate = $('#startDate').datetimepicker();
|
||
|
var $endDate = $('#endDate').datetimepicker({
|
||
|
useCurrent: false //Important! See issue #1075
|
||
|
});
|
||
|
$("#startDate").on("dp.change", function (e) {
|
||
|
$('#endDate').data("DateTimePicker").minDate(e.date);
|
||
|
});
|
||
|
$("#endDate").on("dp.change", function (e) {
|
||
|
$('#startDate').data("DateTimePicker").maxDate(e.date);
|
||
|
});
|
||
|
|
||
9 years ago
|
$('#save').click(function (e) {
|
||
8 years ago
|
e.preventDefault();
|
||
|
|
||
9 years ago
|
var start = '';
|
||
|
var end = '';
|
||
|
if ($startDate.data("DateTimePicker").date()) {
|
||
|
start = $startDate.data("DateTimePicker").date().toISOString();
|
||
|
}
|
||
|
if ($endDate.data("DateTimePicker").date()) {
|
||
|
end = $endDate.data("DateTimePicker").date().toISOString();
|
||
|
}
|
||
|
|
||
9 years ago
|
var $form = $("#mainForm");
|
||
8 years ago
|
|
||
9 years ago
|
var data = $form.serialize();
|
||
9 years ago
|
data = data + "¬iceStart=" + start + "¬iceEnd=" + end;
|
||
9 years ago
|
|
||
|
$.ajax({
|
||
|
type: $form.prop("method"),
|
||
|
data: data,
|
||
|
url: $form.prop("action"),
|
||
|
dataType: "json",
|
||
|
success: function (response) {
|
||
|
if (response.result === true) {
|
||
|
generateNotify("Success!", "success");
|
||
|
} else {
|
||
|
generateNotify(response.message, "warning");
|
||
|
}
|
||
|
},
|
||
|
error: function (e) {
|
||
|
console.log(e);
|
||
|
generateNotify("Something went wrong!", "danger");
|
||
|
}
|
||
|
});
|
||
|
});
|
||
9 years ago
|
|
||
9 years ago
|
});
|
||
|
</script>
|