#7 Dodati su export/import za template, isto tako template za document
This commit is contained in:
@@ -2,10 +2,11 @@ import logging
|
||||
|
||||
from django.shortcuts import render, redirect , get_object_or_404
|
||||
from .forms import OrganizationForm
|
||||
from .models import Organization,Document,Risk
|
||||
from .models import Organization,Document,Risk, DocumentTemplate
|
||||
from backend.core.utils import get_top_risk
|
||||
from django.urls import reverse
|
||||
from backend.accounts.utils import send_confirmation_email
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
|
||||
# @login_required
|
||||
# def index(request):
|
||||
@@ -73,3 +74,9 @@ def document(request, document_id):
|
||||
'organization': doc.organization,
|
||||
'segments': doc.segments.all(),
|
||||
})
|
||||
|
||||
@staff_member_required
|
||||
def template_preview(request, name):
|
||||
template = get_object_or_404(DocumentTemplate, name=name)
|
||||
parsed_template = template.to_dict()
|
||||
return render(request, 'template_preview.html', {'template': parsed_template})
|
||||
Reference in New Issue
Block a user