from django.shortcuts import render, redirect
from django.views import View
from django.contrib import messages,auth
from usermanagement.models import UserProfile
from codesofy_lib.custom_config import get_global_master_details,get_local_date_time
from django.views.decorators.cache import cache_control
from django.utils.decorators import method_decorator
import logging
from datetime import datetime


logger = logging.getLogger("user-login-logoff-log")

def get_local_master_details():
    context = get_global_master_details()
    return context
# Create your views here.

@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class HomeView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'home.html',context)
    
@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class WhoView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'who.html',context)

@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class ContactView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'contact.html',context)
    
@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class CaseView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'case.html',context)

@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class CaseDetailView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'case-detail.html',context)
    
@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class BlogView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'blog.html',context)
    
@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class BlogDetailView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'blog-detail.html',context)

@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class CareerView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'career.html',context)

@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class POSView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'pos-product.html',context)

@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class MedisofyView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'medisofy-product.html',context)

@method_decorator(cache_control(no_cache=True, must_revalidate=True,no_store=True), name='dispatch')
class EduSofyView(View):
    def get(self, request):
        context = get_local_master_details()
        return render(request, 'edusofy-product.html', context)