From 3b63ed9f1701820ddb9530265bfc8cf93fc482e3 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Fri, 8 Nov 2019 16:26:44 +0530 Subject: Add model to display schedule details --- static/website/templates/home.html | 321 +-------------------------- static/website/templates/navbar.html | 4 +- website/admin.py | 7 +- website/migrations/0004_tentativeschedule.py | 21 ++ website/models.py | 5 + website/views.py | 6 +- 6 files changed, 49 insertions(+), 315 deletions(-) create mode 100644 website/migrations/0004_tentativeschedule.py diff --git a/static/website/templates/home.html b/static/website/templates/home.html index c35c91b..f2016cd 100644 --- a/static/website/templates/home.html +++ b/static/website/templates/home.html @@ -370,320 +370,21 @@ It provides a unique opportunity to discuss about the latest trends on Scientifi - + + + {% endif %} +
diff --git a/static/website/templates/navbar.html b/static/website/templates/navbar.html index a3f4452..1f98a10 100644 --- a/static/website/templates/navbar.html +++ b/static/website/templates/navbar.html @@ -31,8 +31,8 @@
  • Speakers
  • Register
  • CFP
  • -
  • Photos
  • diff --git a/website/admin.py b/website/admin.py index 85a4b7e..119dc07 100644 --- a/website/admin.py +++ b/website/admin.py @@ -1,5 +1,5 @@ from django.contrib import admin -from .models import CFP, RegistrationDetail, Proposal +from .models import CFP, RegistrationDetail, Proposal, TentativeSchedule class CFPAdmin(admin.ModelAdmin): list_display = ['start_date','end_date','date_of_announcement'] @@ -10,6 +10,11 @@ class RegistrationDetailAdmin(admin.ModelAdmin): class ProposalAdmin(admin.ModelAdmin): list_display = ['title', 'email', 'phone'] +class TentativeScheduleAdmin(admin.ModelAdmin): + list_display = ['schedule_table'] + + admin.site.register(CFP, CFPAdmin) admin.site.register(RegistrationDetail, RegistrationDetailAdmin) admin.site.register(Proposal, ProposalAdmin) +admin.site.register(TentativeSchedule, TentativeScheduleAdmin) diff --git a/website/migrations/0004_tentativeschedule.py b/website/migrations/0004_tentativeschedule.py new file mode 100644 index 0000000..d9b9a6c --- /dev/null +++ b/website/migrations/0004_tentativeschedule.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.4 on 2019-11-08 06:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('website', '0003_auto_20190919_1231'), + ] + + operations = [ + migrations.CreateModel( + name='TentativeSchedule', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('schedule_table', models.TextField(blank=True, null=True)), + ('display_schedule_table', models.BooleanField(default=True)), + ], + ), + ] diff --git a/website/models.py b/website/models.py index a0f9015..e50864e 100644 --- a/website/models.py +++ b/website/models.py @@ -162,3 +162,8 @@ class RegistrationDetail(models.Model): registration_ticket = models.CharField(max_length=100, blank=True, null=True) registration_description = models.TextField(max_length=500, blank= True, null= True) display_registration_type = models.BooleanField(default = True) + +class TentativeSchedule(models.Model): + schedule_table = models.TextField(blank=True, null= True) + display_schedule_table = models.BooleanField(default = True) + \ No newline at end of file diff --git a/website/views.py b/website/views.py index cef071a..aded8a5 100644 --- a/website/views.py +++ b/website/views.py @@ -12,7 +12,7 @@ from django.views.decorators.csrf import (csrf_exempt, csrf_protect, requires_csrf_token) from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User -from website.models import Proposal, Comments, Ratings, CFP, RegistrationDetail +from website.models import Proposal, Comments, Ratings, CFP, RegistrationDetail, TentativeSchedule from website.forms import (ProposalForm, UserRegisterForm, UserRegistrationForm, UserLoginForm, WorkshopForm) # ,ContactForm @@ -42,8 +42,10 @@ def index(request): context = {} registration_details = RegistrationDetail.objects.all() context['registration_details'] = registration_details - cfp_dates = CFP.objects.get(id=1) + cfp_dates = CFP.objects.first() context['cfp_dates'] = cfp_dates + tentative_schedule = TentativeSchedule.objects.first() + context['tentative_schedule'] = tentative_schedule template = loader.get_template('index.html') return HttpResponse(template.render(context, request)) -- cgit