lakshmivairamani commited on
Commit
b829532
·
verified ·
1 Parent(s): b485bda

Update templates/company_profile.html

Browse files
Files changed (1) hide show
  1. templates/company_profile.html +189 -184
templates/company_profile.html CHANGED
@@ -1,185 +1,190 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Company Profile</title>
8
- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
9
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
10
- <!-- Include AdminLTE CSS -->
11
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
12
- <!-- Include DataTables CSS -->
13
- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
14
- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
15
- <link href="https://cdn.jsdelivr.net/npm/@ttskch/[email protected]/dist/select2-bootstrap4.min.css"
16
- rel="stylesheet" />
17
-
18
- <style>
19
- .container {
20
- margin-top: 10px;
21
- margin-left: 420px;
22
- align-items: center;
23
- max-width: 600px;
24
- padding: 10px;
25
- border: 1px solid #ccc;
26
- border-radius: 5px;
27
- position: relative;
28
- z-index: 1;
29
- }
30
-
31
- .container::before {
32
- content: '';
33
- position: absolute;
34
- top: 50%;
35
- left: 40%;
36
- background: url('..\static\img\redmindlogo3.jpg') no-repeat center center;
37
- background-size: contain;
38
- opacity: 0.1;
39
- width: 100%;
40
- height: 90%;
41
- z-index: -1;
42
- }
43
-
44
- .form-group {
45
- margin-bottom: 5px;
46
- }
47
-
48
- .form-group label {
49
- font-weight: bold;
50
- margin-bottom: 5px;
51
- display: block;
52
- }
53
-
54
- .form-group input .form-group select {
55
- width: 100%;
56
- padding: 10px;
57
- border: 1px solid #ccc;
58
- border-radius: 4px;
59
- text-align: center;
60
- }
61
-
62
- .form-group select.select2-container--bootstrap4 .select2-selection--multiple {
63
- height: auto;
64
- /* Adjust height to fit content */
65
- }
66
-
67
- .btn-primary {
68
- margin-right: 10px;
69
- color: black;
70
- font-size: 16px;
71
- font-weight: bold;
72
- }
73
-
74
- h3 {
75
- text-align: center;
76
- margin-bottom: 10px;
77
- }
78
-
79
- .btn-container {
80
- text-align: center;
81
- margin-top: 10px;
82
- color: white;
83
- }
84
-
85
- footer {
86
- position: absolute;
87
- bottom: 0;
88
- width: 100%;
89
- color: black;
90
- text-align: right;
91
- padding-right: 245px;
92
- padding-top: 0px;
93
- background-color: #f8f9fa;
94
- border: none !important;
95
- }
96
-
97
- #llm_tools {
98
- text-align: center;
99
- font-weight: bold;
100
- }
101
- </style>
102
- </head>
103
-
104
- <body>
105
- {% include 'sidepane.html' %}
106
- <div class="container mt-4">
107
- <h3>Company Profile</h3>
108
- <form id="companyProfileForm" class="needs-validation" novalidate action="/submit_company_profile"
109
- method="post">
110
- <div class="form-group">
111
- <label for="company_name">Company Name <span class="text-danger">*</span></label>
112
- <input type="text" id="company_name" name="company_name" class="form-control" required>
113
- <div class="invalid-feedback">
114
- Please enter the company name.
115
- </div>
116
- </div>
117
- <div class="form-group">
118
- <label for="company_code">Company Code <span class="text-danger">*</span></label>
119
- <input type="text" id="company_code" name="company_code" class="form-control" required>
120
- <div class="invalid-feedback">
121
- Please enter the company code.
122
- </div>
123
- </div>
124
- <div class="form-group">
125
- <label for="domain">Domain/Business <span class="text-danger">*</span></label>
126
- <input type="text" id="domain" name="domain" class="form-control" required>
127
- <div class="invalid-feedback">
128
- Please enter the domain/business.
129
- </div>
130
- </div>
131
- <div class="form-group">
132
- <label for="llm_tools">LLM Tools <span class="text-danger">*</span></label>
133
- <select type='text' id="llm_tools" name="llm_tools" class="form-control" multiple required>
134
- <option value="Database">Database</option>
135
- <option value="Static Documents">Static Documents</option>
136
- <option value="API">API</option>
137
- </select>
138
- <div class="invalid-feedback">
139
- Please select at least one LLM tool.
140
- </div>
141
- </div>
142
- <div class="btn-container">
143
- <button type="submit" class="btn btn-primary">Save</button>
144
- <button type="reset" class="btn btn-primary">Clear</button>
145
- </div>
146
- </form>
147
- </div>
148
-
149
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
150
- <script>
151
- $(document).ready(function () {
152
- // Initialize Select2 for multi-select dropdown
153
- $('#llm_tools').select2({
154
- theme: 'bootstrap4',
155
- placeholder: 'Select',
156
- allowClear: true
157
- });
158
-
159
- $('#companyProfileForm').on('submit', function (event) {
160
- event.preventDefault(); // Prevent default form submission
161
-
162
- // Gather form data
163
- var formData = $(this).serialize();
164
-
165
- $.ajax({
166
- type: "POST",
167
- url: "/submit_company_profile",
168
- data: formData,
169
- success: function (response) {
170
- alert(response.message); // Show success message
171
- setTimeout(function () {
172
- window.location.href = '/company_profile'; // Redirect to the desired page after a delay
173
- }, 2000); // Delay for 2 seconds (2000 milliseconds)
174
- },
175
- error: function (xhr) {
176
- alert("An error occurred: " + xhr.responseJSON.detail); // Show error message
177
- }
178
- });
179
- });
180
- });
181
- </script>
182
-
183
- </body>
184
-
 
 
 
 
 
