Skip to content

Commit

Permalink
Merge pull request #3 from roniahmadi/main
Browse files Browse the repository at this point in the history
update
  • Loading branch information
roniahmadi authored Jul 13, 2024
2 parents 94cbd47 + b47acdd commit 0e55702
Show file tree
Hide file tree
Showing 22 changed files with 129 additions and 140 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
mysql
.env
**/__pycache__
**/migrations
# projekpi/settings.py #
Binary file modified frontend/static/video.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/templates/checkout/home_beli.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h4> {% translater user.languages.code "Checkout" "Checkout" %} {{ cart_item.pro
<div class="border rounded flex flex-row">
<div class="w-24 h-30 ">
{% if produk.gambarutama %}
<img src="/media/{{ produk.gambarutama.gambar }}" />
<img src="{% get_media_prefix %}{{ produk.gambarutama.gambar }}" />
{% else %}
{{ produk.nama }}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/home/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2 class="text-xl font-bold">Back</h2>
{% if gambar %}
{% for g in gambar %}
<li class="splide__slide">
<img src="/media/{{ g.gambar }}" alt="" class="image-fluid w-100" />
<img src="{% get_media_prefix %}{{ g.gambar }}" alt="" class="image-fluid w-100" />
</li>
{% endfor %}
{% else %}
Expand Down
4 changes: 2 additions & 2 deletions frontend/templates/home/home_pencarian.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="flex flex-col gap-5 overflow-y-hidden flex-wrap overflow-x-scroll h-[250px]" style="height: 280px;">
{% for ktg in kategori %}
<div class="flex justify-between flex-col items-center my-2 cursor-pointer h-[90px] w-[100px]" onclick="redirect_kategori('{{ ktg.pk }}')">
<img src="/media/{{ ktg.icon }}" alt="{{ ktg.nama }}" class="w-13 h-[6rem]" />
<img src="{% get_media_prefix %}{{ ktg.icon }}" alt="{{ ktg.nama }}" class="w-13 h-[6rem]" />
<span style="" class="text-[12px] font-bold text-center">{{ ktg.nama }}</span>
</div>
{% endfor %}
Expand All @@ -39,7 +39,7 @@ <h1 class="font-bold">List Product</h1>
<div class="min-w-[112px] border rounded-xl overflow-hidden">
<a href='{% url "detail_produk" pro.slug %}'>
{% if pro.gambarutama %}
<img src="/media/{{pro.gambarutama.gambar}}" class="object-cover max-h-40 w-full" alt="" />
<img src="{% get_media_prefix %}{{pro.gambarutama.gambar}}" class="object-cover max-h-40 w-full" alt="" />
{% else %}
<img src="{% static 'sample.png' %}" class="image-fluid" alt="" />
{% endif %}
Expand Down
41 changes: 38 additions & 3 deletions frontend/templates/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ul class="splide__list">
{% for b in banner %}
<li class="splide__slide rounded h-40 overflow-hidden">
<img src="/media/{{ b.image }}" alt="" class="image-fluid w-100 rounded" />
<img src="{% get_media_prefix %}{{ b.image }}" alt="" class="image-fluid w-100 rounded" />
</li>
{% endfor %}
</ul>
Expand Down Expand Up @@ -39,7 +39,7 @@
<div class="flex flex-col gap-5 overflow-y-hidden flex-wrap overflow-x-scroll h-[250px]" style="height: 280px;">
{% for ktg in kategori %}
<div class="flex justify-between flex-col items-center my-2 cursor-pointer h-[90px] w-[100px]" onclick="redirect_kategori('{{ ktg.pk }}')">
<img src="/media/{{ ktg.icon }}" alt="{{ ktg.nama }}" class="w-13 h-[6rem]" />
<img src="{% get_media_prefix %}{{ ktg.icon }}" alt="{{ ktg.nama }}" class="w-13 h-[6rem]" />
<span class="text-[12px] font-bold text-center">{% translater user.languages.code ktg.nama ktg.nama %}</span>
</div>
{% endfor %}
Expand All @@ -60,7 +60,42 @@
<h1 class="font-bold">{% translater user.languages.code "Product" "Produk" %}</h1>
<a href="/produk" class="text-sm underline text-slate-400">{% translater user.languages.code "Selengkapnya" "Selengkapnya" %}</a>
</div>
<div class="grid grid-cols-2 flex-wrap gap-6 overflow-auto" id="produks-list">
<div class="grid grid-cols-2 flex-wrap gap-6 overflow-auto">
{% for a in produk.object_list %}
<div class="min-w-[112px] rounded-xl">
<a href="{% url 'detail_produk' a.slug %}">
{% if a.gambarutama %}
<img src="/media/{{ a.gambarutama.gambar }}" class="object-cover max-h-40 w-full" alt="" />
{% else %}
<img src="{% static 'sample.png' %}" class="image-fluid" alt="" />
{% endif %}
<span class="text-xs bg-fuchsia-700 px-2 rounded-r-full p-1 font-semibold text-white ktg-translate" id="ktg-${index_res}">
{% if a.tipe %}
{{ a.tipe.nama }}
{% else %}
Untype
{% endif %}
</span>
<div class="flex flex-col p-2 w-full gap-1">
<p class="text-xs text-slate-600 text-[9px] toko-r" id="toko-r-${index_res}">Toko <strong>
{{ a.store.nama }}
</strong></p>
<h4 class="text-sm produk-nama" id="produk-nama-${index_res}">{{ a.nama }}</h4>
<p class="font-bold text-xs text-orange-400 produk-coin" id="produk-coin-${index_res}">Coin: {{ a.harga }} π</p>
<hr />
<p class="text-xs text-slate-600 produk-stok" id="produk-stok-${index_res}">Stock :{{ a.stok_produk }}</p>
<div class="rating">
<input type="radio" value="0" name="rating-{{ forloop.counter }}" style="display: none;" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star is None %} checked {% endif %}/>
<input type="radio" value="1" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 1 %} checked {% endif %} />
<input type="radio" value="2" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 2 %} checked {% endif %} />
<input type="radio" value="3" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 3 %} checked {% endif %} />
<input type="radio" value="4" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 4 %} checked {% endif %} />
<input type="radio" value="5" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 5 %} checked {% endif %} />
</div>
</div>
</a>
</div>
{% endfor %}
</div>
</div>
</div>
Expand Down
136 changes: 46 additions & 90 deletions frontend/templates/home/produk.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,114 +5,70 @@
<div class="flex items-center justify-between">
<h1 class="font-bold my-4">All Product ({{kategori.nama}})</h1>
<div class="relative flex">
<div class="p-2 shadow-sm flex items-center rounded-l-full border">
<!-- <div class="p-2 shadow-sm flex items-center rounded-l-full border">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-slate-500" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M4 6h16M7 12h10m-6 6h2"></path></svg>
</div>
<select id="states" class="bg-gray-50 border border-gray-200 text-gray-900 text-xs rounded-r-full focus:ring-blue-500 focus:border-blue-500 w-full p-2.5">
</div> -->
<!-- <select id="states" class="bg-gray-50 border border-gray-200 text-gray-900 text-xs rounded-r-full focus:ring-blue-500 focus:border-blue-500 w-full p-2.5">
<option selected="">Filter</option>
<option value="harga">Harga</option>
<option value="stock">Stock</option>
<option value="new">Terbaru</option>
</select>
</select> -->
</div>
</div>
<div class="grid grid-cols-2 gap-1 " id="produks-list">

