Skip to content

Commit

Permalink
Merge pull request #13 from roniahmadi/main
Browse files Browse the repository at this point in the history
update add transaction module
  • Loading branch information
roniahmadi authored Oct 5, 2024
2 parents 16cffa4 + 99ef6c9 commit 134afa4
Show file tree
Hide file tree
Showing 37 changed files with 234 additions and 582 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
Gerai Pi Indonesia is one of the P2App Marketplaces which will become a Digitalization Transaction Bridge driven by Pi Coin as a Crypto Currency by prioritizing Trust in the Indonesian Pi/Pioneer Community

# Developer of Geraipi
Comingsoon

# Vission and Mission of geraipi
Comingsoon
2 changes: 1 addition & 1 deletion frontend/templates/checkout/home_beli.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'layout.html' %}
{% load static translater %}
{% block content %}
<div class="mt-3 mb-4">
<div class="mt-3 pb-10">
<form action="" method="post" id="sbbutton">
<div class="h-screen mx-3">
{% if messages %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</head>

<body style="background-color: aliceblue">
<div class="container-mobile mx-auto bg-white scroll-smooth min-h-screen no-scrollbar">
<div class="mx-auto bg-white scroll-smooth min-h-screen no-scrollbar max-w-[450px]">
{% block header %}
{% include 'component/header_home.html' %}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/toko/listtransaksi.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ <h3 class="text-lg font-bold text-center">Detail Barang ({{ tr.cart.kode }})</h3
{% if tr.cart.status_toko == 2 %}
<button class="btn btn-sm btn-success" type="button" onclick="sendKurir('transaksi-{{tr.cart.id}}')">Kirim</button>
{% elif tr.cart.status_toko == 3 %}
<a class="btn btn-sm btn-success" href="#">Laporkan</a>
<a class="btn btn-sm btn-success" href="{% url 'toko_laporkan' id=tr.cart.id %}">Laporkan</a>
{% endif %}
<!-- if there is a button in form, it will close the modal -->
<button class="btn btn-sm" type="submit">Close</button>
Expand Down
30 changes: 30 additions & 0 deletions frontend/templates/toko/report.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends 'layout.html' %}
{% load static translater%}
{% load i18n %}
{% block content %}
<div class="mt-3 mb-4 min-h-screen mx-5">
<div class="card max-w-full">
<div class="card-body p-[1rem]">
<div class="">
Laporan Toko <b>{{ user_toko }}</b>
</div>
<div>
<table class="w-full">
<tr>
<td class="w-[1rem]" >Pembeli</td>
<td class="px-1 w-[.1rem]">:</td>
<td>-</td>
</tr>
<tr>
<td class="w-[1rem]">Catatan</td>
<td class="px-1 w-[.1rem]">:</td>
<td></td>
</tr>
</table>
</div>
</div>
</div>
</div>
{% endblock %}
{% block bottom_nav %}
{% endblock %}
2 changes: 2 additions & 0 deletions frontend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
from frontend.views.withdrawl_toko_view import WithdrawlToko
from frontend.views.withdrawl_view import Withdrawl
from frontend.views.withdrawltokojson_view import WithdrawlTokoJson
from frontend.views.toko.report import ReportToko

urlpatterns = [
path("", Splash.as_view(), name="splash"),
Expand Down Expand Up @@ -137,6 +138,7 @@
name="withdrawl_toko_json",
),
path("toko/<int:id>/transaksi/", TransaksiToko.as_view(), name="transaksi_toko"),
path("toko/transaksi/<int:id>/report", ReportToko.as_view(), name="toko_laporkan"),
# user
path("user/withdrawl/", Withdrawl.as_view(), name="withdrawl"),
path(
Expand Down
26 changes: 26 additions & 0 deletions frontend/views/toko/report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django.shortcuts import redirect, render
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt

from frontend.views.base_view import FrontPage
from store.models import UserStore
from transaction.models import Report, ReportImage

Check failure on line 7 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

frontend/views/toko/report.py:7:32: F401 `transaction.models.Report` imported but unused

Check failure on line 7 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

frontend/views/toko/report.py:7:40: F401 `transaction.models.ReportImage` imported but unused

Check failure on line 7 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

frontend/views/toko/report.py:7:32: F401 `transaction.models.Report` imported but unused

Check failure on line 7 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

frontend/views/toko/report.py:7:40: F401 `transaction.models.ReportImage` imported but unused

Check failure on line 7 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

frontend/views/toko/report.py:7:32: F401 `transaction.models.Report` imported but unused

Check failure on line 7 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

frontend/views/toko/report.py:7:40: F401 `transaction.models.ReportImage` imported but unused


@method_decorator(csrf_exempt, name="dispatch")
class ReportToko(FrontPage):
def get(self, request, id):
user_setting = request.user.id

Check failure on line 13 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F841)

