diff --git a/community/settings.py b/community/settings.py index fa375669..81c2da61 100644 --- a/community/settings.py +++ b/community/settings.py @@ -104,6 +104,10 @@ 'django.template.context_processors.request', 'django.contrib.messages.context_processors.messages', ], + + 'libraries':{ + 'ribbon_link': 'community.templatetags.ribbon_link', + }, }, }, ] diff --git a/community/templatetags/__init__.py b/community/templatetags/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/templatetags/ribbon_link.py b/community/templatetags/ribbon_link.py new file mode 100644 index 00000000..62d095f3 --- /dev/null +++ b/community/templatetags/ribbon_link.py @@ -0,0 +1,12 @@ +from django import template +from community.git import get_remote_url + + +register = template.Library() + + +@register.simple_tag +def get_ribbon_link(): + url = get_remote_url() + link = 'https://' + url.resource + '/' + url.pathname + return link diff --git a/templates/activity.html b/templates/activity.html index a16da76f..e793b3ff 100644 --- a/templates/activity.html +++ b/templates/activity.html @@ -13,6 +13,7 @@
+ {% include 'ribbon.html' %}Note: All the datetime is in UTC
{{ error | safe }}
diff --git a/templates/ribbon.html b/templates/ribbon.html new file mode 100644 index 00000000..70db7d59 --- /dev/null +++ b/templates/ribbon.html @@ -0,0 +1,14 @@ +{% load ribbon_link %} +{% get_ribbon_link as link %} + +