Skip to content

Commit

Permalink
Put error popup inside the basket
Browse files Browse the repository at this point in the history
  • Loading branch information
klmp200 committed Dec 25, 2024
1 parent 138e166 commit 280d273
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
31 changes: 13 additions & 18 deletions core/static/core/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -344,24 +344,6 @@ body {
text-align: center;
}

.popup {
z-index: 10;
/* to get on top of tomselect */
display: inline-block;
text-align: center;
overflow: auto;
margin: auto;
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
height: 20vh;
width: 20vw;
align-content: center;
}


.tabs {
border-radius: 5px;

Expand Down Expand Up @@ -1283,6 +1265,18 @@ u,
float: right;
}

.basket-error-container {
position: relative;
display: block
}

.basket-error {
z-index: 10; // to get on top of tomselect
text-align: center;
position: absolute;
}


#products {
flex-basis: 100%;
margin: 0.2em;
Expand All @@ -1292,6 +1286,7 @@ u,
#click_form {
flex: auto;
margin: 0.2em;
width: 20%;
}

#user_info {
Expand Down
20 changes: 11 additions & 9 deletions counter/templates/counter/counter_click.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@
<p class="important">Javascript is required for the counter UI.</p>
</noscript>

<p
x-cloak
class="alert alert-red popup"
x-show="alertMessage.show"
x-transition.duration.500ms
x-text="alertMessage.content"
></p>

<div id="user_info">
<h5>{% trans %}Customer{% endtrans %}</h5>
{{ user_mini_profile(customer.user) }}
Expand All @@ -51,7 +43,7 @@
</p>
</div>

<div id="click_form" style="width: 20%;">
<div id="click_form">
<h5 id="selling-accordion">{% trans %}Selling{% endtrans %}</h5>
<div>
{% set counter_click_url = url('counter:click', counter_id=counter.id, user_id=customer.user_id) %}
Expand Down Expand Up @@ -86,6 +78,16 @@

<form x-cloak method="post" action="" x-ref="basketForm">

<div class="basket-error-container">
<div
x-cloak
class="alert alert-red basket-error"
x-show="alertMessage.show"
x-transition.duration.500ms
x-text="alertMessage.content"
></div>
</div>

{% csrf_token %}
<div x-ref="basketManagementForm">
{{ form.management_form }}
Expand Down

0 comments on commit 280d273

Please sign in to comment.