diff --git a/csc_new/pages/admin.py b/csc_new/pages/admin.py index 80401b3..a39922b 100755 --- a/csc_new/pages/admin.py +++ b/csc_new/pages/admin.py @@ -1,6 +1,7 @@ from django.contrib import admin -from pages.models import ExamReview, Photo +from pages.models import ExamReview, Photo, GeneralMeetingSlides # Register your models here. admin.site.register(ExamReview) admin.site.register(Photo) +admin.site.register(GeneralMeetingSlides) diff --git a/csc_new/pages/models.py b/csc_new/pages/models.py index a5542ab..4489081 100755 --- a/csc_new/pages/models.py +++ b/csc_new/pages/models.py @@ -27,6 +27,23 @@ def delete(self, *args, **kwargs): super(ExamReview, self).delete(*args, **kwargs) +class GeneralMeetingSlides(models.Model): + date = models.DateField() + pdf = models.FileField(upload_to="general_meeting_slides", verbose_name="PDF") + + class Meta: + verbose_name = "General Meeting Slides" + verbose_name_plural = verbose_name + + def __str__(self): + return self.date.__str__() + + def delete(self, *args, **kwargs): + # this is broken (the delete doesn't work; the file lingers in MEDIA_ROOT) + os.remove(os.path.join(settings.MEDIA_ROOT, str(self.pdf))) + super(GeneralMeetingSlides, self).delete(*args, **kwargs) + + class Photo(models.Model): title = models.CharField(max_length=100) desc = models.CharField(max_length=255) diff --git a/csc_new/pages/templates/pages/resources.html b/csc_new/pages/templates/pages/resources.html index 5357406..64d90f0 100755 --- a/csc_new/pages/templates/pages/resources.html +++ b/csc_new/pages/templates/pages/resources.html @@ -46,6 +46,17 @@

Exam Reviews

{% endfor %} +

General Meeting Slides

+{% for week in slides %} +
+ {{ week.date }} +
+{% empty %} +
+ General Meeting Slides will be posted as the meetings occur throughout the semester. +
+{% endfor %} +

Other Resources

Workshop Resources diff --git a/csc_new/pages/views.py b/csc_new/pages/views.py index ccfeaf0..cfed01a 100755 --- a/csc_new/pages/views.py +++ b/csc_new/pages/views.py @@ -34,6 +34,7 @@ def resources(request): 'exams': ExamReview.objects.all(), 'MEDIA_URL': settings.MEDIA_URL, 'img_list': Photo.objects.values_list('src', flat=True), + 'slides': GeneralMeetingSlides.objects.all(), }) return HttpResponse(template.render(context)) diff --git a/csc_new/staticfiles/css/style.css b/csc_new/staticfiles/css/style.css index e5f90d3..4838dd6 100755 --- a/csc_new/staticfiles/css/style.css +++ b/csc_new/staticfiles/css/style.css @@ -129,6 +129,14 @@ p.footnote { margin-left: 1in; } +.slides > span { + margin-right: 20px; +} + +/* CSS3 negation psuedo-class (@see stackoverflow.com/questions/2573544) */ +.slides:not(:last-child) { + margin-bottom: 10px; +} /* ----------------- FOR PICTURES.HTML ----------------- */