mirror of https://github.com/Ombi-app/Ombi
pull/787/head
parent
17502d695b
commit
1067b9afd7
@ -0,0 +1,89 @@
|
||||
@using PlexRequests.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.CustomizationSettings>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
var plexTheme = string.Empty;
|
||||
var originalTheme = string.Empty;
|
||||
|
||||
if (!string.IsNullOrEmpty(Model.ThemeName))
|
||||
{
|
||||
plexTheme = Model.ThemeName.Equals(Themes.PlexTheme) ? "selected=\"selected\"" : string.Empty;
|
||||
originalTheme = Model.ThemeName.Equals(Themes.OriginalTheme) ? "selected=\"selected\"" : string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
plexTheme = "selected=\"selected\"";
|
||||
}
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Customization Settings</legend>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ApplicationName" class="control-label">Application Name</label>
|
||||
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="ApplicationName" name="ApplicationName" placeholder="Application Name" value="@Model.ApplicationName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="select" class="control-label">Theme</label>
|
||||
<div id="themes">
|
||||
<select class="form-control form-control-custom" id="select">
|
||||
<option @plexTheme class="form-control form-control-custom" value="@Themes.PlexTheme">Plex</option>
|
||||
<option @originalTheme class="form-control form-control-custom" value="@Themes.OriginalTheme">Original Blue</option>
|
||||
</select>
|
||||
</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() {
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var theme = $("#themes option:selected").val();
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "&themeName=" + theme;
|
||||
|
||||
$.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>
|
Loading…
Reference in new issue