aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-01-23 13:32:21 +0100
committerGravatar Leon Sandøy <[email protected]>2022-01-23 13:32:21 +0100
commitac6e0d026530395d9afae2611f56028b808a7a76 (patch)
treecc1241989d357b6df3bb2a3667cc78f02f37f7cc /pydis_site/apps/resources
parentMerge branch 'main' into swfarnsworth/smarter-resources/merge-with-main (diff)
Kaizen: Refactor some code to be more beautiful.
Diffstat (limited to 'pydis_site/apps/resources')
-rw-r--r--pydis_site/apps/resources/templatetags/get_category_icon.py28
-rw-r--r--pydis_site/apps/resources/views/resources.py4
2 files changed, 16 insertions, 16 deletions
diff --git a/pydis_site/apps/resources/templatetags/get_category_icon.py b/pydis_site/apps/resources/templatetags/get_category_icon.py
index cfac7832..8111cda6 100644
--- a/pydis_site/apps/resources/templatetags/get_category_icon.py
+++ b/pydis_site/apps/resources/templatetags/get_category_icon.py
@@ -4,32 +4,32 @@ register = template.Library()
_ICONS = {
"Algorithms And Data Structures": "fa-cogs",
+ "Beginner": "fa-play-circle",
+ "Book": "fa-book",
+ "Community": "fa-users",
+ "Course": "fa-chalkboard-teacher",
"Data Science": "fa-flask",
"Databases": "fa-server",
+ "Discord Bots": "fa-robot",
+ "Free": "fa-first-aid",
"Game Development": "fa-joystick",
"General": "fa-book",
+ "Interactive": "fa-mouse-pointer",
+ "Intermediate": "fa-align-center",
"Microcontrollers": "fa-microchip",
"Other": "fa-question-circle",
+ "Paid": "fa-sack",
+ "Podcast": "fa-microphone-alt",
"Project Ideas": "fa-lightbulb-o",
"Software Design": "fa-paint-brush",
+ "Subscription": "fa-credit-card",
"Testing": "fa-vial",
- "Tooling": "fa-toolbox",
- "User Interface": "fa-desktop",
- "Web Development": "fa-wifi",
- "Discord Bots": "fa-robot",
- "Book": "fa-book",
- "Community": "fa-users",
- "Course": "fa-chalkboard-teacher",
- "Interactive": "fa-mouse-pointer",
- "Podcast": "fa-microphone-alt",
"Tool": "fa-tools",
+ "Tooling": "fa-toolbox",
"Tutorial": "fa-clipboard-list",
+ "User Interface": "fa-desktop",
"Video": "fa-video",
- "Free": "fa-first-aid",
- "Paid": "fa-sack",
- "Subscription": "fa-credit-card",
- "Beginner": "fa-play-circle",
- "Intermediate": "fa-align-center"
+ "Web Development": "fa-wifi",
}
diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py
index 5b3cccab..de6b2dac 100644
--- a/pydis_site/apps/resources/views/resources.py
+++ b/pydis_site/apps/resources/views/resources.py
@@ -14,8 +14,8 @@ def _parse_checkbox_options(options: str) -> set[str]:
def resource_view(request: HttpRequest) -> HttpResponse:
"""View for resources index page."""
checkbox_options = {
- a: _parse_checkbox_options(request.GET.get(b))
- for a, b in (
+ option: _parse_checkbox_options(request.GET.get(url_param, ""))
+ for option, url_param in (
('topics', 'topic'),
('type', 'type'),
('payment_tiers', 'payment'),