Skip to content

Commit

Permalink
Update poll.html
Browse files Browse the repository at this point in the history
  • Loading branch information
strafrecht-admin authored Sep 14, 2023
1 parent f2be96f commit 490e75e
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions templates/blocks/sidebar/poll.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,58 @@ <h2>{{ page.poll.title }}</h2>
<small>Startdatum: {{page.poll.date_created.date.day}}.{{page.poll.date_created.date.month}}.{{page.poll.date_created.date.year}}</small>
</form>
</div>
<head>
<style>
.popup-container{
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 20px;
background-color:white;
border: 1px solid #ccc;
box-shadow: 0px 2px 10px rgba(0,0,0,0.2);
z-index: 1000;
}
.overlay{
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
z-index:900;
</style>
</head>


<a href = '#' id = "popupLink">Die Ergebnisse</a>

<div class = "overlay" id = "overlay"></div>

<div class="popup-container" id="popupContainer">
<a href="{% url 'wagtailpolls_vote' page.poll.id %}" class="icon icon-arrow-right"><b>Ergebnisse</b></a>
<button id="closePopup">Schließen</button>
</div>

<script>
const popupLink = document.getElementById('popupLink');
const popupContainer = document.getElementById('popupContainer');
const closePopup = document.getElementById('closePopup');
const overlay = document.getElementById('overlay');

popupLink.addEventListener('click', function(event){
event.preventDefault();
popupContainer.style.display = 'block';
overlay.style.display = 'block';
});

closePopup.addEventListener('click', function() {
popupContainer.style.display = 'none';
overlay.style.display = 'none';
});
</script>
{% endif %}
{% endblock %}

0 comments on commit 490e75e

Please sign in to comment.