-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountyView.ascx
More file actions
168 lines (165 loc) · 9.09 KB
/
Copy pathCountyView.ascx
File metadata and controls
168 lines (165 loc) · 9.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CountyView.ascx.cs" Inherits="tjc.Modules.jacs.CountyView" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<%@ Register Src="Controls/navbar.ascx" TagPrefix="tb" TagName="navbar" %>
<section class="navbar border-0 mb-0 justify-content-start">
<button class="btn btn-default me-3" id="btnToggleMenu" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="true" aria-label="Toggle navigation">
<i class="fa-solid fa-bars"></i>
</button>
<h2 class="mb-0">Counties</h2>
</section>
<div class="d-flex">
<tb:navbar runat="server" ID="navbar" />
<main class="main flex-grow-1 p-3 pt-0">
<a id="lnkAdd" class="btn btn-primary me-3" tabindex="-1" href="#" data-bs-toggle="modal" data-bs-target="#CountyEditModal"><i class="fa fa-plus" aria-hidden="true"></i> Add County</a>
<table id="tblCounty" class="table table-striped w-100">
<thead>
<tr>
<th></th>
<th></th>
<th>Name</th>
<th>Code</th>
<th>Auth Endpoint URL</th>
<th></th>
</tr>
</thead>
</table>
</main>
</div>
<!-- Detail Modal -->
<div class="modal fade" id="CountyDetailModal" tabindex="-1" aria-labelledby="CountyDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div id="progress_county" class="modal-progress" style="display: none;">
<div class="center-progress">
<img alt="" src="/images/loading.gif" />
</div>
</div>
<div class="modal-header">
<h4 class="modal-title" id="CountyDetailModalLabel">County Details</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<table class="table table-striped m-0 p-0 w-100">
<tbody>
<tr><td><strong>Name:</strong></td><td><span id="countyName"></span></td></tr>
<tr><td><strong>Code:</strong></td><td><span id="countyCode"></span></td></tr>
<tr><td><strong>Auth Endpoint URL:</strong></td><td><span id="countyAuthUrl"></span></td></tr>
<tr><td><strong>User Name:</strong></td><td><span id="countyUserName"></span></td></tr>
<tr><td><strong>Password:</strong></td><td><span id="countyPassword" style="word-break:break-all; white-space:pre-wrap; overflow-wrap:break-word; display:block;"></span></td></tr>
<tr><td><strong>Token:</strong></td><td><span id="countyToken" style="word-break:break-all; white-space:pre-wrap; overflow-wrap:break-word; display:block;"></span></td></tr>
</tbody>
</table>
<input type="hidden" id="hdCountyId" />
</div>
<div class="modal-footer justify-content-around">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" data-bs-toggle="modal" data-bs-target="#CountyEditModal" id="editCountyBtn"><i class="fas fa-edit me-2"></i> Edit</button>
<button type="button" id="cmdDelete" class="btn btn-danger" data-bs-dismiss="modal"><i class="fa fa-trash me-2"></i> Delete</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Edit Modal -->
<div class="modal fade" id="CountyEditModal" tabindex="-1" aria-labelledby="CountyEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div id="edit_progress_county" class="modal-progress" style="display: none;">
<div class="center-progress">
<img alt="" src="/images/loading.gif" />
</div>
</div>
<div class="modal-header">
<h4 class="modal-title" id="CountyEditModalLabel">Edit County</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="container-fluid">
<input type="hidden" id="edit_hdCountyId">
<div class="form-group">
<div class="row">
<div class="col-md-6">
<label>Name<em>*</em></label>
<input type="text" id="edit_countyName" class="form-control" required>
<div class="invalid-feedback">County name is required.</div>
</div>
<div class="col-md-6">
<label>Code<em>*</em></label>
<input type="text" id="edit_countyCode" class="form-control" required>
<div class="invalid-feedback">County code is required.</div>
</div>
</div>
<div class="row mt-3">
<div class="col-md-12">
<label>Auth Endpoint URL</label>
<input type="text" id="edit_countyAuthUrl" class="form-control">
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<label>User Name</label>
<input type="text" id="edit_countyUserName" class="form-control">
</div>
<div class="col-md-6">
<label>Password (leave blank to keep existing)</label>
<input type="password" id="edit_countyPassword" class="form-control">
</div>
</div>
<div class="row mt-3">
<div class="col-md-12">
<label>Token (leave blank to keep existing)</label>
<input type="password" id="edit_countyToken" class="form-control">
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-success" id="edit_cmdSave">
<i class="fas fa-save" aria-hidden="true"></i> Save
</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/tjc.modules/JACS/js/jacs.js" ForceProvider="DnnFormBottomProvider" Priority="100" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/tjc.modules/JACS/js/county.js" ForceProvider="DnnFormBottomProvider" Priority="101" />
<dnn:DnnCssInclude runat="server" FilePath="~/Resources/Libraries/DataTables/dataTables.bootstrap5.min.css" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Libraries/DataTables/datatables.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Libraries/DataTables/dataTables.bootstrap5.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="/Resources/Libraries/sweetalert/sweetalert2.min.js" />
<dnn:DnnCssInclude runat="server" FilePath="/Resources/Libraries/sweetalert/sweetalert2.min.css" />
<dnn:DnnJsInclude runat="server" FilePath="/Resources/Libraries/Noty/noty.min.js" />
<dnn:DnnCssInclude runat="server" FilePath="/Resources/Libraries/Noty/noty.min.css" />
<script>
var moduleId = <%=ModuleId%>;
var service = {
path: "JACS",
framework: $.ServicesFramework(moduleId)
};
(function ($, Sys) {
$(document).ready(function () {
try {
if (typeof CountyController === 'undefined') {
console.error('CountyController is not defined. Check if Script(county.js) loaded correctly.');
return;
}
const countyController = new CountyController({
moduleId: moduleId,
userId: <%=UserId%>,
isAdmin: "<%=IsAdmin%>",
adminRole: "<%=AdminRole%>",
service: service,
currentPage: 0,
pageSize: 25,
recordCount: 0,
sortColumnIndex: 2,
sortDirection: "asc"
});
countyController.init();
} catch (e) {
console.error('Error initializing CountyController:', e);
}
});
}(jQuery, window.Sys));
</script>