@opengis/cms 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +98 -98
  2. package/dist/index-W-qQIppj-DunG40EG.js +2452 -0
  3. package/dist/index.html +28 -28
  4. package/dist/index.js +12683 -6702
  5. package/dist/index.umd.cjs +87 -41
  6. package/dist/style.css +1 -0
  7. package/package.json +68 -68
  8. package/plugin.js +76 -76
  9. package/server/app.js +35 -35
  10. package/server/config.js +4 -4
  11. package/server/functions/getDraftKey.js +22 -22
  12. package/server/index.js +22 -22
  13. package/server/migrations/fixes.sql +123 -123
  14. package/server/migrations/site.sql +545 -545
  15. package/server/plugins/adminHook.js +78 -78
  16. package/server/plugins/hook.js +59 -59
  17. package/server/plugins/vite.js +84 -84
  18. package/server/routes/category/controllers/cms.category.delete.js +21 -21
  19. package/server/routes/category/controllers/cms.category.get.js +17 -17
  20. package/server/routes/category/controllers/cms.category.list.js +16 -16
  21. package/server/routes/category/controllers/cms.category.post.js +21 -21
  22. package/server/routes/category/controllers/cms.category.put.js +23 -23
  23. package/server/routes/category/index.mjs +22 -22
  24. package/server/routes/cms/controllers/cmsStat.js +55 -55
  25. package/server/routes/cms/controllers/cmsSuggest.js +57 -57
  26. package/server/routes/cms/controllers/deleteContent.js +114 -114
  27. package/server/routes/cms/controllers/deleteMedia.js +75 -75
  28. package/server/routes/cms/controllers/downloadMedia.js +48 -48
  29. package/server/routes/cms/controllers/getContent.js +110 -110
  30. package/server/routes/cms/controllers/getContentBySlug.js +95 -95
  31. package/server/routes/cms/controllers/getPermissions.js +15 -15
  32. package/server/routes/cms/controllers/insertContent.js +218 -218
  33. package/server/routes/cms/controllers/listMedia.js +93 -93
  34. package/server/routes/cms/controllers/metadataMedia.js +38 -38
  35. package/server/routes/cms/controllers/properties.get.js +53 -53
  36. package/server/routes/cms/controllers/properties.post.js +99 -99
  37. package/server/routes/cms/controllers/searchContent.js +205 -205
  38. package/server/routes/cms/controllers/setPermissions.js +49 -49
  39. package/server/routes/cms/controllers/translate.js +89 -89
  40. package/server/routes/cms/controllers/updateContent.js +238 -238
  41. package/server/routes/cms/controllers/uploadMedia.js +78 -78
  42. package/server/routes/cms/index.mjs +114 -114
  43. package/server/routes/cms/utils/additionalData.js +35 -35
  44. package/server/routes/cms/utils/getCollection.js +81 -81
  45. package/server/routes/cms/utils/getSingle.js +187 -187
  46. package/server/routes/cms/utils/insertContentLocalization.js +86 -86
  47. package/server/routes/cms/utils/requestTranslation.js +85 -85
  48. package/server/routes/cms/utils/updateLocalization.js +47 -47
  49. package/server/routes/cmsSpace/controllers/deleteSpace.js +25 -25
  50. package/server/routes/cmsSpace/controllers/getSpaces.js +27 -27
  51. package/server/routes/cmsSpace/controllers/insertSpace.js +21 -21
  52. package/server/routes/cmsSpace/controllers/updateSpace.js +23 -23
  53. package/server/routes/cmsSpace/index.mjs +20 -20
  54. package/server/routes/contentType/controllers/addContentType.js +162 -162
  55. package/server/routes/contentType/controllers/contentTypeList.js +54 -54
  56. package/server/routes/contentType/controllers/delContentType.js +75 -75
  57. package/server/routes/contentType/controllers/editContentType.js +61 -61
  58. package/server/routes/contentType/controllers/getContentType.js +37 -37
  59. package/server/routes/contentType/index.mjs +35 -35
  60. package/server/routes/contentType/utils/updateContents.js +28 -28
  61. package/server/routes/contentType/utils/updateCustomContentTable.js +55 -55
  62. package/server/routes/feedback/controllers/email.list.js +24 -24
  63. package/server/routes/feedback/controllers/feedback.js +48 -48
  64. package/server/routes/feedback/controllers/feedback.list.js +37 -37
  65. package/server/routes/feedback/controllers/news.subscriptions.js +44 -44
  66. package/server/routes/feedback/index.mjs +71 -71
  67. package/server/routes/logs/controllers/export.user.logs.js +77 -77
  68. package/server/routes/logs/controllers/user.logs.js +44 -44
  69. package/server/routes/logs/index.mjs +9 -9
  70. package/server/routes/menu/controllers/addMenu.js +37 -37
  71. package/server/routes/menu/controllers/delMenu.js +31 -31
  72. package/server/routes/menu/controllers/editMenu.js +41 -41
  73. package/server/routes/menu/controllers/getMenu.js +42 -42
  74. package/server/routes/menu/index.mjs +13 -13
  75. package/server/routes/migration/controllers/collectionToCustom.js +137 -137
  76. package/server/routes/migration/index.mjs +8 -8
  77. package/server/routes/root.mjs +8 -8
  78. package/server/routes/tags/controllers/add.tags.js +24 -24
  79. package/server/routes/tags/controllers/del.tags.js +19 -19
  80. package/server/routes/tags/controllers/edit.tags.js +25 -25
  81. package/server/routes/tags/controllers/get.tags.js +15 -15
  82. package/server/routes/tags/index.mjs +14 -14
  83. package/server/templates/cls/cms.category_type.json +9 -9
  84. package/server/templates/cls/cms.content_review_status.json +9 -9
  85. package/server/templates/cls/cms.content_status.json +9 -9
  86. package/server/templates/cls/cms.content_type.json +9 -9
  87. package/server/templates/cls/cms.lang.json +9 -9
  88. package/server/templates/page/login.html +126 -126
  89. package/server/templates/select/core.user_mentioned.sql +1 -1
  90. package/dist/index-W-qQIppj-DRzFSjU1.js +0 -2452
