diff --git a/sirest/settings.py b/sirest/settings.py index 90842e82da728cc73a6a367f2abc5442e1bb10f5..87ee5d7cbe5db3b81a096ce4497c912222ae8098 100644 --- a/sirest/settings.py +++ b/sirest/settings.py @@ -50,6 +50,7 @@ INSTALLED_APPS = [ 'trigger_6', 'trigger3', 'trigger_2', + 'trigger4', 'trigger5', ] diff --git a/sirest/urls.py b/sirest/urls.py index 197e1385d34570ccbe42006ee7fb5a5386dae0c3..0931a0d394b1e3d7477f1cb8a966f907ff412de2 100644 --- a/sirest/urls.py +++ b/sirest/urls.py @@ -22,5 +22,6 @@ urlpatterns = [ path('trigger_6/', include('trigger_6.urls')), path('trigger3/', include('trigger3.urls')), path('trigger_2/', include('trigger_2.urls')), + path('trigger4/', include('trigger4.urls')), path('trigger5/',include('trigger5.urls')), ] diff --git a/templates/navbar.html b/templates/navbar.html index db4fc9f27c75b93273d6b696d02e3efc253c0cfc..0d1a3227c5832d46a693de4d6450375b918c2285 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -7,24 +7,18 @@ : ((e.name = "menu"), list.classList.add("hidden")); } </script> - <script - src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" - defer - ></script> + <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> </head> <nav class="sticky z-50 top-0 md:px-20 px-4 py-2 bg-[#DD5353] shadow-2xl md:flex md:items-center md:justify-between mb-3" - id="navbar" -> + id="navbar"> <div class="flex gap-2 md:w-full justify-between"> <a href="{% url 'account:show_main' %}"> - <div - class="text-2xl font-bold text-[#fff] flex items-center cursor-pointer hover:text-cream-tua" - > - {% if adminid is not none %} - SIREST {{role}} {{rname}} {{rbranch}} - {% else %} + <div class="text-2xl font-bold text-[#fff] flex items-center cursor-pointer hover:text-cream-tua"> + {% if adminid is not none %} + SIREST {{role}} {{rname}} {{rbranch}} + {% else %} SIREST {{role}} {{rname}} {{rbranch}} <h3 class="text-xs">Not Verified</h3> {% endif %} @@ -34,339 +28,354 @@ <ion-icon name="menu" onclick="menu(this)" class="fill-white"></ion-icon> </div> </div> - <div - id="list-navbar" - class="text-base text-white hidden md:show md:flex md:flex-row md:items-center md:justify-end" - > + <div id="list-navbar" class="text-base text-white hidden md:show md:flex md:flex-row md:items-center md:justify-end"> <div class="md:mx-5 my-3 md:my-0"> - <a href="" class="hover:text-[#DBC8AC] hover:text-lg duration-500" - >Dashboard</a - > + <a href="" class="hover:text-[#DBC8AC] hover:text-lg duration-500">Dashboard</a> </div> - <!-- {admin start} --> - {% if role == 'admin' %} - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> - <span>Restoran</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Daftar Kategori Restoran</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Buat Kategori Restoran</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Daftar Kategori Makanan</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Buat Kategori Makanan</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Daftar Bahan Makanan</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Buat Bahan Makanan</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger3:daftar_restoran' %}">Daftar Restoran dan Makanan</a> - </div> - </div> - </div> <!-- {admin start} --> {% if role == 'admin' %} <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button - @click="open = !open" - class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500" - > + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> + <span>Restoran</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Kategori Restoran</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Kategori Restoran</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Kategori Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Kategori Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Bahan Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Bahan Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger3:daftar_restoran' %}">Daftar Restoran dan Makanan</a> + </div> + </div> + </div> + <!-- {admin start} --> + {% if role == 'admin' %} + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> <span>Restoran</span> - <svg - fill="currentColor" - viewBox="0 0 20 20" - :class="{'rotate-180': open, 'rotate-0': !open}" - class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1" - > - <path - fill-rule="evenodd" + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" - clip-rule="evenodd" - ></path> + clip-rule="evenodd"></path> </svg> </button> - <div - x-show="open" - x-transition:enter="transition ease-out duration-100" - x-transition:enter-start="transform opacity-0 scale-95" - x-transition:enter-end="transform opacity-100 scale-100" - x-transition:leave="transition ease-in duration-75" - x-transition:leave-start="transform opacity-100 scale-100" + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" - class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48" - > + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow"> - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Daftar Kategori Restoran</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Buat Kategori Restoran</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Daftar Kategori Makanan</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Buat Kategori Makanan</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Daftar Bahan Makanan</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Buat Bahan Makanan</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Daftar Restoran dan Makanan</a - > + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Kategori Restoran</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Kategori Restoran</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Kategori Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Kategori Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Bahan Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Bahan Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Restoran dan Makanan</a> </div> </div> </div> <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button - @click="open = !open" - class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500" - > + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> <span>Promo</span> - <svg - fill="currentColor" - viewBox="0 0 20 20" - :class="{'rotate-180': open, 'rotate-0': !open}" - class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1" - > - <path - fill-rule="evenodd" + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" - clip-rule="evenodd" - ></path> + clip-rule="evenodd"></path> </svg> </button> - <div - x-show="open" - x-transition:enter="transition ease-out duration-100" - x-transition:enter-start="transform opacity-0 scale-95" - x-transition:enter-end="transform opacity-100 scale-100" - x-transition:leave="transition ease-in duration-75" - x-transition:leave-start="transform opacity-100 scale-100" + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" - class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48" - > + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow"> - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="{% url 'trigger_6:show_daftar_promo' %}" - >Daftar Promo</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="{% url 'trigger_6:show_buat_promo' %}" - >Buat Promo</a - > + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_6:show_daftar_promo' %}">Daftar Promo</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_6:show_buat_promo' %}">Buat Promo</a> </div> </div> </div> - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> - <span>Pesanan</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger3:tarif_detail' %}">Daftar Tarif Pengiriman per KM</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger3:tambah_tarif' %}">Buat Tarif Pengiriman per KM</a> - </div> - </div> + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> + <span>Pesanan</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger3:tarif_detail' %}">Daftar Tarif Pengiriman per KM</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger3:tambah_tarif' %}">Buat Tarif Pengiriman per KM</a> </div> - {% endif %} - <!-- admin end --> + </div> + </div> + {% endif %} + <!-- admin end --> <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button - @click="open = !open" - class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500" - > + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> <span>Pesanan</span> - <svg - fill="currentColor" - viewBox="0 0 20 20" - :class="{'rotate-180': open, 'rotate-0': !open}" - class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1" - > - <path - fill-rule="evenodd" + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" - clip-rule="evenodd" - ></path> + clip-rule="evenodd"></path> </svg> </button> - <div - x-show="open" - x-transition:enter="transition ease-out duration-100" - x-transition:enter-start="transform opacity-0 scale-95" - x-transition:enter-end="transform opacity-100 scale-100" - x-transition:leave="transition ease-in duration-75" - x-transition:leave-start="transform opacity-100 scale-100" + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" - class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48" - > + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow"> - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Daftar Tarif Pengiriman per KM</a - > - <a - class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" - href="#" - >Buat Tarif Pengiriman per KM</a - > + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Tarif Pengiriman per KM</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Tarif Pengiriman per KM</a> </div> </div> </div> {% endif %} <!-- admin end --> - <!-- pelanggan start --> - {% if role == 'customer' and adminid != None %} - <div class="md:mx-5 my-3 md:my-0 text-center"> - <a href="{% url 'trigger3:daftar_restoran' %}" class="hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap">Daftar Restoran dan Makanan</a> - </div> + <!-- pelanggan start --> + {% if role == 'customer' and adminid != None %} + <div class="md:mx-5 my-3 md:my-0 text-center"> + <a href="{% url 'trigger3:daftar_restoran' %}" + class="hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap">Daftar Restoran dan Makanan</a> + </div> <!-- pelanggan start --> {% if role == 'customer' and adminid != None %} <div class="md:mx-5 my-3 md:my-0 text-center"> - <a - href="" - class="hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap" - >Daftar Restoran dan Makanan</a - > + <a href="" class="hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap">Daftar Restoran dan + Makanan</a> + {% endif %} </div> - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> - <span>Pesanan</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Buat Pesanan</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Pesanan Berlangsung</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger_6:show_riwayat' %}">Riwayat Pesanan</a> - </div> - </div> - </div> - - <div class="md:mx-5 my-3 md:my-0"> - <a - href="{% url 'trigger_2:saldo_restopay' %}" - class="hover:text-[#DBC8AC] hover:text-lg duration-500" - >Restopay</a - > - </div> - {% endif %} - <!-- pelanggan end --> - - <!-- restoran start --> - {% if role == 'restaurant' and adminid != None %} - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap"> - <span>Jam Operasional</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger_2:daftar_jam_operasional' %}">Daftar Jam Operasional</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger_2:buat_jam_operasional' %}" - >Buat Jam Operasional</a> - </div> - </div> - </div> - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> - <span>Makanan</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger3:makanan_resto' %}">Daftar Makanan</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger3:tambah_makanan' %}">Buat Makanan</a> - </div> - </div> - </div> - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> - <span>Pesanan</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger_2:daftar_pesanan' %}">Pesanan Berlangsung</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger_6:show_riwayat' %}">Riwayat Pesanan</a> - </div> - </div> - </div> - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> - <span>Promo</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger_6:show_daftar_promo' %}">Daftar Promo Tersedia</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Daftar Promo Restoran</a> - </div> - </div> - </div> - <div class="md:mx-5 my-3 md:my-0"> - <a - href="{% url 'trigger_2:saldo_restopay' %}" - class="hover:text-[#DBC8AC] hover:text-lg duration-500" - >Restopay</a - > + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> + <span>Pesanan</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Buat Pesanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Pesanan Berlangsung</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_6:show_riwayat' %}">Riwayat Pesanan</a> </div> - {% endif %} - <!-- restoran end --> + </div> + </div> + + <div class="md:mx-5 my-3 md:my-0"> + <a href="{% url 'trigger_2:saldo_restopay' %}" + class="hover:text-[#DBC8AC] hover:text-lg duration-500">Restopay</a> + </div> + {% endif %} + <!-- pelanggan end --> - <!-- kurir start --> - {% if role == 'courier' and adminid != None %} - <div class="md:mx-5 my-3 md:my-0"> - <a href="{% url 'trigger3:daftar_restoran' %}" class="hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap">Daftar Restoran dan Makanan</a> + <!-- restoran start --> + {% if role == 'restaurant' and adminid != None %} + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap"> + <span>Jam Operasional</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_2:daftar_jam_operasional' %}">Daftar Jam Operasional</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_2:buat_jam_operasional' %}">Buat Jam Operasional</a> </div> - <div @click.away="open = false" class="relative" x-data="{ open: false }"> - <button @click="open = !open" class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> - <span>Pesanan</span> - <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> - </button> - <div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> - <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="#">Pesanan Berlangsung</a> - <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" href="{% url 'trigger_6:show_riwayat' %}">Riwayat Pesanan</a> - </div> - </div> - </div> - <div class="md:mx-5 my-3 md:my-0"> - <a - href="{% url 'trigger_2:saldo_restopay' %}" - class="hover:text-[#DBC8AC] hover:text-lg duration-500" - >Restopay</a - > + </div> + </div> + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> + <span>Makanan</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger3:makanan_resto' %}">Daftar Makanan</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger3:tambah_makanan' %}">Buat Makanan</a> </div> - {% endif %} - <!-- kurir end --> + </div> + </div> + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> + <span>Pesanan</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_2:daftar_pesanan' %}">Pesanan Berlangsung</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_6:show_riwayat' %}">Riwayat Pesanan</a> + </div> + </div> + </div> + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> + <span>Promo</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_6:show_daftar_promo' %}">Daftar Promo Tersedia</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Daftar Promo Restoran</a> + </div> + </div> + </div> + <div class="md:mx-5 my-3 md:my-0"> + <a href="{% url 'trigger_2:saldo_restopay' %}" + class="hover:text-[#DBC8AC] hover:text-lg duration-500">Restopay</a> + </div> + {% endif %} + <!-- restoran end --> - <div class="md:mx-5 my-3 md:my-0"> - <a href="{% url 'account:logout' %}" class="hover:text-[#DBC8AC] hover:text-lg duration-500">Logout</a> + <!-- kurir start --> + {% if role == 'courier' and adminid != None %} + <div class="md:mx-5 my-3 md:my-0"> + <a href="{% url 'trigger3:daftar_restoran' %}" + class="hover:text-[#DBC8AC] hover:text-lg duration-500 whitespace-nowrap">Daftar Restoran dan Makanan</a> + </div> + <div @click.away="open = false" class="relative" x-data="{ open: false }"> + <button @click="open = !open" + class="flex flex-row items-center w-full md:mx-5 my-3 md:my-0 text-left bg-transparent rounded-lg focus:outline-none focus:shadow-outline hover:text-[#DBC8AC] hover:text-lg duration-500"> + <span>Pesanan</span> + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> + <path fill-rule="evenodd" + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" + clip-rule="evenodd"></path> + </svg> + </button> + <div x-show="open" x-transition:enter="transition ease-out duration-100" + x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" + x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" + x-transition:leave-end="transform opacity-0 scale-95" + class="absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> + <div class="px-2 py-2 bg-white text-gray-900 rounded-md shadow "> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="#">Pesanan Berlangsung</a> + <a class="block px-4 py-2 mt-2 rounded-lg hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline" + href="{% url 'trigger_6:show_riwayat' %}">Riwayat Pesanan</a> </div> + </div> + </div> + <div class="md:mx-5 my-3 md:my-0"> + <a href="{% url 'trigger_2:saldo_restopay' %}" + class="hover:text-[#DBC8AC] hover:text-lg duration-500">Restopay</a> </div> -</nav> + {% endif %} + <!-- kurir end --> + + <div class="md:mx-5 my-3 md:my-0"> + <a href="{% url 'account:logout' %}" class="hover:text-[#DBC8AC] hover:text-lg duration-500">Logout</a> + </div> + </div> +</nav> \ No newline at end of file diff --git a/trigger4/forms.py b/trigger4/forms.py index e64851000e7cca25da6c07887fce3134ccb4506f..c4e2a94252a1ddcf042a369f2ecaa771e16660d1 100644 --- a/trigger4/forms.py +++ b/trigger4/forms.py @@ -1,21 +1,35 @@ from django import forms +from utils.query import * + +cursor.execute("select distinct province from delivery_fee_per_km") +records = cursor.fetchall() +DATA_PROVINSI = [] +for record in records: + DATA_PROVINSI.append((record[0], record[0])) + +DATA_KENDARAAN = [('Mobil', 'Mobil'), ('Motor', 'Motor')] -DATA_PROVINSI = [('Jawa Barat', 'Jawa Barat'), ('Jawa Tengah', 'Jawa Tengah'), ('Jawa Timur', 'Jawa Timur'), - ('DKI Jakarta', 'DKI Jakarta')] class FormBuatKategoriMakanan(forms.Form): - nama = forms.CharField(label='Nama Kategori Makanan', max_length=100, widget=forms.TextInput( + nama = forms.CharField(label='Nama Kategori Makanan', max_length=100, widget=forms.TextInput( attrs={'class': 'w-[20rem] h-[2.5rem] rounded-lg border-2 border-gray-300', 'type': 'label'})) + +# class FormPemilihanPesananPadaRestoran(forms.Form): +# hari = forms.ChoiceField(label='Hari', choices=DATA_HARI, widget=forms.Select( +# attrs={'class': 'border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2', 'placeholder': 'Hari'})) + + class FormPengisianAlamatMakanan(forms.Form): - Jalan = forms.CharField(label='Jalan', max_length=100, widget=forms.TextInput( + Jalan = forms.CharField(label='Jalan', max_length=100, widget=forms.TextInput( attrs={'class': 'w-[20rem] h-[2.5rem] rounded-lg border-2 border-gray-300', 'type': 'label'})) - Kecamatan = forms.CharField(label='Kecamatan', max_length=100, widget=forms.TextInput( + Kecamatan = forms.CharField(label='Kecamatan', max_length=100, widget=forms.TextInput( attrs={'class': 'w-[20rem] h-[2.5rem] rounded-lg border-2 border-gray-300', 'type': 'label'})) - Kota= forms.CharField(label='Kota', max_length=100, widget=forms.TextInput( + Kota = forms.CharField(label='Kota', max_length=100, widget=forms.TextInput( attrs={'class': 'w-[20rem] h-[2.5rem] rounded-lg border-2 border-gray-300', 'type': 'label'})) - Provinsi = forms.ChoiceField(label='Provinsi', choices=DATA_PROVINSI, widget=forms.Select( - attrs={'class': 'border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2', 'placeholder': 'Hari'})) \ No newline at end of file + # Provinsi = forms.ChoiceField(label='Provinsi', choices=DATA_PROVINSI, widget=forms.Select( + # attrs={'class': 'border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2', 'placeholder': 'Hari'})) + \ No newline at end of file diff --git a/trigger4/templates/buat_kategori_makanan.html b/trigger4/templates/buat_kategori_makanan.html index 6a4454ff8203b1091b7bade7cc81c070eb34d88c..12f759376be019ace6c1224014442ef0537dd6fd 100644 --- a/trigger4/templates/buat_kategori_makanan.html +++ b/trigger4/templates/buat_kategori_makanan.html @@ -17,9 +17,8 @@ </tr> {% endfor %} </table> - <button type="submit" class="bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"> - Simpan - </button> + <a class="bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded btn btn-primary " + href="{% url 'trigger4:daftar_kategori_makanan' %}">Simpan</a> </form> </div> </div> diff --git a/trigger4/templates/daftar_kategori_makanan.html b/trigger4/templates/daftar_kategori_makanan.html index 61b98d0cb2e35488c8905473953013664536932e..71c1f6f7dee843ea1bee3c569c82e5a95c479220 100644 --- a/trigger4/templates/daftar_kategori_makanan.html +++ b/trigger4/templates/daftar_kategori_makanan.html @@ -18,17 +18,19 @@ </tr> </thead> <tbody> - {% for kategori_makanan in daftar_kategori_makanan %} + {% for record in records %} <tr class="border-b border-gray-200 hover:bg-gray-100"> <td class="py-3 px-6"> {{ forloop.counter }} </td> <td class="py-3 px-6"> - {{ kategori_makanan.nama }} + {{ record.1 }} </td> <td class="py-3 px-6"> - <a href="" class="text-blue-500">Hapus</a> + {% if record.2 == None %} + <a href="{% url 'trigger4:delete_kategori_makanan' record.0 %}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Hapus</a> </td> + {% endif %} </tr> {% endfor %} </tbody> diff --git a/trigger4/templates/daftar_restoran_di_provinsi.html b/trigger4/templates/daftar_restoran_di_provinsi.html index 686ce875896de34d7074777d0b0b856c588b2f2d..df0e1895c3e333c59b299e759a9318cbb46c4be9 100644 --- a/trigger4/templates/daftar_restoran_di_provinsi.html +++ b/trigger4/templates/daftar_restoran_di_provinsi.html @@ -21,19 +21,19 @@ </tr> </thead> <tbody> - {% for restoran in daftar_restoran %} + {% for record in records %} <tr class="border-b border-gray-200 hover:bg-gray-100"> <td class="py-3 px-6"> {{ forloop.counter }} </td> <td class="py-3 px-6"> - {{ restoran.Nama_Cabang_Restoran}} + {{ record.0}}-{{ record.1}} </td> <td class="py-3 px-6"> - {{ restoran.Promo_Berlangsung}} + {{ record.2}} </td> <td class="py-3 px-6"> - <a href="" class="text-blue-500">Pilih</a> + <a href="{% url 'trigger4:pemilihan_pesanan_pada_restoran' record.0 record.1 %}" class="text-blue-500">Pilih</a> </td> </tr> {% endfor %} diff --git a/trigger4/templates/pemilihan_pesanan_pada_restoran.html b/trigger4/templates/pemilihan_pesanan_pada_restoran.html index b71dd94e7ff23232109374ded90edd4a6a19a39e..d4a1bec4ff0e81103c4a674481a0a4c127f67148 100644 --- a/trigger4/templates/pemilihan_pesanan_pada_restoran.html +++ b/trigger4/templates/pemilihan_pesanan_pada_restoran.html @@ -24,22 +24,24 @@ </tr> </thead> <tbody> - {% for makanan in daftar_makanan %} + {% for rec in records %} <tr class="border-b border-gray-200 hover:bg-gray-100"> <td class="py-3 px-6"> {{ forloop.counter }} </td> <td class="py-3 px-6"> - {{ makanan.Nama_Makanan}} + {{ rec.0}} </td> <td class="py-3 px-6"> - {{ makanan.Harga}} + {{ rec.1}} </td> <td class="py-3 px-6"> <input type="number" id="quantity" name="quantity" min="0" max="10"> </td> <td class="py-3 px-6"> - <a href="" class="text-blue-500">Pilih</a> + <p>Catatan</p> + <input type="text" name="name" id="name" class="form-control rounded-lg text-black"> + </div> </td> </tr> {% endfor %} diff --git a/trigger4/templates/pengisian_alamat_pemesanan_makanan.html b/trigger4/templates/pengisian_alamat_pemesanan_makanan.html index 425380c981a08809d34b900658fdc7c1ca395bcf..c65fff3c549e3a958057282043b10b514d81a2f0 100644 --- a/trigger4/templates/pengisian_alamat_pemesanan_makanan.html +++ b/trigger4/templates/pengisian_alamat_pemesanan_makanan.html @@ -9,17 +9,28 @@ <h1 class="text-2xl font-bold mb-3">FORM PENGISIAN ALAMAT PEMESANAN MAKANAN</h1> <form action="" method="post" class="mb-3 flex flex-col items-center justify-center gap-10"> {% csrf_token %} - <table class="border-separate border-spacing-2"> - {% for field in form %} - <tr> - <th>{{field.label_tag}}</th> - <td>{{ field.errors }} {{ field }}</td> - </tr> + + {% for field in form %} + <tr> + <th>{{field.label_tag}}</th> + <td>{{ field.errors }} {{ field }}</td> + </tr> + {% endfor %} + <select name="name" id="name" onchange="handleClick(this.value); this.selectedindex = -1" + class="border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2"> + <option style="display: none"></option> + {% for promoname in records %} + <option value="{{ promoname.0 }}">{{ promoname.0 }}</option> {% endfor %} - </table> - <button type="submit" class="bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"> - Lanjut - </button> + </select> + <a class="bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded btn btn-primary " + href="{% url 'trigger4:pemilihan_pesanan_pada_restoran' promoname.0 %}">Simpan</a> + + + + + + </form> </div> </div> diff --git a/trigger4/urls.py b/trigger4/urls.py index da4bab63ab6bd09c13a9037d7e79c74cb44fbe78..6c22fcab5e6cdf5b124ffe7f0bb3ac28f99e5f7c 100644 --- a/trigger4/urls.py +++ b/trigger4/urls.py @@ -6,11 +6,12 @@ app_name = 'trigger4' urlpatterns = [ path('buat_kategori_makanan/', buat_kategori_makanan, name='buat_kategori_makanan'), path('daftar_kategori_makanan/', daftar_kategori_makanan, name='daftar_kategori_makanan'), + path('delete_kategori_makanan/<id>', delete_kategori_makanan, name='delete_kategori_makanan'), path('pengisian_alamat_pemesanan_makanan/', pengisian_alamat_pemesanan_makanan, name='pengisian_alamat_pemesanan_makanan'), path('daftar_restoran_di_provinsi/', daftar_restoran_di_provinsi, name='daftar_restoran_di_provinsi'), - path('pemilihan_makanan_pada_restoran/', pemilihan_pesanan_pada_restoran, name='pemilihan_makanan_pada_restoran'), - path('daftar_pesanan_makanan/', daftar_pesanan_makanan, name='daftar_pesanan_makanan'), + path('pemilihan_pesanan_pada_restoran/<rname>/<rbranch>', pemilihan_pesanan_pada_restoran, name='pemilihan_pesanan_pada_restoran'), + path('daftar_pesanan_makanan/<Province>', daftar_pesanan_makanan, name='daftar_pesanan_makanan'), path('konfirmasi_pembayaran/', konfirmasi_pembayaran, name='konfirmasi_pembayaran'), path('ringkasan_pesanan/', ringkasan_pesanan, name='ringkasan_pesanan'), path('pesanan_berlangsung/', pesanan_berlangsung, name='pesanan_berlangsung'), diff --git a/trigger4/views.py b/trigger4/views.py index 9ce3fc6f3284b8649585f79b011099ace5707261..7facee9d8ec8b91908e92fa2433a4db338957240 100644 --- a/trigger4/views.py +++ b/trigger4/views.py @@ -1,25 +1,71 @@ -from django.shortcuts import render +from django.contrib import messages +from django.http import HttpResponseRedirect, JsonResponse +from django.shortcuts import redirect, render +from django.urls import reverse +from utils.query import * from trigger4.forms import * # Create your views here. + + +def show_detail_riwayat(request, email, datetime): + # query riwayat by id + sql = f'''select u.fname, u.lname, t.street, t.district, t.city, t.province, r.rname, r.rbranch, t.datetime, t.rating, foo.fname, foo.lname, co.platenum, co.vehicletype, co.vehiclebrand, + r.street, r.district, r.city, r.province, t.totalfood, t.totaldiscount, t.deliveryfee, t.totalprice, pm.name, ps.name from transaction t, courier co, transaction_food tf, + customer cu, restaurant r, user_acc u, (select ua.email, ua.fname, ua.lname from user_acc ua) as foo, payment_method pm, payment_status ps where t.courierid = co.email and t.email = cu.email and t.email = u.email and co.email + = foo.email and pm.id = t.pmid and ps.id = t.psid and t.email = \'{email}\' and t.datetime = \'{datetime}\' and (r.rname, r.rbranch) = (tf.rname, tf.rbranch) and (t.email, t.datetime) = (tf.email, tf.datetime); + ''' + cursor.execute(sql) + record_riwayat = cursor.fetchall() + + cursor.execute( + f'select tf.foodname, tf.note, tf.amount from transaction_food tf where tf.email = \'{email}\' and tf.datetime = \'{datetime}\';') + ordered_food = cursor.fetchall() + cursor.execute( + f'select ts.name, th.datetimestatus from transaction_status ts, transaction_history th where ts.id = th.tsid and th.email = \'{email}\' and th.datetime = \'{datetime}\'') + transaction_status = cursor.fetchall() + + for i in range(len(transaction_status)): + transaction_status[i] = list(transaction_status[i]) + transaction_status[i][1] = transaction_status[i][1].strftime( + "%m/%d/%Y %H:%M:%S") + + context = { + 'record_riwayat': record_riwayat, + 'ordered_food': ordered_food, + 'transaction_status': transaction_status, + 'status': transaction_status[-1][0], + 'role': request.COOKIES.get('role'), + 'rname': request.COOKIES.get('rname'), + 'rbranch': request.COOKIES.get('rbranch'), + } + print('masuk') + print(record_riwayat) + print(ordered_food) + print(transaction_status) + return render(request, 'konfiirmasi_pembayaran.html', context) + + def pesanan_berlangsung(request): context = { 'pesanan_berlangsung': [ { - 'restoran' : 'Sego Berkat', - 'waktu_pesanan_dibuat' : '2022-11-04 11:30:05', - 'status_pesanan' : 'Menunggu Konfirmasi Restoran', - + 'restoran': 'Sego Berkat', + 'waktu_pesanan_dibuat': '2022-11-04 11:30:05', + 'status_pesanan': 'Menunggu Konfirmasi Restoran', + }, { - 'restoran' : 'Sego sami', - 'waktu_pesanan_dibuat' : '2022-11-06 11:30:05', - 'status_pesanan' : 'Menunggu Konfirmasi Restoran', - + 'restoran': 'Sego sami', + 'waktu_pesanan_dibuat': '2022-11-06 11:30:05', + 'status_pesanan': 'Menunggu Konfirmasi Restoran', + }, ] } return render(request, 'pesanan_berlangsung.html', context) + + def ringkasan_pesanan(request): context = { 'nama': 'Budi', @@ -60,6 +106,7 @@ def ringkasan_pesanan(request): } return render(request, 'ringkasan_pesanan.html', context) + def konfirmasi_pembayaran(request): context = { 'nama': 'Budi', @@ -97,138 +144,115 @@ def konfirmasi_pembayaran(request): } return render(request, 'konfirmasi_pembayaran.html', context) -def daftar_pesanan_makanan(request): + +def daftar_pesanan_makanan(request, rname, rbranch): + context = { 'daftar_pesanan_makanan': [ { - 'Nama_Pesanan' : 'Nasi Bakar', - 'Harga' : '5000', - 'Jumlah' : '1', - 'Total' : '5000', - 'Metode_Pengantaran':'Motor', - 'Metode_Pembayaran':'RestoPay', - 'Total_Diskon' : '0', - 'Biaya_Pengantaran' : '4000', - 'Total_Biaya' : '9000', - + 'Nama_Pesanan': 'Nasi Bakar', + 'Harga': '5000', + 'Jumlah': '1', + 'Total': '5000', + 'Metode_Pengantaran': 'Motor', + 'Metode_Pembayaran': 'RestoPay', + 'Total_Diskon': '0', + 'Biaya_Pengantaran': '4000', + 'Total_Biaya': '9000', + }, ] } return render(request, 'daftar_pesanan_makanan.html', context) -def pemilihan_pesanan_pada_restoran(request): - context = { - 'daftar_makanan': [ - { - 'Nama_Makanan' : 'Nasi Bakar', - 'Harga' : '50000' - - }, - { - 'Nama_Makanan' : 'Nasi Rebus', - 'Harga' : '6000' - - }, - { - 'Nama_Makanan' : 'Nasi kuah', - 'Harga' : '7000' - - }, - ] - } - return render(request, 'pemilihan_pesanan_pada_restoran.html', context) -def pemilihan_pesanan_pada_restoran(request): + + +def pemilihan_pesanan_pada_restoran(request, rname, rbranch): + cursor.execute( + f'select foodname,price from food where rname=\'{rname}\' and rbranch=\'{rbranch}\'') + records = cursor.fetchall() context = { - 'daftar_makanan': [ - { - 'Nama_Makanan' : 'Nasi Bakar', - 'Harga' : '50000' - - }, - { - 'Nama_Makanan' : 'Nasi Rebus', - 'Harga' : '6000' - - }, - { - 'Nama_Makanan' : 'Nasi kuah', - 'Harga' : '7000' - - }, - ] + 'records': records + + } return render(request, 'pemilihan_pesanan_pada_restoran.html', context) + def pengisian_alamat_pemesanan_makanan(request): form = FormPengisianAlamatMakanan(request.POST or None) + if request.method == "POST": + cursor.execute(f'select distinct province from delvery_fee_per_km') + records = cursor.fetchall() + context = { + 'form': form, + 'records': records + } + return render(request, 'pengisian_alamat_pemesanan_makanan.html', context) + cursor.execute(f'select distinct province from delivery_fee_per_km') + records = cursor.fetchall() + context = { 'form': form, - } + 'records': records + } return render(request, 'pengisian_alamat_pemesanan_makanan.html', context) + def daftar_restoran_di_provinsi(request): + province = request.get + cursor.execute(f'select restaurant.rname,restaurant.rbranch,promo.promoname from restaurant,restaurant_promo,promo where restaurant.rname= restaurant_promo.rname and restaurant_promo.rbranch = restaurant_promo.rbranch and restaurant_promo.pid= promo.id') + records = cursor.fetchall() + # for i in range(len(records)): + # for i in range(len(records_restoran)): + # cursor.execute( + # f'select * from promo where id = \'{records_restoran[i][8]}\' ') + # if len(cursor.fetchmany()) == 1: + # records_restoran[i] += ('Nama Promo', i+1) context = { - 'daftar_restoran': [ - { - 'Nama_Cabang_Restoran' : 'Sego Berkat Depok', - 'Promo_Berlangsung' : 'Promo 17 Agustusan' - - }, - { - 'Nama_Cabang_Restoran' : 'Bebek carok Bogor', - 'Promo_Berlangsung' : '-' - - }, - { - 'Nama_Cabang_Restoran' : 'Nasi rebus Bekasi', - 'Promo_Berlangsung' : 'Promo Hidup Santuy' - - }, - ] + 'records': records } return render(request, 'daftar_restoran_di_provinsi.html', context) - + + def buat_kategori_makanan(request): form = FormBuatKategoriMakanan(request.POST or None) - + if request.method == "POST": + nama = request.POST.get('nama') + if form.is_valid(): + cursor.execute( + f"SELECT MAX(CAST(id as DECIMAL)) from food_category") + maxId = cursor.fetchall()[0][0] + length = int(maxId) + 1 + cursor.execute( + f'insert into food_category values (\'{length}\', \'{nama}\')') + connection.commit() + context = { + 'form': form, + } + return render(request, 'buat_kategori_makanan.html', context) context = { 'form': form, } - return render(request, 'buat_kategori_makanan.html', context) + def daftar_kategori_makanan(request): - context = { - 'daftar_kategori_makanan': [ - { - 'nama': 'carnivore diet', - - }, - { - 'nama': 'vegetarian', - - }, - { - 'nama': 'pemakan angin', - - }, - { - 'nama': 'anti kolesterol', - - }, - { - 'nama': 'murah meriah', - - }, - { - 'nama': 'berkat masjid', - - }, - { - 'nama': 'yang penting halal', - - }, - ] - } - return render(request, 'daftar_kategori_makanan.html', context) \ No newline at end of file + cursor.execute('select * from food_category') + records = cursor.fetchall() + records = sorted(records, key=lambda x: x[1].lower()) + for i in range(len(records)): + cursor.execute( + f'select * from food where fcategory = \'{records[i][0]}\'') + if len(cursor.fetchmany()) == 1: + records[i] += ('Makanan', i+1) + + context = {'records': records} + return render(request, 'daftar_kategori_makanan.html', context) + + +def delete_kategori_makanan(request, id): + cursor.execute(f'delete from food_category where id = \'{id}\'') + connection.commit() + return HttpResponseRedirect(reverse('trigger4:daftar_kategori_makanan'))