image update
This commit is contained in:
parent
330b22daf7
commit
e288cd3f31
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
@ -131,3 +131,6 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
|
|||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
LOGIN_REDIRECT_URL = '/'
|
LOGIN_REDIRECT_URL = '/'
|
||||||
LOGOUT_REDIRECT_URL = '/'
|
LOGOUT_REDIRECT_URL = '/'
|
||||||
|
|
||||||
|
MEDIA_URL = "/media/"
|
||||||
|
MEDIA_ROOT = BASE_DIR / "media"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path, include
|
from django.urls import path, include
|
||||||
|
from django.conf import settings
|
||||||
|
from django.conf.urls.static import static
|
||||||
from api.views.event import EventView
|
from api.views.event import EventView
|
||||||
from api.views.event_division import EventDivisionView
|
from api.views.event_division import EventDivisionView
|
||||||
from api.views.event_comment import EventCommentView
|
from api.views.event_comment import EventCommentView
|
||||||
@ -20,3 +21,6 @@ urlpatterns = [
|
|||||||
path('change_password/', views.change_password, name='change_password'),
|
path('change_password/', views.change_password, name='change_password'),
|
||||||
path('password_change_done/', views.password_change_done, name='password_change_done')
|
path('password_change_done/', views.password_change_done, name='password_change_done')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if settings.DEBUG: # new
|
||||||
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
BIN
media/event_cover_images/9ndu0d.jpg
Normal file
BIN
media/event_cover_images/9ndu0d.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
@ -12,3 +12,4 @@ requests==2.32.3
|
|||||||
soupsieve==2.6
|
soupsieve==2.6
|
||||||
sqlparse==0.5.1
|
sqlparse==0.5.1
|
||||||
urllib3==2.3.0
|
urllib3==2.3.0
|
||||||
|
pillow==11.1.0
|
||||||
|
@ -10,6 +10,7 @@ class Event(BaseModel):
|
|||||||
id = models.AutoField(primary_key=True)
|
id = models.AutoField(primary_key=True)
|
||||||
name = models.TextField(blank=False, null=False)
|
name = models.TextField(blank=False, null=False)
|
||||||
description = models.TextField(blank=False, null=False)
|
description = models.TextField(blank=False, null=False)
|
||||||
|
cover_image = models.ImageField(blank=True, null=True, default=None, upload_to='event_cover_images/')
|
||||||
division = models.ForeignKey(EventDivision, on_delete=models.CASCADE)
|
division = models.ForeignKey(EventDivision, on_delete=models.CASCADE)
|
||||||
start_date = models.DateTimeField(blank=False, null=False)
|
start_date = models.DateTimeField(blank=False, null=False)
|
||||||
end_date = models.DateTimeField(blank=False, null=False)
|
end_date = models.DateTimeField(blank=False, null=False)
|
||||||
|
@ -9,16 +9,27 @@
|
|||||||
<td>Already Responded</td>
|
<td>Already Responded</td>
|
||||||
<td>Start Date</td>
|
<td>Start Date</td>
|
||||||
<td>End Date</td>
|
<td>End Date</td>
|
||||||
|
<td> img </td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for event in events %}
|
{% for event in events%}
|
||||||
<tr>
|
<div class="accordion-item">
|
||||||
<td><a href="{% url 'event' event.id %}">{{event.name}}</a></td>
|
<div class="accordion-item">
|
||||||
<td>{{event.responses}}</td>
|
<h2 class="accordion-header" id="event-{{event.id}}">
|
||||||
<td>{{event.start_date|date:"m/d/Y"}}</td>
|
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#event-collapse-{{event.id}}" aria-expanded="true" aria-controls="event-collapse-{{event.id}}">
|
||||||
<td>{{event.end_date|date:"m/d/Y"}}</td>
|
{{event.name}}
|
||||||
</tr>
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id="event-collapse-{{event.id}}" class="accordion-collapse collapse" aria-labelledby="event-{{event.id}}" data-bs-parent="#accordionExample">
|
||||||
|
<div class="accordion-body">
|
||||||
|
|
||||||
|
{{event.description}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -18,6 +18,7 @@ def index(request):
|
|||||||
'name': active_event.name,
|
'name': active_event.name,
|
||||||
'start_date': active_event.start_date.date(),
|
'start_date': active_event.start_date.date(),
|
||||||
'end_date': active_event.end_date.date(),
|
'end_date': active_event.end_date.date(),
|
||||||
|
'cover_image': active_event.cover_image,
|
||||||
'responses': ', '.join([x.user.username for x in active_event.availability_set.all()])
|
'responses': ', '.join([x.user.username for x in active_event.availability_set.all()])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user