frontend/views/toko/report.py:13:9: F841 Local variable `user_setting` is assigned to but never used

Check failure on line 13 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F841)

frontend/views/toko/report.py:13:9: F841 Local variable `user_setting` is assigned to but never used

Check failure on line 13 in frontend/views/toko/report.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F841)

frontend/views/toko/report.py:13:9: F841 Local variable `user_setting` is assigned to but never used
user_toko = request.user.userstore_set.first()
return render(request, "toko/report.html", {"user_toko": user_toko})

def post(self, request, id):
user = UserStore.objects.filter(users_id=id).first()
if user is None:
user = UserStore.objects.create(users_id=id)
if request.POST.get("setuju"):
user.aggrement = True
else:
user.aggrement = False
user.save()
return redirect("/toko/" + str(id))
1 change: 0 additions & 1 deletion master/admin_view/distric.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ class Meta:

class DistricAdmin(ImportExportModelAdmin):
resource_classes = [DistricResource]

1 change: 0 additions & 1 deletion master/admin_view/provinsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ class Meta:

class ProvinsiAdmin(ImportExportModelAdmin):
resource_classes = [ProvinsiResource]

1 change: 0 additions & 1 deletion master/admin_view/regency.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ class Meta:

class RegencyAdmin(ImportExportModelAdmin):
resource_classes = [RegencyResource]

2 changes: 1 addition & 1 deletion master/admin_view/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class Meta:


class RegionAdmin(ImportExportModelAdmin):
resource_classes = [RegionResource]
resource_classes = [RegionResource]
2 changes: 1 addition & 1 deletion master/admin_view/subregion.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ class Meta:


class SubRegionAdmin(ImportExportModelAdmin):
resource_classes = [SubRegionResource]
resource_classes = [SubRegionResource]
2 changes: 1 addition & 1 deletion master/admin_view/village.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ class Meta:


class VillageAdmin(ImportExportModelAdmin):
resource_classes = [VillageResource]
resource_classes = [VillageResource]
2 changes: 1 addition & 1 deletion master/models/configuration_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class ConfigurationWebsite(SingletonModel):

api_biteship = models.CharField(blank=True, null=True, max_length=255)
verification = models.CharField(blank=True, null=True, max_length=255)
bypass_expedisi = models.BooleanField(default=False)
bypass_expedisi = models.BooleanField(default=False)
6 changes: 1 addition & 5 deletions master/models/expedisi.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
from django.db import models
from master.utils import SOURCE_REQUEST


class Expedisi(models.Model):
SOURCE_REQUEST = [
(1, "Raja Ongkir"),
(2, "Biteship"),
]
code = models.CharField(max_length=255, null=True, blank=True)
nama = models.CharField(max_length=255)
url_request = models.URLField(null=True, blank=True)
source_request = models.IntegerField(choices=SOURCE_REQUEST, default=1)

def __str__(self):
return self.nama

4 changes: 4 additions & 0 deletions master/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SOURCE_REQUEST = [
(1, "Raja Ongkir"),
(2, "Biteship"),
]
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions templatenew/admin.py

This file was deleted.

6 changes: 0 additions & 6 deletions templatenew/apps.py

This file was deleted.

3 changes: 0 additions & 3 deletions templatenew/models.py

This file was deleted.

52 changes: 0 additions & 52 deletions templatenew/templates/component/bottom_page.html

This file was deleted.

39 changes: 0 additions & 39 deletions templatenew/templates/component/navbar_page.html

This file was deleted.

1 change: 0 additions & 1 deletion templatenew/templates/home/page.html

This file was deleted.

Loading

0 comments on commit 134afa4

Please sign in to comment.