-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
135 changed files
with
31,190 additions
and
190 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,54 @@ | ||
# Generated by Django 4.2.5 on 2023-09-27 02:28 | ||
|
||
from django.conf import settings | ||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Product", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(max_length=255)), | ||
("date_added", models.DateField(auto_now_add=True)), | ||
( | ||
"price", | ||
models.IntegerField( | ||
validators=[django.core.validators.MinValueValidator(0)] | ||
), | ||
), | ||
( | ||
"amount", | ||
models.IntegerField( | ||
validators=[django.core.validators.MinValueValidator(0)] | ||
), | ||
), | ||
("description", models.TextField()), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
), | ||
] |
28 changes: 0 additions & 28 deletions
28
main/migrations/0003_alter_product_amount_alter_product_price.py
This file was deleted.
Oops, something went wrong.
Empty file.
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 |
---|---|---|
@@ -1,19 +1,85 @@ | ||
{% extends 'base.html' %} | ||
{% extends 'base.html' %} | ||
|
||
{% block meta %} | ||
<title>Add New Product</title> | ||
<style> | ||
/* Gaya untuk latar belakang dan kontainer form */ | ||
.form-container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background: linear-gradient(45deg, #ff00cc, #3333ff, #00ccff, #33ff00); | ||
background-size: 400% 400%; | ||
animation: gradientAnimation 10s linear infinite; | ||
} | ||
|
||
/* Keyframes animation */ | ||
@keyframes gradientAnimation { | ||
0% { | ||
background-position: 0% 50%; | ||
} | ||
100% { | ||
background-position: 100% 50%; | ||
} | ||
} | ||
|
||
/* Gaya untuk form */ | ||
.form-card { | ||
background-color: rgba(255, 255, 255, 0.8); | ||
border-radius: 5px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); | ||
padding: 20px; | ||
text-align: center; | ||
} | ||
|
||
/* Gaya untuk judul form */ | ||
h1 { | ||
font-size: 36px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
/* Gaya untuk input teks dalam form */ | ||
.form-control { | ||
width: 80%; | ||
padding: 15px; | ||
margin-bottom: 15px; | ||
border: none; | ||
border-radius: 5px; | ||
background: rgba(255, 255, 255, 0.2); | ||
} | ||
|
||
/* Gaya untuk tombol dalam form */ | ||
.btn.submit_btn { | ||
background-color: #2ecc71; | ||
color: #fff; | ||
padding: 15px 30px; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
font-size: 18px; | ||
} | ||
|
||
/* Gaya hover untuk tombol submit */ | ||
.btn.submit_btn:hover { | ||
background-color: #27ae60; | ||
} | ||
</style> | ||
{% endblock meta %} | ||
|
||
{% block content %} | ||
<h1>Add New Product</h1> | ||
|
||
<form method="POST"> | ||
{% csrf_token %} | ||
<table> | ||
{{ form.as_table }} | ||
<tr> | ||
<td></td> | ||
<td> | ||
<input type="submit" value="Add Product"/> | ||
</td> | ||
</tr> | ||
</table> | ||
</form> | ||
|
||
{% endblock %} | ||
<div class="form-container"> | ||
<div class="form-card"> | ||
<h1>Add New Product</h1> | ||
<form method="POST"> | ||
{% csrf_token %} | ||
<div class="form-group"> | ||
{{ form.as_table }} | ||
</div> | ||
<div class="form-group"> | ||
<input class="btn submit_btn" type="submit" value="Add Product"> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
{% endblock content %} |
Oops, something went wrong.