from django.shortcuts import render
from django.contrib.auth.decorators import login_required

from .models import Plan


@login_required
def list_plans(request):
    plans = Plan.objects.filter(is_active=True, is_public=True).order_by('base_price_per_domain')
    return render(request, 'plans/list.html', {
        'plans': plans,
    })
