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_URL": DOMAIN,
"THEME": 'dark',
"SITE_SYMBOL": "shield_person",
"SITE_SYMBOL": "settings",
"DASHBOARD_CALLBACK": "core.views.dashboard_callback",
"SITE_FAVICONS": [
{
@@ -236,9 +236,9 @@ UNFOLD = {
"href": lambda request: static("favicon.svg"),
},
],
# "LOGIN": {
# "image": lambda request: static("robot.png"),
# },
"LOGIN": {
"image": lambda request: static("favicon.png"),
},
"BORDER_RADIUS": "8px",
@@ -248,30 +248,30 @@ UNFOLD = {
"COLORS": {
"base": {
"50": "249 250 251",
"100": "243 244 246",
"200": "229 231 235",
"300": "209 213 219",
"400": "156 163 175",
"500": "107 114 128",
"600": "75 85 99",
"700": "55 65 81",
"800": "31 41 55",
"900": "17 24 39",
"950": "3 7 18"
"50": "250 250 250",
"100": "245 245 245",
"200": "229 229 229",
"300": "212 212 212",
"400": "163 163 163",
"500": "115 115 115",
"600": "82 82 82",
"700": "64 64 64",
"800": "38 38 38",
"900": "23 23 23",
"950": "10 10 10"
},
"primary": {
"50": "255 241 242",
"100": "255 228 230",
"200": "254 205 211",
"300": "253 164 175",
"400": "251 113 133",
"500": "244 63 94",
"600": "225 29 72",
"700": "190 18 60",
"800": "159 18 57",
"900": "136 19 55",
"950": "76 5 25"
"50": "240 253 244",
"100": "220 252 231",
"200": "187 247 208",
"300": "134 239 172",
"400": "74 222 128",
"500": "34 197 94",
"600": "22 163 74",
"700": "21 128 61",
"800": "22 101 52",
"900": "20 83 45",
"950": "5 46 22"
},
"font": {
"subtle-light": "var(--color-base-500)", # text-base-500
@@ -433,7 +433,7 @@ UNFOLD = {
AUTH_USER_MODEL = 'account.User'
def environment_callback(request):
return ["Development", "danger"]
return ["نسخه ی توسعه", "success"]
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
list_display = ['display_image', 'price',]
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"],}),
('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='نام')
description = models.TextField(verbose_name='توضیحات')
price = models.PositiveIntegerField(default=0, verbose_name='قیمت')
min_price = models.PositiveIntegerField(verbose_name='قیمت کف', help_text='این قیمت برای کف قیمتی محصول در نظر گرفته میشود')
currency_type = (
('dollor', 'دلار'),
('toman', 'تومان'),
+2
View File
@@ -47,6 +47,8 @@ class DynamicProductSerializer(serializers.ModelSerializer):
toman_price = obj.price * dollor_price
elif obj.currency == 'derham':
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)
def get_is_new(self, obj):
+1 -1
View File
@@ -24,7 +24,7 @@ services:
[
"sh",
"-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:
- default