Updates to the main page
This commit is contained in:
+36
-2
@@ -1,11 +1,13 @@
|
||||
from django.shortcuts import render, redirect
|
||||
from .models import UsefulLinks, CalendarEvent, MembershipPerson, Payments, SCHAOfficer, Membership
|
||||
from .models import UsefulLinks, CalendarEvent, MembershipPerson, Payments, SCHAOfficer, Membership, CommunityPost
|
||||
from .forms import (
|
||||
ChildrenForm,
|
||||
CommunityPostForm,
|
||||
AddressForm,
|
||||
PeopleForm,
|
||||
CommitteeForm,
|
||||
ServicesForm,
|
||||
|
||||
) # , CaptchaForm
|
||||
from django.db import transaction, IntegrityError
|
||||
|
||||
@@ -489,4 +491,36 @@ def member_dashboard(request):
|
||||
if request.method == "POST":
|
||||
raise NotImplementedError()
|
||||
else:
|
||||
return render(request, "schasite/member_dashboard.html",{})
|
||||
return render(request, "schasite/member_dashboard.html",{})
|
||||
|
||||
def member_posts(request):
|
||||
if request.method == "POST":
|
||||
raise NotImplementedError()
|
||||
else:
|
||||
posts = CommunityPost.objects.all()[:5]
|
||||
return render(request, "schasite/member_posts.html",{"posts":posts})
|
||||
|
||||
def member_posts_create(request):
|
||||
if request.method == "POST":
|
||||
community_post_form = CommunityPostForm(request.POST)
|
||||
if community_post_form.is_valid():
|
||||
community_post_form.save()
|
||||
return render(request, "schasite/member_posts.html",{})
|
||||
else:
|
||||
print(f'Error creating the post: {community_post_form.errors}')
|
||||
return render(request, "schasite/member_posts_create.html",{"community_post": community_post_form})
|
||||
|
||||
else:
|
||||
return render(request, "schasite/member_posts_create.html",{"community_post": CommunityPostForm()})
|
||||
|
||||
def member_posts_detail(request, post_id):
|
||||
if request.method == "POST":
|
||||
raise NotImplementedError()
|
||||
else:
|
||||
return render(request, "schasite/member_posts_detail.html",{})
|
||||
|
||||
def profile(request):
|
||||
if request.method == "POST":
|
||||
raise NotImplementedError()
|
||||
else:
|
||||
return render(request, "schasite/profile.html",{})
|
||||
Reference in New Issue
Block a user