From 21e4d681ca3647a0e38432063614faaab879abec Mon Sep 17 00:00:00 2001 From: bwc9876 Date: Wed, 3 Nov 2021 12:18:47 -0400 Subject: [PATCH] Added copyright page --- Main/templates/about/copyright.html | 26 ++++++++++++++++++++++++++ Main/templates/base.html | 7 +++---- Main/templatetags/common_tags.py | 18 ++++++++++++++++++ Main/urls.py | 3 ++- Main/views.py | 12 ++++++++++++ 5 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 Main/templates/about/copyright.html diff --git a/Main/templates/about/copyright.html b/Main/templates/about/copyright.html new file mode 100644 index 0000000..32d0349 --- /dev/null +++ b/Main/templates/about/copyright.html @@ -0,0 +1,26 @@ +{% extends base_template %} + +{% comment %} + This file is used to show the services used to create this website. +{% endcomment %} + +{% block pageHeader %}Services Used{% endblock %} + +{% block mainContent %} + {% load common_tags %} +
+
+
    +
  • {% external_link "https://www.python.org/" "Python" %}
  • +
  • {% external_link "https://www.djangoproject.com/" "Django" %}
  • +
  • {% external_link "https://pypi.org/project/ldap3/" "ldap3" %}
  • +
  • {% external_link "https://pypi.org/project/jsonschema/" "jsonshcema" %}
  • +
  • {% external_link "https://pypi.org/project/django-mailer/" "django-mailer" %}
  • +
  • {% external_link "https://getbootstrap.com/" "Bootstrap" %}
  • +
  • {% external_link "https://icons.getbootstrap.com/" "Bootstrap Icons" %}
  • +
  • {% external_link "https://jquery.com/" "Jquery" %}
  • +
  • {% external_link "https://sortablejs.github.io/Sortable/" "Sortable.js" %}
  • +
+
+
+{% endblock %} \ No newline at end of file diff --git a/Main/templates/base.html b/Main/templates/base.html index ac34b63..0aaaf65 100644 --- a/Main/templates/base.html +++ b/Main/templates/base.html @@ -94,14 +94,13 @@
- Made by Benjamin - Crocker + Made by {% external_link "https://github.com/Bwc9876" "Benjamin Crocker" classes="link-secondary" %}
- Help + {% external_link "https://github.com/Bwc9876/CodeReview/wiki" "Help" classes="link-secondary" %}
diff --git a/Main/templatetags/common_tags.py b/Main/templatetags/common_tags.py index 97dd3de..22c296a 100644 --- a/Main/templatetags/common_tags.py +++ b/Main/templatetags/common_tags.py @@ -4,6 +4,7 @@ from django import template from django.contrib import messages +from django.template.defaultfilters import safe register = template.Library() @@ -89,3 +90,20 @@ def get_icon_class(message_level): """ return f'bi bi-{icon_classes.get(message_level, "info-circle")}' + + +@register.simple_tag(name="external_link") +def external_link(href: str, display_text: str, classes: str = "") -> str: + """ + This tag will render an element that will open in a new tab and be marked as external + + :param href: The href of the link + :type href: str + :param display_text: The test to display in the element + :type display_text: str + :param classes: Classes to add to the element + :type classes: str + :returns: An element in html that when clicked will open in a new tab + :rtype: str + """ + return safe(f'{display_text}') diff --git a/Main/urls.py b/Main/urls.py index bf6952d..c570d21 100644 --- a/Main/urls.py +++ b/Main/urls.py @@ -17,7 +17,8 @@ urlpatterns = [ path('review/abandon//', views.ReviewAbandonView.as_view(), name="review-abandon"), path('review/grade//', views.ReviewGradeView.as_view(), name="review-grade"), path('review/view//', views.ReviewDetailView.as_view(), name="review-view"), - path('review/completed/', views.ReviewCompleteListView.as_view(), name="review-complete") + path('review/completed/', views.ReviewCompleteListView.as_view(), name="review-complete"), + path('copyright/', views.CopyrightView.as_view(), name="copyright"), ] # If we're in debug, provide URLs to test error pages diff --git a/Main/views.py b/Main/views.py index ebdeb21..2a4b70d 100644 --- a/Main/views.py +++ b/Main/views.py @@ -664,3 +664,15 @@ error_403_handler = Error403.as_view() def error_500_handler(request): return Error500.as_view()(request) + + +# About + +class CopyrightView(TemplateView): + """ + This view displays the services used to make the website + + :cvar template_name: The template to render + """ + + template_name = "about/copyright.html" -- knotmirror 0.0.1