185
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Company Profile</title>
8
+ <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
10
+ <!-- Include AdminLTE CSS -->
11
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
12
+ <!-- Include DataTables CSS -->
13
+ <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
14
+ <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
15
+ <link href="https://cdn.jsdelivr.net/npm/@ttskch/[email protected]/dist/select2-bootstrap4.min.css"
16
+ rel="stylesheet" />
17
+
18
+ <style>
19
+ .container {
20
+ margin-top: 10px;
21
+ margin-left: 420px;
22
+ align-items: center;
23
+ max-width: 600px;
24
+ padding: 10px;
25
+ border: 1px solid #ccc;
26
+ border-radius: 5px;
27
+ position: relative;
28
+ z-index: 1;
29
+ }
30
+
31
+ .container::before {
32
+ content: '';
33
+ position: absolute;
34
+ top: 50%;
35
+ left: 40%;
36
+ background: url('..\static\img\redmindlogo3.jpg') no-repeat center center;
37
+ background-size: contain;
38
+ opacity: 0.1;
39
+ width: 100%;
40
+ height: 90%;
41
+ z-index: -1;
42
+ }
43
+
44
+ .form-group {
45
+ margin-bottom: 5px;
46
+ }
47
+
48
+ .form-group label {
49
+ font-weight: bold;
50
+ margin-bottom: 5px;
51
+ display: block;
52
+ }
53
+
54
+ .form-group input .form-group select {
55
+ width: 100%;
56
+ padding: 10px;
57
+ border: 1px solid #ccc;
58
+ border-radius: 4px;
59
+ text-align: center;
60
+ }
61
+
62
+ .form-group select.select2-container--bootstrap4 .select2-selection--multiple {
63
+ height: auto;
64
+ /* Adjust height to fit content */
65
+ }
66
+
67
+ .btn-primary {
68
+ margin-right: 10px;
69
+ color: black;
70
+ font-size: 16px;
71
+ font-weight: bold;
72
+ }
73
+
74
+ h3 {
75
+ text-align: center;
76
+ margin-bottom: 10px;
77
+ }
78
+
79
+ .btn-container {
80
+ text-align: center;
81
+ margin-top: 10px;
82
+ color: white;
83
+ }
84
+
85
+ footer {
86
+ position: absolute;
87
+ bottom: 0;
88
+ width: 100%;
89
+ color: black;
90
+ text-align: right;
91
+ padding-right: 245px;
92
+ padding-top: 0px;
93
+ background-color: #f8f9fa;
94
+ border: none !important;
95
+ }
96
+
97
+ #llm_tools {
98
+ text-align: center;
99
+ font-weight: bold;
100
+ }
101
+ </style>
102
+ </head>
103
+
104
+ <body>
105
+ {% include 'sidepane.html' %}
106
+ <div class="container mt-4">
107
+ <h3>Company Profile</h3>
108
+ <form id="companyProfileForm" class="needs-validation" novalidate action="/submit_company_profile"
109
+ method="post">
110
+ <div class="form-group">
111
+ <label for="company_name">Company Name <span class="text-danger">*</span></label>
112
+ <input type="text" id="company_name" name="company_name" class="form-control" required>
113
+ <div class="invalid-feedback">
114
+ Please enter the company name.
115
+ </div>
116
+ </div>
117
+ <div class="form-group">
118
+ <label for="company_code">Company Code <span class="text-danger">*</span></label>
119
+ <input type="text" id="company_code" name="company_code" class="form-control" required>
120
+ <div class="invalid-feedback">
121
+ Please enter the company code.
122
+ </div>
123
+ </div>
124
+ <div class="form-group">
125
+ <label for="domain">Domain/Business <span class="text-danger">*</span></label>
126
+ <input type="text" id="domain" name="domain" class="form-control" required>
127
+ <div class="invalid-feedback">
128
+ Please enter the domain/business.
129
+ </div>
130
+ </div>
131
+ <div class="form-group">
132
+ <label for="llm_tools">LLM Tools <span class="text-danger">*</span></label>
133
+ <select type='text' id="llm_tools" name="llm_tools" class="form-control" multiple required>
134
+ <option value="Database">Database</option>
135
+ <option value="Static Documents">Static Documents</option>
136
+ <option value="API">API</option>
137
+ </select>
138
+ <div class="invalid-feedback">
139
+ Please select at least one LLM tool.
140
+ </div>
141
+ </div>
142
+ <div class="btn-container">
143
+ <button type="submit" class="btn btn-primary">Save</button>
144
+ <button type="reset" class="btn btn-primary">Clear</button>
145
+ </div>
146
+ </form>
147
+ </div>
148
+
149
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
150
+ <script>
151
+ $(document).ready(function () {
152
+ // Initialize Select2 for multi-select dropdown
153
+ $('#llm_tools').select2({
154
+ theme: 'bootstrap4',
155
+ placeholder: 'Select',
156
+ allowClear: true
157
+ });
158
+
159
+ $('#companyProfileForm').on('submit', function (event) {
160
+ event.preventDefault(); // Prevent default form submission
161
+
162
+ // Gather form data
163
+ var formData = $(this).serialize();
164
+
165
+ $.ajax({
166
+ type: "POST",
167
+ url: "/submit_company_profile",
168
+ data: formData,
169
+ success: function (response) {
170
+ // Show success message
171
+ alert('Data saved successfully');
172
+ // Reset the form values
173
+ $('#companyProfileForm')[0].reset();
174
+ // Reset Select2 fields
175
+ $('#llm_tools').val(null).trigger('change');
176
+ setTimeout(function () {
177
+ window.location.href = '/company_profile'; // Redirect to the desired page after a delay
178
+ }, 2000); // Delay for 2 seconds (2000 milliseconds)
179
+ },
180
+ error: function (xhr) {
181
+ alert("An error occurred: " + xhr.responseJSON.detail); // Show error message
182
+ }
183
+ });
184
+ });
185
+ });
186
+ </script>
187
+
188
+ </body>
189
+
190
  </html>