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' %}

Community Activity



diff --git a/templates/contributors.html b/templates/contributors.html index 32abe1a6..84e4acbb 100644 --- a/templates/contributors.html +++ b/templates/contributors.html @@ -9,6 +9,7 @@ Contributors Data + {% include 'ribbon.html' %}

Details of all the contributors