<div class="grid grid-cols-2 gap-1 ">
{% for a in produk.object_list %}
<div class="min-w-[112px] rounded-xl">
<a href="{% url 'detail_produk' a.slug %}">
{% if a.gambarutama %}
<img src="/media/{{ a.gambarutama.gambar }}" class="object-cover max-h-40 w-full" alt="" />
{% else %}
<img src="{% static 'sample.png' %}" class="image-fluid" alt="" />
{% endif %}
<span class="text-xs bg-fuchsia-700 px-2 rounded-r-full p-1 font-semibold text-white ktg-translate" id="ktg-${index_res}">
{% if a.tipe %}
{{ a.tipe.nama }}
{% else %}
Untype
{% endif %}
</span>
<div class="flex flex-col p-2 w-full gap-1">
<p class="text-xs text-slate-600 text-[9px] toko-r" id="toko-r-${index_res}">Toko <strong>
{{ a.store.nama }}
</strong></p>
<h4 class="text-sm produk-nama" id="produk-nama-${index_res}">{{ a.nama }}</h4>
<p class="font-bold text-xs text-orange-400 produk-coin" id="produk-coin-${index_res}">Coin: {{ a.harga }} π</p>
<hr />
<p class="text-xs text-slate-600 produk-stok" id="produk-stok-${index_res}">Stock :{{ a.stok_produk }}</p>
<div class="rating">
<input type="radio" value="0" name="rating-{{ forloop.counter }}" style="display: none;" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star is None %} checked {% endif %}/>
<input type="radio" value="1" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 1 %} checked {% endif %} />
<input type="radio" value="2" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 2 %} checked {% endif %} />
<input type="radio" value="3" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 3 %} checked {% endif %} />
<input type="radio" value="4" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 4 %} checked {% endif %} />
<input type="radio" value="5" name="rating-{{ forloop.counter }}" class="mask mask-star-2 bg-orange-400" disabled {% if a.count_star == 5 %} checked {% endif %} />
</div>
</div>
</a>
</div>
{% endfor %}
</div>
<div class="flex justify-between bg-slate-400 rounded-full my-3">
<div>
<a href="#" class="px-3 py-3 my-2" id="prev-button">Prev</a>
{% if produk.has_previous %}
<a href="{% url 'produk' %}?page={{ produk.previous_page_number }}" class="px-3 py-3 my-2" id="prev-button">Prev</a>
{% endif %}
</div>
<div>
<a href="#" class="px-3 py-3" id="next-button" aria-disabled="true">Next</a>
{% if produk.has_next %}
<a href="{% url 'produk' %}?page={{ produk.next_page_number }}" class="px-3 py-3" id="next-button" aria-disabled="true">Next</a>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block script %}
{% comment %} <script src="{% static 'star-rating-master/jquery.rating.js' %}"></script> {% endcomment %}
<script>
function loopdata(obj, i=0){
if(obj[i]){
let index_res = i
let data_res = obj[i]
let html = `
<div class="min-w-[112px] rounded-xl">
<a href='${data_res.produk_detail_url}'>
${data_res.gambar ?
(data_res.gambar.length > 0 ?
`<img src="${data_res.gambar[0].gambar}" class="object-cover max-h-40 w-full" alt="" />`
:
`<img src="{% static 'sample.png' %}" class="image-fluid" alt="" />`
)
:
`<img src="{% static 'sample.png' %}" class="image-fluid" alt="" />`
}
<span class="text-xs bg-fuchsia-700 px-2 rounded-r-full p-1 font-semibold text-white ktg-translate" id="ktg-${index_res}">
${data_res.tipe ?
data_res.tipe.nama : "Untype"
}
</span>
<div class="flex flex-col p-2 w-full gap-1">
<p class="text-xs text-slate-600 text-[9px] toko-r" id="toko-r-${index_res}">Toko <strong>
${data_res.store.nama}
</strong></p>
<h4 class="text-sm produk-nama" id="produk-nama-${index_res}">${data_res.nama}</h4>
<p class="font-bold text-xs text-orange-400 produk-coin" id="produk-coin-${index_res}">Coin: ${data_res.harga} π</p>
<hr />
<p class="text-xs text-slate-600 produk-stok" id="produk-stok-${index_res}">Stock :${data_res.stok_produk}</p>
<div class="rating">
<input type="radio" value="1" name="rating-1" style="display: none;" class="mask mask-star-2 bg-orange-400" disabled ${data_res.count_star == 0 ? "checked" : "" } />
<input type="radio" value="1" name="rating-1" class="mask mask-star-2 bg-orange-400" disabled ${data_res.count_star == 1 ? "checked" : "" } />
<input type="radio" value="2" name="rating-1" class="mask mask-star-2 bg-orange-400" disabled ${data_res.count_star == 2 ? "checked" : "" } />
<input type="radio" value="3" name="rating-1" class="mask mask-star-2 bg-orange-400" disabled ${data_res.count_star == 3 ? "checked" : "" } />
<input type="radio" value="4" name="rating-1" class="mask mask-star-2 bg-orange-400" disabled ${data_res.count_star == 4 ? "checked" : "" } />
<input type="radio" value="5" name="rating-1" class="mask mask-star-2 bg-orange-400" disabled ${data_res.count_star == 5 ? "checked" : "" } />
</div>
</div>
</a>
</div>
`
$('#produks-list').append(html)
i = i + 1
loopdata(obj, i)
}else{
}
}
async function getProduk(next=null, prev=null){
let url = '{% url "produk-list" %}{% if request.GET.kategori %}?kategori={{ request.GET.kategori }}{% endif %}'
$('#produks-list').html('')
if(next){
url = next
}
if(prev){
url = prev
}
$.ajax({
url: url,
method:"get",
success: function(res){
if(res.count > 0){
loopdata(res.results)
}
if(res.next){
$('#next-button').attr("onclick", `getProduk("${res.next}", "")`)
}else{
$('#next-button').attr("onclick", ``)
}
if(res.previous){
$('#prev-button').attr("onclick", `getProduk("","${res.previous}")`)
}else{
$('#prev-button').attr("onclick", ``)
}
}
})
}