@@ -1,26 +1,26 @@
1
- import { dataUpdate } from "@opengis/fastify-table/utils.js";
2
-
3
- export default async function editTags({ pg, body, user, params }, reply) {
4
- const { uid } = user || {};
5
-
6
- if (!uid) {
7
- return reply.code(401).send({ message: 'access restricted', status: 401 });
8
- }
9
-
10
- if (!params?.id) {
11
- return reply.code(400).send({ message: 'id is required!', status: 400 });
12
- }
13
- if (!body) {
14
- return reply.code(400).send({ message: 'body is empty!', status: 400 });
15
- }
16
-
17
- await dataUpdate({
18
- pg,
19
- id: params.id,
20
- table: 'site.tags',
21
- data: body,
22
- uid,
23
- });
24
-
25
- return reply.code(200).send({ message: 'Tag updated successfully', status: 200 });
1
+ import { dataUpdate } from "@opengis/fastify-table/utils.js";
2
+
3
+ export default async function editTags({ pg, body, user, params }, reply) {
4
+ const { uid } = user || {};
5
+
6
+ if (!uid) {
7
+ return reply.code(401).send({ message: 'access restricted', status: 401 });
8
+ }
9
+
10
+ if (!params?.id) {
11
+ return reply.code(400).send({ message: 'id is required!', status: 400 });
12
+ }
13
+ if (!body) {
14
+ return reply.code(400).send({ message: 'body is empty!', status: 400 });
15
+ }
16
+
17
+ await dataUpdate({
18
+ pg,
19
+ id: params.id,
20
+ table: 'site.tags',
21
+ data: body,
22
+ uid,
23
+ });
24
+
25
+ return reply.code(200).send({ message: 'Tag updated successfully', status: 200 });
26
26
  }
@@ -1,16 +1,16 @@
1
- export default async function getTags(req, reply) {
2
- const { pg, query } = req;
3
- const { page = 1, limit = 16, search } = query;
4
- const offset = limit * (page - 1) || 0;
5
-
6
- const { total, filtered } = await pg.one(`select count(*)::int as total, (count(*) filter (where 1=1 ${search ? `and value ilike'%${search}%'` : ''}))::int as filtered from site.tags`);
7
-
8
- const selectSql = `select *,(select count(*)::int as count_data from site.tag_data where tag_id=a.tag_id) from site.tags a
9
- where 1=1 ${search ? `and value ilike'%${search}%'` : ''}
10
- order by created_at desc limit ${limit} offset ${offset}`;
11
-
12
- const { rows } = await pg.query(selectSql);
13
-
14
- return reply.code(200).send({ message: { total, filtered, rows }, status: 200 })
15
-
1
+ export default async function getTags(req, reply) {
2
+ const { pg, query } = req;
3
+ const { page = 1, limit = 16, search } = query;
4
+ const offset = limit * (page - 1) || 0;
5
+
6
+ const { total, filtered } = await pg.one(`select count(*)::int as total, (count(*) filter (where 1=1 ${search ? `and value ilike'%${search}%'` : ''}))::int as filtered from site.tags`);
7
+
8
+ const selectSql = `select *,(select count(*)::int as count_data from site.tag_data where tag_id=a.tag_id) from site.tags a
9
+ where 1=1 ${search ? `and value ilike'%${search}%'` : ''}
10
+ order by created_at desc limit ${limit} offset ${offset}`;
11
+
12
+ const { rows } = await pg.query(selectSql);
13
+
14
+ return reply.code(200).send({ message: { total, filtered, rows }, status: 200 })
15
+
16
16
  }
@@ -1,14 +1,14 @@
1
- import getTags from './controllers/get.tags.js';
2
- import addTags from './controllers/add.tags.js';
3
- import editTags from './controllers/edit.tags.js';
4
- import delTags from './controllers/del.tags.js';
5
-
6
- const policyPublic = { config: { policy: ['public'] } };
7
-
8
- export default async function route(app) {
9
- app.get('/tags', policyPublic, getTags);
10
- app.post('/tags', policyPublic, addTags);
11
- app.put('/tags/:id', policyPublic, editTags);
12
- app.delete('/tags/:id', policyPublic, delTags);
13
-
14
- }
1
+ import getTags from './controllers/get.tags.js';
2
+ import addTags from './controllers/add.tags.js';
3
+ import editTags from './controllers/edit.tags.js';
4
+ import delTags from './controllers/del.tags.js';
5
+
6
+ const policyPublic = { config: { policy: ['public'] } };
7
+
8
+ export default async function route(app) {
9
+ app.get('/tags', policyPublic, getTags);
10
+ app.post('/tags', policyPublic, addTags);
11
+ app.put('/tags/:id', policyPublic, editTags);
12
+ app.delete('/tags/:id', policyPublic, delTags);
13
+
14
+ }
@@ -1,10 +1,10 @@
1
- [
2
- {
3
- "id": "1",
4
- "text": "Important"
5
- },
6
- {
7
- "id": "2",
8
- "text": "Common"
9
- }
1
+ [
2
+ {
3
+ "id": "1",
4
+ "text": "Important"
5
+ },
6
+ {
7
+ "id": "2",
8
+ "text": "Common"
9
+ }
10
10
  ]
@@ -1,10 +1,10 @@
1
- [
2
- {
3
- "id": "1",
4
- "text": "Pending"
5
- },
6
- {
7
- "id": "2",
8
- "text": "Approved"
9
- }
1
+ [
2
+ {
3
+ "id": "1",
4
+ "text": "Pending"
5
+ },
6
+ {
7
+ "id": "2",
8
+ "text": "Approved"
9
+ }
10
10
  ]
@@ -1,10 +1,10 @@
1
- [
2
- {
3
- "id": "1",
4
- "text": "Draft"
5
- },
6
- {
7
- "id": "2",
8
- "text": "Publish"
9
- }
1
+ [
2
+ {
3
+ "id": "1",
4
+ "text": "Draft"
5
+ },
6
+ {
7
+ "id": "2",
8
+ "text": "Publish"
9
+ }
10
10
  ]
@@ -1,10 +1,10 @@
1
- [
2
- {
3
- "id": "1",
4
- "text": "Single"
5
- },
6
- {
7
- "id": "2",
8
- "text": "Collection"
9
- }
1
+ [
2
+ {
3
+ "id": "1",
4
+ "text": "Single"
5
+ },
6
+ {
7
+ "id": "2",
8
+ "text": "Collection"
9
+ }
10
10
  ]
@@ -1,10 +1,10 @@
1
- [
2
- {
3
- "id": "uk",
4
- "text": "Українська"
5
- },
6
- {
7
- "id": "en",
8
- "text": "English"
9
- }
1
+ [
2
+ {
3
+ "id": "uk",
4
+ "text": "Українська"
5
+ },
6
+ {
7
+ "id": "en",
8
+ "text": "English"
9
+ }
10
10
  ]
@@ -1,127 +1,127 @@
1
- <!DOCTYPE html>
2
- <html lang="en" dir="">
3
-
4
- <head>
5
- <!-- scripts -->
6
- <script src="https://cdn.tailwindcss.com"></script>
7
- <script src="/src/assets/tailwind-3.4.17.js"></script>
8
- <!-- <script src="https://cdn.softpro.ua/assets/js/tailwind-3.4.17.js"></script> -->
9
- </head>
10
-
11
- <body class="bg-[#f3f4f6] flex items-center flex-1 w-full h-[100vh] overflow-x-hidden min-h-full ">
12
- <main class="w-full">
13
- <div class="flex w-full max-w-sm mx-auto overflow-hidden bg-white rounded-lg shadow-lg dark:bg-gray-800 lg:max-w-4xl">
14
- <div id="background-image" class="hidden bg-cover lg:block lg:w-1/2 bg-center" style="background-image: url('https://nipo.gov.ua/wp-content/uploads/2023/02/Pro_nas_2301-768x512.jpg');"></div>
15
-
16
- <div class="w-full px-6 py-8 md:px-8 lg:w-1/2">
17
- <div class="flex justify-center mx-auto">
18
- <img class="w-auto h-7 sm:h-16" id="logo-cms" src="https://nipo.gov.ua/wp-content/uploads/2023/01/IP_office_logo_UA-1-1.png" alt="logo">
19
- </div>
20
-
21
- <p id="site-name" class="mt-3 mb-[32px] text-xl text-center text-gray-600 dark:text-gray-200">
22
- Український національний офіс інтелектуальної власності та інновацій
23
- </p>
24
-
25
- <form action="/api/login" method="get" >
26
- <div class="mt-4">
27
- <label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="LoggingEmailAddress">Електронна пошта / Логін</label>
28
- <input name="username" id="LoggingEmailAddress" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="text">
29
- </div>
30
-
31
- <div class="mt-4">
32
- <div class="flex justify-between">
33
- <label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="loggingPassword">Пароль</label>
34
- <!-- <a class="text-xs text-gray-500 dark:text-gray-300 hover:underline">Forget Password?</a> -->
35
- </div>
36
-
37
- <input id="loggingPassword" name="password" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="password">
38
- </div>
39
-
40
- <div class="mt-6">
41
- <button type="submit" class="w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
42
- Увійти
43
- </button>
44
-
45
- {{!-- <a href="https://nsdi.gov.ua/auth/redirect"
46
- class="block text-center mt-2 w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
47
- Авторизуватись з
48
- <span class="ml-2 inline-flex items-center bg-white text-gray-900 px-2 py-1 rounded-md">
49
- ID GOV UA
50
- </span>
51
- </a> --}}
52
- {{!--<a
53
- href="https://id.softpro.ua/oauth/authorize?response_type=code&provider=google&client_id=photo-client-123&redirect_uri={{coalesce protocol 'https'}}://{{req.raw.headers.host}}/auth/by_data&scope=profile email"
54
- class="flex items-center justify-center mt-4 text-gray-600 transition-colors duration-300 transform border rounded-lg hover:bg-gray-50">
55
- <div class="px-4 py-2">
56
- <svg class="w-6 h-6" viewBox="0 0 40 40">
57
- <path
58
- d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.045 27.2142 24.3525 30 20 30C14.4775 30 10 25.5225 10 20C10 14.4775 14.4775 9.99999 20 9.99999C22.5492 9.99999 24.8683 10.9617 26.6342 12.5325L31.3483 7.81833C28.3717 5.04416 24.39 3.33333 20 3.33333C10.7958 3.33333 3.33335 10.7958 3.33335 20C3.33335 29.2042 10.7958 36.6667 20 36.6667C29.2042 36.6667 36.6667 29.2042 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
59
- fill="#FFC107"></path>
60
- <path
61
- d="M5.25497 12.2425L10.7308 16.2583C12.2125 12.59 15.8008 9.99999 20 9.99999C22.5491 9.99999 24.8683 10.9617 26.6341 12.5325L31.3483 7.81833C28.3716 5.04416 24.39 3.33333 20 3.33333C13.5983 3.33333 8.04663 6.94749 5.25497 12.2425Z"
62
- fill="#FF3D00"></path>
63
- <path
64
- d="M20 36.6667C24.305 36.6667 28.2167 35.0192 31.1742 32.34L26.0159 27.975C24.3425 29.2425 22.2625 30 20 30C15.665 30 11.9842 27.2359 10.5975 23.3784L5.16254 27.5659C7.92087 32.9634 13.5225 36.6667 20 36.6667Z"
65
- fill="#4CAF50"></path>
66
- <path
67
- d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.7592 25.1975 27.56 26.805 26.0133 27.9758C26.0142 27.975 26.015 27.975 26.0158 27.9742L31.1742 32.3392C30.8092 32.6708 36.6667 28.3333 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
68
- fill="#1976D2"></path>
69
- </svg>
70
- </div>
71
-
72
- <span class="w-5/6 px-4 py-3 font-bold text-center"> Увійти через Google</span>
73
- </a>--}}
74
- </div>
75
-
76
- </form>
77
- </div>
78
- </div>
79
- </main>
80
-
81
- </body>
82
-
83
-
84
- <script>
85
- const error = location.search.includes('wrong_pass')
86
- if (error) {
87
- document.getElementById('login_error').innerHTML = 'Не вірний користувач або пароль';
88
- }
89
-
90
- // Отримання даних з налаштувань
91
- (async function() {
92
- try {
93
- const response = await fetch('/api/settings');
94
- const data = await response.json();
95
- const siteInfo = data?.settings?.site_info || {};
96
-
97
- // Оновлення назви сайту
98
- if (siteInfo.name) {
99
- const nameElement = document.getElementById('site-name');
100
- if (nameElement) {
101
- nameElement.textContent = siteInfo.name;
102
- }
103
- }
104
-
105
- // Оновлення логотипу CMS
106
- if (siteInfo['logo-cms']) {
107
- const logoElement = document.getElementById('logo-cms');
108
- if (logoElement) {
109
- logoElement.src = siteInfo['logo-cms'];
110
- logoElement.alt = siteInfo.name || 'logo';
111
- }
112
- }
113
-
114
- // Оновлення фонового зображення для логіну
115
- if (siteInfo['image-login']) {
116
- const bgElement = document.getElementById('background-image');
117
- if (bgElement) {
118
- bgElement.style.backgroundImage = `url('${siteInfo['image-login']}')`;
119
- }
120
- }
121
- } catch (error) {
122
- console.error('Помилка при завантаженні налаштувань:', error);
123
- }
124
- })();
125
- </script>
126
-
1
+ <!DOCTYPE html>
2
+ <html lang="en" dir="">
3
+
4
+ <head>
5
+ <!-- scripts -->
6
+ <script src="https://cdn.tailwindcss.com"></script>
7
+ <script src="/src/assets/tailwind-3.4.17.js"></script>
8
+ <!-- <script src="https://cdn.softpro.ua/assets/js/tailwind-3.4.17.js"></script> -->
9
+ </head>
10
+
11
+ <body class="bg-[#f3f4f6] flex items-center flex-1 w-full h-[100vh] overflow-x-hidden min-h-full ">
12
+ <main class="w-full">
13
+ <div class="flex w-full max-w-sm mx-auto overflow-hidden bg-white rounded-lg shadow-lg dark:bg-gray-800 lg:max-w-4xl">
14
+ <div id="background-image" class="hidden bg-cover lg:block lg:w-1/2 bg-center" style="background-image: url('https://nipo.gov.ua/wp-content/uploads/2023/02/Pro_nas_2301-768x512.jpg');"></div>
15
+
16
+ <div class="w-full px-6 py-8 md:px-8 lg:w-1/2">
17
+ <div class="flex justify-center mx-auto">
18
+ <img class="w-auto h-7 sm:h-16" id="logo-cms" src="https://nipo.gov.ua/wp-content/uploads/2023/01/IP_office_logo_UA-1-1.png" alt="logo">
19
+ </div>
20
+
21
+ <p id="site-name" class="mt-3 mb-[32px] text-xl text-center text-gray-600 dark:text-gray-200">
22
+ Український національний офіс інтелектуальної власності та інновацій
23
+ </p>
24
+
25
+ <form action="/api/login" method="get" >
26
+ <div class="mt-4">
27
+ <label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="LoggingEmailAddress">Електронна пошта / Логін</label>
28
+ <input name="username" id="LoggingEmailAddress" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="text">
29
+ </div>
30
+
31
+ <div class="mt-4">
32
+ <div class="flex justify-between">
33
+ <label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="loggingPassword">Пароль</label>
34
+ <!-- <a class="text-xs text-gray-500 dark:text-gray-300 hover:underline">Forget Password?</a> -->
35
+ </div>
36
+
37
+ <input id="loggingPassword" name="password" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="password">
38
+ </div>
39
+
40
+ <div class="mt-6">
41
+ <button type="submit" class="w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
42
+ Увійти
43
+ </button>
44
+
45
+ {{!-- <a href="https://nsdi.gov.ua/auth/redirect"
46
+ class="block text-center mt-2 w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
47
+ Авторизуватись з
48
+ <span class="ml-2 inline-flex items-center bg-white text-gray-900 px-2 py-1 rounded-md">
49
+ ID GOV UA
50
+ </span>
51
+ </a> --}}
52
+ {{!--<a
53
+ href="https://id.softpro.ua/oauth/authorize?response_type=code&provider=google&client_id=photo-client-123&redirect_uri={{coalesce protocol 'https'}}://{{req.raw.headers.host}}/auth/by_data&scope=profile email"
54
+ class="flex items-center justify-center mt-4 text-gray-600 transition-colors duration-300 transform border rounded-lg hover:bg-gray-50">
55
+ <div class="px-4 py-2">
56
+ <svg class="w-6 h-6" viewBox="0 0 40 40">
57
+ <path
58
+ d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.045 27.2142 24.3525 30 20 30C14.4775 30 10 25.5225 10 20C10 14.4775 14.4775 9.99999 20 9.99999C22.5492 9.99999 24.8683 10.9617 26.6342 12.5325L31.3483 7.81833C28.3717 5.04416 24.39 3.33333 20 3.33333C10.7958 3.33333 3.33335 10.7958 3.33335 20C3.33335 29.2042 10.7958 36.6667 20 36.6667C29.2042 36.6667 36.6667 29.2042 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
59
+ fill="#FFC107"></path>
60
+ <path
61
+ d="M5.25497 12.2425L10.7308 16.2583C12.2125 12.59 15.8008 9.99999 20 9.99999C22.5491 9.99999 24.8683 10.9617 26.6341 12.5325L31.3483 7.81833C28.3716 5.04416 24.39 3.33333 20 3.33333C13.5983 3.33333 8.04663 6.94749 5.25497 12.2425Z"
62
+ fill="#FF3D00"></path>
63
+ <path
64
+ d="M20 36.6667C24.305 36.6667 28.2167 35.0192 31.1742 32.34L26.0159 27.975C24.3425 29.2425 22.2625 30 20 30C15.665 30 11.9842 27.2359 10.5975 23.3784L5.16254 27.5659C7.92087 32.9634 13.5225 36.6667 20 36.6667Z"
65
+ fill="#4CAF50"></path>
66
+ <path
67
+ d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.7592 25.1975 27.56 26.805 26.0133 27.9758C26.0142 27.975 26.015 27.975 26.0158 27.9742L31.1742 32.3392C30.8092 32.6708 36.6667 28.3333 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
68
+ fill="#1976D2"></path>
69
+ </svg>
70
+ </div>
71
+
72
+ <span class="w-5/6 px-4 py-3 font-bold text-center"> Увійти через Google</span>
73
+ </a>--}}
74
+ </div>
75
+
76
+ </form>
77
+ </div>
78
+ </div>
79
+ </main>
80
+
81
+ </body>
82
+
83
+
84
+ <script>
85
+ const error = location.search.includes('wrong_pass')
86
+ if (error) {
87
+ document.getElementById('login_error').innerHTML = 'Не вірний користувач або пароль';
88
+ }
89
+
90
+ // Отримання даних з налаштувань
91
+ (async function() {
92
+ try {
93
+ const response = await fetch('/api/settings');
94
+ const data = await response.json();
95
+ const siteInfo = data?.settings?.site_info || {};
96
+
97
+ // Оновлення назви сайту
98
+ if (siteInfo.name) {
99
+ const nameElement = document.getElementById('site-name');
100
+ if (nameElement) {
101
+ nameElement.textContent = siteInfo.name;
102
+ }
103
+ }
104
+
105
+ // Оновлення логотипу CMS
106
+ if (siteInfo['logo-cms']) {
107
+ const logoElement = document.getElementById('logo-cms');
108
+ if (logoElement) {
109
+ logoElement.src = siteInfo['logo-cms'];
110
+ logoElement.alt = siteInfo.name || 'logo';
111
+ }
112
+ }
113
+
114
+ // Оновлення фонового зображення для логіну
115
+ if (siteInfo['image-login']) {
116
+ const bgElement = document.getElementById('background-image');
117
+ if (bgElement) {
118
+ bgElement.style.backgroundImage = `url('${siteInfo['image-login']}')`;
119
+ }
120
+ }
121
+ } catch (error) {
122
+ console.error('Помилка при завантаженні налаштувань:', error);
123
+ }
124
+ })();
125
+ </script>
126
+
127
127
  </html>
@@ -1,2 +1,2 @@
1
- select uid, coalesce(sur_name,'')||coalesce(' '||user_name,'') as text, email from admin.users
1
+ select uid, coalesce(sur_name,'')||coalesce(' '||user_name,'') as text, email from admin.users
2
2
  where enabled order by coalesce(sur_name,'')||coalesce(' '||user_name,'')