Skip to content

Commit

Permalink
Merge pull request #834 from msusicky/develop
Browse files Browse the repository at this point in the history
2.11.2
  • Loading branch information
jan-stanek authored Apr 23, 2024
2 parents aa94840 + 9d34524 commit 8a9f239
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
24 changes: 18 additions & 6 deletions app/templates/nabidky_mapa.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3>Mapa nabídek očkování</h3>

<div class="form-row mb-1">
<div class="col mb-2">
<select id="free-vaccines-vaccine" class="custom-select">
<select id="free-vaccines-illness" class="custom-select">
<option value="">Všechny nemoci</option>
{% for option in free_vaccines_illness_options %}
<option value="{{ option[0] }}">{{ option[0] }}</option>
Expand All @@ -25,10 +25,14 @@ <h3>Mapa nabídek očkování</h3>
<input id="free-vaccines-adults" type="checkbox" class="custom-control-input" checked>
<label class="custom-control-label" for="free-vaccines-adults">dospělí</label>
</div>
<div class="custom-control custom-switch" style="display: inline-block">
<div class="custom-control custom-switch mr-2" style="display: inline-block">
<input id="free-vaccines-children" type="checkbox" class="custom-control-input" checked>
<label class="custom-control-label" for="free-vaccines-children">děti</label>
</div>
<div class="custom-control custom-switch" style="display: inline-block">
<input id="free-vaccines-nonregistered" type="checkbox" class="custom-control-input">
<label class="custom-control-label" for="free-vaccines-nonregistered">i pro neregistrované</label>
</div>
</div>
</div>

Expand Down Expand Up @@ -58,14 +62,14 @@ <h3>Mapa nabídek očkování</h3>
icon.appendChild(image);

var options = {
title: "{{ item.nazev_ordinace }}",
title: "{{ item.nazev_cely }}",
url: icon
}
var marker = new SMap.Marker(c, null, options);

var card = new SMap.Card();
card.setSize(450, null);
card.getHeader().innerHTML = "<strong>{{ item.nazev_ordinace }}</strong>";
card.getHeader().innerHTML = "<strong>{{ item.nazev_cely }}</strong>";
{% if item.nrpzs_kod %}
card.getBody().innerHTML = '<a href="./praktik/{{ item.nrpzs_kod }}" class="btn btn-primary">Detail nabídky</a>';
{% endif %}
Expand All @@ -76,7 +80,8 @@ <h3>Mapa nabídek očkování</h3>
marker.filter_data = {
illness: '{{ item.nemoc }}',
adults: {{ item.dospeli | lower }},
children: {{ item.deti | lower }}
children: {{ item.deti | lower }},
nonregistered: {{ item.neregistrovani | lower }}
}

coords.push(c);
Expand All @@ -95,6 +100,7 @@ <h3>Mapa nabídek očkování</h3>
const illnessValue = $("#free-vaccines-illness").val()
const adultsValue = $("#free-vaccines-adults")[0].checked;
const childrenValue = $("#free-vaccines-children")[0].checked;
const nonregisteredValue = $("#free-vaccines-nonregistered")[0].checked;

layer.removeAll();
var markers_filtered = [];
Expand All @@ -105,8 +111,11 @@ <h3>Mapa nabídek očkování</h3>
const illness = marker.filter_data.illness;
const adults = marker.filter_data.adults;
const children = marker.filter_data.children;
const nonregistered = marker.filter_data.nonregistered;

if ((!illnessValue || illness === illnessValue) && ((adultsValue && adults) || (childrenValue && children))) {
if ((!illnessValue || illness === illnessValue)
&& ((adultsValue && adults) || (childrenValue && children))
&& (!nonregisteredValue || nonregistered)) {
markers_filtered.push(marker);
}
}
Expand All @@ -130,6 +139,9 @@ <h3>Mapa nabídek očkování</h3>
}
filterMarkers();
});
$("#free-vaccines-nonregistered").change(function () {
filterMarkers();
});
filterMarkers();
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/praktici_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h5>Editovat své záznamy</h5>
</div>
</form>
<p class="card-text font-italic text-justify">
Pokud jste heslo zapomněli, či máte jiný problém, napište nám na [email protected].
Pokud jste heslo zapomněli, či máte jiný problém, napište nám na [email protected].
</p>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions scripts/create_static_pages_offers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ if [ $wget_res -ne 0 ]; then
exit $wget_res
fi

wget -P $WEB_TMP_DIR/127.0.0.1:5000 -e robots=off --adjust-extension http://127.0.0.1:5000/nabidky_mapa
wget_res=$?

if [ $wget_res -ne 0 ]; then
rm -r $WEB_TMP_DIR
exit $wget_res
fi

wget -P $WEB_TMP_DIR/127.0.0.1:5000 -e robots=off --adjust-extension http://127.0.0.1:5000/praktici
wget_res=$?

Expand Down
4 changes: 0 additions & 4 deletions scripts/cron
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# daily fetcher
20 6 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 15481697

# hourly fetcher - disabled, centers probably don't update that often
# 30 7-22 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 15481698

# monthly fetcher
00 5 5 * * bash /home/ockovani/prd/app/scripts/execute_action.sh 16635318

# update GP page
2/5 * * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 94783487

# post tweet - disabled
# 35 7 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 6797956

0 comments on commit 8a9f239

Please sign in to comment.