$(function () {
getProduk()
});
</script>
{% endblock %}

{% block styles %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/koleksi.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1 class="font-bold my-4">All Product</h1>
<div class="min-w-[112px] border rounded-xl overflow-hidden">
<a href='{% url "detail_produk" pro.slug %}'>
{% if pro.gambarutama %}
<img src="/media/{{pro.gambarutama.gambar}}" class="object-cover max-h-40 w-full" alt="" />
<img src="{% get_media_prefix %}{{pro.gambarutama.gambar}}" class="object-cover max-h-40 w-full" alt="" />
{% else %}
<img src="{% static 'sample.png' %}" class="image-fluid" alt="" />
{% endif %}
Expand Down
33 changes: 4 additions & 29 deletions frontend/templates/mail_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,47 +144,22 @@
</td>
</tr>

<tr class="heading">
<td>Payment Method</td>

<td>Check #</td>
</tr>

<tr class="details">
<td>Check</td>

<td>1000</td>
</tr>

<tr class="heading">
<td>Item</td>

<td>Price</td>
</tr>

<tr class="item">
<td>Website design</td>

<td>$300.00</td>
</tr>

<tr class="item">
<td>Hosting (3 months)</td>
<td>{{ carts.produk }}</td>

<td>$75.00</td>
<td>{{ carts.produk.harga }}</td>
</tr>

<tr class="item last">
<td>Domain name (1 year)</td>

<td>$10.00</td>
</tr>

<tr class="total">
<!-- <tr class="total">
<td></td>
<td>Total: $385.00</td>
</tr>
</tr> -->
</table>
</div>
</body>
Expand Down
8 changes: 8 additions & 0 deletions frontend/templates/member/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
<label for="" class="px-2">Nama</label>
<input type="text" name="name" class="w-full rounded-full" required>
</div>
<div class="my-2">
<label for="" class="px-2">Email</label>
<input type="text" name="email" class="w-full rounded-full" required>
</div>
<div class="my-2">
<label for="" class="px-2">Nomor</label>
<input type="text" name="nomor" class="w-full rounded-full" required>
</div>
<button type="submit" class="bg-green-600 text-center mt-8 rounded w-full">Daftar</button>
</form>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/profil/profiles_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="flex flex-row justify-center">
<div class="w-[100px] flex flex-col">
{% if user.image_profile %}
<img src="/media/{{ user.image_profile }}" alt="" class="w-full h-[100px] rounded-full" id="profile-image">
<img src="{% get_media_prefix %}{{ user.image_profile }}" alt="" class="w-full h-[100px] rounded-full" id="profile-image">
{% else %}
<img src="{% static 'logo_atas.jpg' %}" alt="" class="w-full h-[100px] rounded-full" id="profile-image">
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/promo.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 class="font-bold my-4">Sedang Promo</h1>
<div class="min-w-[112px] border rounded-xl overflow-hidden">
<a href='{% url "detail_produk" pro.slug %}'>
{% if pro.gambarutama %}
<img src="/media/{{pro.gambarutama.gambar}}" class="object-cover max-h-40 w-full" alt="" />
<img src="{% get_media_prefix %}{{pro.gambarutama.gambar}}" class="object-cover max-h-40 w-full" alt="" />
{% else %}
<img src="{% static 'sample.png' %}" class="image-fluid" alt="" />
{% endif %}
Expand Down
Loading

0 comments on commit 0e55702

Please sign in to comment.