# Path: src/ctf_gameserver/web/scoring/models.py
# class Service(models.Model):
# class Flag(models.Model):
#     class Meta:
# class Capture(models.Model):
#     class Meta:
# class StatusCheck(models.Model):
#     class Meta:
# class ScoreBoard(models.Model):
#     class Meta:
# class CheckerState(models.Model):
#     class Meta:
# class GameControl(models.Model):
#     class Meta:
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def get_instance(cls):
#     def clean(self):
#     def are_services_public(self):
#     def competition_started(self):
#     def competition_over(self):
#     STATUSES = {
#         _('up'): 0,      # Maps to "OK" from the checkers' perspective
#         _('down'): 1,
#         _('faulty'): 2,
#         _('flag not found'): 3,
#         _('recovering'): 4
#     }
# 
# Path: src/ctf_gameserver/web/flatpages/models.py
# class Category(models.Model):
#     class Meta:
# class Flatpage(models.Model):
#     class Meta:
#     class ObjectsWithoutCategoryManager(models.Manager):
#     def __str__(self):
#         def get_queryset(self):
#     def __str__(self):
#     def clean(self):
#     def get_absolute_url(self):
#     def siblings(self):
#     def has_siblings(self):
#     def is_home_page(self):
#     def render_content(self):


from django.conf import settings
from .scoring import models as scoring_models
from .flatpages import models as flatpages_models



def game_control(_):
    """
    Context processor which adds information from the Game Control table to the context.
    """

    control_instance = scoring_models.GameControl.get_instance()

    return {
        'competition_name': control_instance.competition_name,
        'registration_open': control_instance.registration_open,
        'services_public': control_instance.are_services_public()
    }


def flatpage_nav(_):
    """
    Context processor which adds data required for the main navigation of flatpages to the context.
    """

    categories = flatpages_models.Category.objects.all()

# Path: src/ctf_gameserver/web/scoring/models.py
# class Service(models.Model):
# class Flag(models.Model):
#     class Meta:
# class Capture(models.Model):
#     class Meta:
# class StatusCheck(models.Model):
#     class Meta:
# class ScoreBoard(models.Model):
#     class Meta:
# class CheckerState(models.Model):
#     class Meta:
# class GameControl(models.Model):
#     class Meta:
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def get_instance(cls):
#     def clean(self):
#     def are_services_public(self):
#     def competition_started(self):
#     def competition_over(self):
#     STATUSES = {
#         _('up'): 0,      # Maps to "OK" from the checkers' perspective
#         _('down'): 1,
#         _('faulty'): 2,
#         _('flag not found'): 3,
#         _('recovering'): 4
#     }
# 
# Path: src/ctf_gameserver/web/flatpages/models.py
# class Category(models.Model):
#     class Meta:
# class Flatpage(models.Model):
#     class Meta:
#     class ObjectsWithoutCategoryManager(models.Manager):
#     def __str__(self):
#         def get_queryset(self):
#     def __str__(self):
#     def clean(self):
#     def get_absolute_url(self):
#     def siblings(self):
#     def has_siblings(self):
#     def is_home_page(self):
#     def render_content(self):


# Path: src/ctf_gameserver/web/context_processors.py
from django.conf import settings
from .scoring import models as scoring_models
from .flatpages import models as flatpages_models




def game_control(_):
    """
    Context processor which adds information from the Game Control table to the context.
    """

    control_instance = scoring_models.GameControl.get_instance()

    return {
        'competition_name': control_instance.competition_name,
        'registration_open': control_instance.registration_open,
        'services_public': control_instance.are_services_public()
    }


def flatpage_nav(_):
    """
    Context processor which adds data required for the main navigation of flatpages to the context.
    """

    categories = flatpages_models.Category.objects.all()

    pages = flatpages_models.Flatpage.objects_without_category.all()