kreta/KretaWeb/Areas/Adminisztracio/Views/FelHelyValaszto/Index.cshtml
2024-03-13 00:33:46 +01:00

165 lines
5.2 KiB
Text

@using Kreta.Framework
@using Kreta.Enums
@model Kreta.Web.Areas.Adminisztracio.Models.FelHelyValasztoModel
@{
ViewBag.Title = LoginResource.FelHelyValaszto;
Layout = null;
}
<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>@ViewBag.Title</title>
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Roboto+Condensed:wght@300;400;700&display=swap" rel="stylesheet">
<link rel="icon" href="../../favicon.ico" type="image/x-icon" />
@Styles.Render("~/App_Themes/css", "~/Content/css", "~/Content/kretaControls")
@Styles.Render(Request.Browser.IsMobileDevice ? "~/Content/kretaMobileCss" : "~/Content/kretaCss")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/ErrorHandler")
@Scripts.Render("~/bundles/js")
@Html.Raw(Kreta.Core.Analytics.Client.Factory.GetInstance())
<script type="text/javascript">
GlobalErrorHandler('@Url.Action("ClientError", "Layout", new { area = string.Empty })');
</script>
<style>
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 100%;
font-family: "Open Sans";
font-size: 14px;
font-weight: 400;
color: #445261;
background-color: #385765;
}
.FelhelyValasztoHeader {
background-color: #385765;
padding: 1em;
color: #e5e9ec;
text-align: center;
}
.k-checkbox-label::before {
top: 3px;
}
.k-checkbox-label {
line-height: 1.5em;
}
.noUlLiButton {
}
.Box-Container {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
align-content: center;
flex-grow: 1;
}
.Box-Item {
margin: 3em;
max-width: 600px;
min-height: 300px;
min-width: 400px;
display: flex;
flex-direction: column;
flex-grow: 1;
-webkit-box-shadow: 10px 10px 5px -2px rgba(56,56,56,1);
box-shadow: 10px 10px 5px -2px rgba(56,56,56,1);
background-color: #eceff2;
}
.k-button {
background-color: #385765;
}
.SetFelHelyBtn {
float: right;
}
</style>
</head>
<body>
<div class="Box-Container">
<div class="Box-Item container-fluid details">
<div class="FelhelyValasztoHeader">
@LoginResource.KivalaszthatoFelhelyek
</div>
@Html.KretaCheckBoxList("FeladatEllatasiHelyIds", Model.FelhelyList, isPostAsArray: false, onClickEvent: "FelhelyKezeloHelper.onchange($(this).attr('id')); ")
<div>
<div class="k-button k-button-icontext SetFelHelyBtn" style="padding: 10px 14px;"><span></span>@CommonResource.Rendben</div>
</div>
</div>
</div>
<script type="text/javascript">
var FelhelyKezeloHelper = (function () {
var helper = function () { };
helper.logout = function () { logOut(); };
helper.onchange = function (controlId) { onchange(controlId); };
function logOut() {
AjaxHelper.DoPost('@Url.Action("LogOut", "Layout", new { area = string.Empty})', undefined, logOutCallBack);
}
function logOutCallBack(data) {
window.location.assign(data.Url);
}
function onchange(controlId) {
var control = $("#" + controlId);
if (control.prop("checked")) {
$("input:checkbox").each(function () {
if ($(this).prop("checked") && $(this).attr('id') != controlId) {
$(this).prop("checked", false);
}
});
}
else {
control.prop("checked", true);
}
}
function CallBack(data) {
if (data.Success) {
window.location.assign(data.Url);
}
}
function SetFelHelyToClaim() {
AjaxHelper.DoPost('@Url.Action("SetFelHelyToClaim", "FelHelyValaszto", new { area = "Adminisztracio" })', { mukodesifelhelyId: $("input:checked").val() }, CallBack);
}
function initChecked() {
$(".noUlLiButton").find(".k-checkbox").first().prop("checked", true);
}
$(document).ready(function () {
initChecked();
$(".SetFelHelyBtn").click(function () {
SetFelHelyToClaim();
})
});
return helper;
})();
</script>
</body>
</html>