Closed botanicvelious closed 5 years ago
from django.shortcuts import render
from aldryn_newsblog import models
def unpublished_article(request):
unpublished = None
if request.user.is_authenticated:
unpublished = models.Article.objects.filter(author__user=request.user, is_published=False)
return render(request, 'unpublished_notice.html', {'unpublished': unpublished})
I have created a demo view like this and this one does the required job but how should I integrate this with the djangocms?
You can override the default template files.
So, should I have to override all the templates or only base.html would be enough?
Whatever template you need to override to make it work. Dont just override everything for no reason, just the ones you need.
I created a page named "unpublished-page" and kept it as unpublished. Now it shows a large red box at the top to admin if a page is unpublished. Is this what, exactly was required? It shows the red box only on unpublished page.
Looks correct, make sure that only displays when someone is logged in!
@botanicvelious Is there something more required in this issue?
This task is to add a notice to a logged in user when a page is unpublished. Some sort of large red box at the top would do nicely.