update pannel login and min price and auto collect static

This commit is contained in:
Parsa Nazer
2025-02-04 00:21:40 +03:30
parent 1f66684b04
commit 80b1259224
7 changed files with 51 additions and 29 deletions
+27 -27
View File
@@ -226,7 +226,7 @@ UNFOLD = {
"SITE_HEADER": os.getenv("SITE_HEADER"), "SITE_HEADER": os.getenv("SITE_HEADER"),
"SITE_URL": DOMAIN, "SITE_URL": DOMAIN,
"THEME": 'dark', "THEME": 'dark',
"SITE_SYMBOL": "shield_person", "SITE_SYMBOL": "settings",
"DASHBOARD_CALLBACK": "core.views.dashboard_callback", "DASHBOARD_CALLBACK": "core.views.dashboard_callback",
"SITE_FAVICONS": [ "SITE_FAVICONS": [
{ {
@@ -236,9 +236,9 @@ UNFOLD = {
"href": lambda request: static("favicon.svg"), "href": lambda request: static("favicon.svg"),
}, },
], ],
# "LOGIN": { "LOGIN": {
# "image": lambda request: static("robot.png"), "image": lambda request: static("favicon.png"),
# }, },
"BORDER_RADIUS": "8px", "BORDER_RADIUS": "8px",
@@ -248,30 +248,30 @@ UNFOLD = {
"COLORS": { "COLORS": {
"base": { "base": {
"50": "249 250 251", "50": "250 250 250",
"100": "243 244 246", "100": "245 245 245",
"200": "229 231 235", "200": "229 229 229",
"300": "209 213 219", "300": "212 212 212",
"400": "156 163 175", "400": "163 163 163",
"500": "107 114 128", "500": "115 115 115",
"600": "75 85 99", "600": "82 82 82",
"700": "55 65 81", "700": "64 64 64",
"800": "31 41 55", "800": "38 38 38",
"900": "17 24 39", "900": "23 23 23",
"950": "3 7 18" "950": "10 10 10"
}, },
"primary": { "primary": {
"50": "255 241 242", "50": "240 253 244",
"100": "255 228 230", "100": "220 252 231",
"200": "254 205 211", "200": "187 247 208",
"300": "253 164 175", "300": "134 239 172",
"400": "251 113 133", "400": "74 222 128",
"500": "244 63 94", "500": "34 197 94",
"600": "225 29 72", "600": "22 163 74",
"700": "190 18 60", "700": "21 128 61",
"800": "159 18 57", "800": "22 101 52",
"900": "136 19 55", "900": "20 83 45",
"950": "76 5 25" "950": "5 46 22"
}, },
"font": { "font": {
"subtle-light": "var(--color-base-500)", # text-base-500 "subtle-light": "var(--color-base-500)", # text-base-500
@@ -433,7 +433,7 @@ UNFOLD = {
AUTH_USER_MODEL = 'account.User' AUTH_USER_MODEL = 'account.User'
def environment_callback(request): def environment_callback(request):
return ["Development", "danger"] return ["نسخه ی توسعه", "success"]
def badge_callback(request): def badge_callback(request):
Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

+1 -1
View File
@@ -30,7 +30,7 @@ class ProductModelAdmin(ModelAdmin, ImportExportModelAdmin):
warn_unsaved_form = True warn_unsaved_form = True
list_display = ['display_image', 'price',] list_display = ['display_image', 'price',]
fieldsets = ( fieldsets = (
('Main Fileds', {'fields': ('name', 'description', 'price', 'currency', 'discount', 'category', 'related_products', 'show',), "classes": ["tab"],}), ('Main Fileds', {'fields': ('name', 'description', 'price', 'min_price', 'currency', 'discount', 'category', 'related_products', 'show',), "classes": ["tab"],}),
('SEO Fileds', {'fields': ('meta_description', 'meta_keywords', 'meta_rating', 'slug'), "classes": ["tab"],}), ('SEO Fileds', {'fields': ('meta_description', 'meta_keywords', 'meta_rating', 'slug'), "classes": ["tab"],}),
('Users Fileds', {'fields': ('rating', 'view', 'sell', ), "classes": ["tab"],}) ('Users Fileds', {'fields': ('rating', 'view', 'sell', ), "classes": ["tab"],})
@@ -0,0 +1,19 @@
# Generated by Django 5.1.2 on 2025-02-03 19:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0011_alter_productmodel_category_and_more'),
]
operations = [
migrations.AddField(
model_name='productmodel',
name='min_price',
field=models.PositiveIntegerField(default=100000000, help_text='این قیمت برای کف قیمتی محصول در نظر گرفته میشود', verbose_name='قیمت کف'),
preserve_default=False,
),
]
+1
View File
@@ -89,6 +89,7 @@ class ProductModel(models.Model):
name = models.CharField(max_length=255, verbose_name='نام') name = models.CharField(max_length=255, verbose_name='نام')
description = models.TextField(verbose_name='توضیحات') description = models.TextField(verbose_name='توضیحات')
price = models.PositiveIntegerField(default=0, verbose_name='قیمت') price = models.PositiveIntegerField(default=0, verbose_name='قیمت')
min_price = models.PositiveIntegerField(verbose_name='قیمت کف', help_text='این قیمت برای کف قیمتی محصول در نظر گرفته میشود')
currency_type = ( currency_type = (
('dollor', 'دلار'), ('dollor', 'دلار'),
('toman', 'تومان'), ('toman', 'تومان'),
+2
View File
@@ -47,6 +47,8 @@ class DynamicProductSerializer(serializers.ModelSerializer):
toman_price = obj.price * dollor_price toman_price = obj.price * dollor_price
elif obj.currency == 'derham': elif obj.currency == 'derham':
toman_price = obj.price * dollor_price * dollar_to_dirham toman_price = obj.price * dollor_price * dollar_to_dirham
# min price implmentaion
toman_price = toman_price if toman_price > obj.min_price else obj.min_price
return "{:,.0f} تومان".format(toman_price) return "{:,.0f} تومان".format(toman_price)
def get_is_new(self, obj): def get_is_new(self, obj):
+1 -1
View File
@@ -24,7 +24,7 @@ services:
[ [
"sh", "sh",
"-c", "-c",
"python manage.py migrate && python manage.py runserver 0.0.0.0:8000", "python manage.py migrate && python manage.py collectstatic --no-input && python manage.py runserver 0.0.0.0:8000",
] ]
networks: networks:
- default - default