
from django import template
from Instanssi.kompomaatti.models import Compo, Competition

register = template.Library()

@register.inclusion_tag('kompomaatti/compo_nav_items.html')
def render_base_compos_nav(event_id):
    return {
        'event_id': event_id,
        'compos': Compo.objects.filter(active=True, event_id=event_id)
    }

@register.inclusion_tag('kompomaatti/competition_nav_items.html')
def render_base_competitions_nav(event_id):
    return {
        'event_id': event_id,
        'competitions': Competition.objects.filter(active=True, event_id=event_id)
    }


from django import template
from Instanssi.kompomaatti.models import Compo, Competition

register = template.Library()

@register.inclusion_tag('kompomaatti/tags/compo_nav_items.html')
def render_base_compos_nav(event_id):
    return {
        'event_id': event_id,
        'compos': Compo.objects.filter(active=True, event_id=event_id)
    }

@register.inclusion_tag('kompomaatti/tags/competition_nav_items.html')
def render_base_competitions_nav(event_id):
    return {
        'event_id': event_id,
        'competitions': Competition.objects.filter(active=True, event_id=event_id)
    }

Update tags to use new template subdirectory.
kompomaatti: Update tags to use new template subdirectory.

  
  from django import template
  from Instanssi.kompomaatti.models import Compo, Competition
  
  register = template.Library()
  
- @register.inclusion_tag('kompomaatti/compo_nav_items.html')
+ @register.inclusion_tag('kompomaatti/tags/compo_nav_items.html')
  def render_base_compos_nav(event_id):
      return {
          'event_id': event_id,
          'compos': Compo.objects.filter(active=True, event_id=event_id)
      }
  
- @register.inclusion_tag('kompomaatti/competition_nav_items.html')
+ @register.inclusion_tag('kompomaatti/tags/competition_nav_items.html')
  def render_base_competitions_nav(event_id):
      return {
          'event_id': event_id,
          'competitions': Competition.objects.filter(active=True, event_id=event_id)
      }
  
Update tags to use new template subdirectory.
## Code Before:

from django import template
from Instanssi.kompomaatti.models import Compo, Competition

register = template.Library()

@register.inclusion_tag('kompomaatti/compo_nav_items.html')
def render_base_compos_nav(event_id):
    return {
        'event_id': event_id,
        'compos': Compo.objects.filter(active=True, event_id=event_id)
    }

@register.inclusion_tag('kompomaatti/competition_nav_items.html')
def render_base_competitions_nav(event_id):
    return {
        'event_id': event_id,
        'competitions': Competition.objects.filter(active=True, event_id=event_id)
    }

## Instruction:
Update tags to use new template subdirectory.
## Code After:

from django import template
from Instanssi.kompomaatti.models import Compo, Competition

register = template.Library()

@register.inclusion_tag('kompomaatti/tags/compo_nav_items.html')
def render_base_compos_nav(event_id):
    return {
        'event_id': event_id,
        'compos': Compo.objects.filter(active=True, event_id=event_id)
    }

@register.inclusion_tag('kompomaatti/tags/competition_nav_items.html')
def render_base_competitions_nav(event_id):
    return {
        'event_id': event_id,
        'competitions': Competition.objects.filter(active=True, event_id=event_id)
    }
