-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from SuzuSys/develop2
注文画面の UI や確認ダイアログの追加 - orders.py の order_sessions の型を変更 - 変更した order_sessions の型に合わせ、orders.py の各関数を変更 - 変更した order_sessions の型に合わせ、components/order-session.html の for loop 処理の変更 - 確認ダイアログ components/order-confirm.html の追加 - 確認ダイアログのリクエスト処理をする get_order_session_to_confirm() の追加 - 商品の name, price, count をまとめた ProductCompact クラスの追加 - components/order-session.html の UI の変更
- Loading branch information
Showing
7 changed files
with
334 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{% macro order_confirm(session_id, products, count, total_price, placement_status) %} | ||
<div class="relative z-10" aria-labelledby="confirm-dialog" role="dialog" aria-modal="true"> | ||
<!-- background --> | ||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div> | ||
<div class="fixed inset-0 z-10 w-screen"> | ||
<div class="flex h-full items-end justify-center py-4 px-10 text-center"> | ||
<!-- dialog --> | ||
<div class="flex flex-col overflow-y-auto transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all max-h-full"> | ||
<!-- text area wrapper --> | ||
<div class="flex flex-col overflow-y-auto bg-white px-4 pb-4 pt-5"> | ||
<!-- text area --> | ||
{% if placement_status == "" %} | ||
<div class="flex flex-col overflow-y-auto mt-1 text-center"> | ||
<h3 class=" font-semibold leading-6 text-gray-900 text-lg">注文の確定</h3> | ||
<div class="flex flex-col overflow-y-auto mt-5"> | ||
<ul class="flex flex-col overflow-y-auto mx-1 px-3"> | ||
{% for product in products.values() %} | ||
<li class="flex flex-row justify-between items-start gap-x-6 text-lg"> | ||
<span class="break-words">{{ product.name }}</span> | ||
<span class="whitespace-nowrap">{{ product.price }} x {{ product.count }}</span> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
<p class="flex flex-row mx-1 px-3 mt-5 justify-between text-lg"> | ||
<span class="break-words">計</span> | ||
<span class="whitespace-nowrap">{{ count }} 点</span> | ||
</p> | ||
<p class="flex flex-row mx-1 px-3 justify-between text-lg"> | ||
<span class="break-words">合計金額</span> | ||
<span class="whitespace-nowrap">{{ total_price }}</span> | ||
</p> | ||
</div> | ||
</div> | ||
{% else %} | ||
{{ placement_status }} | ||
{% endif %} | ||
</div> | ||
<!-- control --> | ||
<div class="flex-none bg-gray-50 px-4 py-3"> | ||
<button | ||
type="button" | ||
hx-post="/orders/{{ session_id }}" | ||
hx-target="#order-session" | ||
class="inline-flex w-full justify-center rounded bg-blue-600 px-8 py-4 text-xl font-semibold text-white shadow-sm" | ||
>確認</button> | ||
<button | ||
type="button" | ||
onclick="htmx.swap('#order-confirm', '', {swapStyle: 'innerHTML'})" | ||
class="mt-3 inline-flex w-full justify-center rounded bg-white px-5 py-4 text-xl font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300" | ||
>キャンセル</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.