diff --git a/subjects/templates/subjects/subject_card.html b/subjects/templates/subjects/subject_card.html
index 557b496..13d9564 100644
--- a/subjects/templates/subjects/subject_card.html
+++ b/subjects/templates/subjects/subject_card.html
@@ -1,4 +1,4 @@
-{% load static i18n permissions_tags %}
+{% load static i18n permissions_tags subject_counter %}
{% subject_permissions request.user subject as has_subject_permissions %}
{% subject_view_permissions request.user subject as has_subject_view_permissions %}
@@ -73,8 +73,12 @@
{% if has_subject_view_permissions %}
{% trans "Access Subject" %}
- {% else %}
+ {% elif subject.subscribe_end|aftertoday %}
{% trans "Subscribe to Subject" %}
+
+ {% else %}
+ {% trans "This subject doesn't allow new subscriptions" %}
+
{% endif %}
{% endif %}
diff --git a/subjects/templatetags/subject_counter.py b/subjects/templatetags/subject_counter.py
index 631b9ed..379ac7f 100644
--- a/subjects/templatetags/subject_counter.py
+++ b/subjects/templatetags/subject_counter.py
@@ -1,5 +1,5 @@
from django import template
-
+import datetime
register = template.Library()
@register.filter(name = 'subject_count')
@@ -13,4 +13,11 @@ def subject_count(category, user):
else:
total = category.subject_category.count()
- return total
\ No newline at end of file
+ return total
+
+
+@register.filter(name = 'aftertoday')
+def after_today(date):
+ if date > datetime.datetime.today().date():
+ return True
+ return False
\ No newline at end of file
--
libgit2 0.21.2