Skip to content

Instantly share code, notes, and snippets.

@muminoff
Created November 17, 2017 02:20
Show Gist options
  • Save muminoff/48ccd41eac89217d5bd400edbed4defd to your computer and use it in GitHub Desktop.
Save muminoff/48ccd41eac89217d5bd400edbed4defd to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Christian Membership Management">
<meta name="keywords" content="christian, membership">
<meta name="robots" content="index, follow">
<meta name="copyright" content="CMM Lab">
<meta name="language" content="ko">
<meta name="web_author" content="CMM Lab">
<meta name="author" content="CMM Lab">
<meta name="rating" content="general">
<title>Christian Configuration| CMM</title>
<!-- Font -->
<link href="/assets/vendors/NanumBarunGothic/nanumbarungothic.css" rel='stylesheet' type='text/css'>
<!-- Font Awesome -->
<link href="/assets/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- XEicon -->
<link href="/assets/vendors/xeicon/xeicon.min.css" rel="stylesheet">
<!-- Bootstrap -->
<link href="/assets/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- NProgress -->
<link href="/assets/vendors/nprogress/nprogress.css" rel="stylesheet">
<!-- iCheck -->
<link href="/assets/vendors/iCheck/skins/minimal/_all.css" rel="stylesheet">
<!-- Bootstrap-select -->
<link href="/assets/vendors/bootstrap-select/dist/css/bootstrap-select.min.css" rel='stylesheet' type='text/css'>
<!-- bootstrap-daterangepicker -->
<link href="/assets/vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="/assets/build/css/custom.min.css" rel="stylesheet">
<link rel="stylesheet" href="/assets/vendors/pnotify/dist/pnotify.css" />
<link rel="stylesheet" href="/assets/vendors/pnotify/dist/pnotify.buttons.css" />
<link rel="stylesheet" href="/assets/vendors/pnotify/dist/pnotify.nonblock.css" />
</head>
<body class="nav-md">
<div class="container body">
<div class="main_container">
<div class="col-md-3 left_col">
<div class="left_col scroll-view">
<div class="navbar nav_title" style="border: 0;">
<a href="/workspace/" class="site_title">
<img src="/assets/production/images/img_logo.png" class="logo" alt="CMM">
<img src="/assets/production/images/img_logo_m.png" class="logo_m" alt="CMM">
</a>
</div>
<div class="clearfix"></div>
<!-- menu profile quick info -->
<div class="profile">
<table class="profile_info">
<tbody>
<tr>
<td colspan="2" class="text-center">
<span class="name"><i class="xi-church"></i>ISG교회</span>
<!-- <a href="/user/logout/" class="btn">로그아웃</a> -->
</td>
</tr>
<tr>
<td colspan="2" class="text-center">
<i class="fa fa-tablet"></i>
사용가능 : <span class="num">136,722</span> 코인
</td>
</tr>
<tr>
<td><a href="/workspace/"><i class="fa fa-dashboard"></i>대시보드</a></td>
<td><a href="/workspace/church/"><i class="fa fa-info-circle"></i>교회정보</a></td>
</tr>
<tr>
<td><a href="/workspace/coin/"><i class="fa fa-credit-card"></i>코인충전</a></td>
<td><a href="/workspace/message/"><i class="fa fa-list-alt" aria-hidden="true"></i>발송내역</a></td>
</tr>
</tbody>
</table>
<div class="clearfix"></div>
</div>
<!-- /menu profile quick info -->
<br />
<!-- sidebar menu -->
<div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
<div class="menu_section">
<ul class="nav side-menu">
<li><a><i class="fa fa-address-card-o"></i>성도<span class="fa fa-angle-down"></span></a>
<ul class="nav child_menu">
<li><a href="/workspace/christian/">성도조회</a></li>
<li><a href="/workspace/christian/register/">성도등록</a></li>
</ul>
</li>
<li><a><i class="fa fa-envelope-o"></i>헌금<span class="fa fa-angle-down"></span></a>
<ul class="nav child_menu">
<li><a href="#">헌금조회</a></li>
<li><a href="#">헌금등록</a></li>
</ul>
</li>
<li><a><i class="fa fa-calendar-check-o"></i>출석<span class="fa fa-angle-down"></span></a>
<ul class="nav child_menu">
<li><a href="#">출석조회</a></li>
<li><a href="#">출석등록</a></li>
</ul>
</li>
<li><a><i class="fa fa-home"></i>심방<span class="fa fa-angle-down"></span></a>
<ul class="nav child_menu">
<li><a href="#">심방조회</a></li>
<li><a href="#">심방등록</a></li>
</ul>
</li>
<li><a><i class="fa fa-database"></i>예산<span class="fa fa-angle-down"></span></a>
<ul class="nav child_menu">
<li><a href="#">예산조회</a></li>
<li><a href="#">예산등록</a></li>
</ul>
</li>
<li><a><i class="fa fa-bar-chart-o"></i>통계<span class="fa fa-angle-down"></span></a>
<ul class="nav child_menu">
<li><a href="#">재정통계</a></li>
<li><a href="#">재정보고서</a></li>
<li><a href="#">성도통계</a></li>
</ul>
</li>
<li><a><i class="fa fa-tasks"></i>설정<span class="fa fa-angle-down"></span></a>
<ul class="nav child_menu">
<li><a href="/workspace/config/area/">구역설정</a></li>
<li><a href="/workspace/config/department/">부서설정</a></li>
<li><a href="/workspace/config/christian/">교적정보설정</a></li>
<li><a href="#">예산설정</a></li>
<li><a href="#">문자템플릿</a></li>
</ul>
</li>
</div>
<!-- /menu footer buttons -->
<!-- <div class="sidebar-footer hidden-small">
</div> -->
<!-- /menu footer buttons -->
</div>
<!-- /sidebar menu -->
</div>
</div>
<!-- top navigation -->
<div class="top_nav">
<div class="nav_menu">
<nav>
<div class="nav toggle">
<a id="menu_toggle"><i class="fa fa-bars"></i></a>
</div>
<form class="navbar-form navbar-left top_search" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="검색 키워드를 입력하세요 (이름 혹은 전화번호)">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="/">
<i class="fa fa-laptop" aria-hidden="true"></i>
<span class="sr-only">홈</span>
</a>
</li>
<li class="">
<a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<img src="/assets/production/images/user.png" alt="">
<span class=" fa fa-angle-down"></span>
</a>
<ul class="dropdown-menu dropdown-usermenu pull-right">
<li><a href="/user/profile/">프로필</a></li>
<li><a href="/workspace/church/create/">교회 생성</a></li>
<li>
<a href="/workspace/church/5/">ISG교회
<span class="badge bg-red pull-right">current</span>
</a>
</li>
<li><a href="javascript:;">도움말</a></li>
<li><a href="/user/logout/"><i class="fa fa-sign-out pull-right"></i>로그아웃</a></li>
</ul>
</li>
<li class="">
<a href="javascript:;" class="user-lang dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span>언어</span>
<span class=" fa fa-angle-down"></span>
</a>
<ul class="dropdown-menu dropdown-usermenu pull-right">
<form action="/i18n/setlang/" method="post" id="ko-lang-form">
<input type='hidden' name='csrfmiddlewaretoken' value='dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' />
<input type="hidden" name="language" value="ko" />
<input type="hidden" name="next" value="/workspace/config/christian/" />
</form>
<li>
<a href="javascript:void(0);" onclick="document.getElementById('ko-lang-form').submit();">
<span><img src="" class="flag flag-ko" /></span>
<span>한국어</span>
</a>
</li>
<form action="/i18n/setlang/" method="post" id="en-lang-form">
<input type='hidden' name='csrfmiddlewaretoken' value='dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' />
<input type="hidden" name="language" value="en" />
<input type="hidden" name="next" value="/workspace/config/christian/" />
</form>
<li>
<a href="javascript:void(0);" onclick="document.getElementById('en-lang-form').submit();">
<span><img src="" class="flag flag-en" /></span>
<span>English</span>
</a>
</li>
</ul>
</li>
<li role="presentation" class="dropdown">
<a href="javascript:;" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-bell"></i>
<span class="badge bg-red">6</span>
</a>
<ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
<li>
<a>
<span class="image"><img src="/assets/production/images/img_profile.png" alt="Profile Image" /></span>
<span>
<span>John Smith</span>
<span class="time">3 mins ago</span>
</span>
<span class="message">
Film festivals used to be do-or-die moments for movie makers. They were where...
</span>
</a>
</li>
<li>
<a>
<span class="image"><img src="/assets/production/images/img_profile.png" alt="Profile Image" /></span>
<span>
<span>John Smith</span>
<span class="time">3 mins ago</span>
</span>
<span class="message">
Film festivals used to be do-or-die moments for movie makers. They were where...
</span>
</a>
</li>
<li>
<a>
<span class="image"><img src="/assets/production/images/img_profile.png" alt="Profile Image" /></span>
<span>
<span>John Smith</span>
<span class="time">3 mins ago</span>
</span>
<span class="message">
Film festivals used to be do-or-die moments for movie makers. They were where...
</span>
</a>
</li>
<li>
<a>
<span class="image"><img src="/assets/production/images/img_profile.png" alt="Profile Image" /></span>
<span>
<span>John Smith</span>
<span class="time">3 mins ago</span>
</span>
<span class="message">
Film festivals used to be do-or-die moments for movie makers. They were where...
</span>
</a>
</li>
<li>
<div class="text-center">
<a>
<strong>See All Alerts</strong>
<i class="fa fa-angle-right"></i>
</a>
</div>
</li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
<!-- /top navigation -->
<div class="right_col" role="main">
<div class="page-title">
<div class="title_left pull-left">
<h1>
Christian Configuration
</h1>
</div>
<ol class="breadcrumb pull-right">
<li>
<a href="/workspace/"><i class="fa fa-home"></i> 홈</a>
</li>
<li>
<a href="/workspace/config/christian/">설정</a>
</li>
<li>
<a href="/workspace/config/christian/">Christian Configuration</a>
</li>
</ol>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-4 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Christian Class</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<form id="id-christian-class-form" name="christian-class-form" action="/workspace/config/christian/" method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' />
<select class="form-control" id="id-christian-class-select" name="christian-class-select" size="10">
<option id="1" value="Class 1">Class 1</option>
<option id="23" value="Class 2">Class 2</option>
</select>
<div class="btn-group" role="group">
<button id="id-christian-class-add-button" name="christian-class-add-button" class="btn btn-default" type="button">추가</button>
<button id="id-christian-class-delete-button" name="christian-class-delete-button" class="btn btn-default" type="button">삭제</button>
</div>
<div class="input-group">
<input id="id-christian-class-name" name="christian-class-name" type="text" class="form-control" maxlength="20" />
<span class="input-group-btn">
<button id="id-christian-class-save-button" name="christian-class-save-button" class="btn btn-primary" type="button">Save</button>
</span>
</div>
<input name="form-type" type="hidden" value="christian-class" />
<input name="action-type" type="hidden" value="" id="id-christian-class-action-type"/>
<input name="pk" type="hidden" value="" id="id-christian-class-pk"/>
</form>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Christian Level</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<form id="id-christian-level-form" name="christian-level-form" action="/workspace/config/christian/" method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' />
<select class="form-control" id="id-christian-level-select" name="christian-level-select" size="10">
<option id="6" value="test 1">test 1</option>
<option id="11" value="test 2">test 2</option>
<option id="9" value="test 3">test 3</option>
<option id="7" value="test 4">test 4</option>
</select>
<div class="btn-group" role="group">
<button id="id-christian-level-add-button" name="christian-level-add-button" class="btn btn-default" type="button">추가</button>
<button id="id-christian-level-delete-button" name="christian-level-delete-button" class="btn btn-default" type="button">삭제</button>
</div>
<div class="input-group">
<input id="id-christian-level-name" name="christian-level-name" type="text" class="form-control" maxlength="20" />
<span class="input-group-btn">
<button id="id-christian-level-save-button" name="christian-level-save-button" class="btn btn-primary" type="button">Save</button>
</span>
</div>
<input name="form-type" type="hidden" value="christian-level" />
<input name="action-type" type="hidden" value="" id="id-christian-level-action-type"/>
<input name="pk" type="hidden" value="" id="id-christian-level-pk"/>
</form>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Christian Duty</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<form id="id-christian-duty-form" name="christian-duty-form" action="/workspace/config/christian/" method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' />
<select class="form-control" id="id-christian-duty-select" name="christian-duty-select" size="10">
<option id="1" value="Duty 0">Duty 0</option>
<option id="2" value="Duty 1">Duty 1</option>
<option id="3" value="Duty 2">Duty 2</option>
<option id="4" value="Duty 3">Duty 3</option>
<option id="5" value="Duty 4">Duty 4</option>
<option id="6" value="Duty 5">Duty 5</option>
<option id="7" value="Duty 6">Duty 6</option>
<option id="13" value="Duty 7">Duty 7</option>
<option id="14" value="Duty 8">Duty 8</option>
<option id="15" value="Duty 9">Duty 9</option>
</select>
<div class="btn-group" role="group">
<button id="id-christian-duty-add-button" name="christian-duty-add-button" class="btn btn-default" type="button">추가</button>
<button id="id-christian-duty-delete-button" name="christian-duty-delete-button" class="btn btn-default" type="button">삭제</button>
</div>
<div class="input-group">
<input id="id-christian-duty-name" name="christian-duty-name" type="text" class="form-control" maxlength="20" />
<span class="input-group-btn">
<button id="id-christian-duty-save-button" name="christian-duty-save-button" class="btn btn-primary" type="button">Save</button>
</span>
</div>
<input name="form-type" type="hidden" value="christian-duty" />
<input name="action-type" type="hidden" value="" id="id-christian-duty-action-type"/>
<input name="pk" type="hidden" value="" id="id-christian-duty-pk"/>
</form>
</div>
</div>
</div>
</div><!-- /row -->
<div class="row">
<div class="col-md-6 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Offering Service</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<form id="id-offering-service-form" name="offering-service-form" action="/workspace/config/christian/" method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' />
<select class="form-control" id="id-offering-service-select" name="offering-service-select" size="10">
<option id="1" value="Offering service 0">Offering service 0</option>
<option id="2" value="Offering service 1">Offering service 1</option>
<option id="3" value="Offering service 2">Offering service 2</option>
<option id="4" value="Offering service 3">Offering service 3</option>
<option id="5" value="Offering service 4">Offering service 4</option>
<option id="6" value="Offering service 5">Offering service 5</option>
<option id="7" value="Offering service 6">Offering service 6</option>
<option id="8" value="Offering service 7">Offering service 7</option>
<option id="9" value="Offering service 8">Offering service 8</option>
<option id="16" value="Offering service 9">Offering service 9</option>
</select>
<div class="btn-group" role="group">
<button id="id-offering-service-add-button" name="offering-service-add-button" class="btn btn-default" type="button">추가</button>
<button id="id-offering-service-delete-button" name="offering-service-delete-button" class="btn btn-default" type="button">삭제</button>
</div>
<div class="input-group">
<input id="id-offering-service-name" name="offering-service-name" type="text" class="form-control" maxlength="20" />
<span class="input-group-btn">
<button id="id-offering-service-save-button" name="offering-service-save-button" class="btn btn-primary" type="button">Save</button>
</span>
</div>
<input name="form-type" type="hidden" value="offering-service" />
<input name="action-type" type="hidden" value="" id="id-offering-service-action-type"/>
<input name="pk" type="hidden" value="" id="id-offering-service-pk"/>
</form>
</div>
</div>
</div>
<div class="col-md-6 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Offering Type</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<form id="id-offering-type-form" name="offering-type-form" action="/workspace/config/christian/" method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' />
<select class="form-control" id="id-offering-type-select" name="offering-type-select" size="10">
<option id="1" value="Offering type 0">Offering type 0</option>
<option id="2" value="Offering type 1">Offering type 1</option>
<option id="3" value="Offering type 2">Offering type 2</option>
<option id="4" value="Offering type 3">Offering type 3</option>
<option id="5" value="Offering type 4">Offering type 4</option>
<option id="6" value="Offering type 5">Offering type 5</option>
<option id="7" value="Offering type 6">Offering type 6</option>
<option id="8" value="Offering type 7">Offering type 7</option>
<option id="9" value="Offering type 8">Offering type 8</option>
<option id="10" value="Offering type 9">Offering type 9</option>
</select>
<div class="btn-group" role="group">
<button id="id-offering-type-add-button" name="offering-type-add-button" class="btn btn-default" type="button">추가</button>
<button id="id-offering-type-delete-button" name="offering-type-delete-button" class="btn btn-default" type="button">삭제</button>
</div>
<div class="input-group">
<input id="id-offering-type-name" name="offering-type-name" type="text" class="form-control" maxlength="20" />
<span class="input-group-btn">
<button id="id-offering-type-save-button" name="offering-type-save-button" class="btn btn-primary" type="button">Save</button>
</span>
</div>
<input name="form-type" type="hidden" value="offering-type" />
<input name="action-type" type="hidden" value="" id="id-offering-type-action-type"/>
<input name="pk" type="hidden" value="" id="id-offering-type-pk"/>
</form>
</div>
</div>
</div>
</div><!-- /row -->
</div>
<!-- footer content -->
<footer>
<div class="pull-right">
CMM
</div>
<div class="clearfix"></div>
</footer>
<!-- /footer content -->
</div>
</div>
<!-- jQuery -->
<script src="/assets/vendors/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="/assets/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Parsley -->
<script src="/assets/vendors/parsleyjs/dist/parsley.min.js"></script>
<!-- jquery-placeholder -->
<script src="/assets/vendors/jquery-placeholder/jquery.placeholder.min.js"></script>
<!-- iCheck -->
<script src="/assets/vendors/iCheck/icheck.min.js"></script>
<!-- Bootstrap-select -->
<script src="/assets/vendors/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<!-- bootstrap-daterangepicker -->
<script src="/assets/vendors/moment/min/moment.min.js"></script>
<script src="/assets/vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- postcodify -->
<script src="/assets/vendors/search.min/index.js"></script>
<!-- custom js -->
<script src="/assets/build/js/smartresize.min.js"></script>
<script src="/assets/build/js/custom.min.js"></script>
<script src="/assets/build/js/common.min.js"></script>
<!-- common javascript -->
<script></script>
<!-- /common javascript -->
<script src="/assets/vendors/pnotify/dist/pnotify.js"></script>
<script src="/assets/vendors/pnotify/dist/pnotify.buttons.js"></script>
<script src="/assets/vendors/pnotify/dist/pnotify.nonblock.js"></script>
<script type="text/javascript">
let globalChristianClassId = null;
let globalChristianLevelId = null;
let globalChristianDutyId = null;
let globalOfferingServiceId = null;
let globalOfferingTypeId = null;
(function($) {
'use strict';
// define elements
let christianClassForm = $('#id-christian-class-form');
let christianClassSelect = $('#id-christian-class-select');
let christianClassName = $('#id-christian-class-name');
let christianClassSaveButton = $('#id-christian-class-save-button');
let christianClassAddButton = $('#id-christian-class-add-button');
let christianClassDeleteButton = $('#id-christian-class-delete-button');
let christianClassActionType = $('#id-christian-class-action-type');
let christianClassPK = $('#id-christian-class-pk');
let christianLevelForm = $('#id-christian-level-form');
let christianLevelSelect = $('#id-christian-level-select');
let christianLevelName = $('#id-christian-level-name');
let christianLevelSaveButton = $('#id-christian-level-save-button');
let christianLevelAddButton = $('#id-christian-level-add-button');
let christianLevelDeleteButton = $('#id-christian-level-delete-button');
let christianLevelActionType = $('#id-christian-level-action-type');
let christianLevelPK = $('#id-christian-level-pk');
let christianDutyForm = $('#id-christian-duty-form');
let christianDutySelect = $('#id-christian-duty-select');
let christianDutyName = $('#id-christian-duty-name');
let christianDutySaveButton = $('#id-christian-duty-save-button');
let christianDutyAddButton = $('#id-christian-duty-add-button');
let christianDutyDeleteButton = $('#id-christian-duty-delete-button');
let christianDutyActionType = $('#id-christian-duty-action-type');
let christianDutyPK = $('#id-christian-duty-pk');
let offeringServiceForm = $('#id-offering-service-form');
let offeringServiceSelect = $('#id-offering-service-select');
let offeringServiceName = $('#id-offering-service-name');
let offeringServiceSaveButton = $('#id-offering-service-save-button');
let offeringServiceAddButton = $('#id-offering-service-add-button');
let offeringServiceDeleteButton = $('#id-offering-service-delete-button');
let offeringServiceActionType = $('#id-offering-service-action-type');
let offeringServicePK = $('#id-offering-service-pk');
let offeringTypeForm = $('#id-offering-type-form');
let offeringTypeSelect = $('#id-offering-type-select');
let offeringTypeName = $('#id-offering-type-name');
let offeringTypeSaveButton = $('#id-offering-type-save-button');
let offeringTypeAddButton = $('#id-offering-type-add-button');
let offeringTypeDeleteButton = $('#id-offering-type-delete-button');
let offeringTypeActionType = $('#id-offering-type-action-type');
let offeringTypePK = $('#id-offering-type-pk');
// trigger christian class select change
christianClassSelect.on('change', function() {
const selectedChristianClass = $(this).children(':selected');
globalChristianClassId = selectedChristianClass.attr('id');
christianClassName.val(selectedChristianClass.val());
});
// trigger christian level select change
christianLevelSelect.on('change', function() {
const selectedChristianLevel = $(this).children(':selected');
globalChristianLevelId = selectedChristianLevel.attr('id');
christianLevelName.val(selectedChristianLevel.val());
});
// trigger christian duty select change
christianDutySelect.on('change', function() {
const selectedChristianDuty = $(this).children(':selected');
globalChristianDutyId = selectedChristianDuty.attr('id');
christianDutyName.val(selectedChristianDuty.val());
});
// trigger offering service select change
offeringServiceSelect.on('change', function() {
const selectedOfferingService = $(this).children(':selected');
globalOfferingServiceId = selectedOfferingService.attr('id');
offeringServiceName.val(selectedOfferingService.val());
});
// trigger offering type select change
offeringTypeSelect.on('change', function() {
const selectedOfferingType = $(this).children(':selected');
globalOfferingTypeId = selectedOfferingType.attr('id');
offeringTypeName.val(selectedOfferingType.val());
});
// trigger christian class add button click
christianClassAddButton.on('click', function() {
christianClassName.val('');
christianClassName.focus();
christianClassSelect.val([]);
});
// trigger christian level add button click
christianLevelAddButton.on('click', function() {
christianLevelName.val('');
christianLevelName.focus();
christianLevelSelect.val([]);
});
// trigger christian duty add button click
christianDutyAddButton.on('click', function() {
christianDutyName.val('');
christianDutyName.focus();
christianDutySelect.val([]);
});
// trigger offering service add button click
offeringServiceAddButton.on('click', function() {
offeringServiceName.val('');
offeringServiceName.focus();
offeringServiceSelect.val([]);
});
// trigger offering type add button click
offeringTypeAddButton.on('click', function() {
offeringTypeName.val('');
offeringTypeName.focus();
offeringTypeSelect.val([]);
});
// trigger christian class delete button click
christianClassDeleteButton.on('click', function() {
const isChristianClassSelected = christianClassSelect.val() !== null;
if(!isChristianClassSelected) {
new PNotify({
title: '삭제',
text: 'No data to delete!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
christianClassSelect.focus();
return null;
}
const christianClassId = christianClassSelect.children(':selected').attr('id');
christianClassActionType.val("delete");
christianClassPK.val(globalChristianClassId);
let data = christianClassForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianClassForm.serialize(),
}).done(function(resp) {
reloadChristianClasses();
new PNotify({
title: '삭제',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
});
// trigger christian level delete button click
christianLevelDeleteButton.on('click', function() {
const isChristianLevelSelected = christianLevelSelect.val() !== null;
if(!isChristianLevelSelected) {
new PNotify({
title: '삭제',
text: 'No data to delete!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
christianLevelSelect.focus();
return null;
}
const christianLevelId = christianLevelSelect.children(':selected').attr('id');
christianLevelActionType.val("delete");
christianLevelPK.val(globalChristianLevelId);
let data = christianLevelForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianLevelForm.serialize(),
}).done(function(resp) {
reloadChristianLevels();
new PNotify({
title: '삭제',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
});
// trigger christian duty delete button click
christianDutyDeleteButton.on('click', function() {
const isChristianDutySelected = christianDutySelect.val() !== null;
if(!isChristianDutySelected) {
new PNotify({
title: '삭제',
text: 'No data to delete!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
christianDutySelect.focus();
return null;
}
const christianDutyId = christianDutySelect.children(':selected').attr('id');
christianDutyActionType.val("delete");
christianDutyPK.val(globalChristianDutyId);
let data = christianDutyForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianDutyForm.serialize(),
}).done(function(resp) {
reloadChristianDuties();
new PNotify({
title: '삭제',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
});
// trigger offering service delete button click
offeringServiceDeleteButton.on('click', function() {
const isOfferingServiceSelected = offeringServiceSelect.val() !== null;
if(!isOfferingServiceSelected) {
new PNotify({
title: '삭제',
text: 'No data to delete!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
offeringServiceSelect.focus();
return null;
}
const offeringServiceId = offeringServiceSelect.children(':selected').attr('id');
offeringServiceActionType.val("delete");
offeringServicePK.val(globalOfferingServiceId);
let data = offeringServiceForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: offeringServiceForm.serialize(),
}).done(function(resp) {
reloadOfferingServices();
new PNotify({
title: '삭제',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
});
// trigger offering type delete button click
offeringTypeDeleteButton.on('click', function() {
const isOfferingTypeSelected = offeringTypeSelect.val() !== null;
if(!isOfferingTypeSelected) {
new PNotify({
title: '삭제',
text: 'No data to delete!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
offeringTypeSelect.focus();
return null;
}
const offeringTypeId = offeringTypeSelect.children(':selected').attr('id');
offeringTypeActionType.val("delete");
offeringTypePK.val(globalOfferingTypeId);
let data = offeringTypeForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: offeringTypeForm.serialize(),
}).done(function(resp) {
reloadOfferingTypes();
new PNotify({
title: '삭제',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
});
// trigger christian class save button click
christianClassSaveButton.on('click', function() {
const isChristianClassNameEmpty = christianClassName.val().length === 0;
const isChristianClassSelected = christianClassSelect.val() !== null;
if (isChristianClassNameEmpty) {
new PNotify({
title: 'Save',
text: 'No data to save!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
christianClassName.val('');
christianClassName.focus();
return null;
}
const isNameSame = christianClassSelect.val() == christianClassName.val();
if (isNameSame) { return null; }
const isNameNew = !isChristianClassSelected;
// if new name
if (isNameNew) {
christianClassActionType.val("create");
let data = christianClassForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianClassForm.serialize(),
}).done(function(resp) {
reloadChristianClasses();
new PNotify({
title: 'Create',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
} else {
christianClassActionType.val("update");
christianClassPK.val(globalChristianClassId);
let data = christianClassForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianClassForm.serialize(),
}).done(function(resp) {
reloadChristianClasses();
new PNotify({
title: 'Update',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
}
});
// trigger christian level save button click
christianLevelSaveButton.on('click', function() {
const isChristianLevelNameEmpty = christianLevelName.val().length === 0;
const isChristianLevelSelected = christianLevelSelect.val() !== null;
if (isChristianLevelNameEmpty) {
new PNotify({
title: 'Save',
text: 'No data to save!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
christianLevelName.val('');
christianLevelName.focus();
return null;
}
const isNameSame = christianLevelSelect.val() == christianLevelName.val();
if (isNameSame) { return null; }
const isNameNew = !isChristianLevelSelected;
// if new name
if (isNameNew) {
christianLevelActionType.val("create");
let data = christianLevelForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianLevelForm.serialize(),
}).done(function(resp) {
reloadChristianLevels();
new PNotify({
title: 'Create',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
} else {
christianLevelActionType.val("update");
christianLevelPK.val(globalChristianLevelId);
let data = christianLevelForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianLevelForm.serialize(),
}).done(function(resp) {
reloadChristianLevels();
new PNotify({
title: 'Update',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
}
});
// trigger christian duty save button click
christianDutySaveButton.on('click', function() {
const isChristianDutyNameEmpty = christianDutyName.val().length === 0;
const isChristianDutySelected = christianDutySelect.val() !== null;
if (isChristianDutyNameEmpty) {
new PNotify({
title: 'Save',
text: 'No data to save!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
christianDutyName.val('');
christianDutyName.focus();
return null;
}
const isNameSame = christianDutySelect.val() == christianDutyName.val();
if (isNameSame) { return null; }
const isNameNew = !isChristianDutySelected;
// if new name
if (isNameNew) {
christianDutyActionType.val("create");
let data = christianDutyForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianDutyForm.serialize(),
}).done(function(resp) {
reloadChristianDuties();
new PNotify({
title: 'Create',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
} else {
christianDutyActionType.val("update");
christianDutyPK.val(globalChristianDutyId);
let data = christianDutyForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: christianDutyForm.serialize(),
}).done(function(resp) {
reloadChristianDuties();
new PNotify({
title: 'Update',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
}
});
// trigger offering service save button click
offeringServiceSaveButton.on('click', function() {
const isOfferingServiceNameEmpty = offeringServiceName.val().length === 0;
const isOfferingServiceSelected = offeringServiceSelect.val() !== null;
if (isOfferingServiceNameEmpty) {
new PNotify({
title: 'Save',
text: 'No data to save!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
offeringServiceName.val('');
offeringServiceName.focus();
return null;
}
const isNameSame = offeringServiceSelect.val() == offeringServiceName.val();
if (isNameSame) { return null; }
const isNameNew = !isOfferingServiceSelected;
// if new name
if (isNameNew) {
offeringServiceActionType.val("create");
let data = offeringServiceForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: offeringServiceForm.serialize(),
}).done(function(resp) {
reloadOfferingServices();
new PNotify({
title: 'Create',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
} else {
offeringServiceActionType.val("update");
offeringServicePK.val(globalOfferingServiceId);
let data = offeringServiceForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: offeringServiceForm.serialize(),
}).done(function(resp) {
reloadOfferingServices();
new PNotify({
title: 'Update',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
}
});
// trigger offering type save button click
offeringTypeSaveButton.on('click', function() {
const isOfferingTypeNameEmpty = offeringTypeName.val().length === 0;
const isOfferingTypeSelected = offeringTypeSelect.val() !== null;
if (isOfferingTypeNameEmpty) {
new PNotify({
title: 'Save',
text: 'No data to save!',
type: 'warning',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
offeringTypeName.val('');
offeringTypeName.focus();
return null;
}
const isNameSame = offeringTypeSelect.val() == offeringTypeName.val();
if (isNameSame) { return null; }
const isNameNew = !isOfferingTypeSelected;
// if new name
if (isNameNew) {
offeringTypeActionType.val("create");
let data = offeringTypeForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: offeringTypeForm.serialize(),
}).done(function(resp) {
reloadOfferingTypes();
new PNotify({
title: 'Create',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
} else {
offeringTypeActionType.val("update");
offeringTypePK.val(globalOfferingTypeId);
let data = offeringTypeForm.serialize();
$.ajaxSetup({
data: { csrfmiddlewaretoken: 'dAeWrSLgqArJO7WlYzIM4xDFY5JUph8izGynBJfRaydwlQa36NzSh1cyOI2Wr45m' }
});
$.ajax({
method: 'POST',
url: '/workspace/config/christian/',
data: offeringTypeForm.serialize(),
}).done(function(resp) {
reloadOfferingTypes();
new PNotify({
title: 'Update',
text: resp.message,
type: 'success',
styling: 'bootstrap3',
nonblock: {
nonblock: true
}
});
});
}
});
// reload christian class items
function reloadChristianClasses() {
$.ajax({
method: 'GET',
url: '/workspace/config/christian/'
}).done(function(resp) {
christianClassSelect.find('option').remove();
const items = resp.data.christian_class_items;
items.map((item, index) => {
christianClassSelect.append('<option id="' + item.pk + '" value="' + item.name + '">' + item.name + '</option>');
});
christianClassName.val('');
christianClassSelect.focus();
});
}
// reload christian level items
function reloadChristianLevels() {
$.ajax({
method: 'GET',
url: '/workspace/config/christian/'
}).done(function(resp) {
christianLevelSelect.find('option').remove();
const items = resp.data.christian_level_items;
items.map((item, index) => {
christianLevelSelect.append('<option id="' + item.pk + '" value="' + item.name + '">' + item.name + '</option>');
});
christianLevelName.val('');
christianLevelSelect.focus();
});
}
// reload christian duty items
function reloadChristianDuties() {
$.ajax({
method: 'GET',
url: '/workspace/config/christian/'
}).done(function(resp) {
christianDutySelect.find('option').remove();
const items = resp.data.christian_duty_items;
items.map((item, index) => {
christianDutySelect.append('<option id="' + item.pk + '" value="' + item.name + '">' + item.name + '</option>');
});
christianDutyName.val('');
christianDutySelect.focus();
});
}
// reload offering service items
function reloadOfferingServices() {
$.ajax({
method: 'GET',
url: '/workspace/config/christian/'
}).done(function(resp) {
offeringServiceSelect.find('option').remove();
const items = resp.data.offering_service_items;
items.map((item, index) => {
offeringServiceSelect.append('<option id="' + item.pk + '" value="' + item.name + '">' + item.name + '</option>');
});
offeringServiceName.val('');
offeringServiceSelect.focus();
});
}
// reload offering type items
function reloadOfferingTypes() {
$.ajax({
method: 'GET',
url: '/workspace/config/christian/'
}).done(function(resp) {
offeringTypeSelect.find('option').remove();
const items = resp.data.offering_type_items;
items.map((item, index) => {
offeringTypeSelect.append('<option id="' + item.pk + '" value="' + item.name + '">' + item.name + '</option>');
});
offeringTypeName.val('');
offeringTypeSelect.focus();
});
}
})(jQuery);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment