Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
[carpentries#2063] Conditionally show event's recruitment info
Browse files Browse the repository at this point in the history
Show only if we enabled the feature flag.
  • Loading branch information
pbanaszkiewicz committed Jan 19, 2022
1 parent 6e3a65b commit dcc58bd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Empty file.
12 changes: 12 additions & 0 deletions amy/recruitment/templatetags/instructorrecruitment.py
@@ -0,0 +1,12 @@
from django import template
from django.conf import settings

register = template.Library()


@register.simple_tag
def is_instructor_recruitment_enabled():
try:
return bool(settings.INSTRUCTOR_RECRUITMENT_ENABLED)
except AttributeError:
return False
8 changes: 6 additions & 2 deletions amy/templates/workshops/event.html
Expand Up @@ -5,6 +5,7 @@
{% load revisions %}
{% load tags %}
{% load dates %}
{% load instructorrecruitment %}

{% block title %}
<div class="jumbotron container-fluid">
Expand All @@ -24,8 +25,11 @@ <h1 class="d-inline-block">Event <span class="badge badge-light">{{ event.slug }
</div>
<div class="col-lg-6">
{% comment %} Only show Instructor Selection summary in centrally-organised events. Exclude TTT events, too. {% endcomment %}
{% if "TTT" not in event.tags.strings and event.administrator.domain != "self-organized" %}
{% include "includes/instructor_selection_summary.html" with event=event stats=recruitment_stats %}
{% is_instructor_recruitment_enabled as INSTRUCTOR_RECRUITMENT_ENABLED %}
{% if INSTRUCTOR_RECRUITMENT_ENABLED %}
{% if "TTT" not in event.tags.strings and event.administrator.domain != "self-organized" %}
{% include "includes/instructor_selection_summary.html" with event=event stats=recruitment_stats %}
{% endif %}
{% endif %}
</div>
</div>
Expand Down

0 comments on commit dcc58bd

Please sign in to comment.