summaryrefslogtreecommitdiff
path: root/public/app/views
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-06-12 01:12:30 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-06-12 01:12:30 +0300
commit5375e22de976b74f5f04d800014c30d9c66f0fe5 (patch)
tree3f9d79b898c4bbb392c2a4ec5ec65c0fde5c6f01 /public/app/views
parent0b0076b2ece062f248b7c048d6bb28abbe9174a5 (diff)
downloadgyraf1gov-5375e22de976b74f5f04d800014c30d9c66f0fe5.tar.gz
gyraf1gov-5375e22de976b74f5f04d800014c30d9c66f0fe5.tar.bz2
gyraf1gov-5375e22de976b74f5f04d800014c30d9c66f0fe5.zip
official Reliese Candidate; themes added; routes organized; fine tuning
Diffstat (limited to 'public/app/views')
-rw-r--r--public/app/views/components/header_includes.php8
-rw-r--r--public/app/views/components/menu.php1
-rw-r--r--public/app/views/components/theme.php89
-rw-r--r--public/app/views/js/credits.php26
-rw-r--r--public/app/views/js/submit/application-form.php2
-rw-r--r--public/app/views/templates/admin_users.php134
-rw-r--r--public/app/views/templates/application.php2
-rw-r--r--public/app/views/templates/create_pdf.php2
-rw-r--r--public/app/views/templates/invite.php8
-rw-r--r--public/app/views/templates/penalty.php4
-rw-r--r--public/app/views/user/invitation.php4
-rw-r--r--public/app/views/user/login.php6
-rw-r--r--public/app/views/user/update_password.php2
13 files changed, 242 insertions, 46 deletions
diff --git a/public/app/views/components/header_includes.php b/public/app/views/components/header_includes.php
index bd72cb6..c096bd5 100644
--- a/public/app/views/components/header_includes.php
+++ b/public/app/views/components/header_includes.php
@@ -2,6 +2,10 @@
if (!isset($administration)) {
$administration = false;
}
+
+ if (!isset($no_dataTables)) {
+ $no_dataTables = false;
+ }
?>
<!-- FONTS and LIBRARY CSS (self-hosted)
@@ -52,13 +56,15 @@
<script src="<?=SITE_URL?>/assets/js/pdfmake/pdfmake.min.js"></script>
<script src="<?=SITE_URL?>/assets/js/pdfmake/vfs_fonts.js"></script>
+<?php if (!$no_dataTables) : ?>
<!-- DataTables js -->
<script src="/assets/js/DataTables/datatables.min.js"></script>
+<?php endif; ?>
<!-- select2-4.1.0-rc.0 js -->
<script src="/assets/js/select2-4.1.0-rc0/js/select2.min.js"></script>
-<?php /* DEPRICATED:
+<?php /* DEPRECATED:
<!-- marked -->
<script src="/assets/js/marked/marked.min.js"></script>
*/
diff --git a/public/app/views/components/menu.php b/public/app/views/components/menu.php
index 30ed673..08d459b 100644
--- a/public/app/views/components/menu.php
+++ b/public/app/views/components/menu.php
@@ -21,6 +21,7 @@
<?php if ($is_admin) : ?>
<li class="list-group-item separator">Διαχείριση</li>
<li class="list-group-item"><a href="/admin/petitions">Κατάσταση πρακτικών & αιτήσεων</a></li>
+ <li class="list-group-item"><a href="/admin/users">Διαχείριση Χρηστών</a></li>
<li class="list-group-item"><a href="/admin/invite">Αποστολή προσκλήσεων</a></li>
<?php endif; ?>
diff --git a/public/app/views/components/theme.php b/public/app/views/components/theme.php
index 4e95193..a769dce 100644
--- a/public/app/views/components/theme.php
+++ b/public/app/views/components/theme.php
@@ -1,9 +1,29 @@
<?php
+/** themes
+ * --- -- -- - - -
+ * auto select one id of L = array.LENGTH, per month:
+ * ( ( (month*31 + day) % L*2 ) div 2 )
+ * this will allow theme exchange every 2 days
+ *
+ *
+ * 4-day rollup:
+ * --- -- -- - - -
+ * supports up to 21 themes/season
+ * = 84 themes/year
+ *
+ * algo:
+ * ( ( ( month*31 + day) % L*4 ) div 4 )
+ * change seasonal theme every 4 days
+ * ... Catch Exceptions:
+ * if (month == 12) : month = 0
+ * if (month == 6 && day == 1) then day = 2
+ *
+ */
-// decide a theme according to month
-$month = idate('m');
+// decide a theme season according to month
+$mo = intval(date('m'));
-switch ($month) {
+switch ($mo) {
case 12: case 1: case 2:
$season = 'winter';
break;
@@ -25,27 +45,6 @@ switch ($month) {
}
-/** themes
- * --- -- -- - - -
- * auto select one id of L = array.LENGTH, per month:
- * ( ( (month*31 + day) % L*2 ) div 2 )
- * this will allow theme exchange every 2 days
- *
- *
- * 4-day rollup:
- * --- -- -- - - -
- * supports up to 21 themes/season
- * = 84 themes/year
- *
- * algo:
- * ( ( ( month*31 + day) % L*4 ) div 4 )
- * change seasonal theme every 4 days
- * ... Catch Exceptions:
- * if (month == 12) : month = 0
- * if (month == 6 && day == 1) then day = 2
- *
- */
-
$theme_def = [
# --- summer ---
@@ -76,15 +75,40 @@ $theme_def = [
'label' => 'Doc Searls: Amazing Santa Barbara sunset (2014/01)'
],
+ 'f9' => [
+ 'css' => 'fall-09',
+ 'url' => 'https://www.freepik.com/free-photo/flock-birds-flying-during-sunset_13962565.htm',
+ 'label' => 'wirestock: View of a flock of birds flying into a beautiful sky during sunset'
+ ],
+
# --- winter ---
+ 'w3' => [
+ 'css' => 'winter-03',
+ 'url' => 'https://unsplash.com/photos/yzkoleKww6w',
+ 'label' => 'Raimond Klavins: Snow covered mountain under blue sky during daytime, Himalayas'
+ ],
+
+ 'w8' => [
+ 'css' => 'winter-08',
+ 'url' => 'https://www.freepik.com/free-photo/3d-iceberg-blue-sea_3585791.htm',
+ 'label' => 'kjpargeter: 3d iceberg in blue sea'
+ ],
+
'w9' => [
'css' => 'winter-09',
'url' => 'https://www.freepik.com/free-photo/abstract-water-waves-with-ink-dots_5068293.htm',
'label' => 'freepik: Abstract water waves with ink dots'
],
+ 'w10' => [
+ 'css' => 'winter-10',
+ 'url' => 'https://unsplash.com/photos/D1eFDB4CMj0',
+ 'label' => 'Vidar Nordli-Mathisen: Skogsøya, Norway'
+ ],
+
+
# --- spring ---
'g1' => [
@@ -111,21 +135,28 @@ $theme_def = [
$themes = [
- 'summer' => [ 's1', 's5', 'g9', 's2', 'g1' ],
+ 'summer' => [ 's1', 's2', 's5', 'g9', 'g1' ],
- 'fall' => [ 'f8', 's5', 'g4', 's2' ],
+ 'fall' => [ 'f8', 's5', 'g4', 's2', 'f9' ],
- 'winter' => [ 'w9' ],
+ 'winter' => [ 'w3', 'w8', 'w9', 'w10' ],
- 'spring' => [ 'g1', 'g4', 'g9' ]
+ 'spring' => [ 'g1', 'g4', 'w3', 'g9', 'f9' ]
];
+/** check algo in the begining of this file */
+$day = intval(date('d'));
+$themesLen = count($themes[$season]);
+if ($mo == 12) { $mo = 0; }
+if ($mo == 6 && $day == 1) { $day == 2; }
+$imageID = intdiv( ( ( $mo*31 + $day) % $themesLen*4 ), 4 );
-define('THEME', $theme_def[ $themes['summer'][0] ]);
+define('THEME', $theme_def[ $themes[ $season ][ $imageID ] ]);
+// testing: define('THEME', $theme_def[ $themes[ 'winter' ][ 1 ] ]);
?>
<!-- theme overides -->
diff --git a/public/app/views/js/credits.php b/public/app/views/js/credits.php
index ca0f15c..5dd3fe6 100644
--- a/public/app/views/js/credits.php
+++ b/public/app/views/js/credits.php
@@ -5,6 +5,30 @@ ic_div.innerHTML = '<a href="<?=THEME['url']?>" target="_blank" title="Attributi
ic_div.className = 'image-credits';
// append image-credits div to body
-document.querySelector('body').appendChild(ic_div);
+document.querySelector('body').appendChild(ic_div);
+
+// make sure...
+// the user agrees with cookie-policy on his device
+let cookieExp = 3600*24*200; // cookie expiration (200 days)
+if (!cookieExists('operational') || (readCookie('operational') == 'no')) {
+ let confirm_cookies = confirm([
+ 'Ο ιστότοπος χρησιμοποιεί cookies τα οποία έχουν αποκλειστικά λειτουργικό ρόλο.',
+ ' ',
+ 'Ειδικότερα:',
+ '– ένα Session cookie που εγγυάται την ασφάλεια της σύνδεσής σας',
+ '– ένα Http-only cookie που διατηρεί κωδικοποιημένη την κατάσταση της σύνδεσής σας μετά την είσοδό σας στο σύστημα, και',
+ '– ένα cookie που εξετάζει αν έχετε αποδεχθεί τη χρήση αυτών των cookies.',
+ ' ',
+ 'Και τα 3 αυτά cookies είναι Secure, Same-site, Non-Tracking cookies.',
+ ' ',
+ 'Συμφωνείτε με τη διατήρηση αυτών των cookies;'
+ ].join('\n'))
+ if (!confirm_cookies) {
+ window.location.href = 'https://en.wikipedia.org/wiki/HTTP_cookie';
+
+ } else {
+ createCookie('operational', 'yes', cookieExp);
+ }
+}
</script> \ No newline at end of file
diff --git a/public/app/views/js/submit/application-form.php b/public/app/views/js/submit/application-form.php
index 272fbcb..d34b249 100644
--- a/public/app/views/js/submit/application-form.php
+++ b/public/app/views/js/submit/application-form.php
@@ -70,7 +70,7 @@
// bolditalics: 'https://example.com/fonts/fontFile4.ttf'
},
FiraMono: {
- normal: '<?=SITE_URL?>/assets/fonts/FiraMono-Regular.ttf',
+ normal: '<?=SITE_URL?>/assets/fonts/FiraMono-Regular.ttf'
}
}
diff --git a/public/app/views/templates/admin_users.php b/public/app/views/templates/admin_users.php
new file mode 100644
index 0000000..baa2e58
--- /dev/null
+++ b/public/app/views/templates/admin_users.php
@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title><?=SITE_TITLE?> - Control Panel</title>
+
+ <?php // header includes
+ ////////////////////////////////////////////////////////////////////////
+ Render::view('components/header_includes');
+ ?>
+<style>
+:root { /* login-form overides */
+ --form-content-font-size: 1rem;
+ --form-input-height: 34px;
+ --select2-arrow-top: 1px;
+}
+</style>
+</head>
+<body class="office central-form left-menu">
+
+ <div class='container'>
+ <div class='content row'>
+
+ <div class="col-sm-12">
+
+<div class="manage">
+ <!-- title bar -->
+ <div class="title-bar">
+ <div class="row">
+ <h5 class="col-md-10">Διαχείριση Χρηστών</h5>
+ <div class="col-md-2">
+ <a type="button" class="btn btn-sm btn-back2panel pull-right" href="/panel">
+ Επιστροφή
+ </a>
+ </div>
+ </div>
+
+ </div>
+
+
+ <div class="row">
+ <div class="col-md-12">
+
+ <div id="petitions">
+
+ <table id="dt-petitions" class="table table-responsive dt-table" style="width:100%">
+ <thead>
+ <th class="dt-last_name">Επίθετο</th>
+ <th class="dt-first_name">Όνομα</th>
+ <th class="dt-email">email</th>
+ <th class="dt-sector">Τομέας</th>
+ <th class="dt-status">Status</th>
+ <th class="dt-actions"></th>
+ </thead>
+ </table>
+
+ </div>
+
+ </div>
+ </div>
+
+</div><!-- /manage -->
+
+ </div>
+
+ </div>
+ </div>
+
+
+
+
+ <!-- MODAL for set protocol number -->
+ <div class="modal fade" id="managePetition" aria-labelledby="myModalLabel" aria-hidden="true">
+ <div class="modal-dialog modal-lg" role="document">
+ <div class="modal-content">
+
+ <form method="post" action="">
+
+ <div class="modal-header">
+ <h4 class="modal-title" id="myModalLabel">Ενημέρωση αριθμού πρωτόκολλου</h4>
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
+ </div><!-- /modal-header -->
+
+ <!-- modal-body -->
+ <div class="modal-body">
+
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="protocol">Αριθμός Πρψτοκόλλου</label>
+ <div class="col-sm-12">
+ <input class="form-control form-control-sm" type="text" name="protocol" value="" required="">
+ </div>
+ </div>
+
+ <div class="row form-group"><!-- hiddens -->
+ <input type="hidden" name="id" value="0"><!-- petition-id -->
+ <input type="hidden" name="signature" value=""><!-- signature -->
+ </div>
+
+ </div><!-- /modal body -->
+
+ <div class="modal-footer">
+ <div class="row form-actions" style="width: 50%;">
+
+ <div class="col-sm-4">
+ <button type="button" class="btn btn-default js-modal-close col-12" data-bs-dismiss="modal">Κλείσιμο</button>
+ </div>
+ <div class="col-sm-8">
+ <button class="btn btn-primary col-12" type="submit">Καταχώριση</button>
+ </div>
+
+ </div>
+ </div><!-- /modal-footer -->
+
+ </form><!-- /form -->
+
+ </div>
+ </div>
+ </div>
+
+ </body>
+
+<script src="/assets/js/panel/admin_users.js"></script>
+
+ <!-- scripts
+ * handle show petition request
+
+ if admin:
+ * modal + give protocol-number
+ -->
+<?php // credits
+ //////////////////////////////////////////////////////////////////////////////
+ Render::view('js/credits');
+?>
+</html>
diff --git a/public/app/views/templates/application.php b/public/app/views/templates/application.php
index 35b1435..72c9251 100644
--- a/public/app/views/templates/application.php
+++ b/public/app/views/templates/application.php
@@ -6,7 +6,7 @@
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes', [ 'no_dataTables' => true ]);
?>
</head>
diff --git a/public/app/views/templates/create_pdf.php b/public/app/views/templates/create_pdf.php
index 19b2894..6b5c164 100644
--- a/public/app/views/templates/create_pdf.php
+++ b/public/app/views/templates/create_pdf.php
@@ -58,7 +58,7 @@ pdfMake.fonts = {
// bolditalics: 'https://example.com/fonts/fontFile4.ttf'
},
FiraMono: {
- normal: '<?=SITE_URL?>/assets/fonts/FiraMono-Regular.ttf',
+ normal: '<?=SITE_URL?>/assets/fonts/FiraMono-Regular.ttf'
}
}
diff --git a/public/app/views/templates/invite.php b/public/app/views/templates/invite.php
index d7947da..ab0f12c 100644
--- a/public/app/views/templates/invite.php
+++ b/public/app/views/templates/invite.php
@@ -59,7 +59,7 @@
</form>
</div>
- <div class="info">
+ <div class="info clear-read">
<p>
Χρησιμοποιήστε τη φόρμα για να προσκαλέσετε νέους χρήστες
ή για reset ενός account.
@@ -120,7 +120,11 @@ $(document).ready(function() {
window.location.href = '/panel';
} else {
- alert('Τα στοιχεία πρόσβασης που δώσατε είναι λάθος. Παρακαλώ προσπαθήστε ξανά.');
+ alert([
+ 'Κατάσταση αποστολής προσλήσεων:\\n\n',
+ data.sent,
+ 'Υπήρξαν προβλήματα στην αποστολή κάποιων προσκλήσεων.'
+ ].join(''));
}
});
diff --git a/public/app/views/templates/penalty.php b/public/app/views/templates/penalty.php
index cad9221..232e8a8 100644
--- a/public/app/views/templates/penalty.php
+++ b/public/app/views/templates/penalty.php
@@ -6,7 +6,7 @@
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes', [ 'no_dataTables' => true ]);
?>
</head>
@@ -93,7 +93,7 @@
-<!-- DEPRICATED:
+<!-- DEPRECATED:
<script>
$(document).ready(function() {
diff --git a/public/app/views/user/invitation.php b/public/app/views/user/invitation.php
index 328c621..64e5bcb 100644
--- a/public/app/views/user/invitation.php
+++ b/public/app/views/user/invitation.php
@@ -6,7 +6,7 @@
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes', [ 'no_dataTables' => true ]);
?>
</head>
<body class="office central-form">
@@ -37,7 +37,7 @@
</form>
</div>
- <div class="info">
+ <div class="info clear-read">
<p>
Απαιτείται η συμπλήρωση όλων των στοιχείων
προκειμένου να γίνεται γρήγορα η σύνταξη των εγγράφων.
diff --git a/public/app/views/user/login.php b/public/app/views/user/login.php
index 6bf3b0a..a9517c6 100644
--- a/public/app/views/user/login.php
+++ b/public/app/views/user/login.php
@@ -45,7 +45,7 @@
</form>
</div>
- <div class="info">
+ <div class="info clear-read">
<!--
<p>Αν ξεχάσατε τον κωδικό πρόσβασης μπορείτε να δημιουργήσετε ένα νέο (υπο κατασκευή).</p>
-->
@@ -53,10 +53,6 @@
Εαν δικαιούστε αλλά δεν έχετε πρόσβαση στο site, παρακαλούμε επικοινωνήστε
με τη διεύθυνση του σχολείου προκειμένου να σας αποσταλεί σχετική πρόσκληση.
</p>
- <p>
- Ο ιστότοπος χρησιμοποιεί cookies τα οποία έχουν αποκλειστικά λειτουργικό ρόλο.
- Η χρήση των υπηρεσιών του site συνεπάγεται την αποδοχή διατήρησης αυτών των cookies.
- </p>
</div>
</div>
diff --git a/public/app/views/user/update_password.php b/public/app/views/user/update_password.php
index 38494ad..b415f7c 100644
--- a/public/app/views/user/update_password.php
+++ b/public/app/views/user/update_password.php
@@ -6,7 +6,7 @@
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes', [ 'no_dataTables' => true ]);
?>
</head>
<body class="office central-form">