From e02f171a061db7d19a087945d4ae2ee7144d5500 Mon Sep 17 00:00:00 2001
From: Paul Marillonnet <pmarillonnet@entrouvert.com>
Date: Tue, 2 Apr 2019 16:53:40 +0200
Subject: [PATCH 3/3] remove unused a2 idp templatetags package (#31155)

---
 src/authentic2/idp/templatetags/__init__.py   |   0
 .../idp/templatetags/breadcrumbs.py           | 134 ------------------
 2 files changed, 134 deletions(-)
 delete mode 100644 src/authentic2/idp/templatetags/__init__.py
 delete mode 100644 src/authentic2/idp/templatetags/breadcrumbs.py

diff --git a/src/authentic2/idp/templatetags/__init__.py b/src/authentic2/idp/templatetags/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/authentic2/idp/templatetags/breadcrumbs.py b/src/authentic2/idp/templatetags/breadcrumbs.py
deleted file mode 100644
index 5d23851b..00000000
--- a/src/authentic2/idp/templatetags/breadcrumbs.py
+++ /dev/null
@@ -1,134 +0,0 @@
-# This is a copy of http://djangosnippets.org/snippets/1289/
-#
-# it provides two template tags to use in HTML templates: breadcrumb and
-# breadcrumb_url.
-#
-# The first allows creating of simple url, with the text portion and url
-# portion. Or only unlinked text (as the last item in breadcrumb trail for
-# example). The second, can actually take the named url with arguments.
-# Additionally it takes a title as the first argument.
-#
-# Initial Author: Andriy Drozdyuk
-
-
-from django import template
-from django.template import loader, Node, Variable
-from django.utils.encoding import smart_str, smart_unicode
-from django.template.defaulttags import url
-from django.template import VariableDoesNotExist
-
-register = template.Library()
-
-@register.tag
-def breadcrumb(parser, token):
-    """
-    Renders the breadcrumb.
-    Examples:
-        {% breadcrumb "Title of breadcrumb" url_var %}
-        {% breadcrumb context_var  url_var %}
-        {% breadcrumb "Just the title" %}
-        {% breadcrumb just_context_var %}
-
-    Parameters:
-    -First parameter is the title of the crumb,
-    -Second (optional) parameter is the url variable to link to, produced by url tag, i.e.:
-        {% url 'person_detail' object.id as person_url %}
-        then:
-        {% breadcrumb person.name person_url %}
-
-    @author Andriy Drozdyuk
-    """
-    return BreadcrumbNode(token.split_contents()[1:])
-
-
-@register.tag
-def breadcrumb_url(parser, token):
-    """
-    Same as breadcrumb
-    but instead of url context variable takes in all the
-    arguments URL tag takes.
-        {% breadcrumb "Title of breadcrumb" person_detail person.id %}
-        {% breadcrumb person.name person_detail person.id %}
-    """
-
-    bits = token.split_contents()
-    if len(bits)==2:
-        return breadcrumb(parser, token)
-
-    # Extract our extra title parameter
-    title = bits.pop(1)
-    token.contents = ' '.join(bits)
-
-    url_node = url(parser, token)
-
-    return UrlBreadcrumbNode(title, url_node)
-
-
-class BreadcrumbNode(Node):
-    def __init__(self, vars):
-        """
-        First var is title, second var is url context variable
-        """
-        self.vars = map(Variable,vars)
-
-    def render(self, context):
-        title = self.vars[0].var
-
-        if title.find("'")==-1 and title.find('"')==-1:
-            try:
-                val = self.vars[0]
-                title = val.resolve(context)
-            except:
-                title = ''
-
-        else:
-            title=title.strip("'").strip('"')
-            title=smart_unicode(title)
-
-        url = None
-
-        if len(self.vars)>1:
-            val = self.vars[1]
-            try:
-                url = val.resolve(context)
-            except VariableDoesNotExist:
-                url = None
-
-        return create_crumb(title, url)
-
-
-class UrlBreadcrumbNode(Node):
-    def __init__(self, title, url_node):
-        self.title = Variable(title)
-        self.url_node = url_node
-
-    def render(self, context):
-        title = self.title.var
-
-        if title.find("'")==-1 and title.find('"')==-1:
-            try:
-                val = self.title
-                title = val.resolve(context)
-            except:
-                title = ''
-        else:
-            title=title.strip("'").strip('"')
-            title=smart_unicode(title)
-
-        url = self.url_node.render(context)
-        return create_crumb(title, url)
-
-
-def create_crumb(title, url=None):
-    """
-    Helper function
-    """
-    crumb = """<span class="breadcrumbs-arrow">""" \
-            """ > """ \
-            """</span>"""
-    if url:
-        crumb = "%s <a href='%s'>%s</a>" % (crumb, url, title)
-    else:
-        crumb = "%s %s" % (crumb, title)
-
-    return crumb
-- 
2.20.1

