Fixes for the icon in the eventtypes
This commit is contained in:
@@ -50,8 +50,8 @@ MIDDLEWARE = [
|
||||
|
||||
CORS_ALLOWED_ORIGINS = [
|
||||
"http://localhost:5173",
|
||||
"https://prototype.eventifyplus.com/",
|
||||
"https://eventifyplus.com/"
|
||||
"https://prototype.eventifyplus.com",
|
||||
"https://eventifyplus.com"
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'eventify.urls'
|
||||
@@ -74,24 +74,24 @@ TEMPLATES = [
|
||||
|
||||
WSGI_APPLICATION = 'eventify.wsgi.application'
|
||||
|
||||
# DATABASES = {
|
||||
# 'default': {
|
||||
# 'ENGINE': 'django.db.backends.sqlite3',
|
||||
# 'NAME': BASE_DIR / 'db.sqlite3',
|
||||
# }
|
||||
# }
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'eventify_uat_db', # your DB name
|
||||
'USER': 'eventify_uat', # your DB user
|
||||
'PASSWORD': 'eventifyplus@!@#$', # your DB password
|
||||
'HOST': '0.0.0.0', # or IP/domain
|
||||
'PORT': '5440', # default PostgreSQL port
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
|
||||
# DATABASES = {
|
||||
# 'default': {
|
||||
# 'ENGINE': 'django.db.backends.postgresql',
|
||||
# 'NAME': 'eventify_uat_db', # your DB name
|
||||
# 'USER': 'eventify_uat', # your DB user
|
||||
# 'PASSWORD': 'eventifyplus@!@#$', # your DB password
|
||||
# 'HOST': '0.0.0.0', # or IP/domain
|
||||
# 'PORT': '5440', # default PostgreSQL port
|
||||
# }
|
||||
# }
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
|
||||
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
|
||||
|
||||
@@ -5,7 +5,12 @@ from .models import EventType
|
||||
class EventTypeForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = EventType
|
||||
fields = ['event_type']
|
||||
fields = ['event_type', 'event_type_icon']
|
||||
widgets = {
|
||||
'event_type': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'event_type_icon': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
}
|
||||
labels = {
|
||||
'event_type': 'Event Type',
|
||||
'event_type_icon': 'Event Type Icon',
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="container mt-4">
|
||||
<h3>{% if object %}Edit{% else %}Add{% endif %} Event</h3>
|
||||
|
||||
<form method="post" novalidate>
|
||||
<form method="post" enctype="multipart/form-data" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
|
||||
@@ -5,19 +5,26 @@
|
||||
<a class="btn btn-success" href="{% url 'master_data:event_type_add' %}">Add Category</a>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead><tr><th>#</th><th>Event Type</th><th>Actions</th></tr></thead>
|
||||
<thead><tr><th>#</th><th>Event Type</th><th>Icon</th><th>Actions</th></tr></thead>
|
||||
<tbody>
|
||||
{% for c in categories %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ c.event_type }}</td>
|
||||
<td>
|
||||
{% if c.event_type_icon %}
|
||||
<img src="{{ c.event_type_icon.url }}" width="50" height="50" alt="{{ c.event_type }}">
|
||||
{% else %}
|
||||
<span class="text-muted">No icon</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-primary" href="{% url 'master_data:event_type_edit' c.pk %}">Edit</a>
|
||||
<a class="btn btn-sm btn-danger" href="{% url 'master_data:event_type_delete' c.pk %}">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="3">No categories yet.</td></tr>
|
||||
<tr><td colspan="4">No categories yet.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user