Commit 2a08f640 authored by Neal Berones's avatar Neal Berones

added image files to static/ folder, modified details.html to display images for announcements

parent d4cc5c6c
from django.db import models from django.db import models
from homepage.models import WidgetUser from homepage.models import WidgetUser
import os
Like = 'Like' Like = 'Like'
Love = 'Love' Love = 'Love'
...@@ -16,6 +17,10 @@ class Announcement(models.Model): ...@@ -16,6 +17,10 @@ class Announcement(models.Model):
def __str__(self): def __str__(self):
return self.announcement_title return self.announcement_title
def file(self):
value = os.path.basename(self.image.name)
return value
class Reaction(models.Model): class Reaction(models.Model):
reaction_name = models.CharField(max_length=10, choices=REACTION_CHOICES, default=Like) reaction_name = models.CharField(max_length=10, choices=REACTION_CHOICES, default=Like)
tally = models.IntegerField(default = 0) tally = models.IntegerField(default = 0)
......
...@@ -12,5 +12,6 @@ ...@@ -12,5 +12,6 @@
<p>Like: {{ like_tally }}</p> <p>Like: {{ like_tally }}</p>
<p>Love: {{ love_tally }}</p> <p>Love: {{ love_tally }}</p>
<p>Angry: {{ angry_tally }}</p> <p>Angry: {{ angry_tally }}</p>
<img src = "../../static/{{ announcement.file }}" width="400" height="200">
</body> </body>
{% endblock %} {% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment