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.
138 lines
4.8 KiB
138 lines
4.8 KiB
@using PlexRequests.UI.Helpers
|
|
@Html.Partial("_Sidebar")
|
|
|
|
<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>
|
|
<small>If enabled then all users will be redirected to the landing page instead of the login page.</small>
|
|
</div>
|
|
|
|
<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>
|
|
<input type="text" class="form-control-custom form-control " id="NoticeMessage" name="NoticeMessage" placeholder="e.g. Plex will be down for maintaince" value="@Model.NoticeMessage">
|
|
</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">
|
|
<div class='input-group date' id='startDate'>
|
|
<input type='text' class="form-control" />
|
|
<span class="input-group-addon">
|
|
<span class="glyphicon glyphicon-calendar"></span>
|
|
</span>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class='input-group date' id='endDate'>
|
|
<input type='text' class="form-control"/>
|
|
<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 () {
|
|
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);
|
|
});
|
|
|
|
$('#save').click(function (e) {
|
|
e.preventDefault();
|
|
|
|
var $form = $("#mainForm");
|
|
|
|
var data = $form.serialize();
|
|
data = data + "¬iceStart=" + $startDate.data("DateTimePicker").date().toISOString() + "¬iceEnd=" + $endDate.data("DateTimePicker").date().toISOString();
|
|
|
|
$.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");
|
|
}
|
|
});
|
|
});
|
|
|
|
});
|
|
</script> |