from django.shortcuts import render
from navigator.artikel.models import Konten
from navigator.layanan.models import Aplikasi

# Create your views here.

#########################################################################
##      LIST APLIKASI 
def getLayanan(request):
    layanan_list = Aplikasi.objects.all() # select * from Aplikasi
    template = 'navigator/list_aplikasi.html' # letak html nya
    context = {
         'layanan_list':layanan_list
    }
    context['segment'] = 'ekosistem_digital'
    return render(request, template, context)


def getLayananSinergi(request):
    #layanan_list = Aplikasi.objects.all() # select * from Aplikasi
    template = 'navigator/layanan_sinergi.html' # letak html nya
    context = {
         #'layanan_list':layanan_list
    }
    return render(request, template, context)


#########################################################################
##      DATA TRANSAKSI 
def indexDataTransaksi(request):
    template = 'navigator/datatransaksi/index.html' # letak html nya
    context = {}
    return render(request, template, context)
    
def dataTransaksi(request):
    list_sekilas = Konten.objects.filter(id=1)
    list_regulasi = Konten.objects.filter(id=2)
    list_pembakuan = Konten.objects.filter(id=3)

    context = {}
    context['segment'] = 'index'
    context['judul'] = 'Home'
    context['headline'] = 'SIKD NAVIGATOR'
    context['Konten_Sekilas'] = list_sekilas
    context['Konten_Regulasi'] = list_regulasi
    context['Konten_Pembakuan'] = list_pembakuan


    template = 'navigator/datatransaksi/datatransaksi.html' # letak html nya
    return render(request, template, context)

