diff --git a/server/list.php b/server/list.php index 2862861..a5ac1f4 100644 --- a/server/list.php +++ b/server/list.php @@ -1,5 +1,10 @@ t("Availability List", false), 'token_list' => $_SESSION['token_list']]); +if($JSless){ + $query_results = $db->select("SELECT * FROM `".DB_PREFIX."_profiles` ORDER BY available DESC, chief DESC, services ASC, availability_minutes ASC, name ASC"); +} else { + $query_results = null; +} +loadtemplate('list.html', ['title' => t("Availability List", false), 'token_list' => $_SESSION['token_list'], 'query_results' => $query_results]); bdump($_SESSION); diff --git a/server/log.php b/server/log.php index 44c0ed8..9bde2c6 100644 --- a/server/log.php +++ b/server/log.php @@ -1,3 +1,8 @@ t('Logs', false)]); +if($JSless){ + $query_results = $db->select("SELECT * FROM `".DB_PREFIX."_log` ORDER BY `timestamp` DESC"); +} else { + $query_results = null; +} +loadtemplate('log.html', ['title' => t('Logs', false), 'query_results' => $query_results]); diff --git a/server/resources/src/main.css b/server/resources/src/main.css index f0ad2ae..c3ed671 100644 --- a/server/resources/src/main.css +++ b/server/resources/src/main.css @@ -1,3 +1,7 @@ +#jsDisabledNotice { + display: none; +} + body:not(table) { max-width: 100%; overflow-x: hidden; diff --git a/server/resources/src/main.js b/server/resources/src/main.js index 8aa8fc9..9866c68 100644 --- a/server/resources/src/main.js +++ b/server/resources/src/main.js @@ -152,6 +152,9 @@ var fillTableLoaded = undefined; window.addEventListener("securitypolicyviolation", console.error.bind(console)); $(function() { + $("#topNavBar").show(); + $("#content").show(); + $("#footer").show(); $("#menuButton").on("click", function() { const topNavBar = document.getElementById("topNavBar"); if (topNavBar.className === "topnav") { diff --git a/server/services.php b/server/services.php index 6b2bb63..49adf41 100644 --- a/server/services.php +++ b/server/services.php @@ -1,4 +1,9 @@ t('Services', false)]); +if($JSless){ + $query_results = $db->select("SELECT * FROM `".DB_PREFIX."_services` ORDER BY date DESC, beginning DESC"); +} else { + $query_results = null; +} +loadtemplate('services.html', ['title' => t('Services', false), 'query_results' => $query_results]); ?> diff --git a/server/templates/JSless/base.html b/server/templates/JSless/base.html new file mode 100644 index 0000000..efed26c --- /dev/null +++ b/server/templates/JSless/base.html @@ -0,0 +1,106 @@ +{% apply minimize %} + + +
+ {% block head %} +{{ 'Are you sure you want to delete the service?'|t }}
+ + +{{ 'Are you sure you want to delete the training?'|t }}
+ + +{{ 'Are you sure you want to delete the user?'|t }}
+ + +{{ 'Error'|t}} {{ 'code'|t}} {{ error.code }}. {{ 'Check the entered credentials and make sure they are correct'|t }}.
+ +{{ 'Are you available in case of alert?'|t }}
+ + +{{ 'Name'|t }} | +{{ 'Available'|t }} | + {% if user.full_viewer %} +{{ 'Driver'|t }} | +{{ 'Call'|t }} | +{{ 'Write'|t }} | +{{ 'Services'|t }} | +{{ 'Availability Minutes'|t }} | + {#{{ 'Other'|t }} | TODO: fix "Other" page #} + {% endif %} +||
---|---|---|---|---|---|---|---|---|---|
{{ username(row.id) }} | +{{ yesOrNo(row.available) }} | + {% if user.full_viewer %} +{{ yesOrNo(row.driver) }} | + {% if row.phone_number %} +Chiama | + {% else %} ++ {% endif %} + {% if row.phone_number %} + | Manda un messaggio | + {% else %} ++ {% endif %} + | {{ row.services }} | +{{ row.availability_minutes }} | + {#{{ 'Other'|t }} | TODO: fix "Other" page #} + {% endif %} +
+ +
+{{ 'Action'|t }} | +{{ 'Interested'|t }} | +{{ 'Made by'|t }} | +{{ 'Datetime'|t }} | +
---|---|---|---|
{{ row.action }} | +{{ username(row.changed) }} | +{{ username(row.editor) }} | +{{ row.timestamp }} | +
+ +
+{{ 'Date'|t }} | +{{ 'code'|t|capitalize }} | +{{ 'Start time'|t }} | +{{ 'End time'|t }} | +{{ 'Chief'|t }} | +{{ 'Drivers'|t }} | +{{ 'Crew'|t }} | +{{ 'Place'|t }} | +{{ 'Notes'|t }} | +{{ 'Type'|t }} | + {% if option('service_edit') %} +{{ 'Edit'|t }} | + {% endif %} + {% if option('service_remove') %} +{{ 'Remove'|t }} | + {% endif %} +
---|---|---|---|---|---|---|---|---|---|---|---|
{{ row.date }} | +{{ row.code }} | +{{ row.beginning }} | +{{ row.end }} | +{{ username(row.chief) }} | +{{ username_list(row.drivers) }} | +{{ username_list(row.crew) }} | +
+ {% if "#" in row.place %}
+ {% set mapImageID = row.place|split('#')[1] %}
+ {% set place = row.place|split('#')[0] %}
+ {% set place_lat = place|split(';')[0] %}
+ {% set place_lng = place|split(';')[1] %}
+ + {% endif %} + Apri la mappa in Google Maps + Apri la mappa in OpenStreetMap + Lat: {{ place_lat }} + Lng: {{ place_lng }} + |
+ {{ row.notes }} | +{{ row.type }} | + {% if option('service_edit') %} +Modifica | + {% endif %} + {% if option('service_remove') %} +Rimuovi | + {% endif %} +
{{ 'Date'|t }} | +{{ 'Name'|t }} | +{{ 'Start time'|t }} | +{{ 'End time'|t }} | +{{ 'Chief'|t }} | +{{ 'Crew'|t }} | +{{ 'Place'|t }} | +{{ 'Notes'|t }} | + {% if option('training_edit') %} +{{ 'Edit'|t }} | + {% endif %} + {% if option('training_remove') %} +{{ 'Remove'|t }} | + {% endif %} +
---|---|---|---|---|---|---|---|---|---|
{{ row.date }} | +{{ row.name }} | +{{ row.beginning }} | +{{ row.end }} | +{{ username(row.chief) }} | +{{ username_list(row.crew) }} | +
+ {% if "#" in row.place %}
+ {% set mapImageID = row.place|split('#')[1] %}
+ {% set place = row.place|split('#')[0] %}
+ {% set place_lat = place|split(';')[0] %}
+ {% set place_lng = place|split(';')[1] %}
+ + {% endif %} + Apri la mappa in Google Maps + Apri la mappa in OpenStreetMap + Lat: {{ place_lat }} + Lng: {{ place_lng }} + |
+ {{ row.notes }} | + {% if option('training_edit') %} +Modifica | + {% endif %} + {% if option('training_remove') %} +Rimuovi | + {% endif %} +