From 9f8ca9ff6217ac20b95aa92c4193df73ef1dccec Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 18 May 2021 22:00:01 +0200 Subject: Add bulma-modal, we'll need it later. --- pydis_site/settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 7df7ad85..710c56cc 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -263,6 +263,7 @@ BULMA_SETTINGS = { "extensions": [ "bulma-dropdown", "bulma-navbar-burger", + "bulma-modal", ], } -- cgit v1.2.3 From 5c37aee79c04d9199dc47b9d60f9899a0f6571d9 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Wed, 19 May 2021 09:02:21 +0200 Subject: Dramatically simplify resources. We don't need _category_info, we don't need subcategories, we this will be much simpler now. Also, rglob is nice. --- .../resources/communities/_category_info.yaml | 2 -- .../resources/courses/_category_info.yaml | 4 --- .../resources/interactive/_category_info.yaml | 4 --- .../resources/podcasts/_category_info.yaml | 4 --- .../resources/reading/_category_info.yaml | 2 -- .../resources/reading/books/_category_info.yaml | 5 --- .../reading/tutorials/_category_info.yaml | 5 --- .../resources/resources/tools/_category_info.yaml | 4 --- .../tools/accessibility/screen_readers.yaml | 7 ++++ .../resources/tools/accessibility/talon_voice.yaml | 6 ++++ .../tools/accessibility_tools/_category_info.yaml | 5 --- .../tools/accessibility_tools/screen_readers.yaml | 7 ---- .../tools/accessibility_tools/talon_voice.yaml | 6 ---- .../resources/tools/editors/_category_info.yaml | 5 --- .../resources/tools/ides/_category_info.yaml | 5 --- .../resources/resources/videos/_category_info.yaml | 2 -- pydis_site/apps/resources/tests/test_views.py | 13 +++----- .../testing_resources/testing/_category_info.yaml | 1 - .../testing/foobar/_category_info.yaml | 1 - pydis_site/apps/resources/urls.py | 2 +- pydis_site/apps/resources/utils.py | 37 ++++------------------ pydis_site/apps/resources/views/resources_list.py | 25 ++------------- 22 files changed, 27 insertions(+), 125 deletions(-) delete mode 100644 pydis_site/apps/resources/resources/communities/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/courses/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/podcasts/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/_category_info.yaml create mode 100644 pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml create mode 100644 pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/accessibility_tools/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/accessibility_tools/screen_readers.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/accessibility_tools/talon_voice.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/editors/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/ides/_category_info.yaml delete mode 100644 pydis_site/apps/resources/resources/videos/_category_info.yaml delete mode 100644 pydis_site/apps/resources/tests/testing_resources/testing/_category_info.yaml delete mode 100644 pydis_site/apps/resources/tests/testing_resources/testing/foobar/_category_info.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/communities/_category_info.yaml b/pydis_site/apps/resources/resources/communities/_category_info.yaml deleted file mode 100644 index b9cb6533..00000000 --- a/pydis_site/apps/resources/resources/communities/_category_info.yaml +++ /dev/null @@ -1,2 +0,0 @@ -description: Partnered communities that share part of our mission. -name: Communities diff --git a/pydis_site/apps/resources/resources/courses/_category_info.yaml b/pydis_site/apps/resources/resources/courses/_category_info.yaml deleted file mode 100644 index 948b48de..00000000 --- a/pydis_site/apps/resources/resources/courses/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: Listing of best Python courses. -name: Courses -default_icon: regular/graduation-cap -default_icon_color: black diff --git a/pydis_site/apps/resources/resources/interactive/_category_info.yaml b/pydis_site/apps/resources/resources/interactive/_category_info.yaml deleted file mode 100644 index 7e8f34d9..00000000 --- a/pydis_site/apps/resources/resources/interactive/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: Learn Python with interactive courses, games, and programming challenges. -name: Interactive -default_icon: branding/python -default_icon_color: black diff --git a/pydis_site/apps/resources/resources/podcasts/_category_info.yaml b/pydis_site/apps/resources/resources/podcasts/_category_info.yaml deleted file mode 100644 index 1d2d3ba5..00000000 --- a/pydis_site/apps/resources/resources/podcasts/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: Notable podcasts about the Python ecosystem. -name: Podcasts -default_icon: regular/microphone-alt -default_icon_color: black diff --git a/pydis_site/apps/resources/resources/reading/_category_info.yaml b/pydis_site/apps/resources/resources/reading/_category_info.yaml deleted file mode 100644 index 64b87e47..00000000 --- a/pydis_site/apps/resources/resources/reading/_category_info.yaml +++ /dev/null @@ -1,2 +0,0 @@ -description: Books and tutorials related to Python and popular third-party libraries and frameworks. -name: Reading diff --git a/pydis_site/apps/resources/resources/reading/books/_category_info.yaml b/pydis_site/apps/resources/resources/reading/books/_category_info.yaml deleted file mode 100644 index ae092a20..00000000 --- a/pydis_site/apps/resources/resources/reading/books/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: The best books for learning Python or Python Frameworks. -name: Books -default_icon: branding/python -default_icon_color: black -position: 0 diff --git a/pydis_site/apps/resources/resources/reading/tutorials/_category_info.yaml b/pydis_site/apps/resources/resources/reading/tutorials/_category_info.yaml deleted file mode 100644 index a18b837d..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Tutorials and references for those that are just getting started with Python. -name: Tutorials -default_icon: branding/python -default_icon_color: black -position: 1 diff --git a/pydis_site/apps/resources/resources/tools/_category_info.yaml b/pydis_site/apps/resources/resources/tools/_category_info.yaml deleted file mode 100644 index 6b16baa6..00000000 --- a/pydis_site/apps/resources/resources/tools/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: This page is a curated list of tools that we regularly recommend in the community. - If you have a suggestion for something to add to this page, please create an issue in - our meta repo, and we'll consider adding it. -name: Tools diff --git a/pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml b/pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml new file mode 100644 index 00000000..39372956 --- /dev/null +++ b/pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml @@ -0,0 +1,7 @@ +description: Screen readers are software programs that allow blind + or visually impaired users to read the text displayed on a computer screen with a speech synthesizer or braille display. + There are many different screen reader program options, + with this link describing many of them and their capabilities. +name: Screen Readers - American Foundation for the Blind +title_url: https://www.afb.org/blindness-and-low-vision/using-technology/assistive-technology-products/screen-readers +position: 1 diff --git a/pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml b/pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml new file mode 100644 index 00000000..9df5f66f --- /dev/null +++ b/pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml @@ -0,0 +1,6 @@ +description: Talon is a tool being built that aims to bring programming, + realtime video gaming, command line, and full desktop computer proficiency to people + who have limited or no use of their hands. +name: Talon Voice +title_url: https://talonvoice.com/ +position: 0 diff --git a/pydis_site/apps/resources/resources/tools/accessibility_tools/_category_info.yaml b/pydis_site/apps/resources/resources/tools/accessibility_tools/_category_info.yaml deleted file mode 100644 index e770db07..00000000 --- a/pydis_site/apps/resources/resources/tools/accessibility_tools/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Accessibility tools that help people write Python code. -name: Accessibility Tools -default_icon: branding/python -default_icon_color: black -position: 2 diff --git a/pydis_site/apps/resources/resources/tools/accessibility_tools/screen_readers.yaml b/pydis_site/apps/resources/resources/tools/accessibility_tools/screen_readers.yaml deleted file mode 100644 index 39372956..00000000 --- a/pydis_site/apps/resources/resources/tools/accessibility_tools/screen_readers.yaml +++ /dev/null @@ -1,7 +0,0 @@ -description: Screen readers are software programs that allow blind - or visually impaired users to read the text displayed on a computer screen with a speech synthesizer or braille display. - There are many different screen reader program options, - with this link describing many of them and their capabilities. -name: Screen Readers - American Foundation for the Blind -title_url: https://www.afb.org/blindness-and-low-vision/using-technology/assistive-technology-products/screen-readers -position: 1 diff --git a/pydis_site/apps/resources/resources/tools/accessibility_tools/talon_voice.yaml b/pydis_site/apps/resources/resources/tools/accessibility_tools/talon_voice.yaml deleted file mode 100644 index 9df5f66f..00000000 --- a/pydis_site/apps/resources/resources/tools/accessibility_tools/talon_voice.yaml +++ /dev/null @@ -1,6 +0,0 @@ -description: Talon is a tool being built that aims to bring programming, - realtime video gaming, command line, and full desktop computer proficiency to people - who have limited or no use of their hands. -name: Talon Voice -title_url: https://talonvoice.com/ -position: 0 diff --git a/pydis_site/apps/resources/resources/tools/editors/_category_info.yaml b/pydis_site/apps/resources/resources/tools/editors/_category_info.yaml deleted file mode 100644 index 3cdfff3a..00000000 --- a/pydis_site/apps/resources/resources/tools/editors/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Lightweight code editors supporting Python -name: Editors -default_icon: branding/python -default_icon_color: black -position: 1 diff --git a/pydis_site/apps/resources/resources/tools/ides/_category_info.yaml b/pydis_site/apps/resources/resources/tools/ides/_category_info.yaml deleted file mode 100644 index 614625a6..00000000 --- a/pydis_site/apps/resources/resources/tools/ides/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Fully-integrated development environments for serious Python work. -name: IDEs -default_icon: branding/python -default_icon_color: black -position: 0 diff --git a/pydis_site/apps/resources/resources/videos/_category_info.yaml b/pydis_site/apps/resources/resources/videos/_category_info.yaml deleted file mode 100644 index 8192e021..00000000 --- a/pydis_site/apps/resources/resources/videos/_category_info.yaml +++ /dev/null @@ -1,2 +0,0 @@ -description: Excellent Youtube channels with content related to Python. -name: Videos diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py index 53685eef..568f4d13 100644 --- a/pydis_site/apps/resources/tests/test_views.py +++ b/pydis_site/apps/resources/tests/test_views.py @@ -19,16 +19,13 @@ class TestResourcesView(TestCase): class TestResourcesListView(TestCase): - @patch("pydis_site.apps.resources.views.resources_list.RESOURCES_PATH", TESTING_RESOURCES_PATH) def test_valid_resource_list_200(self): """Check does site return code 200 when visiting valid resource list.""" - url = reverse("resources:resources", ("testing",)) + url = reverse("resources:resources") response = self.client.get(url) self.assertEqual(response.status_code, 200) - @patch("pydis_site.apps.resources.views.resources_list.RESOURCES_PATH", TESTING_RESOURCES_PATH) - def test_invalid_resource_list_404(self): - """Check does site return code 404 when trying to visit invalid resource list.""" - url = reverse("resources:resources", ("invalid",)) - response = self.client.get(url) - self.assertEqual(response.status_code, 404) + @patch("pydis_site.apps.resources.utils.RESOURCES_PATH", TESTING_RESOURCES_PATH) + def test_filter_resource_list(self): + """TODO: Check that we can correctly filter resources with GET parameters.""" + pass diff --git a/pydis_site/apps/resources/tests/testing_resources/testing/_category_info.yaml b/pydis_site/apps/resources/tests/testing_resources/testing/_category_info.yaml deleted file mode 100644 index bae17ea3..00000000 --- a/pydis_site/apps/resources/tests/testing_resources/testing/_category_info.yaml +++ /dev/null @@ -1 +0,0 @@ -name: Testing diff --git a/pydis_site/apps/resources/tests/testing_resources/testing/foobar/_category_info.yaml b/pydis_site/apps/resources/tests/testing_resources/testing/foobar/_category_info.yaml deleted file mode 100644 index eaac32d9..00000000 --- a/pydis_site/apps/resources/tests/testing_resources/testing/foobar/_category_info.yaml +++ /dev/null @@ -1 +0,0 @@ -name: Foobar diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index 19142081..cd4f53e7 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -5,5 +5,5 @@ from pydis_site.apps.resources import views app_name = "resources" urlpatterns = [ path("", views.ResourcesView.as_view(), name="index"), - path("/", views.ResourcesListView.as_view(), name="resources") + path("list/", views.ResourcesListView.as_view(), name="resources") ] diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 1855fc80..6e21e2ba 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -2,41 +2,16 @@ import typing as t from pathlib import Path import yaml +from django.conf import settings +RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") -def get_resources(path: Path) -> t.List[t.Dict]: + +def get_resources() -> t.List[t.Dict]: """Loads resource YAMLs from provided path.""" resources = [] - for item in path.iterdir(): - if item.is_file() and item.suffix == ".yaml" and item.name != "_category_info.yaml": - resources.append(yaml.safe_load(item.read_text())) + for item in RESOURCES_PATH.rglob("*.yaml"): + resources.append(yaml.safe_load(item.read_text())) return resources - - -def get_subcategories(path: Path) -> t.List[t.Dict]: - """Loads resources subcategories with their resources by provided path.""" - subcategories = [] - - for item in path.iterdir(): - if item.is_dir() and item.joinpath("_category_info.yaml").exists(): - subcategories.append({ - "category_info": { - **yaml.safe_load( - item.joinpath("_category_info.yaml").read_text() - ), - "raw_name": item.name - }, - "resources": [ - yaml.safe_load(subitem.read_text()) - for subitem in item.iterdir() - if ( - subitem.is_file() - and subitem.suffix == ".yaml" - and subitem.name != "_category_info.yaml" - ) - ] - }) - - return subcategories diff --git a/pydis_site/apps/resources/views/resources_list.py b/pydis_site/apps/resources/views/resources_list.py index 55f22993..0ec74d78 100644 --- a/pydis_site/apps/resources/views/resources_list.py +++ b/pydis_site/apps/resources/views/resources_list.py @@ -1,14 +1,8 @@ -from pathlib import Path from typing import Any, Dict -import yaml -from django.conf import settings -from django.http import Http404 from django.views.generic import TemplateView -from pydis_site.apps.resources.utils import get_resources, get_subcategories - -RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") +from pydis_site.apps.resources.utils import get_resources class ResourcesListView(TemplateView): @@ -19,21 +13,6 @@ class ResourcesListView(TemplateView): def get_context_data(self, **kwargs) -> Dict[str, Any]: """Add resources and subcategories data into context.""" context = super().get_context_data(**kwargs) - - resource_path = RESOURCES_PATH / self.kwargs["category"] - if ( - not resource_path.is_dir() - or not resource_path.joinpath("_category_info.yaml").exists() - ): - raise Http404 - - context["resources"] = get_resources(resource_path) - context["subcategories"] = get_subcategories(resource_path) - context["category_info"] = { - **yaml.safe_load( - resource_path.joinpath("_category_info.yaml").read_text() - ), - "raw_name": resource_path.name - } + context["resources"] = get_resources() return context -- cgit v1.2.3 From d5d9b90b8df929745d339d3d38226a16cc6fac13 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 23 May 2021 10:39:29 +0200 Subject: Add GoodReads CSS. --- pydis_site/static/css/resources/resources_list.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources_list.css b/pydis_site/static/css/resources/resources_list.css index 33129c87..e6808a99 100644 --- a/pydis_site/static/css/resources/resources_list.css +++ b/pydis_site/static/css/resources/resources_list.css @@ -34,12 +34,12 @@ i.resource-icon.is-youtube-red:hover { color: #f80000; } -i.resource-icon.is-amazon-orange { - color: #FF9900; +i.resource-icon.is-goodreads-cream { + color: #f3f2e9; } -i.resource-icon.is-amazon-orange:hover { - color: #ffb71a; +i.resource-icon.is-goodreads-cream:hover { + color: #ffffff; } i.resource-icon.is-black { -- cgit v1.2.3 From 3bd5c0c9f6438bde2c913a3820d4128b8faf5140 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 23 May 2021 10:40:45 +0200 Subject: Add tags to all the resources. Also updates all amazon links with GoodReads. --- .../resources/resources/communities/adafruit.yaml | 23 ++++++++++++++++------ .../communities/awesome_programming_discord.yaml | 8 ++++++++ .../apps/resources/resources/communities/kivy.yaml | 9 +++++++++ .../resources/resources/communities/microsoft.yaml | 8 ++++++++ .../resources/resources/communities/pallets.yaml | 8 ++++++++ .../resources/resources/communities/panda3d.yaml | 9 +++++++++ .../communities/people_postgres_data.yaml | 8 ++++++++ .../resources/resources/communities/pyglet.yaml | 9 +++++++++ .../resources/communities/python_subreddit.yaml | 14 +++++++++++++ .../resources/communities/real_python.yaml | 8 ++++++++ .../resources/resources/communities/rlbot.yaml | 13 ------------ .../resources/resources/communities/subreddit.yaml | 6 ------ .../automate_the_boring_stuff_with_python.yaml | 8 ++++++++ ...uction_to_computer_science_and_programming.yaml | 9 +++++++++ .../courses/practical_python_programming.yaml | 7 +++++++ .../resources/courses/university_of_michigan.yaml | 7 +++++++ .../resources/courses/university_of_toronto.yaml | 8 ++++++++ .../resources/interactive/code_combat.yaml | 9 +++++++++ .../resources/resources/interactive/edublocks.yaml | 7 +++++++ .../resources/resources/interactive/exercism.yaml | 8 ++++++++ .../resources/interactive/jetbrains_academy.yaml | 7 +++++++ .../resources/interactive/python_morsels.yaml | 7 +++++++ .../resources/interactive/python_tutor.yaml | 8 ++++++++ .../resources/resources/interactive/sololearn.yaml | 8 ++++++++ .../resources/podcasts/podcast_dunder_init.yaml | 8 ++++++++ .../resources/resources/podcasts/python_bytes.yaml | 8 ++++++++ .../resources/podcasts/talk_python_to_me.yaml | 8 ++++++++ .../resources/podcasts/test_and_code.yaml | 9 +++++++++ .../podcasts/the_real_python_podcast.yaml | 8 ++++++++ .../reading/books/automate_the_boring_stuff.yaml | 15 +++++++++++--- .../resources/reading/books/byte_of_python.yaml | 14 ++++++++++--- .../resources/reading/books/effective_python.yaml | 15 ++++++++++---- .../reading/books/flask_web_development.yaml | 14 ++++++++++--- .../resources/reading/books/fluent_python.yaml | 14 ++++++++++--- .../reading/books/hitchhikers_guide_to_python.yaml | 15 +++++++++++--- .../reading/books/inferential_thinking.yaml | 9 +++++++++ .../resources/reading/books/mission_python.yaml | 14 ++++++++++--- .../neural_networks_from_scratch_in_python.yaml | 11 +++++++++++ .../resources/reading/books/python_cookbook.yaml | 13 +++++++++--- .../reading/books/python_crash_course.yaml | 14 ++++++++++--- .../resources/reading/books/python_tricks.yaml | 15 +++++++++++--- .../resources/reading/books/think_python.yaml | 13 +++++++++--- .../reading/books/two_scoops_of_django.yaml | 17 +++++++++++----- .../tutorials/getting_started_with_kivy.yaml | 8 ++++++++ ...ng_started_with_python_for_non_programmers.yaml | 7 +++++++ ...etting_started_with_python_for_programmers.yaml | 7 +++++++ .../reading/tutorials/python_cheat_sheet.yaml | 7 +++++++ .../reading/tutorials/python_developer_guide.yaml | 8 ++++++++ .../reading/tutorials/simple_guide_to_git.yaml | 7 +++++++ .../reading/tutorials/the_flask_mega_tutorial.yaml | 8 ++++++++ .../resources/reading/tutorials/wtf_python.yaml | 9 +++++++++ .../tools/accessibility/screen_readers.yaml | 4 ++++ .../resources/tools/accessibility/talon_voice.yaml | 3 +++ .../resources/resources/tools/editors/atom.yaml | 3 +++ .../resources/tools/editors/google_collab.yaml | 5 +++++ .../resources/tools/editors/mu_editor.yaml | 10 ++++++++++ .../resources/tools/editors/sublime_text.yaml | 3 +++ .../tools/editors/visual_studio_code.yaml | 3 +++ .../resources/resources/tools/ides/pycharm.yaml | 4 ++++ .../resources/resources/tools/ides/repl_it.yaml | 5 +++++ .../resources/resources/tools/ides/spyder.yaml | 5 +++++ .../resources/resources/tools/ides/thonny.yaml | 5 +++++ .../resources/resources/videos/corey_schafer.yaml | 11 +++++++++++ .../apps/resources/resources/videos/jetbrains.yaml | 10 ++++++++++ .../resources/videos/jim_shaped_coding.yaml | 10 ++++++++++ .../apps/resources/resources/videos/microsoft.yaml | 7 +++++++ .../resources/resources/videos/python_discord.yaml | 9 +++++++++ .../apps/resources/resources/videos/sentdex.yaml | 11 +++++++++++ 68 files changed, 555 insertions(+), 64 deletions(-) create mode 100644 pydis_site/apps/resources/resources/communities/python_subreddit.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/rlbot.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/subreddit.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/communities/adafruit.yaml b/pydis_site/apps/resources/resources/communities/adafruit.yaml index e5c81a6c..f226a20c 100644 --- a/pydis_site/apps/resources/resources/communities/adafruit.yaml +++ b/pydis_site/apps/resources/resources/communities/adafruit.yaml @@ -7,9 +7,20 @@ title_image: https://www.mouser.com/images/suppliers/logos/adafruit.png title_url: https://discord.gg/adafruit position: 4 urls: -- icon: branding/discord - url: https://discord.gg/adafruit - color: blurple -- icon: regular/link - url: https://adafruit.com/ - color: teal + - icon: branding/discord + url: https://discord.gg/adafruit + color: blurple + - icon: regular/link + url: https://adafruit.com/ + color: teal +tags: + topics: + - microcontrollers + - arduino + - circuitpython + - adafruit + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml b/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml index 335ac507..d3ebedb8 100644 --- a/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml +++ b/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml @@ -7,3 +7,11 @@ title_icon_color: black title_url: https://github.com/mhxion/awesome-programming-discord name: awesome-programming-discord position: 10 +tags: + topics: + - programming + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/kivy.yaml b/pydis_site/apps/resources/resources/communities/kivy.yaml index 601d7dba..641236b4 100644 --- a/pydis_site/apps/resources/resources/communities/kivy.yaml +++ b/pydis_site/apps/resources/resources/communities/kivy.yaml @@ -16,3 +16,12 @@ urls: - icon: branding/github url: https://github.com/kivy color: black +tags: + topics: + - user interface + - game development + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/microsoft.yaml b/pydis_site/apps/resources/resources/communities/microsoft.yaml index b36c3a85..3019fb9d 100644 --- a/pydis_site/apps/resources/resources/communities/microsoft.yaml +++ b/pydis_site/apps/resources/resources/communities/microsoft.yaml @@ -10,3 +10,11 @@ urls: - icon: regular/link url: https://www.microsoft.com/en-us/boards/pycon2020.aspx color: teal +tags: + topics: + - python + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/pallets.yaml b/pydis_site/apps/resources/resources/communities/pallets.yaml index 239b1491..4328b469 100644 --- a/pydis_site/apps/resources/resources/communities/pallets.yaml +++ b/pydis_site/apps/resources/resources/communities/pallets.yaml @@ -11,3 +11,11 @@ urls: - icon: regular/link url: https://www.palletsprojects.com/ color: teal +tags: + topics: + - web development + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/panda3d.yaml b/pydis_site/apps/resources/resources/communities/panda3d.yaml index 4235793d..8f1d0f9b 100644 --- a/pydis_site/apps/resources/resources/communities/panda3d.yaml +++ b/pydis_site/apps/resources/resources/communities/panda3d.yaml @@ -10,3 +10,12 @@ urls: - icon: regular/link url: https://www.panda3d.org/ color: teal +tags: + topics: + - user interface + - game development + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml b/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml index 1c17d343..cd13a18a 100644 --- a/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml +++ b/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml @@ -16,3 +16,11 @@ urls: - icon: branding/reddit url: https://reddit.com/r/postgresql color: orangered +tags: + topics: + - databases + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/pyglet.yaml b/pydis_site/apps/resources/resources/communities/pyglet.yaml index 784f514e..68cca2af 100644 --- a/pydis_site/apps/resources/resources/communities/pyglet.yaml +++ b/pydis_site/apps/resources/resources/communities/pyglet.yaml @@ -13,3 +13,12 @@ urls: - icon: regular/link url: http://pyglet.org/ color: teal +tags: + topics: + - user interface + - game development + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/python_subreddit.yaml b/pydis_site/apps/resources/resources/communities/python_subreddit.yaml new file mode 100644 index 00000000..b2176ff5 --- /dev/null +++ b/pydis_site/apps/resources/resources/communities/python_subreddit.yaml @@ -0,0 +1,14 @@ +description: News about the Python programming language, and language-related discussion. +name: r/Python +title_icon: branding/reddit +title_icon_color: orangered +title_url: https://www.reddit.com/r/Python/ +position: 0 +tags: + topics: + - python + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/real_python.yaml b/pydis_site/apps/resources/resources/communities/real_python.yaml index 1fc74d93..f1e71125 100644 --- a/pydis_site/apps/resources/resources/communities/real_python.yaml +++ b/pydis_site/apps/resources/resources/communities/real_python.yaml @@ -10,3 +10,11 @@ urls: - icon: branding/youtube url: https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA color: youtube-red +tags: + topics: + - python + payment_tiers: + - free + complexity: + - beginner + - intermediate diff --git a/pydis_site/apps/resources/resources/communities/rlbot.yaml b/pydis_site/apps/resources/resources/communities/rlbot.yaml deleted file mode 100644 index d12c1dec..00000000 --- a/pydis_site/apps/resources/resources/communities/rlbot.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: RLBot is a community of programmers making awesome Rocket League bots. - They've created a framework that you can use to write bots in a number of languages (including Python), - and they host regular tournaments where botmakers can pit their creations against each other. -title_image: https://i.imgur.com/S8L1muZ.png -title_url: https://discord.gg/4JJdJKb -position: 7 -urls: - - icon: branding/discord - url: https://discord.gg/4JJdJKb - color: blurple - - icon: regular/link - url: https://www.rlbot.org/ - color: teal diff --git a/pydis_site/apps/resources/resources/communities/subreddit.yaml b/pydis_site/apps/resources/resources/communities/subreddit.yaml deleted file mode 100644 index d3ddb15a..00000000 --- a/pydis_site/apps/resources/resources/communities/subreddit.yaml +++ /dev/null @@ -1,6 +0,0 @@ -description: News about the Python programming language, and language-related discussion. -name: r/Python -title_icon: branding/reddit -title_icon_color: orangered -title_url: https://www.reddit.com/r/Python/ -position: 0 diff --git a/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml b/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml index 66034ea2..52872d2c 100644 --- a/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml +++ b/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml @@ -3,3 +3,11 @@ description: The interactive course version of Al Sweigart's excellent book for name: Automate the Boring Stuff with Python title_url: https://www.udemy.com/automate/?couponCode=FOR_LIKE_10_BUCKS position: 3 +tags: + topics: + - python + - automation + payment_tiers: + - paid + complexity: + - beginner diff --git a/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml b/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml index 5560b2cb..3de01803 100644 --- a/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml +++ b/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml @@ -4,3 +4,12 @@ description: This MITx offering teaches computer science with Python. name: 'MIT: Introduction to Computer Science and Programming' title_url: https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-11 position: 1 +tags: + topics: + - python + - computer science + payment_tiers: + - free + - paid + complexity: + - beginner diff --git a/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml b/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml index b801ca8c..ded29ce1 100644 --- a/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml +++ b/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml @@ -7,3 +7,10 @@ description: Created and taught by David Beazley Date: Sun, 23 May 2021 10:43:13 +0200 Subject: Remove www from the URL for inferential thinking. The www subdomain gives an SSL error for an expired certificate, so we don't want to use that one. --- .../apps/resources/resources/reading/books/inferential_thinking.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml b/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml index f4983e56..f1ac2b3c 100644 --- a/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml +++ b/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml @@ -5,7 +5,7 @@ name: Inferential Thinking position: 13 urls: - icon: regular/link - url: https://www.inferentialthinking.com/chapters/intro + url: https://inferentialthinking.com/chapters/intro color: teal tags: topics: -- cgit v1.2.3 From 7c67ea311eebeb5273d02469295fa4218348e213 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 23 May 2021 10:51:55 +0200 Subject: Test boilerplate --- pydis_site/apps/resources/tests/test_resources.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 pydis_site/apps/resources/tests/test_resources.py (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/tests/test_resources.py b/pydis_site/apps/resources/tests/test_resources.py new file mode 100644 index 00000000..81638e2f --- /dev/null +++ b/pydis_site/apps/resources/tests/test_resources.py @@ -0,0 +1,9 @@ +from django.test import TestCase + + +class TestResources(TestCase): + """Test our resource filtering systems.""" + + def test_utils_to_retrieve_tags(self): + """Test that the utils that retrieve the tags work as intended.""" + pass -- cgit v1.2.3 From df7ca78d6958c99a39b50ea8c3c40de849fe71e0 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sat, 5 Jun 2021 11:56:54 -0400 Subject: Collapse resources into one directory, migrate to new tagging system. This commit fails the lint test from pipenv, though the main branch is on poetry now. --- pydis_site/apps/resources/resources/adafruit.yaml | 24 +++++++++++++++ pydis_site/apps/resources/resources/atom.yaml | 14 +++++++++ .../resources/automate_the_boring_stuff_book.yaml | 23 +++++++++++++++ .../automate_the_boring_stuff_course.yaml | 14 +++++++++ .../resources/awesome_programming_discord.yaml | 18 ++++++++++++ .../apps/resources/resources/byte_of_python.yaml | 24 +++++++++++++++ .../apps/resources/resources/code_combat.yaml | 22 ++++++++++++++ .../resources/resources/communities/adafruit.yaml | 26 ----------------- .../communities/awesome_programming_discord.yaml | 17 ----------- .../apps/resources/resources/communities/kivy.yaml | 27 ----------------- .../resources/resources/communities/microsoft.yaml | 20 ------------- .../resources/resources/communities/pallets.yaml | 21 ------------- .../resources/resources/communities/panda3d.yaml | 21 ------------- .../communities/people_postgres_data.yaml | 26 ----------------- .../resources/resources/communities/pyglet.yaml | 24 --------------- .../resources/communities/python_subreddit.yaml | 14 --------- .../resources/communities/real_python.yaml | 20 ------------- .../apps/resources/resources/corey_schafer.yaml | 31 ++++++++++++++++++++ .../automate_the_boring_stuff_with_python.yaml | 13 --------- ...uction_to_computer_science_and_programming.yaml | 15 ---------- .../courses/practical_python_programming.yaml | 16 ---------- .../resources/courses/university_of_michigan.yaml | 12 -------- .../resources/courses/university_of_toronto.yaml | 19 ------------ pydis_site/apps/resources/resources/edublocks.yaml | 18 ++++++++++++ .../apps/resources/resources/effective_python.yaml | 23 +++++++++++++++ pydis_site/apps/resources/resources/exercism.yaml | 22 ++++++++++++++ .../resources/resources/flask_web_development.yaml | 23 +++++++++++++++ .../apps/resources/resources/fluent_python.yaml | 23 +++++++++++++++ .../resources/getting_started_with_kivy.yaml | 14 +++++++++ ...ng_started_with_python_for_non_programmers.yaml | 13 +++++++++ ...etting_started_with_python_for_programmers.yaml | 14 +++++++++ .../apps/resources/resources/google_collab.yaml | 17 +++++++++++ .../resources/hitchhikers_guide_to_python.yaml | 20 +++++++++++++ .../resources/resources/inferential_thinking.yaml | 18 ++++++++++++ .../resources/interactive/code_combat.yaml | 20 ------------- .../resources/resources/interactive/edublocks.yaml | 17 ----------- .../resources/resources/interactive/exercism.yaml | 21 ------------- .../resources/interactive/jetbrains_academy.yaml | 15 ---------- .../resources/interactive/python_morsels.yaml | 17 ----------- .../resources/interactive/python_tutor.yaml | 12 -------- .../resources/resources/interactive/sololearn.yaml | 15 ---------- .../resources/resources/jetbrains_academy.yaml | 18 ++++++++++++ .../apps/resources/resources/jetbrains_videos.yaml | 23 +++++++++++++++ .../resources/resources/jim_shaped_coding.yaml | 24 +++++++++++++++ pydis_site/apps/resources/resources/kivy.yaml | 28 ++++++++++++++++++ pydis_site/apps/resources/resources/microsoft.yaml | 22 ++++++++++++++ .../apps/resources/resources/microsoft_videos.yaml | 26 +++++++++++++++++ .../apps/resources/resources/mission_python.yaml | 22 ++++++++++++++ ...uction_to_computer_science_and_programming.yaml | 16 ++++++++++ pydis_site/apps/resources/resources/mu_editor.yaml | 15 ++++++++++ .../neural_networks_from_scratch_in_python.yaml | 21 +++++++++++++ pydis_site/apps/resources/resources/pallets.yaml | 22 ++++++++++++++ pydis_site/apps/resources/resources/panda3d.yaml | 23 +++++++++++++++ .../resources/resources/people_postgres_data.yaml | 27 +++++++++++++++++ .../resources/resources/podcast_dunder_init.yaml | 14 +++++++++ .../resources/podcasts/podcast_dunder_init.yaml | 13 --------- .../resources/resources/podcasts/python_bytes.yaml | 13 --------- .../resources/podcasts/talk_python_to_me.yaml | 13 --------- .../resources/podcasts/test_and_code.yaml | 14 --------- .../podcasts/the_real_python_podcast.yaml | 15 ---------- .../resources/practical_python_programming.yaml | 18 ++++++++++++ pydis_site/apps/resources/resources/pycharm.yaml | 14 +++++++++ pydis_site/apps/resources/resources/pyglet.yaml | 25 ++++++++++++++++ .../apps/resources/resources/python_bytes.yaml | 15 ++++++++++ .../resources/resources/python_cheat_sheet.yaml | 13 +++++++++ .../apps/resources/resources/python_cookbook.yaml | 23 +++++++++++++++ .../resources/resources/python_crash_course.yaml | 29 ++++++++++++++++++ .../resources/python_developer_guide.yaml | 13 +++++++++ .../resources/resources/python_discord_videos.yaml | 19 ++++++++++++ .../apps/resources/resources/python_morsels.yaml | 19 ++++++++++++ .../apps/resources/resources/python_subreddit.yaml | 16 ++++++++++ .../apps/resources/resources/python_tricks.yaml | 21 +++++++++++++ .../apps/resources/resources/python_tutor.yaml | 14 +++++++++ .../reading/books/automate_the_boring_stuff.yaml | 23 --------------- .../resources/reading/books/byte_of_python.yaml | 23 --------------- .../resources/reading/books/effective_python.yaml | 22 -------------- .../reading/books/flask_web_development.yaml | 22 -------------- .../resources/reading/books/fluent_python.yaml | 22 -------------- .../reading/books/hitchhikers_guide_to_python.yaml | 20 ------------- .../reading/books/inferential_thinking.yaml | 18 ------------ .../resources/reading/books/mission_python.yaml | 21 ------------- .../neural_networks_from_scratch_in_python.yaml | 21 ------------- .../resources/reading/books/python_cookbook.yaml | 21 ------------- .../reading/books/python_crash_course.yaml | 28 ------------------ .../resources/reading/books/python_tricks.yaml | 21 ------------- .../resources/reading/books/think_python.yaml | 24 --------------- .../reading/books/two_scoops_of_django.yaml | 21 ------------- .../tutorials/getting_started_with_kivy.yaml | 13 --------- ...ng_started_with_python_for_non_programmers.yaml | 12 -------- ...etting_started_with_python_for_programmers.yaml | 12 -------- .../reading/tutorials/python_cheat_sheet.yaml | 12 -------- .../reading/tutorials/python_developer_guide.yaml | 13 --------- .../reading/tutorials/simple_guide_to_git.yaml | 13 --------- .../reading/tutorials/the_flask_mega_tutorial.yaml | 12 -------- .../resources/reading/tutorials/wtf_python.yaml | 17 ----------- .../apps/resources/resources/real_python.yaml | 22 ++++++++++++++ pydis_site/apps/resources/resources/repl_it.yaml | 14 +++++++++ .../apps/resources/resources/screen_readers.yaml | 17 +++++++++++ pydis_site/apps/resources/resources/sentdex.yaml | 34 ++++++++++++++++++++++ .../resources/resources/simple_guide_to_git.yaml | 14 +++++++++ pydis_site/apps/resources/resources/sololearn.yaml | 17 +++++++++++ pydis_site/apps/resources/resources/spyder.yaml | 14 +++++++++ .../apps/resources/resources/sublime_text.yaml | 14 +++++++++ .../resources/resources/talk_python_to_me.yaml | 14 +++++++++ .../apps/resources/resources/talon_voice.yaml | 15 ++++++++++ .../apps/resources/resources/test_and_code.yaml | 15 ++++++++++ .../resources/the_flask_mega_tutorial.yaml | 13 +++++++++ .../resources/the_real_python_podcast.yaml | 16 ++++++++++ .../apps/resources/resources/think_python.yaml | 26 +++++++++++++++++ pydis_site/apps/resources/resources/thonny.yaml | 14 +++++++++ .../tools/accessibility/screen_readers.yaml | 11 ------- .../resources/tools/accessibility/talon_voice.yaml | 9 ------ .../resources/resources/tools/editors/atom.yaml | 8 ----- .../resources/tools/editors/google_collab.yaml | 12 -------- .../resources/tools/editors/mu_editor.yaml | 17 ----------- .../resources/tools/editors/sublime_text.yaml | 8 ----- .../tools/editors/visual_studio_code.yaml | 7 ----- .../resources/resources/tools/ides/pycharm.yaml | 9 ------ .../resources/resources/tools/ides/repl_it.yaml | 10 ------- .../resources/resources/tools/ides/spyder.yaml | 10 ------- .../resources/resources/tools/ides/thonny.yaml | 10 ------- .../resources/resources/two_scoops_of_django.yaml | 22 ++++++++++++++ .../resources/university_of_michigan.yaml | 13 +++++++++ .../resources/resources/university_of_toronto.yaml | 20 +++++++++++++ .../resources/resources/videos/corey_schafer.yaml | 30 ------------------- .../apps/resources/resources/videos/jetbrains.yaml | 22 -------------- .../resources/videos/jim_shaped_coding.yaml | 23 --------------- .../apps/resources/resources/videos/microsoft.yaml | 25 ---------------- .../resources/resources/videos/python_discord.yaml | 17 ----------- .../apps/resources/resources/videos/sentdex.yaml | 33 --------------------- .../resources/resources/visual_studio_code.yaml | 13 +++++++++ .../apps/resources/resources/wtf_python.yaml | 18 ++++++++++++ 132 files changed, 1260 insertions(+), 1148 deletions(-) create mode 100644 pydis_site/apps/resources/resources/adafruit.yaml create mode 100644 pydis_site/apps/resources/resources/atom.yaml create mode 100644 pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml create mode 100644 pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml create mode 100644 pydis_site/apps/resources/resources/awesome_programming_discord.yaml create mode 100644 pydis_site/apps/resources/resources/byte_of_python.yaml create mode 100644 pydis_site/apps/resources/resources/code_combat.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/adafruit.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/kivy.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/microsoft.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/pallets.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/panda3d.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/people_postgres_data.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/pyglet.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/python_subreddit.yaml delete mode 100644 pydis_site/apps/resources/resources/communities/real_python.yaml create mode 100644 pydis_site/apps/resources/resources/corey_schafer.yaml delete mode 100644 pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml delete mode 100644 pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml delete mode 100644 pydis_site/apps/resources/resources/courses/practical_python_programming.yaml delete mode 100644 pydis_site/apps/resources/resources/courses/university_of_michigan.yaml delete mode 100644 pydis_site/apps/resources/resources/courses/university_of_toronto.yaml create mode 100644 pydis_site/apps/resources/resources/edublocks.yaml create mode 100644 pydis_site/apps/resources/resources/effective_python.yaml create mode 100644 pydis_site/apps/resources/resources/exercism.yaml create mode 100644 pydis_site/apps/resources/resources/flask_web_development.yaml create mode 100644 pydis_site/apps/resources/resources/fluent_python.yaml create mode 100644 pydis_site/apps/resources/resources/getting_started_with_kivy.yaml create mode 100644 pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml create mode 100644 pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml create mode 100644 pydis_site/apps/resources/resources/google_collab.yaml create mode 100644 pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml create mode 100644 pydis_site/apps/resources/resources/inferential_thinking.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/code_combat.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/edublocks.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/exercism.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/jetbrains_academy.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/python_morsels.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/python_tutor.yaml delete mode 100644 pydis_site/apps/resources/resources/interactive/sololearn.yaml create mode 100644 pydis_site/apps/resources/resources/jetbrains_academy.yaml create mode 100644 pydis_site/apps/resources/resources/jetbrains_videos.yaml create mode 100644 pydis_site/apps/resources/resources/jim_shaped_coding.yaml create mode 100644 pydis_site/apps/resources/resources/kivy.yaml create mode 100644 pydis_site/apps/resources/resources/microsoft.yaml create mode 100644 pydis_site/apps/resources/resources/microsoft_videos.yaml create mode 100644 pydis_site/apps/resources/resources/mission_python.yaml create mode 100644 pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml create mode 100644 pydis_site/apps/resources/resources/mu_editor.yaml create mode 100644 pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml create mode 100644 pydis_site/apps/resources/resources/pallets.yaml create mode 100644 pydis_site/apps/resources/resources/panda3d.yaml create mode 100644 pydis_site/apps/resources/resources/people_postgres_data.yaml create mode 100644 pydis_site/apps/resources/resources/podcast_dunder_init.yaml delete mode 100644 pydis_site/apps/resources/resources/podcasts/podcast_dunder_init.yaml delete mode 100644 pydis_site/apps/resources/resources/podcasts/python_bytes.yaml delete mode 100644 pydis_site/apps/resources/resources/podcasts/talk_python_to_me.yaml delete mode 100644 pydis_site/apps/resources/resources/podcasts/test_and_code.yaml delete mode 100644 pydis_site/apps/resources/resources/podcasts/the_real_python_podcast.yaml create mode 100644 pydis_site/apps/resources/resources/practical_python_programming.yaml create mode 100644 pydis_site/apps/resources/resources/pycharm.yaml create mode 100644 pydis_site/apps/resources/resources/pyglet.yaml create mode 100644 pydis_site/apps/resources/resources/python_bytes.yaml create mode 100644 pydis_site/apps/resources/resources/python_cheat_sheet.yaml create mode 100644 pydis_site/apps/resources/resources/python_cookbook.yaml create mode 100644 pydis_site/apps/resources/resources/python_crash_course.yaml create mode 100644 pydis_site/apps/resources/resources/python_developer_guide.yaml create mode 100644 pydis_site/apps/resources/resources/python_discord_videos.yaml create mode 100644 pydis_site/apps/resources/resources/python_morsels.yaml create mode 100644 pydis_site/apps/resources/resources/python_subreddit.yaml create mode 100644 pydis_site/apps/resources/resources/python_tricks.yaml create mode 100644 pydis_site/apps/resources/resources/python_tutor.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/automate_the_boring_stuff.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/byte_of_python.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/effective_python.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/flask_web_development.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/fluent_python.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/hitchhikers_guide_to_python.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/mission_python.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/neural_networks_from_scratch_in_python.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/python_cookbook.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/python_crash_course.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/python_tricks.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/think_python.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/books/two_scoops_of_django.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_kivy.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_non_programmers.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_programmers.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/python_cheat_sheet.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/python_developer_guide.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/simple_guide_to_git.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/the_flask_mega_tutorial.yaml delete mode 100644 pydis_site/apps/resources/resources/reading/tutorials/wtf_python.yaml create mode 100644 pydis_site/apps/resources/resources/real_python.yaml create mode 100644 pydis_site/apps/resources/resources/repl_it.yaml create mode 100644 pydis_site/apps/resources/resources/screen_readers.yaml create mode 100644 pydis_site/apps/resources/resources/sentdex.yaml create mode 100644 pydis_site/apps/resources/resources/simple_guide_to_git.yaml create mode 100644 pydis_site/apps/resources/resources/sololearn.yaml create mode 100644 pydis_site/apps/resources/resources/spyder.yaml create mode 100644 pydis_site/apps/resources/resources/sublime_text.yaml create mode 100644 pydis_site/apps/resources/resources/talk_python_to_me.yaml create mode 100644 pydis_site/apps/resources/resources/talon_voice.yaml create mode 100644 pydis_site/apps/resources/resources/test_and_code.yaml create mode 100644 pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml create mode 100644 pydis_site/apps/resources/resources/the_real_python_podcast.yaml create mode 100644 pydis_site/apps/resources/resources/think_python.yaml create mode 100644 pydis_site/apps/resources/resources/thonny.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/editors/atom.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/editors/google_collab.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/editors/mu_editor.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/editors/sublime_text.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/editors/visual_studio_code.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/ides/pycharm.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/ides/repl_it.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/ides/spyder.yaml delete mode 100644 pydis_site/apps/resources/resources/tools/ides/thonny.yaml create mode 100644 pydis_site/apps/resources/resources/two_scoops_of_django.yaml create mode 100644 pydis_site/apps/resources/resources/university_of_michigan.yaml create mode 100644 pydis_site/apps/resources/resources/university_of_toronto.yaml delete mode 100644 pydis_site/apps/resources/resources/videos/corey_schafer.yaml delete mode 100644 pydis_site/apps/resources/resources/videos/jetbrains.yaml delete mode 100644 pydis_site/apps/resources/resources/videos/jim_shaped_coding.yaml delete mode 100644 pydis_site/apps/resources/resources/videos/microsoft.yaml delete mode 100644 pydis_site/apps/resources/resources/videos/python_discord.yaml delete mode 100644 pydis_site/apps/resources/resources/videos/sentdex.yaml create mode 100644 pydis_site/apps/resources/resources/visual_studio_code.yaml create mode 100644 pydis_site/apps/resources/resources/wtf_python.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/adafruit.yaml b/pydis_site/apps/resources/resources/adafruit.yaml new file mode 100644 index 00000000..1945274c --- /dev/null +++ b/pydis_site/apps/resources/resources/adafruit.yaml @@ -0,0 +1,24 @@ +description: Adafruit is an open-source electronics manufacturer + that makes all the components you need to start your own Python-powered hardware projects. + Their official community host regular show-and-tells, + provide help with your projects, + and the Adafruit devs do all the CircuitPython Development right out in the open. +title_image: https://www.mouser.com/images/suppliers/logos/adafruit.png +title_url: https://discord.gg/adafruit +urls: + - icon: branding/discord + url: https://discord.gg/adafruit + color: blurple + - icon: regular/link + url: https://adafruit.com/ + color: teal +tags: + topics: + - microcontrollers + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/atom.yaml b/pydis_site/apps/resources/resources/atom.yaml new file mode 100644 index 00000000..3a46a45f --- /dev/null +++ b/pydis_site/apps/resources/resources/atom.yaml @@ -0,0 +1,14 @@ +description: A free Electron-based editor, a "hackable text editor for the 21st century", maintained + by the GitHub team. +name: Atom +title_url: https://atom.io/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml new file mode 100644 index 00000000..deaca948 --- /dev/null +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml @@ -0,0 +1,23 @@ +description: One of the best books out there for Python beginners. This book will + teach you the basics of Python, while also teaching invaluable automation tools + and techniques for solving common problems. You'll learn how to go about scraping + the web, manipulating files and automating keyboard and mouse input. Ideal for an + office worker who wants to make himself more useful. +name: Automate the Boring Stuff with Python +urls: +- icon: regular/book + url: https://automatetheboringstuff.com/ + color: black +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python + color: goodreads-cream +tags: + topics: + - general + payment_tiers: + - free + - paid + complexity: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml new file mode 100644 index 00000000..b93ef868 --- /dev/null +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml @@ -0,0 +1,14 @@ +description: The interactive course version of Al Sweigart's excellent book for beginners, taught by the author himself. + This link has a discounted version of the course which will always cost 10 dollars. Thanks, Al! +name: Automate the Boring Stuff with Python +title_url: https://www.udemy.com/automate/?couponCode=FOR_LIKE_10_BUCKS +tags: + topics: + - general + payment_tiers: + - paid + complexity: + - beginner + type: + - course + - interactive diff --git a/pydis_site/apps/resources/resources/awesome_programming_discord.yaml b/pydis_site/apps/resources/resources/awesome_programming_discord.yaml new file mode 100644 index 00000000..4233f26e --- /dev/null +++ b/pydis_site/apps/resources/resources/awesome_programming_discord.yaml @@ -0,0 +1,18 @@ +description: We have listed our favourite communities, + but there are many more excellent communities out there! + An awesome list collating the best programming related Discord servers is available on GitHub + and has all sorts of topics from blockchain to virtual reality! +title_icon: branding/github +title_icon_color: black +title_url: https://github.com/mhxion/awesome-programming-discord +name: awesome-programming-discord +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/byte_of_python.yaml b/pydis_site/apps/resources/resources/byte_of_python.yaml new file mode 100644 index 00000000..618578d1 --- /dev/null +++ b/pydis_site/apps/resources/resources/byte_of_python.yaml @@ -0,0 +1,24 @@ +description: A free book on programming using the Python language. + It serves as a tutorial or guide to the Python language for a beginner audience. + If all you know about computers is how to save text files, then this is the book for you. +name: A Byte of Python +urls: +- icon: regular/link + url: https://python.swaroopch.com/ + color: teal +- icon: regular/book + url: http://www.lulu.com/shop/swaroop-c-h/a-byte-of-python/paperback/product-21142968.html + color: black +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/6762544-a-byte-of-python + color: goodreads-cream +tags: + topics: + - general + payment_tiers: + - free + - paid + complexity: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/code_combat.yaml b/pydis_site/apps/resources/resources/code_combat.yaml new file mode 100644 index 00000000..41dac6b6 --- /dev/null +++ b/pydis_site/apps/resources/resources/code_combat.yaml @@ -0,0 +1,22 @@ +description: Learn Python while gaming - an open-source project with thousands of + contributors, which teaches you Python through a deep, top-down RPG. +name: Code Combat +urls: +- icon: regular/link + url: https://codecombat.com/ + color: teal +- icon: branding/github + url: https://github.com/codecombat/codecombat + color: black +tags: + topics: + - general + - algorithms and data structures + payment_tiers: + - free + - subscription + complexity: + - beginner + - intermediate + type: + - interactive diff --git a/pydis_site/apps/resources/resources/communities/adafruit.yaml b/pydis_site/apps/resources/resources/communities/adafruit.yaml deleted file mode 100644 index f226a20c..00000000 --- a/pydis_site/apps/resources/resources/communities/adafruit.yaml +++ /dev/null @@ -1,26 +0,0 @@ -description: Adafruit is an open-source electronics manufacturer - that makes all the components you need to start your own Python-powered hardware projects. - Their official community host regular show-and-tells, - provide help with your projects, - and the Adafruit devs do all the CircuitPython Development right out in the open. -title_image: https://www.mouser.com/images/suppliers/logos/adafruit.png -title_url: https://discord.gg/adafruit -position: 4 -urls: - - icon: branding/discord - url: https://discord.gg/adafruit - color: blurple - - icon: regular/link - url: https://adafruit.com/ - color: teal -tags: - topics: - - microcontrollers - - arduino - - circuitpython - - adafruit - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml b/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml deleted file mode 100644 index d3ebedb8..00000000 --- a/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: We have listed our favourite communities, - but there are many more excellent communities out there! - An awesome list collating the best programming related Discord servers is available on GitHub - and has all sorts of topics from blockchain to virtual reality! -title_icon: branding/github -title_icon_color: black -title_url: https://github.com/mhxion/awesome-programming-discord -name: awesome-programming-discord -position: 10 -tags: - topics: - - programming - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/kivy.yaml b/pydis_site/apps/resources/resources/communities/kivy.yaml deleted file mode 100644 index 641236b4..00000000 --- a/pydis_site/apps/resources/resources/communities/kivy.yaml +++ /dev/null @@ -1,27 +0,0 @@ -description: The Kivy project, through the Kivy framework and its sister projects, - aims to provide all the tools to create desktop and mobile applications in Python. - Allowing rapid development of multitouch applications with custom and exciting user interfaces. -icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/logos/kivy-logo-black-256.png -icon_size: 50 -title_image: https://i.imgur.com/EVP3jZR.png -title_url: https://discord.gg/djPtTRJ -position: 5 -urls: - - icon: branding/discord - url: https://discord.gg/djPtTRJ - color: blurple - - icon: regular/link - url: https://kivy.org/ - color: teal - - icon: branding/github - url: https://github.com/kivy - color: black -tags: - topics: - - user interface - - game development - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/microsoft.yaml b/pydis_site/apps/resources/resources/communities/microsoft.yaml deleted file mode 100644 index 3019fb9d..00000000 --- a/pydis_site/apps/resources/resources/communities/microsoft.yaml +++ /dev/null @@ -1,20 +0,0 @@ -description: Microsoft Python is a Discord server for discussing all things relating to using Python with Microsoft products, - they have channels for Azure, VS Code, IoT, Data Science and much more! -title_image: https://1000logos.net/wp-content/uploads/2017/04/Microsoft-Logo.png -title_url: https://discord.gg/b8YJQPx -position: 1 -urls: - - icon: branding/discord - url: https://discord.gg/b8YJQPx - color: blurple - - icon: regular/link - url: https://www.microsoft.com/en-us/boards/pycon2020.aspx - color: teal -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/pallets.yaml b/pydis_site/apps/resources/resources/communities/pallets.yaml deleted file mode 100644 index 4328b469..00000000 --- a/pydis_site/apps/resources/resources/communities/pallets.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: The Pallets Projects develop Python libraries such as the Flask web framework, - the Jinja templating library, and the Click command line toolkit. Join to discuss - and get help from the Pallets community. -title_image: https://i.imgur.com/sV9Ypdf.png -title_url: https://discord.gg/t6rrQZH -position: 6 -urls: - - icon: branding/discord - url: https://discord.gg/t6rrQZH - color: blurple - - icon: regular/link - url: https://www.palletsprojects.com/ - color: teal -tags: - topics: - - web development - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/panda3d.yaml b/pydis_site/apps/resources/resources/communities/panda3d.yaml deleted file mode 100644 index 8f1d0f9b..00000000 --- a/pydis_site/apps/resources/resources/communities/panda3d.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: Panda3D is a Python-focused 3-D framework for rapid development of games, - visualizations, and simulations, written in C++ with an emphasis on performance and flexibility. -title_image: http://www.panda3d.org/wp-content/uploads/2019/01/panda3d_logo.png -title_url: https://discord.gg/9XsucTT -position: 9 -urls: - - icon: branding/discord - url: https://discord.gg/9XsucTT - color: blurple - - icon: regular/link - url: https://www.panda3d.org/ - color: teal -tags: - topics: - - user interface - - game development - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml b/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml deleted file mode 100644 index cd13a18a..00000000 --- a/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml +++ /dev/null @@ -1,26 +0,0 @@ -description: People, Postgres, Data specializes in building users of Postgres - and related ecosystem including but not limited to technologies such as RDS Postgres, - Aurora for Postgres, Google Postgres, PostgreSQL.Org Postgres, Greenplum, Timescale and ZomboDB. - They take a holistic approach to their community inviting not only technical topics but Professional Development - and Life in general including movies, games, books and travel. -title_image: https://media.discordapp.net/attachments/748954447857844318/750519488268730377/people_postgres_data.png -title_url: https://discord.gg/Ujw8m8v -position: 2 -urls: - - icon: branding/discord - url: https://discord.gg/Ujw8m8v - color: bluple - - icon: regular/link - url: https://postgresconf.org/ - color: teal - - icon: branding/reddit - url: https://reddit.com/r/postgresql - color: orangered -tags: - topics: - - databases - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/pyglet.yaml b/pydis_site/apps/resources/resources/communities/pyglet.yaml deleted file mode 100644 index 68cca2af..00000000 --- a/pydis_site/apps/resources/resources/communities/pyglet.yaml +++ /dev/null @@ -1,24 +0,0 @@ -description: Pyglet is a powerful, - yet easy to use Python library for developing games and other visually-rich applications on Windows, - Mac OS X and Linux. It supports windowing, user interface event handling, Joysticks, OpenGL graphics, - loading images and videos, and playing sounds and music. All of this with a friendly Pythonic API, - that's simple to learn and doesn't get in your way. -title_image: https://i.imgur.com/LfQwXUe.png -title_url: https://discord.gg/QXyegWe -position: 8 -urls: - - icon: branding/discord - url: https://discord.gg/QXyegWe - color: blurple - - icon: regular/link - url: http://pyglet.org/ - color: teal -tags: - topics: - - user interface - - game development - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/python_subreddit.yaml b/pydis_site/apps/resources/resources/communities/python_subreddit.yaml deleted file mode 100644 index b2176ff5..00000000 --- a/pydis_site/apps/resources/resources/communities/python_subreddit.yaml +++ /dev/null @@ -1,14 +0,0 @@ -description: News about the Python programming language, and language-related discussion. -name: r/Python -title_icon: branding/reddit -title_icon_color: orangered -title_url: https://www.reddit.com/r/Python/ -position: 0 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/communities/real_python.yaml b/pydis_site/apps/resources/resources/communities/real_python.yaml deleted file mode 100644 index f1e71125..00000000 --- a/pydis_site/apps/resources/resources/communities/real_python.yaml +++ /dev/null @@ -1,20 +0,0 @@ -description: Dan Bader's treasure trove of quizzes, tutorials and interactive content for learning Python. - An absolute goldmine. -title_image: https://i.imgur.com/WDqhZ36.png -title_url: https://realpython.com/ -position: 3 -urls: - - icon: regular/link - url: https://realpython.com/ - color: teal - - icon: branding/youtube - url: https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA - color: youtube-red -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/corey_schafer.yaml b/pydis_site/apps/resources/resources/corey_schafer.yaml new file mode 100644 index 00000000..c4d9ad5e --- /dev/null +++ b/pydis_site/apps/resources/resources/corey_schafer.yaml @@ -0,0 +1,31 @@ +description: 'Corey has a number of exceptionally high quality tutorial series + on everything from Python basics to Django and Flask: + + Check out his channel for more video series! + ' +title_image: https://i.imgur.com/KIfWw3b.png +urls: + - icon: branding/youtube + url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g + color: youtube-red + - icon: regular/link + url: https://coreyms.com/ + color: teal +tags: + topics: + - general + - software design + - web development + - tooling + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml b/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml deleted file mode 100644 index 52872d2c..00000000 --- a/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: The interactive course version of Al Sweigart's excellent book for beginners, taught by the author himself. - This link has a discounted version of the course which will always cost 10 dollars. Thanks, Al! -name: Automate the Boring Stuff with Python -title_url: https://www.udemy.com/automate/?couponCode=FOR_LIKE_10_BUCKS -position: 3 -tags: - topics: - - python - - automation - payment_tiers: - - paid - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml b/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml deleted file mode 100644 index 3de01803..00000000 --- a/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: This MITx offering teaches computer science with Python. - It covers computational thinking, algorithms, data structures - and the Python programming language itself. -name: 'MIT: Introduction to Computer Science and Programming' -title_url: https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-11 -position: 1 -tags: - topics: - - python - - computer science - payment_tiers: - - free - - paid - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml b/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml deleted file mode 100644 index ded29ce1..00000000 --- a/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml +++ /dev/null @@ -1,16 +0,0 @@ -description: Created and taught by David Beazley, - this course is a conversion of his instructor-led Python training course used for corporate training - and professional development. It has been in continual development since 2007 - and battle tested in real-world classrooms. Usually, it’s taught in-person over the span of three - or four days–requiring approximately 25-35 hours of intense work. - This includes the completion of approximately 130 hands-on coding exercises. -name: Practical Python Programming -title_url: https://dabeaz-course.github.io/practical-python/ -position: 4 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/courses/university_of_michigan.yaml b/pydis_site/apps/resources/resources/courses/university_of_michigan.yaml deleted file mode 100644 index 4ed48ff2..00000000 --- a/pydis_site/apps/resources/resources/courses/university_of_michigan.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: A 5-part specialization course that teaches Python from scratch. - The course has no pre-requisites and avoids all but the simplest mathematics. -name: 'University of Michigan: Programming for Everybody' -title_url: https://www.coursera.org/learn/python -position: 2 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/courses/university_of_toronto.yaml b/pydis_site/apps/resources/resources/courses/university_of_toronto.yaml deleted file mode 100644 index e71fb1e6..00000000 --- a/pydis_site/apps/resources/resources/courses/university_of_toronto.yaml +++ /dev/null @@ -1,19 +0,0 @@ -description: A 2-part course that teaches Python. Primarily intended for high school students - and first-year university students who want to learn programming. -name: 'University of Toronto: Learn to Program' -position: 0 -urls: - - icon: regular/graduation-cap - url: https://www.coursera.org/learn/learn-to-program - color: orangered - - icon: regular/graduation-cap - url: https://www.coursera.org/learn/program-code - color: youtube-red -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/edublocks.yaml b/pydis_site/apps/resources/resources/edublocks.yaml new file mode 100644 index 00000000..9fd87945 --- /dev/null +++ b/pydis_site/apps/resources/resources/edublocks.yaml @@ -0,0 +1,18 @@ +description: EduBlocks provides a simple drag and drop interface to help beginners get to grips + with the key concepts of Python. There is built-in support for modules such as random, + turtle, processing and pygal to play around with, + and it even allows you to export the Python code you have written in the graphical editor. + EduBlocks also has integration with BBC micro:bit, + Raspberry Pi and CircuitPython allowing you to write code for these devices graphically + and export the code to run on actual devices. +name: EduBlocks +title_url: https://edublocks.org/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + type: + - interactive diff --git a/pydis_site/apps/resources/resources/effective_python.yaml b/pydis_site/apps/resources/resources/effective_python.yaml new file mode 100644 index 00000000..5ca94c63 --- /dev/null +++ b/pydis_site/apps/resources/resources/effective_python.yaml @@ -0,0 +1,23 @@ +description: A book that gives 90 best practices for writing excellent Python. Great + for intermediates. +name: Effective Python +urls: +- icon: regular/link + url: https://effectivepython.com/ + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/48566725-effective-python + color: goodreads-cream +- icon: branding/github + url: https://github.com/bslatkin/effectivepython + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + complexity: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/exercism.yaml b/pydis_site/apps/resources/resources/exercism.yaml new file mode 100644 index 00000000..7885bb9a --- /dev/null +++ b/pydis_site/apps/resources/resources/exercism.yaml @@ -0,0 +1,22 @@ +description: Level up your programming skills with more than 2600 exercises across + 47 programming languages, Python included. The website provides a mentored mode, + where you can get your code reviewed for each solution you submit. The mentors will + give you insightful advice to make you a better programmer. +name: exercism.io +urls: +- icon: regular/link + url: https://exercism.io/ + color: teal +- icon: branding/github + url: https://github.com/exercism/python + color: black +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - interactive diff --git a/pydis_site/apps/resources/resources/flask_web_development.yaml b/pydis_site/apps/resources/resources/flask_web_development.yaml new file mode 100644 index 00000000..27e75fe6 --- /dev/null +++ b/pydis_site/apps/resources/resources/flask_web_development.yaml @@ -0,0 +1,23 @@ +description: A comprehensive Flask walkthrough that has you building a complete social + blogging application from scratch. +name: Flask Web Development +urls: +- icon: regular/link + url: http://shop.oreilly.com/product/0636920031116.do + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/18774655-flask-web-development + color: goodreads-cream +- icon: branding/github + url: https://github.com/miguelgrinberg/flasky + color: black +tags: + topics: + - web development + payment_tiers: + - paid + complexity: + - beginner + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/fluent_python.yaml b/pydis_site/apps/resources/resources/fluent_python.yaml new file mode 100644 index 00000000..24c2b150 --- /dev/null +++ b/pydis_site/apps/resources/resources/fluent_python.yaml @@ -0,0 +1,23 @@ +description: A veritable tome of intermediate and advanced Python information. A must-read + for any Python professional. By far the most recommended book for intermediates. +name: Fluent Python +urls: +- icon: regular/link + url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/22800567-fluent-python + color: goodreads-cream +- icon: branding/github + url: https://github.com/fluentpython + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + complexity: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml b/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml new file mode 100644 index 00000000..5dbcd387 --- /dev/null +++ b/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml @@ -0,0 +1,14 @@ +description: A big list of excellent resources for getting started making Kivy applications. +name: Getting Started with Kivy +title_url: https://blog.kivy.org/2019/12/getting-started-with-kivy/ +icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/logos/kivy-logo-black-256.png +tags: + topics: + - user interface + - game development + payment_tiers: + - free + complexity: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml b/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml new file mode 100644 index 00000000..85c061bd --- /dev/null +++ b/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml @@ -0,0 +1,13 @@ +description: A list of beginner resources for programmers with no prior developer experience, + from Python's official guide. +name: Getting Started with Python for Non-Programmers +title_url: https://wiki.python.org/moin/BeginnersGuide/NonProgrammers +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml b/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml new file mode 100644 index 00000000..2565eedd --- /dev/null +++ b/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml @@ -0,0 +1,14 @@ +description: A list of beginner resources for programmers coming from other languages, + from Python's official guide. +name: Getting Started with Python for Programmers +title_url: https://wiki.python.org/moin/BeginnersGuide/Programmers +position: 0 +tags: + topics: + - general + payment_tiers: + - free + complexity: + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/google_collab.yaml b/pydis_site/apps/resources/resources/google_collab.yaml new file mode 100644 index 00000000..65876c0e --- /dev/null +++ b/pydis_site/apps/resources/resources/google_collab.yaml @@ -0,0 +1,17 @@ +description: Google Collab is a high-powered custom version of Jupyter Notebook which supports e.g. + !apt-get to install arbitrary Debian packages to the runtime, which is very generous with CPU and memory, + and well-integrated with Google Drive. + You can share your Collab Notebooks with other people and work collaboratively. +name: Google Collab +title_url: https://colab.research.google.com/notebooks/intro.ipynb +tags: + topics: + - general + - data science + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml new file mode 100644 index 00000000..e50f6297 --- /dev/null +++ b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml @@ -0,0 +1,20 @@ +description: A best practice handbook for both novice and expert Python developers to the installation, + configuration, and usage of Python on a daily basis. +name: The Hitchhiker's Guide to Python +urls: +- icon: regular/link + url: https://python-guide.org/ + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/28321007-the-hitchhiker-s-guide-to-python + color: goodreads-cream +tags: + topics: + - general + payment_tiers: + - paid + complexity: + - beginner + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/inferential_thinking.yaml b/pydis_site/apps/resources/resources/inferential_thinking.yaml new file mode 100644 index 00000000..92963948 --- /dev/null +++ b/pydis_site/apps/resources/resources/inferential_thinking.yaml @@ -0,0 +1,18 @@ +description: Inferential Thinking is the textbook for the Foundations of Data Science course at UC Berkley. + It introduces you the fundamentals of both Data Science and Python at a level accessible to all. + It is available both through your browser and in PDF form. +name: Inferential Thinking +urls: + - icon: regular/link + url: https://inferentialthinking.com/chapters/intro + color: teal +tags: + topics: + - data science + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/interactive/code_combat.yaml b/pydis_site/apps/resources/resources/interactive/code_combat.yaml deleted file mode 100644 index 640696a9..00000000 --- a/pydis_site/apps/resources/resources/interactive/code_combat.yaml +++ /dev/null @@ -1,20 +0,0 @@ -description: Learn Python while gaming - an open-source project with thousands of - contributors, which teaches you Python through a deep, top-down RPG. -name: Code Combat -position: 0 -urls: -- icon: regular/link - url: https://codecombat.com/ - color: teal -- icon: branding/github - url: https://github.com/codecombat/codecombat - color: black -tags: - topics: - - python - payment_tiers: - - free - - subscription - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/interactive/edublocks.yaml b/pydis_site/apps/resources/resources/interactive/edublocks.yaml deleted file mode 100644 index bef33abe..00000000 --- a/pydis_site/apps/resources/resources/interactive/edublocks.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: EduBlocks provides a simple drag and drop interface to help beginners get to grips - with the key concepts of Python. There is built-in support for modules such as random, - turtle, processing and pygal to play around with, - and it even allows you to export the Python code you have written in the graphical editor. - EduBlocks also has integration with BBC micro:bit, - Raspberry Pi and CircuitPython allowing you to write code for these devices graphically - and export the code to run on actual devices. -name: EduBlocks -title_url: https://edublocks.org/ -position: 5 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/interactive/exercism.yaml b/pydis_site/apps/resources/resources/interactive/exercism.yaml deleted file mode 100644 index 6e3d83db..00000000 --- a/pydis_site/apps/resources/resources/interactive/exercism.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: Level up your programming skills with more than 2600 exercises across - 47 programming languages, Python included. The website provides a mentored mode, - where you can get your code reviewed for each solution you submit. The mentors will - give you insightful advice to make you a better programmer. -name: exercism.io -position: 1 -urls: -- icon: regular/link - url: https://exercism.io/ - color: teal -- icon: branding/github - url: https://github.com/exercism/python - color: black -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/interactive/jetbrains_academy.yaml b/pydis_site/apps/resources/resources/interactive/jetbrains_academy.yaml deleted file mode 100644 index bb3606c9..00000000 --- a/pydis_site/apps/resources/resources/interactive/jetbrains_academy.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: Learn Python with a wide range of high quality, project-based lessons. - Keep track of your progress as you cover all the basic concepts a Python programmer needs to know, - as well as touching on more advanced areas such as web development with Django, - natural language processing with NLTK, and data science with NumPy, pandas, and scikit-learn! - It requires a paid subscription, but a free trial is available. -name: JetBrains Academy -title_url: https://www.jetbrains.com/academy/ -position: 6 -tags: - topics: - - python - payment_tiers: - - subscription - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/interactive/python_morsels.yaml b/pydis_site/apps/resources/resources/interactive/python_morsels.yaml deleted file mode 100644 index f51fe198..00000000 --- a/pydis_site/apps/resources/resources/interactive/python_morsels.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: 'Learn to write more idiomatic Python code with deliberate practice! - - - Sign up for this service and receive one short Python exercise every week. After - you attempt to work through the exercise, you''ll receive a number of solutions - to the exercise with explanations of each one. Each exercise will include automated - tests and some may include bonuses for a little more of a challenge!' -name: Python Morsels -title_url: https://www.pythonmorsels.com/ -position: 3 -tags: - topics: - - python - payment_tiers: - - subscription - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/interactive/python_tutor.yaml b/pydis_site/apps/resources/resources/interactive/python_tutor.yaml deleted file mode 100644 index fbde8b24..00000000 --- a/pydis_site/apps/resources/resources/interactive/python_tutor.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: Write Python code in your web browser, and see it visualized step by step. -name: Python Tutor -title_url: https://www.pythontutor.com/ -position: 2 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/interactive/sololearn.yaml b/pydis_site/apps/resources/resources/interactive/sololearn.yaml deleted file mode 100644 index 605c119f..00000000 --- a/pydis_site/apps/resources/resources/interactive/sololearn.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: SoloLearn's Python 3 course serves as a simple and convenient introduction to Python. - Containing exercises and quizzes in modules to cover introductory subjects of the language, - you can pick it up and put it down between your busier aspects of life thanks to both PC - and mobile apps being available to use. -name: SoloLearn -title_url: https://www.sololearn.com/Course/Python/ -position: 4 -tags: - topics: - - python - payment_tiers: - - free - - subscription - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/jetbrains_academy.yaml b/pydis_site/apps/resources/resources/jetbrains_academy.yaml new file mode 100644 index 00000000..63c061ce --- /dev/null +++ b/pydis_site/apps/resources/resources/jetbrains_academy.yaml @@ -0,0 +1,18 @@ +description: Learn Python with a wide range of high quality, project-based lessons. + Keep track of your progress as you cover all the basic concepts a Python programmer needs to know, + as well as touching on more advanced areas such as web development with Django, + natural language processing with NLTK, and data science with NumPy, pandas, and scikit-learn! + It requires a paid subscription, but a free trial is available. +name: JetBrains Academy +title_url: https://www.jetbrains.com/academy/ +tags: + topics: + - general + - web development + - data science + payment_tiers: + - subscription + complexity: + - beginner + type: + - interactive diff --git a/pydis_site/apps/resources/resources/jetbrains_videos.yaml b/pydis_site/apps/resources/resources/jetbrains_videos.yaml new file mode 100644 index 00000000..f13ecbb7 --- /dev/null +++ b/pydis_site/apps/resources/resources/jetbrains_videos.yaml @@ -0,0 +1,23 @@ +description: A collection of videos made by the PyCharm team at JetBrains on subjects such as TDD, + Django, pytest and much more!

+ Episodes of their "What does this package do?" series go over all sorts of libraries in Python + both in the standard library and from the community and give a video explanation of the key concepts. +icon_image: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/JetBrains_Logo_2016.svg/1200px-JetBrains_Logo_2016.svg.png +icon_size: 50 +title_image: https://resources.jetbrains.com/storage/products/pycharm/img/meta/pycharm_logo_300x300.png +urls: + - icon: branding/youtube + url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw + color: youtube-red +tags: + topics: + - general + - testing + - web development + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/jim_shaped_coding.yaml b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml new file mode 100644 index 00000000..a217183e --- /dev/null +++ b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml @@ -0,0 +1,24 @@ +description: 'JimShapedCoding contains a set of YouTube tutorials covering things from Flask to GUI development in Python: + + Check out his channel for more videos!' +title_image: https://i.imgur.com/DlovZPf.png +urls: + - icon: branding/youtube + url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg + color: youtube-red +tags: + topics: + - general + - user interface + - web development + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/kivy.yaml b/pydis_site/apps/resources/resources/kivy.yaml new file mode 100644 index 00000000..c4028647 --- /dev/null +++ b/pydis_site/apps/resources/resources/kivy.yaml @@ -0,0 +1,28 @@ +description: The Kivy project, through the Kivy framework and its sister projects, + aims to provide all the tools to create desktop and mobile applications in Python. + Allowing rapid development of multitouch applications with custom and exciting user interfaces. +icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/logos/kivy-logo-black-256.png +icon_size: 50 +title_image: https://i.imgur.com/EVP3jZR.png +title_url: https://discord.gg/djPtTRJ +urls: + - icon: branding/discord + url: https://discord.gg/djPtTRJ + color: blurple + - icon: regular/link + url: https://kivy.org/ + color: teal + - icon: branding/github + url: https://github.com/kivy + color: black +tags: + topics: + - user interface + - game development + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/microsoft.yaml b/pydis_site/apps/resources/resources/microsoft.yaml new file mode 100644 index 00000000..455131be --- /dev/null +++ b/pydis_site/apps/resources/resources/microsoft.yaml @@ -0,0 +1,22 @@ +description: Microsoft Python is a Discord server for discussing all things relating to using Python with Microsoft products, + they have channels for Azure, VS Code, IoT, Data Science and much more! +title_image: https://1000logos.net/wp-content/uploads/2017/04/Microsoft-Logo.png +title_url: https://discord.gg/b8YJQPx +urls: + - icon: branding/discord + url: https://discord.gg/b8YJQPx + color: blurple + - icon: regular/link + url: https://www.microsoft.com/en-us/boards/pycon2020.aspx + color: teal +tags: + topics: + - general + - tooling + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/microsoft_videos.yaml b/pydis_site/apps/resources/resources/microsoft_videos.yaml new file mode 100644 index 00000000..d0dbc4f4 --- /dev/null +++ b/pydis_site/apps/resources/resources/microsoft_videos.yaml @@ -0,0 +1,26 @@ +description: A trove of tutorials & guides for developers from Microsoft's Developer hub. + Follow the links below for a series of high-quality Python tutorials for beginners. + + Microsoft's Python Development Team also runs a Discord Server for discussions of Python in the Microsoft ecosystem, + including Visual Studio Code and Azure. +title_image: http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2qVsJ?ver=3f74 +urls: + - icon: branding/youtube + url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g + color: youtube-red + - icon: branding/discord + url: https://aka.ms/python-discord + color: blurple +tags: + topics: + - python + payment_tiers: + - free + complexity: + - beginner + type: + - video diff --git a/pydis_site/apps/resources/resources/mission_python.yaml b/pydis_site/apps/resources/resources/mission_python.yaml new file mode 100644 index 00000000..2a1ffcad --- /dev/null +++ b/pydis_site/apps/resources/resources/mission_python.yaml @@ -0,0 +1,22 @@ +description: Learn programming and Python while building a complete and awesome space-themed + game using cutting-edge Python 3.6 and Pygame Zero. Extensive use of code examples, + images, and walk-throughs make this a pleasure to both read and follow along. Excellent + book for beginners. +name: Mission Python +urls: +- icon: regular/link + url: https://www.sean.co.uk/books/mission-python/index.shtm + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/35545850-mission-python + color: goodreads-cream +tags: + topics: + - general + - game development + payment_tiers: + - paid + complexity: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml b/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml new file mode 100644 index 00000000..4aa028ea --- /dev/null +++ b/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml @@ -0,0 +1,16 @@ +description: This MITx offering teaches computer science with Python. + It covers computational thinking, algorithms, data structures + and the Python programming language itself. +name: 'MIT: Introduction to Computer Science and Programming' +title_url: https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-11 +tags: + topics: + - general + - algorithms and data structures + payment_tiers: + - free + - paid + complexity: + - beginner + type: + - course diff --git a/pydis_site/apps/resources/resources/mu_editor.yaml b/pydis_site/apps/resources/resources/mu_editor.yaml new file mode 100644 index 00000000..68c9b7db --- /dev/null +++ b/pydis_site/apps/resources/resources/mu_editor.yaml @@ -0,0 +1,15 @@ +description: An editor aimed at beginners for the purpose of learning how to code + without the distractions more advanced editors sometimes cause. + Particularly useful for use with microcontrollers, + with built-in tools to interact with Adafruit and Arduino boards. +name: Mu-Editor +title_url: https://codewith.mu/ +tags: + topics: + - microcontrollers + payment_tiers: + - free + complexity: + - beginner + type: + - tool diff --git a/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml new file mode 100644 index 00000000..ae5005a7 --- /dev/null +++ b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml @@ -0,0 +1,21 @@ +description: '"Neural Networks From Scratch" is a book intended to teach you how to build neural networks on your own, + without any libraries, so you can better understand deep learning and how all of the elements work. + This is so you can go out and do new/novel things with deep learning as well as to become more successful with even more basic models. + This book is to accompany the usual free tutorial videos and sample code from youtube.com/sentdex.' +name: Neural Networks from Scratch in Python +urls: + - icon: regular/link + url: https://nnfs.io/ + color: teal + - icon: branding/goodreads + url: https://www.goodreads.com/book/show/55927899-neural-networks-from-scratch-in-python + color: goodreads-cream +tags: + topics: + - data science + payment_tiers: + - paid + complexity: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/pallets.yaml b/pydis_site/apps/resources/resources/pallets.yaml new file mode 100644 index 00000000..dc337784 --- /dev/null +++ b/pydis_site/apps/resources/resources/pallets.yaml @@ -0,0 +1,22 @@ +description: The Pallets Projects develop Python libraries such as the Flask web framework, + the Jinja templating library, and the Click command line toolkit. Join to discuss + and get help from the Pallets community. +title_image: https://i.imgur.com/sV9Ypdf.png +title_url: https://discord.gg/t6rrQZH +urls: + - icon: branding/discord + url: https://discord.gg/t6rrQZH + color: blurple + - icon: regular/link + url: https://www.palletsprojects.com/ + color: teal +tags: + topics: + - web development + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/panda3d.yaml b/pydis_site/apps/resources/resources/panda3d.yaml new file mode 100644 index 00000000..286e8b27 --- /dev/null +++ b/pydis_site/apps/resources/resources/panda3d.yaml @@ -0,0 +1,23 @@ +description: Panda3D is a Python-focused 3-D framework for rapid development of games, + visualizations, and simulations, written in C++ with an emphasis on performance and flexibility. +title_image: http://www.panda3d.org/wp-content/uploads/2019/01/panda3d_logo.png +title_url: https://discord.gg/9XsucTT +position: 9 +urls: + - icon: branding/discord + url: https://discord.gg/9XsucTT + color: blurple + - icon: regular/link + url: https://www.panda3d.org/ + color: teal +tags: + topics: + - user interface + - game development + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/people_postgres_data.yaml b/pydis_site/apps/resources/resources/people_postgres_data.yaml new file mode 100644 index 00000000..4f84cb99 --- /dev/null +++ b/pydis_site/apps/resources/resources/people_postgres_data.yaml @@ -0,0 +1,27 @@ +description: People, Postgres, Data specializes in building users of Postgres + and related ecosystem including but not limited to technologies such as RDS Postgres, + Aurora for Postgres, Google Postgres, PostgreSQL.Org Postgres, Greenplum, Timescale and ZomboDB. + They take a holistic approach to their community inviting not only technical topics but Professional Development + and Life in general including movies, games, books and travel. +title_image: https://media.discordapp.net/attachments/748954447857844318/750519488268730377/people_postgres_data.png +title_url: https://discord.gg/Ujw8m8v +urls: + - icon: branding/discord + url: https://discord.gg/Ujw8m8v + color: bluple + - icon: regular/link + url: https://postgresconf.org/ + color: teal + - icon: branding/reddit + url: https://reddit.com/r/postgresql + color: orangered +tags: + topics: + - databases + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/podcast_dunder_init.yaml b/pydis_site/apps/resources/resources/podcast_dunder_init.yaml new file mode 100644 index 00000000..ee3028a3 --- /dev/null +++ b/pydis_site/apps/resources/resources/podcast_dunder_init.yaml @@ -0,0 +1,14 @@ +description: The podcast about Python and the people who make it great. Weekly long-form + interviews with the creators of notable Python packages. +name: Podcast.__init__ +title_url: https://www.podcastinit.com/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/podcasts/podcast_dunder_init.yaml b/pydis_site/apps/resources/resources/podcasts/podcast_dunder_init.yaml deleted file mode 100644 index c22d4a59..00000000 --- a/pydis_site/apps/resources/resources/podcasts/podcast_dunder_init.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: The podcast about Python and the people who make it great. Weekly long-form - interviews with the creators of notable Python packages. -name: Podcast.__init__ -title_url: https://www.podcastinit.com/ -position: 2 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/podcasts/python_bytes.yaml b/pydis_site/apps/resources/resources/podcasts/python_bytes.yaml deleted file mode 100644 index 9112d1b7..00000000 --- a/pydis_site/apps/resources/resources/podcasts/python_bytes.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: A byte-sized podcast where Michael Kennedy and Brian Okken work through - this week's notable Python headlines. -name: Python Bytes -title_url: https://pythonbytes.fm/ -position: 1 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/podcasts/talk_python_to_me.yaml b/pydis_site/apps/resources/resources/podcasts/talk_python_to_me.yaml deleted file mode 100644 index 8f63a0fb..00000000 --- a/pydis_site/apps/resources/resources/podcasts/talk_python_to_me.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: The essential weekly Python podcast. Michael Kennedy and a prominent - name within the Python community dive into a topic that relates to their experience. -name: Talk Python To Me -title_url: https://talkpython.fm/ -position: 0 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/podcasts/test_and_code.yaml b/pydis_site/apps/resources/resources/podcasts/test_and_code.yaml deleted file mode 100644 index 5c3ff1e3..00000000 --- a/pydis_site/apps/resources/resources/podcasts/test_and_code.yaml +++ /dev/null @@ -1,14 +0,0 @@ -description: Brian Okken's weekly podcast on testing. Usually deals with Python, - but also covers many language-agnostic topics from the testing and DevOps world. -name: Test & Code -title_url: https://testandcode.com/ -position: 3 -tags: - topics: - - testing - - devops - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/podcasts/the_real_python_podcast.yaml b/pydis_site/apps/resources/resources/podcasts/the_real_python_podcast.yaml deleted file mode 100644 index 48885f05..00000000 --- a/pydis_site/apps/resources/resources/podcasts/the_real_python_podcast.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: A weekly Python podcast hosted by Christopher Bailey with interviews, - coding tips, and conversation with guests from the Python community. - The show covers a wide range of topics including Python programming best practices, - career tips, and related software development topics. -name: The Real Python Podcast -title_url: https://realpython.com/podcasts/rpp/ -position: 4 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/practical_python_programming.yaml b/pydis_site/apps/resources/resources/practical_python_programming.yaml new file mode 100644 index 00000000..85b3967a --- /dev/null +++ b/pydis_site/apps/resources/resources/practical_python_programming.yaml @@ -0,0 +1,18 @@ +description: Created and taught by David Beazley, + this course is a conversion of his instructor-led Python training course used for corporate training + and professional development. It has been in continual development since 2007 + and battle tested in real-world classrooms. Usually, it’s taught in-person over the span of three + or four days–requiring approximately 25-35 hours of intense work. + This includes the completion of approximately 130 hands-on coding exercises. +name: Practical Python Programming +title_url: https://dabeaz-course.github.io/practical-python/ +position: 4 +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + type: + - course diff --git a/pydis_site/apps/resources/resources/pycharm.yaml b/pydis_site/apps/resources/resources/pycharm.yaml new file mode 100644 index 00000000..1fda3bff --- /dev/null +++ b/pydis_site/apps/resources/resources/pycharm.yaml @@ -0,0 +1,14 @@ +description: The very best Python IDE, with a wealth of advanced features and convenience + functions. +name: PyCharm +title_url: https://www.jetbrains.com/pycharm/ +tags: + topics: + - general + payment_tiers: + - free + - paid + complexity: + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/pyglet.yaml b/pydis_site/apps/resources/resources/pyglet.yaml new file mode 100644 index 00000000..1f74557f --- /dev/null +++ b/pydis_site/apps/resources/resources/pyglet.yaml @@ -0,0 +1,25 @@ +description: Pyglet is a powerful, + yet easy to use Python library for developing games and other visually-rich applications on Windows, + Mac OS X and Linux. It supports windowing, user interface event handling, Joysticks, OpenGL graphics, + loading images and videos, and playing sounds and music. All of this with a friendly Pythonic API, + that's simple to learn and doesn't get in your way. +title_image: https://i.imgur.com/LfQwXUe.png +title_url: https://discord.gg/QXyegWe +urls: + - icon: branding/discord + url: https://discord.gg/QXyegWe + color: blurple + - icon: regular/link + url: http://pyglet.org/ + color: teal +tags: + topics: + - user interface + - game development + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/python_bytes.yaml b/pydis_site/apps/resources/resources/python_bytes.yaml new file mode 100644 index 00000000..578fff2e --- /dev/null +++ b/pydis_site/apps/resources/resources/python_bytes.yaml @@ -0,0 +1,15 @@ +description: A byte-sized podcast where Michael Kennedy and Brian Okken work through + this week's notable Python headlines. +name: Python Bytes +title_url: https://pythonbytes.fm/ +position: 1 +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/python_cheat_sheet.yaml b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml new file mode 100644 index 00000000..9bec6d57 --- /dev/null +++ b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml @@ -0,0 +1,13 @@ +description: A Python 3 cheat sheet with useful information and tips, as well as common + pitfalls for beginners. This is a PDF. +name: Python Cheat Sheet +title_url: https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf +tags: + topics: + - python + payment_tiers: + - free + complexity: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/python_cookbook.yaml b/pydis_site/apps/resources/resources/python_cookbook.yaml new file mode 100644 index 00000000..0c4ffd99 --- /dev/null +++ b/pydis_site/apps/resources/resources/python_cookbook.yaml @@ -0,0 +1,23 @@ +description: A book full of very smart problem-solving recipes for various Python topics, + including moving from Python 2 to Python 3. +name: Python Cookbook +urls: +- icon: regular/link + url: http://shop.oreilly.com/product/0636920027072.do + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/17152735-python-cookbook + color: goodreads-cream +- icon: branding/github + url: https://github.com/dabeaz/python-cookbook + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + complexity: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/python_crash_course.yaml b/pydis_site/apps/resources/resources/python_crash_course.yaml new file mode 100644 index 00000000..41f0973d --- /dev/null +++ b/pydis_site/apps/resources/resources/python_crash_course.yaml @@ -0,0 +1,29 @@ +description: "This fast-paced, thorough introduction to programming with Python will have you writing programs, + solving problems, and making things that work in no time. + In the first half of the book, you’ll learn basic programming concepts, such as variables, lists, classes, and loops, + and practice writing clean code with exercises for each topic. + You’ll also learn how to make your programs interactive and test your code safely before adding it to a project. + In the second half, you’ll put your new knowledge into practice with three substantial projects: + a Space Invaders–inspired arcade game, a set of data visualizations with Python’s handy libraries, + and a simple web app you can deploy online." +name: Python Crash Course +urls: + - icon: regular/link + url: https://nostarch.com/pythoncrashcourse2e + color: teal + - icon: branding/goodreads + url: https://www.goodreads.com/book/show/23241059-python-crash-course + color: goodreads-cream + - icon: branding/github + url: https://ehmatthes.github.io/pcc/ + color: black +tags: + topics: + - general + - game development + payment_tiers: + - paid + complexity: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/python_developer_guide.yaml b/pydis_site/apps/resources/resources/python_developer_guide.yaml new file mode 100644 index 00000000..f17c88ce --- /dev/null +++ b/pydis_site/apps/resources/resources/python_developer_guide.yaml @@ -0,0 +1,13 @@ +description: This guide is a comprehensive resource for contributing to Python – for both new and experienced contributors. + It is maintained by the same community that maintains Python. +name: Python Developer's Guide +title_url: https://devguide.python.org/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/python_discord_videos.yaml b/pydis_site/apps/resources/resources/python_discord_videos.yaml new file mode 100644 index 00000000..2a8fed08 --- /dev/null +++ b/pydis_site/apps/resources/resources/python_discord_videos.yaml @@ -0,0 +1,19 @@ +description: It's our channel! We are slowly gathering content here directly related to Python, + our community and the events we host. Come check us out! +title_image: https://raw.githubusercontent.com/python-discord/branding/master/logos/logo_banner/logo_site_banner_dark_512.png +position: 2 +urls: + - icon: branding/youtube + url: https://www.youtube.com/pythondiscord + color: youtube-red +tags: + topics: + - general + - software design + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/python_morsels.yaml b/pydis_site/apps/resources/resources/python_morsels.yaml new file mode 100644 index 00000000..de02be7f --- /dev/null +++ b/pydis_site/apps/resources/resources/python_morsels.yaml @@ -0,0 +1,19 @@ +description: 'Learn to write more idiomatic Python code with deliberate practice! + + + Sign up for this service and receive one short Python exercise every week. After + you attempt to work through the exercise, you''ll receive a number of solutions + to the exercise with explanations of each one. Each exercise will include automated + tests and some may include bonuses for a little more of a challenge!' +name: Python Morsels +title_url: https://www.pythonmorsels.com/ +tags: + topics: + - general + - software design + payment_tiers: + - subscription + complexity: + - intermediate + type: + - interactive diff --git a/pydis_site/apps/resources/resources/python_subreddit.yaml b/pydis_site/apps/resources/resources/python_subreddit.yaml new file mode 100644 index 00000000..ef9f23d9 --- /dev/null +++ b/pydis_site/apps/resources/resources/python_subreddit.yaml @@ -0,0 +1,16 @@ +description: News about the Python programming language, and language-related discussion. +name: r/Python +title_icon: branding/reddit +title_icon_color: orangered +title_url: https://www.reddit.com/r/Python/ +position: 0 +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/python_tricks.yaml b/pydis_site/apps/resources/resources/python_tricks.yaml new file mode 100644 index 00000000..6d857a9d --- /dev/null +++ b/pydis_site/apps/resources/resources/python_tricks.yaml @@ -0,0 +1,21 @@ +description: Full of useful Python tips, tricks and features. Get this if you have + a good grasp of the basics and want to take your Python skills to the next level, + or are a experienced programmer looking to add to your toolbelt. +name: Python Tricks +urls: +- icon: regular/link + url: https://realpython.com/products/python-tricks-book/ + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/36990732-python-tricks + color: goodreads-cream +tags: + topics: + - general + - software design + payment_tiers: + - paid + complexity: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/python_tutor.yaml b/pydis_site/apps/resources/resources/python_tutor.yaml new file mode 100644 index 00000000..4f6d5130 --- /dev/null +++ b/pydis_site/apps/resources/resources/python_tutor.yaml @@ -0,0 +1,14 @@ +description: Write Python code in your web browser, and see it visualized step by step. +name: Python Tutor +title_url: https://www.pythontutor.com/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool + - interactive diff --git a/pydis_site/apps/resources/resources/reading/books/automate_the_boring_stuff.yaml b/pydis_site/apps/resources/resources/reading/books/automate_the_boring_stuff.yaml deleted file mode 100644 index 9fc5a66c..00000000 --- a/pydis_site/apps/resources/resources/reading/books/automate_the_boring_stuff.yaml +++ /dev/null @@ -1,23 +0,0 @@ -description: One of the best books out there for Python beginners. This book will - teach you the basics of Python, while also teaching invaluable automation tools - and techniques for solving common problems. You'll learn how to go about scraping - the web, manipulating files and automating keyboard and mouse input. Ideal for an - office worker who wants to make himself more useful. -name: Automate the Boring Stuff with Python -position: 2 -urls: -- icon: regular/book - url: https://automatetheboringstuff.com/ - color: black -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python - color: goodreads-cream -tags: - topics: - - python - - automation - payment_tiers: - - free - - paid - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/books/byte_of_python.yaml b/pydis_site/apps/resources/resources/reading/books/byte_of_python.yaml deleted file mode 100644 index 9590883c..00000000 --- a/pydis_site/apps/resources/resources/reading/books/byte_of_python.yaml +++ /dev/null @@ -1,23 +0,0 @@ -description: A free book on programming using the Python language. - It serves as a tutorial or guide to the Python language for a beginner audience. - If all you know about computers is how to save text files, then this is the book for you. -name: A Byte of Python -position: 1 -urls: -- icon: regular/link - url: https://python.swaroopch.com/ - color: teal -- icon: regular/book - url: http://www.lulu.com/shop/swaroop-c-h/a-byte-of-python/paperback/product-21142968.html - color: black -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/6762544-a-byte-of-python - color: goodreads-cream -tags: - topics: - - python - payment_tiers: - - free - - paid - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/books/effective_python.yaml b/pydis_site/apps/resources/resources/reading/books/effective_python.yaml deleted file mode 100644 index 2526e0e1..00000000 --- a/pydis_site/apps/resources/resources/reading/books/effective_python.yaml +++ /dev/null @@ -1,22 +0,0 @@ -description: A book that gives 90 best practices for writing excellent Python. Great - for intermediates. -name: Effective Python -position: 3 -urls: -- icon: regular/link - url: https://effectivepython.com/ - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/48566725-effective-python - color: goodreads-cream -- icon: branding/github - url: https://github.com/bslatkin/effectivepython - color: black -tags: - topics: - - python - - best practices - payment_tiers: - - paid - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/flask_web_development.yaml b/pydis_site/apps/resources/resources/reading/books/flask_web_development.yaml deleted file mode 100644 index 1dad7978..00000000 --- a/pydis_site/apps/resources/resources/reading/books/flask_web_development.yaml +++ /dev/null @@ -1,22 +0,0 @@ -description: A comprehensive Flask walkthrough that has you building a complete social - blogging application from scratch. -name: Flask Web Development -position: 6 -urls: -- icon: regular/link - url: http://shop.oreilly.com/product/0636920031116.do - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/18774655-flask-web-development - color: goodreads-cream -- icon: branding/github - url: https://github.com/miguelgrinberg/flasky - color: black -tags: - topics: - - web development - payment_tiers: - - paid - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/fluent_python.yaml b/pydis_site/apps/resources/resources/reading/books/fluent_python.yaml deleted file mode 100644 index c319d473..00000000 --- a/pydis_site/apps/resources/resources/reading/books/fluent_python.yaml +++ /dev/null @@ -1,22 +0,0 @@ -description: A veritable tome of intermediate and advanced Python information. A must-read - for any Python professional. By far the most recommended book for intermediates. -name: Fluent Python -position: 7 -urls: -- icon: regular/link - url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/22800567-fluent-python - color: goodreads-cream -- icon: branding/github - url: https://github.com/fluentpython - color: black -tags: - topics: - - python - - best practices - payment_tiers: - - paid - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/hitchhikers_guide_to_python.yaml b/pydis_site/apps/resources/resources/reading/books/hitchhikers_guide_to_python.yaml deleted file mode 100644 index fc98c8ba..00000000 --- a/pydis_site/apps/resources/resources/reading/books/hitchhikers_guide_to_python.yaml +++ /dev/null @@ -1,20 +0,0 @@ -description: A best practice handbook for both novice and expert Python developers to the installation, - configuration, and usage of Python on a daily basis. -name: The Hitchhiker's Guide to Python -position: 0 -urls: -- icon: regular/link - url: https://python-guide.org/ - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/28321007-the-hitchhiker-s-guide-to-python - color: goodreads-cream -tags: - topics: - - python - - soft skills - payment_tiers: - - paid - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml b/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml deleted file mode 100644 index f1ac2b3c..00000000 --- a/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml +++ /dev/null @@ -1,18 +0,0 @@ -description: Inferential Thinking is the textbook for the Foundations of Data Science course at UC Berkley. - It introduces you the fundamentals of both Data Science and Python at a level accessible to all. - It is available both through your browser and in PDF form. -name: Inferential Thinking -position: 13 -urls: - - icon: regular/link - url: https://inferentialthinking.com/chapters/intro - color: teal -tags: - topics: - - data science - - python - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/mission_python.yaml b/pydis_site/apps/resources/resources/reading/books/mission_python.yaml deleted file mode 100644 index ab97e9ee..00000000 --- a/pydis_site/apps/resources/resources/reading/books/mission_python.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: Learn programming and Python while building a complete and awesome space-themed - game using cutting-edge Python 3.6 and Pygame Zero. Extensive use of code examples, - images, and walk-throughs make this a pleasure to both read and follow along. Excellent - book for beginners. -name: Mission Python -position: 5 -urls: -- icon: regular/link - url: https://www.sean.co.uk/books/mission-python/index.shtm - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/35545850-mission-python - color: goodreads-cream -tags: - topics: - - python - - game development - payment_tiers: - - paid - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/books/neural_networks_from_scratch_in_python.yaml b/pydis_site/apps/resources/resources/reading/books/neural_networks_from_scratch_in_python.yaml deleted file mode 100644 index c6a51755..00000000 --- a/pydis_site/apps/resources/resources/reading/books/neural_networks_from_scratch_in_python.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: '"Neural Networks From Scratch" is a book intended to teach you how to build neural networks on your own, - without any libraries, so you can better understand deep learning and how all of the elements work. - This is so you can go out and do new/novel things with deep learning as well as to become more successful with even more basic models. - This book is to accompany the usual free tutorial videos and sample code from youtube.com/sentdex.' -name: Neural Networks from Scratch in Python -position: 11 -urls: - - icon: regular/link - url: https://nnfs.io/ - color: teal - - icon: branding/goodreads - url: https://www.goodreads.com/book/show/55927899-neural-networks-from-scratch-in-python - color: goodreads-cream -tags: - topics: - - neural networks - - machine learning - payment_tiers: - - paid - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/python_cookbook.yaml b/pydis_site/apps/resources/resources/reading/books/python_cookbook.yaml deleted file mode 100644 index 0ae8460e..00000000 --- a/pydis_site/apps/resources/resources/reading/books/python_cookbook.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: A book full of very smart problem-solving recipes for various Python topics, - including moving from Python 2 to Python 3. -name: Python Cookbook -position: 8 -urls: -- icon: regular/link - url: http://shop.oreilly.com/product/0636920027072.do - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/17152735-python-cookbook - color: goodreads-cream -- icon: branding/github - url: https://github.com/dabeaz/python-cookbook - color: black -tags: - topics: - - python - payment_tiers: - - paid - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/python_crash_course.yaml b/pydis_site/apps/resources/resources/reading/books/python_crash_course.yaml deleted file mode 100644 index 981ca1c8..00000000 --- a/pydis_site/apps/resources/resources/reading/books/python_crash_course.yaml +++ /dev/null @@ -1,28 +0,0 @@ -description: "This fast-paced, thorough introduction to programming with Python will have you writing programs, - solving problems, and making things that work in no time. - In the first half of the book, you’ll learn basic programming concepts, such as variables, lists, classes, and loops, - and practice writing clean code with exercises for each topic. - You’ll also learn how to make your programs interactive and test your code safely before adding it to a project. - In the second half, you’ll put your new knowledge into practice with three substantial projects: - a Space Invaders–inspired arcade game, a set of data visualizations with Python’s handy libraries, - and a simple web app you can deploy online." -name: Python Crash Course -position: 12 -urls: - - icon: regular/link - url: https://nostarch.com/pythoncrashcourse2e - color: teal - - icon: branding/goodreads - url: https://www.goodreads.com/book/show/23241059-python-crash-course - color: goodreads-cream - - icon: branding/github - url: https://ehmatthes.github.io/pcc/ - color: black -tags: - topics: - - python - - game development - payment_tiers: - - paid - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/books/python_tricks.yaml b/pydis_site/apps/resources/resources/reading/books/python_tricks.yaml deleted file mode 100644 index 01707bb8..00000000 --- a/pydis_site/apps/resources/resources/reading/books/python_tricks.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: Full of useful Python tips, tricks and features. Get this if you have - a good grasp of the basics and want to take your Python skills to the next level, - or are a experienced programmer looking to add to your toolbelt. -name: Python Tricks -position: 4 -urls: -- icon: regular/link - url: https://realpython.com/products/python-tricks-book/ - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/36990732-python-tricks - color: goodreads-cream -tags: - topics: - - python - - best practices - - soft skills - payment_tiers: - - paid - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/books/think_python.yaml b/pydis_site/apps/resources/resources/reading/books/think_python.yaml deleted file mode 100644 index a996ede5..00000000 --- a/pydis_site/apps/resources/resources/reading/books/think_python.yaml +++ /dev/null @@ -1,24 +0,0 @@ -description: Think Python is an introduction to Python programming for beginners. - It starts with basic concepts of programming, - and is carefully designed to define all terms when they are first used and to develop each new concept in a logical progression. - Larger pieces, like recursion and object-oriented programming are divided into a sequence of smaller steps - and introduced over the course of several chapters. -name: Think Python -position: 10 -urls: - - icon: regular/link - url: https://greenteapress.com/wp/think-python-2e/ - color: teal - - icon: branding/goodreads - url: https://www.goodreads.com/book/show/14514306-think-python - color: goodreads-cream - - icon: branding/github - url: https://github.com/AllenDowney/ThinkPython2 - color: black -tags: - topics: - - python - payment_tiers: - - paid - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/books/two_scoops_of_django.yaml b/pydis_site/apps/resources/resources/reading/books/two_scoops_of_django.yaml deleted file mode 100644 index 10a9d11d..00000000 --- a/pydis_site/apps/resources/resources/reading/books/two_scoops_of_django.yaml +++ /dev/null @@ -1,21 +0,0 @@ -description: Tips, tricks, and best practices for your Django project. - A highly recommended resource for Django web developers. -name: Two Scoops of Django -position: 9 -urls: -- icon: regular/book - url: https://www.feldroy.com/collections/everything/products/two-scoops-of-django-3-x - color: teal -- icon: branding/goodreads - url: https://www.goodreads.com/book/show/55822151-two-scoops-of-django-3-x - color: goodreads-cream -- icon: branding/github - url: https://github.com/twoscoops/two-scoops-of-django-2.0-code-examples - color: black -tags: - topics: - - web development - payment_tiers: - - paid - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_kivy.yaml b/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_kivy.yaml deleted file mode 100644 index 00b5d459..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_kivy.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: A big list of excellent resources for getting started making Kivy applications. -name: Getting Started with Kivy -title_url: https://blog.kivy.org/2019/12/getting-started-with-kivy/ -icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/logos/kivy-logo-black-256.png -position: 3 -tags: - topics: - - user interface - - game development - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_non_programmers.yaml b/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_non_programmers.yaml deleted file mode 100644 index 3b89c4ac..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_non_programmers.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: A list of beginner resources for programmers with no prior developer experience, - from Python's official guide. -name: Getting Started with Python for Non-Programmers -title_url: https://wiki.python.org/moin/BeginnersGuide/NonProgrammers -position: 1 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_programmers.yaml b/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_programmers.yaml deleted file mode 100644 index e369834d..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_programmers.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: A list of beginner resources for programmers coming from other languages, - from Python's official guide. -name: Getting Started with Python for Programmers -title_url: https://wiki.python.org/moin/BeginnersGuide/Programmers -position: 0 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/tutorials/python_cheat_sheet.yaml b/pydis_site/apps/resources/resources/reading/tutorials/python_cheat_sheet.yaml deleted file mode 100644 index 3162f048..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/python_cheat_sheet.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: A Python 3 cheat sheet with useful information and tips, as well as common - pitfalls for beginners. This is a PDF. -name: Python Cheat Sheet -title_url: https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf -position: 6 -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/tutorials/python_developer_guide.yaml b/pydis_site/apps/resources/resources/reading/tutorials/python_developer_guide.yaml deleted file mode 100644 index fb9b2db5..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/python_developer_guide.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: This guide is a comprehensive resource for contributing to Python – for both new and experienced contributors. - It is maintained by the same community that maintains Python. -name: Python Developer's Guide -title_url: https://devguide.python.org/ -position: 2 -tags: - topics: - - cpython - - open source - payment_tiers: - - free - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/tutorials/simple_guide_to_git.yaml b/pydis_site/apps/resources/resources/reading/tutorials/simple_guide_to_git.yaml deleted file mode 100644 index 8857e151..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/simple_guide_to_git.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: A simple, no-nonsense guide to the basics of using Git. -name: A Simple Guide to Git -title_url: http://rogerdudler.github.io/git-guide/ -title_icon: branding/github -title_icon_color: black -position: 4 -tags: - topics: - - version control - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/reading/tutorials/the_flask_mega_tutorial.yaml b/pydis_site/apps/resources/resources/reading/tutorials/the_flask_mega_tutorial.yaml deleted file mode 100644 index c98d8ea2..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/the_flask_mega_tutorial.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: Miguel Grinberg's fully featured mega-tutorial for learning how to create web applications with the Flask framework. -name: The Flask Mega-Tutorial -title_url: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world -position: 5 -tags: - topics: - - web development - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/reading/tutorials/wtf_python.yaml b/pydis_site/apps/resources/resources/reading/tutorials/wtf_python.yaml deleted file mode 100644 index 916486b9..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/wtf_python.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: Python, being a beautifully designed high-level and interpreter-based programming language, - provides us with many features for the programmer's comfort. - But sometimes, the outcomes of a Python snippet may not seem obvious at first sight. - Here's a fun project attempting to explain what exactly is happening under the hood for some counter-intuitive snippets - and lesser-known features in Python. -name: WTF Python -title_url: https://github.com/satwikkansal/wtfpython -position: 7 -tags: - topics: - - python - - best practices - - esoteric - payment_tiers: - - free - complexity: - - intermediate diff --git a/pydis_site/apps/resources/resources/real_python.yaml b/pydis_site/apps/resources/resources/real_python.yaml new file mode 100644 index 00000000..36d8db7f --- /dev/null +++ b/pydis_site/apps/resources/resources/real_python.yaml @@ -0,0 +1,22 @@ +description: Dan Bader's treasure trove of quizzes, tutorials and interactive content for learning Python. + An absolute goldmine. +title_image: https://i.imgur.com/WDqhZ36.png +title_url: https://realpython.com/ +position: 3 +urls: + - icon: regular/link + url: https://realpython.com/ + color: teal + - icon: branding/youtube + url: https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA + color: youtube-red +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/repl_it.yaml b/pydis_site/apps/resources/resources/repl_it.yaml new file mode 100644 index 00000000..e1ba1d19 --- /dev/null +++ b/pydis_site/apps/resources/resources/repl_it.yaml @@ -0,0 +1,14 @@ +description: A free, collaborative, in-browser IDE to code in 50+ languages — + without spending a second on setup. +name: repl.it +title_url: https://repl.it/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/screen_readers.yaml b/pydis_site/apps/resources/resources/screen_readers.yaml new file mode 100644 index 00000000..9673a132 --- /dev/null +++ b/pydis_site/apps/resources/resources/screen_readers.yaml @@ -0,0 +1,17 @@ +description: Screen readers are software programs that allow blind + or visually impaired users to read the text displayed on a computer screen with a speech synthesizer or braille display. + There are many different screen reader program options, + with this link describing many of them and their capabilities. +name: Screen Readers - American Foundation for the Blind +title_url: https://www.afb.org/blindness-and-low-vision/using-technology/assistive-technology-products/screen-readers +tags: + topics: + - other + payment_tiers: + - free + - paid + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/sentdex.yaml b/pydis_site/apps/resources/resources/sentdex.yaml new file mode 100644 index 00000000..21acd4e9 --- /dev/null +++ b/pydis_site/apps/resources/resources/sentdex.yaml @@ -0,0 +1,34 @@ +description: 'An enormous amount of Python content for all skill levels + from the most popular Python YouTuber on the web. + + Check out his channel for more video series! + ' +title_image: https://i.imgur.com/kJgWZIu.png +position: 1 +urls: + - icon: branding/youtube + url: https://www.youtube.com/user/sentdex + color: youtube-red + - icon: branding/discord + url: https://discord.gg/sentdex + color: blurple + - icon: regular/link + url: https://pythonprogramming.net/ + color: teal +tags: + topics: + - general + - user interface + - data science + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/simple_guide_to_git.yaml b/pydis_site/apps/resources/resources/simple_guide_to_git.yaml new file mode 100644 index 00000000..144b6c70 --- /dev/null +++ b/pydis_site/apps/resources/resources/simple_guide_to_git.yaml @@ -0,0 +1,14 @@ +description: A simple, no-nonsense guide to the basics of using Git. +name: A Simple Guide to Git +title_url: http://rogerdudler.github.io/git-guide/ +title_icon: branding/github +title_icon_color: black +tags: + topics: + - tooling + payment_tiers: + - free + complexity: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/sololearn.yaml b/pydis_site/apps/resources/resources/sololearn.yaml new file mode 100644 index 00000000..637a58b8 --- /dev/null +++ b/pydis_site/apps/resources/resources/sololearn.yaml @@ -0,0 +1,17 @@ +description: SoloLearn's Python 3 course serves as a simple and convenient introduction to Python. + Containing exercises and quizzes in modules to cover introductory subjects of the language, + you can pick it up and put it down between your busier aspects of life thanks to both PC + and mobile apps being available to use. +name: SoloLearn +title_url: https://www.sololearn.com/Course/Python/ +tags: + topics: + - general + payment_tiers: + - free + - subscription + complexity: + - beginner + type: + - interactive + - course \ No newline at end of file diff --git a/pydis_site/apps/resources/resources/spyder.yaml b/pydis_site/apps/resources/resources/spyder.yaml new file mode 100644 index 00000000..8dc05542 --- /dev/null +++ b/pydis_site/apps/resources/resources/spyder.yaml @@ -0,0 +1,14 @@ +description: The Scientific Python Development Environment. + Simpler and lighter than PyCharm, but still packs a punch. +name: Spyder +title_url: https://www.spyder-ide.org/ +tags: + topics: + - data science + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/sublime_text.yaml b/pydis_site/apps/resources/resources/sublime_text.yaml new file mode 100644 index 00000000..76aeac45 --- /dev/null +++ b/pydis_site/apps/resources/resources/sublime_text.yaml @@ -0,0 +1,14 @@ +description: A powerful Python-backed editor with great community support and a wealth + of extensions. +name: Sublime Text +title_url: https://www.sublimetext.com/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/talk_python_to_me.yaml b/pydis_site/apps/resources/resources/talk_python_to_me.yaml new file mode 100644 index 00000000..ec7df8b5 --- /dev/null +++ b/pydis_site/apps/resources/resources/talk_python_to_me.yaml @@ -0,0 +1,14 @@ +description: The essential weekly Python podcast. Michael Kennedy and a prominent + name within the Python community dive into a topic that relates to their experience. +name: Talk Python To Me +title_url: https://talkpython.fm/ +tags: + topics: + - python + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/talon_voice.yaml b/pydis_site/apps/resources/resources/talon_voice.yaml new file mode 100644 index 00000000..0f28a328 --- /dev/null +++ b/pydis_site/apps/resources/resources/talon_voice.yaml @@ -0,0 +1,15 @@ +description: Talon is a tool being built that aims to bring programming, + realtime video gaming, command line, and full desktop computer proficiency to people + who have limited or no use of their hands. +name: Talon Voice +title_url: https://talonvoice.com/ +tags: + topics: + - other + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/test_and_code.yaml b/pydis_site/apps/resources/resources/test_and_code.yaml new file mode 100644 index 00000000..efe0c218 --- /dev/null +++ b/pydis_site/apps/resources/resources/test_and_code.yaml @@ -0,0 +1,15 @@ +description: Brian Okken's weekly podcast on testing. Usually deals with Python, + but also covers many language-agnostic topics from the testing and DevOps world. +name: Test & Code +title_url: https://testandcode.com/ +tags: + topics: + - testing + - tooling + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml b/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml new file mode 100644 index 00000000..514da947 --- /dev/null +++ b/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml @@ -0,0 +1,13 @@ +description: Miguel Grinberg's fully featured mega-tutorial for learning how to create web applications with the Flask framework. +name: The Flask Mega-Tutorial +title_url: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world +tags: + topics: + - web development + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/the_real_python_podcast.yaml b/pydis_site/apps/resources/resources/the_real_python_podcast.yaml new file mode 100644 index 00000000..62ba32ce --- /dev/null +++ b/pydis_site/apps/resources/resources/the_real_python_podcast.yaml @@ -0,0 +1,16 @@ +description: A weekly Python podcast hosted by Christopher Bailey with interviews, + coding tips, and conversation with guests from the Python community. + The show covers a wide range of topics including Python programming best practices, + career tips, and related software development topics. +name: The Real Python Podcast +title_url: https://realpython.com/podcasts/rpp/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/think_python.yaml b/pydis_site/apps/resources/resources/think_python.yaml new file mode 100644 index 00000000..472324c5 --- /dev/null +++ b/pydis_site/apps/resources/resources/think_python.yaml @@ -0,0 +1,26 @@ +description: Think Python is an introduction to Python programming for beginners. + It starts with basic concepts of programming, + and is carefully designed to define all terms when they are first used and to develop each new concept in a logical progression. + Larger pieces, like recursion and object-oriented programming are divided into a sequence of smaller steps + and introduced over the course of several chapters. +name: Think Python +urls: + - icon: regular/link + url: https://greenteapress.com/wp/think-python-2e/ + color: teal + - icon: branding/goodreads + url: https://www.goodreads.com/book/show/14514306-think-python + color: goodreads-cream + - icon: branding/github + url: https://github.com/AllenDowney/ThinkPython2 + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + complexity: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/thonny.yaml b/pydis_site/apps/resources/resources/thonny.yaml new file mode 100644 index 00000000..7b9447f5 --- /dev/null +++ b/pydis_site/apps/resources/resources/thonny.yaml @@ -0,0 +1,14 @@ +description: A Python IDE specifially aimed at learning programming. Has a lot of + helpful features to help you understand your code. +name: Thonny +title_url: https://thonny.org/ +position: 2 +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + type: + - tool \ No newline at end of file diff --git a/pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml b/pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml deleted file mode 100644 index 0f44cfbb..00000000 --- a/pydis_site/apps/resources/resources/tools/accessibility/screen_readers.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: Screen readers are software programs that allow blind - or visually impaired users to read the text displayed on a computer screen with a speech synthesizer or braille display. - There are many different screen reader program options, - with this link describing many of them and their capabilities. -name: Screen Readers - American Foundation for the Blind -title_url: https://www.afb.org/blindness-and-low-vision/using-technology/assistive-technology-products/screen-readers -position: 1 -tags: - payment_tiers: - - free - - paid diff --git a/pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml b/pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml deleted file mode 100644 index 0c99e33d..00000000 --- a/pydis_site/apps/resources/resources/tools/accessibility/talon_voice.yaml +++ /dev/null @@ -1,9 +0,0 @@ -description: Talon is a tool being built that aims to bring programming, - realtime video gaming, command line, and full desktop computer proficiency to people - who have limited or no use of their hands. -name: Talon Voice -title_url: https://talonvoice.com/ -position: 0 -tags: - payment_tiers: - - free diff --git a/pydis_site/apps/resources/resources/tools/editors/atom.yaml b/pydis_site/apps/resources/resources/tools/editors/atom.yaml deleted file mode 100644 index f11a13c8..00000000 --- a/pydis_site/apps/resources/resources/tools/editors/atom.yaml +++ /dev/null @@ -1,8 +0,0 @@ -description: A free Electron-based editor, a "hackable text editor for the 21st century", maintained - by the GitHub team. -name: Atom -title_url: https://atom.io/ -position: 0 -tags: - payment_tiers: - - free diff --git a/pydis_site/apps/resources/resources/tools/editors/google_collab.yaml b/pydis_site/apps/resources/resources/tools/editors/google_collab.yaml deleted file mode 100644 index a6288b9f..00000000 --- a/pydis_site/apps/resources/resources/tools/editors/google_collab.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: Google Collab is a high-powered custom version of Jupyter Notebook which supports e.g. - !apt-get to install arbitrary Debian packages to the runtime, which is very generous with CPU and memory, - and well-integrated with Google Drive. - You can share your Collab Notebooks with other people and work collaboratively. -name: Google Collab -title_url: https://colab.research.google.com/notebooks/intro.ipynb -position: 4 -tags: - topics: - - collaboration - payment_tiers: - - free diff --git a/pydis_site/apps/resources/resources/tools/editors/mu_editor.yaml b/pydis_site/apps/resources/resources/tools/editors/mu_editor.yaml deleted file mode 100644 index 4c3bfdbf..00000000 --- a/pydis_site/apps/resources/resources/tools/editors/mu_editor.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: An editor aimed at beginners for the purpose of learning how to code - without the distractions more advanced editors sometimes cause. - Particularly useful for use with microcontrollers, - with built-in tools to interact with Adafruit and Arduino boards. -name: Mu-Editor -title_url: https://codewith.mu/ -position: 3 -tags: - topics: - - microcontrollers - - arduino - - adafruit - - circuitpython - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/tools/editors/sublime_text.yaml b/pydis_site/apps/resources/resources/tools/editors/sublime_text.yaml deleted file mode 100644 index 9c9f53ef..00000000 --- a/pydis_site/apps/resources/resources/tools/editors/sublime_text.yaml +++ /dev/null @@ -1,8 +0,0 @@ -description: A powerful Python-backed editor with great community support and a wealth - of extensions. -name: Sublime Text -title_url: https://www.sublimetext.com/ -position: 2 -tags: - payment_tiers: - - free diff --git a/pydis_site/apps/resources/resources/tools/editors/visual_studio_code.yaml b/pydis_site/apps/resources/resources/tools/editors/visual_studio_code.yaml deleted file mode 100644 index 71c39664..00000000 --- a/pydis_site/apps/resources/resources/tools/editors/visual_studio_code.yaml +++ /dev/null @@ -1,7 +0,0 @@ -description: A fully-featured editor based on Electron, extendable with plugins. -name: Visual Studio Code -title_url: https://code.visualstudio.com/ -position: 1 -tags: - payment_tiers: - - free diff --git a/pydis_site/apps/resources/resources/tools/ides/pycharm.yaml b/pydis_site/apps/resources/resources/tools/ides/pycharm.yaml deleted file mode 100644 index 1a28a207..00000000 --- a/pydis_site/apps/resources/resources/tools/ides/pycharm.yaml +++ /dev/null @@ -1,9 +0,0 @@ -description: The very best Python IDE, with a wealth of advanced features and convenience - functions. -name: PyCharm -title_url: https://www.jetbrains.com/pycharm/ -position: 0 -tags: - payment_tiers: - - free - - paid diff --git a/pydis_site/apps/resources/resources/tools/ides/repl_it.yaml b/pydis_site/apps/resources/resources/tools/ides/repl_it.yaml deleted file mode 100644 index 18100a03..00000000 --- a/pydis_site/apps/resources/resources/tools/ides/repl_it.yaml +++ /dev/null @@ -1,10 +0,0 @@ -description: A free, collaborative, in-browser IDE to code in 50+ languages — - without spending a second on setup. -name: repl.it -title_url: https://repl.it/ -position: 3 -tags: - topics: - - collaboration - payment_tiers: - - free diff --git a/pydis_site/apps/resources/resources/tools/ides/spyder.yaml b/pydis_site/apps/resources/resources/tools/ides/spyder.yaml deleted file mode 100644 index aadc7006..00000000 --- a/pydis_site/apps/resources/resources/tools/ides/spyder.yaml +++ /dev/null @@ -1,10 +0,0 @@ -description: The Scientific Python Development Environment. - Simpler and lighter than PyCharm, but still packs a punch. -name: Spyder -title_url: https://www.spyder-ide.org/ -position: 1 -tags: - topics: - - data science - payment_tiers: - - free diff --git a/pydis_site/apps/resources/resources/tools/ides/thonny.yaml b/pydis_site/apps/resources/resources/tools/ides/thonny.yaml deleted file mode 100644 index abec004b..00000000 --- a/pydis_site/apps/resources/resources/tools/ides/thonny.yaml +++ /dev/null @@ -1,10 +0,0 @@ -description: A Python IDE specifially aimed at learning programming. Has a lot of - helpful features to help you understand your code. -name: Thonny -title_url: https://thonny.org/ -position: 2 -tags: - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/two_scoops_of_django.yaml b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml new file mode 100644 index 00000000..618cc5f5 --- /dev/null +++ b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml @@ -0,0 +1,22 @@ +description: Tips, tricks, and best practices for your Django project. + A highly recommended resource for Django web developers. +name: Two Scoops of Django +urls: +- icon: regular/book + url: https://www.feldroy.com/collections/everything/products/two-scoops-of-django-3-x + color: teal +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/55822151-two-scoops-of-django-3-x + color: goodreads-cream +- icon: branding/github + url: https://github.com/twoscoops/two-scoops-of-django-2.0-code-examples + color: black +tags: + topics: + - web development + payment_tiers: + - paid + complexity: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/university_of_michigan.yaml b/pydis_site/apps/resources/resources/university_of_michigan.yaml new file mode 100644 index 00000000..0154e4dd --- /dev/null +++ b/pydis_site/apps/resources/resources/university_of_michigan.yaml @@ -0,0 +1,13 @@ +description: A 5-part specialization course that teaches Python from scratch. + The course has no pre-requisites and avoids all but the simplest mathematics. +name: 'University of Michigan: Programming for Everybody' +title_url: https://www.coursera.org/learn/python +tags: + topics: + - python + payment_tiers: + - free + complexity: + - beginner + type: + - course diff --git a/pydis_site/apps/resources/resources/university_of_toronto.yaml b/pydis_site/apps/resources/resources/university_of_toronto.yaml new file mode 100644 index 00000000..d057eb39 --- /dev/null +++ b/pydis_site/apps/resources/resources/university_of_toronto.yaml @@ -0,0 +1,20 @@ +description: A 2-part course that teaches Python. Primarily intended for high school students + and first-year university students who want to learn programming. +name: 'University of Toronto: Learn to Program' +urls: + - icon: regular/graduation-cap + url: https://www.coursera.org/learn/learn-to-program + color: orangered + - icon: regular/graduation-cap + url: https://www.coursera.org/learn/program-code + color: youtube-red +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - course diff --git a/pydis_site/apps/resources/resources/videos/corey_schafer.yaml b/pydis_site/apps/resources/resources/videos/corey_schafer.yaml deleted file mode 100644 index 97054c6a..00000000 --- a/pydis_site/apps/resources/resources/videos/corey_schafer.yaml +++ /dev/null @@ -1,30 +0,0 @@ -description: 'Corey has a number of exceptionally high quality tutorial series - on everything from Python basics to Django and Flask: - - Check out his channel for more video series! - ' -title_image: https://i.imgur.com/KIfWw3b.png -position: 0 -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g - color: youtube-red - - icon: regular/link - url: https://coreyms.com/ - color: teal -tags: - topics: - - python - - best practices - - web development - - version control - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/videos/jetbrains.yaml b/pydis_site/apps/resources/resources/videos/jetbrains.yaml deleted file mode 100644 index ea3c892d..00000000 --- a/pydis_site/apps/resources/resources/videos/jetbrains.yaml +++ /dev/null @@ -1,22 +0,0 @@ -description: A collection of videos made by the PyCharm team at JetBrains on subjects such as TDD, - Django, pytest and much more!

- Episodes of their "What does this package do?" series go over all sorts of libraries in Python - both in the standard library and from the community and give a video explanation of the key concepts. -icon_image: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/JetBrains_Logo_2016.svg/1200px-JetBrains_Logo_2016.svg.png -icon_size: 50 -title_image: https://resources.jetbrains.com/storage/products/pycharm/img/meta/pycharm_logo_300x300.png -position: 3 -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw - color: youtube-red -tags: - topics: - - python - - testing - - web development - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/videos/jim_shaped_coding.yaml b/pydis_site/apps/resources/resources/videos/jim_shaped_coding.yaml deleted file mode 100644 index 663e3003..00000000 --- a/pydis_site/apps/resources/resources/videos/jim_shaped_coding.yaml +++ /dev/null @@ -1,23 +0,0 @@ -description: 'JimShapedCoding contains a set of YouTube tutorials covering things from Flask to GUI development in Python: - - Check out his channel for more videos!' -title_image: https://i.imgur.com/DlovZPf.png -position: 5 -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg - color: youtube-red -tags: - topics: - - python - - user interface - - web development - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/videos/microsoft.yaml b/pydis_site/apps/resources/resources/videos/microsoft.yaml deleted file mode 100644 index 5b24e0a0..00000000 --- a/pydis_site/apps/resources/resources/videos/microsoft.yaml +++ /dev/null @@ -1,25 +0,0 @@ -description: A trove of tutorials & guides for developers from Microsoft's Developer hub. - Follow the links below for a series of high-quality Python tutorials for beginners. - - Microsoft's Python Development Team also runs a Discord Server for discussions of Python in the Microsoft ecosystem, - including Visual Studio Code and Azure. -title_image: http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2qVsJ?ver=3f74 -position: 4 -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g - color: youtube-red - - icon: branding/discord - url: https://aka.ms/python-discord - color: blurple -tags: - topics: - - python - payment_tiers: - - free - complexity: - - beginner diff --git a/pydis_site/apps/resources/resources/videos/python_discord.yaml b/pydis_site/apps/resources/resources/videos/python_discord.yaml deleted file mode 100644 index fccf5bd9..00000000 --- a/pydis_site/apps/resources/resources/videos/python_discord.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: It's our channel! We are slowly gathering content here directly related to Python, - our community and the events we host. Come check us out! -title_image: https://raw.githubusercontent.com/python-discord/branding/master/logos/logo_banner/logo_site_banner_dark_512.png -position: 2 -urls: - - icon: branding/youtube - url: https://www.youtube.com/pythondiscord - color: youtube-red -tags: - topics: - - python - - events - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/videos/sentdex.yaml b/pydis_site/apps/resources/resources/videos/sentdex.yaml deleted file mode 100644 index 27e38bf5..00000000 --- a/pydis_site/apps/resources/resources/videos/sentdex.yaml +++ /dev/null @@ -1,33 +0,0 @@ -description: 'An enormous amount of Python content for all skill levels - from the most popular Python YouTuber on the web. - - Check out his channel for more video series! - ' -title_image: https://i.imgur.com/kJgWZIu.png -position: 1 -urls: - - icon: branding/youtube - url: https://www.youtube.com/user/sentdex - color: youtube-red - - icon: branding/discord - url: https://discord.gg/sentdex - color: blurple - - icon: regular/link - url: https://pythonprogramming.net/ - color: teal -tags: - topics: - - python - - machine learning - - user interface - - data science - payment_tiers: - - free - complexity: - - beginner - - intermediate diff --git a/pydis_site/apps/resources/resources/visual_studio_code.yaml b/pydis_site/apps/resources/resources/visual_studio_code.yaml new file mode 100644 index 00000000..f09efcf8 --- /dev/null +++ b/pydis_site/apps/resources/resources/visual_studio_code.yaml @@ -0,0 +1,13 @@ +description: A fully-featured editor based on Electron, extendable with plugins. +name: Visual Studio Code +title_url: https://code.visualstudio.com/ +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/wtf_python.yaml b/pydis_site/apps/resources/resources/wtf_python.yaml new file mode 100644 index 00000000..7f67ccf9 --- /dev/null +++ b/pydis_site/apps/resources/resources/wtf_python.yaml @@ -0,0 +1,18 @@ +description: Python, being a beautifully designed high-level and interpreter-based programming language, + provides us with many features for the programmer's comfort. + But sometimes, the outcomes of a Python snippet may not seem obvious at first sight. + Here's a fun project attempting to explain what exactly is happening under the hood for some counter-intuitive snippets + and lesser-known features in Python. +name: WTF Python +title_url: https://github.com/satwikkansal/wtfpython +position: 7 +tags: + topics: + - software design + - other + payment_tiers: + - free + complexity: + - intermediate + type: + - tutorial -- cgit v1.2.3 From 8c4aa671f74307289e0805ef3becda239c5db37d Mon Sep 17 00:00:00 2001 From: lemonsaurus Date: Sun, 6 Jun 2021 13:33:56 +0200 Subject: Update templates with new resource urls. --- pydis_site/templates/base/navbar.html | 2 +- pydis_site/templates/resources/resources.html | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index 4cc49dc6..9c492f35 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -67,7 +67,7 @@ Resources - + Tools diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index f1f487cf..04744f90 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -24,7 +24,7 @@
- +

Read

Lovingly curated books to explore

@@ -32,7 +32,7 @@
- +

Try

Interactively discover the possibilities

- +

Learn

Structured courses with clear goals

@@ -61,14 +61,14 @@
- +

Tools

Things we love to use

-- cgit v1.2.3 From 8cb4d72de5834f116e264a4b00c321a0f1c57fb0 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sun, 4 Jul 2021 21:39:33 -0400 Subject: Add final line break for style compliance. --- pydis_site/apps/resources/resources/sololearn.yaml | 2 +- pydis_site/apps/resources/resources/thonny.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/sololearn.yaml b/pydis_site/apps/resources/resources/sololearn.yaml index 637a58b8..b9b59bca 100644 --- a/pydis_site/apps/resources/resources/sololearn.yaml +++ b/pydis_site/apps/resources/resources/sololearn.yaml @@ -14,4 +14,4 @@ tags: - beginner type: - interactive - - course \ No newline at end of file + - course diff --git a/pydis_site/apps/resources/resources/thonny.yaml b/pydis_site/apps/resources/resources/thonny.yaml index 7b9447f5..59aba96d 100644 --- a/pydis_site/apps/resources/resources/thonny.yaml +++ b/pydis_site/apps/resources/resources/thonny.yaml @@ -11,4 +11,4 @@ tags: complexity: - beginner type: - - tool \ No newline at end of file + - tool -- cgit v1.2.3 From 46339104514772724d672aec8b6ffe6bf7789f30 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sun, 4 Jul 2021 21:40:11 -0400 Subject: Add resource Data Science from Scratch. --- .../resources/data_science_from_scratch.yaml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pydis_site/apps/resources/resources/data_science_from_scratch.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml new file mode 100644 index 00000000..14cba1f4 --- /dev/null +++ b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml @@ -0,0 +1,24 @@ +description: Data Science from Scratch is a good introduction to data science for the complete beginner, and covers + some of the fundamentals of Python programming as well as the basic math, probability and statistics needed to get + started. While either edition of this book is useful for those with prior Python experience, complete beginners + should use the second edition, which contains more up-to-date code examples and better practices. +name: Data Science from Scratch +urls: + - icon: regular/link + url: https://www.oreilly.com/library/view/data-science-from/9781492041122/ + color: teal + - icon: branding/goodreads + url: https://www.goodreads.com/en/book/show/52059715-data-science-from-scratch + color: goodreads-cream + - icon: branding/github + url: https://github.com/joelgrus/data-science-from-scratch + color: black +tags: + topics: + - data science + payment_tiers: + - paid + complexity: + - beginner + type: + - book -- cgit v1.2.3 From 45128f4e696faa78d801b928a9915575a3f17232 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sun, 4 Jul 2021 21:40:39 -0400 Subject: Add resource regex101. --- pydis_site/apps/resources/resources/regex101.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pydis_site/apps/resources/resources/regex101.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/regex101.yaml b/pydis_site/apps/resources/resources/regex101.yaml new file mode 100644 index 00000000..2dee95ce --- /dev/null +++ b/pydis_site/apps/resources/resources/regex101.yaml @@ -0,0 +1,15 @@ +description: An online tool for testing regular expressions that helps you understand what the regular expression can + match. Remember to set the "flavor" to Python 2.7 (it works for recent versions of Python). +name: regex101 +title_url: https://regex101.com/ +tags: + topics: + - general + - other + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - tool -- cgit v1.2.3 From d56348043a1b0343006c62dfaf738513a3cf4e7d Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 6 Jul 2021 17:55:50 -0400 Subject: Remove reference to Python 2.7. The maintainer of regex101 has changed the name from "Python 2.7" to just "Python". --- pydis_site/apps/resources/resources/regex101.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/regex101.yaml b/pydis_site/apps/resources/resources/regex101.yaml index 2dee95ce..db3df957 100644 --- a/pydis_site/apps/resources/resources/regex101.yaml +++ b/pydis_site/apps/resources/resources/regex101.yaml @@ -1,5 +1,5 @@ description: An online tool for testing regular expressions that helps you understand what the regular expression can - match. Remember to set the "flavor" to Python 2.7 (it works for recent versions of Python). + match. Remember to set the "flavor" to Python. name: regex101 title_url: https://regex101.com/ tags: -- cgit v1.2.3 From 65fd1070f2c89a62330826c1f7f20aa5de8c6715 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 6 Jul 2021 17:59:16 -0400 Subject: Add Kaggle's pandas tutorial. --- .../apps/resources/resources/kaggle_pandas_tutorial.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml b/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml new file mode 100644 index 00000000..a1907e0f --- /dev/null +++ b/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml @@ -0,0 +1,13 @@ +description: An interactive tutorial for learning Pandas, the most popular library for manipulating tabular data + in Python's data science ecosystem. This tutorial assumes some familiarity with writing code in notebooks. +name: Kaggle Pandas Tutorial +title_url: https://www.kaggle.com/learn/pandas +tags: + topics: + - data science + payment_tiers: + - free + complexity: + - intermediate + type: + - tutorial -- cgit v1.2.3 From c781ed1f80188ffb274eeada974172f4aa07c0b5 Mon Sep 17 00:00:00 2001 From: fisher60 Date: Fri, 23 Jul 2021 20:20:10 -0500 Subject: change resources to prepare for smart resource search --- pydis_site/apps/resources/urls.py | 2 +- pydis_site/apps/resources/views/__init__.py | 4 +- pydis_site/apps/resources/views/resources.py | 10 +- pydis_site/static/css/resources/resources.css | 51 +++++----- pydis_site/templates/resources/resources.html | 131 ++++++++++++++------------ 5 files changed, 105 insertions(+), 93 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index cd4f53e7..c8d441df 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -4,6 +4,6 @@ from pydis_site.apps.resources import views app_name = "resources" urlpatterns = [ - path("", views.ResourcesView.as_view(), name="index"), + path("", views.resources.resource_view, name="index"), path("list/", views.ResourcesListView.as_view(), name="resources") ] diff --git a/pydis_site/apps/resources/views/__init__.py b/pydis_site/apps/resources/views/__init__.py index 8eb383b5..c89071c5 100644 --- a/pydis_site/apps/resources/views/__init__.py +++ b/pydis_site/apps/resources/views/__init__.py @@ -1,4 +1,4 @@ -from .resources import ResourcesView +from .resources import resource_view from .resources_list import ResourcesListView -__all__ = ["ResourcesView", "ResourcesListView"] +__all__ = ["resource_view", "ResourcesListView"] diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 25ce3e50..dfd21682 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,7 +1,11 @@ from django.views.generic import TemplateView +from django.shortcuts import render +# class ResourcesView(TemplateView): +# """View for resources index page.""" +# +# template_name = "resources/resources.html" -class ResourcesView(TemplateView): - """View for resources index page.""" - template_name = "resources/resources.html" +def resource_view(request): + return render(request, template_name="resources/resources.html") diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index cf4cb472..a9226647 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -1,29 +1,30 @@ -.box, .tile.is-parent { - transition: 0.1s ease-out; -} -.box { - min-height: 15vh; -} -.tile.is-parent:hover .box { - box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); -} -.tile.is-parent:hover { - padding: 0.65rem 0.85rem 0.85rem 0.65rem; - filter: saturate(1.1) brightness(1.1); -} +/*.box, .tile.is-parent {*/ +/* transition: 0.1s ease-out;*/ +/*}*/ +/*.box {*/ +/* min-height: 15vh;*/ +/*}*/ +/*.tile.is-parent:hover .box {*/ +/* box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);*/ +/*}*/ +/*.tile.is-parent:hover {*/ +/* padding: 0.65rem 0.85rem 0.85rem 0.65rem;*/ +/* filter: saturate(1.1) brightness(1.1);*/ +/*}*/ -#readingBlock { - background-image: linear-gradient(141deg, #911eb4 0%, #b631de 71%, #cf4bf7 100%); -} +/*#readingBlock {*/ +/* background-image: linear-gradient(141deg, #911eb4 0%, #b631de 71%, #cf4bf7 100%);*/ +/*}*/ -#interactiveBlock { - background-image: linear-gradient(141deg, #d05600 0%, #da722a 71%, #e68846 100%); -} +/*#interactiveBlock {*/ +/* background-image: linear-gradient(141deg, #d05600 0%, #da722a 71%, #e68846 100%);*/ +/*}*/ -#communitiesBlock { - background-image: linear-gradient(141deg, #3b756f 0%, #3a847c 71%, #41948b 100%); -} +/*#communitiesBlock {*/ +/* background-image: linear-gradient(141deg, #3b756f 0%, #3a847c 71%, #41948b 100%);*/ +/*}*/ + +/*#podcastsBlock {*/ +/* background-image: linear-gradient(141deg, #232382 0%, #30309c 71%, #4343ad 100%);*/ +/*}*/ -#podcastsBlock { - background-image: linear-gradient(141deg, #232382 0%, #30309c 71%, #4343ad 100%); -} diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 04744f90..7eb21432 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -12,79 +12,86 @@
+ {% endblock %} -- cgit v1.2.3 From 33709ed770042ef7773cb886009426545eab4ca1 Mon Sep 17 00:00:00 2001 From: fisher60 Date: Sat, 24 Jul 2021 18:20:47 -0500 Subject: add function to gather tags from resource yaml files I added a function to utils to load all the tags from the resources, this should allow all the tags to be loaded once and exist in memory. --- pydis_site/apps/resources/utils.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 6e21e2ba..3c8571ef 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -7,6 +7,29 @@ from django.conf import settings RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") +default_categories = [ + "topics", + "payment_tiers", + "complexity", + "type" +] + + +def get_resources_meta() -> dict: + all_resources = get_resources() + + resource_meta_tags = {x: set() for x in default_categories} + + for resource in all_resources: + tags = resource.get("tags") + + for tag_key, tag_values in tags.items(): + for tag_item in tag_values: + resource_meta_tags[tag_key].add(tag_item) + + return resource_meta_tags + + def get_resources() -> t.List[t.Dict]: """Loads resource YAMLs from provided path.""" resources = [] -- cgit v1.2.3 From 156951f12c05146650a84d4ac9d45e7a8a085023 Mon Sep 17 00:00:00 2001 From: fisher60 Date: Sat, 24 Jul 2021 18:22:59 -0500 Subject: add constant for resource tags. Add Functional front end This change adds a fully functional front end menu for testing. This is a very rough outline and will need a bit of UI and UX love to get working fully. Should act as an example of functionality --- pydis_site/apps/resources/views/resources.py | 25 +++++++-- pydis_site/templates/resources/resources.html | 81 +++++++++++++++++---------- 2 files changed, 71 insertions(+), 35 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index dfd21682..f88a23fb 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,11 +1,24 @@ -from django.views.generic import TemplateView from django.shortcuts import render -# class ResourcesView(TemplateView): -# """View for resources index page.""" -# -# template_name = "resources/resources.html" +from pydis_site.apps.resources.utils import get_resources_meta + +RESOURCE_META_TAGS = get_resources_meta() + + +def format_checkbox_options(options: str) -> list: + """Split up the comma separated parameters into a list.""" + if options: + return options.split(",")[:-1] + return list() def resource_view(request): - return render(request, template_name="resources/resources.html") + """View for resources index page.""" + context = { + "checkboxOptions": format_checkbox_options(request.GET.get("checkboxOptions")), + "topics": RESOURCE_META_TAGS.get("topics"), + "tag_types": RESOURCE_META_TAGS.get("type"), + "payment_tiers": RESOURCE_META_TAGS.get("payment_tiers"), + "complexities": RESOURCE_META_TAGS.get("complexity") + } + return render(request, template_name="resources/resources.html", context=context) diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 7eb21432..fca3d0da 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -23,55 +23,66 @@
Topic -
- -
- -
-
+ {% endfor %}
Type + + {% for tag_type in tag_types %}
-
+
+ {% endfor %}
Payment + + {% for payment_tier in payment_tiers %}
-
+
+ {% endfor %}
Level + + {% for complexity in complexities %}
-
+
+ {% endfor %}
-
- +
+ + + + + + + + +
@@ -79,9 +90,18 @@ {% endblock %} -- cgit v1.2.3 From a4d0139215b29058d0f8de17f389d589dafed34c Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sat, 24 Jul 2021 20:32:34 -0400 Subject: Remove extra newline from end of file (there is now one newline). --- pydis_site/static/css/resources/resources.css | 1 - 1 file changed, 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index a9226647..488effc3 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -27,4 +27,3 @@ /*#podcastsBlock {*/ /* background-image: linear-gradient(141deg, #232382 0%, #30309c 71%, #4343ad 100%);*/ /*}*/ - -- cgit v1.2.3 From 0d55308776a029517899f8f26d454b0bb920a9ee Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sat, 24 Jul 2021 20:33:11 -0400 Subject: Added type annotations; refactored. --- pydis_site/apps/resources/views/resources.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index f88a23fb..2414e48b 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,3 +1,4 @@ +from django.http import HttpRequest, HttpResponse from django.shortcuts import render from pydis_site.apps.resources.utils import get_resources_meta @@ -5,20 +6,21 @@ from pydis_site.apps.resources.utils import get_resources_meta RESOURCE_META_TAGS = get_resources_meta() -def format_checkbox_options(options: str) -> list: +def format_checkbox_options(options: str) -> list[str]: """Split up the comma separated parameters into a list.""" - if options: - return options.split(",")[:-1] - return list() + return options.split(",")[:-1] if options else [] -def resource_view(request): +def resource_view(request: HttpRequest) -> HttpResponse: """View for resources index page.""" - context = { - "checkboxOptions": format_checkbox_options(request.GET.get("checkboxOptions")), - "topics": RESOURCE_META_TAGS.get("topics"), - "tag_types": RESOURCE_META_TAGS.get("type"), - "payment_tiers": RESOURCE_META_TAGS.get("payment_tiers"), - "complexities": RESOURCE_META_TAGS.get("complexity") - } - return render(request, template_name="resources/resources.html", context=context) + return render( + request, + template_name="resources/resources.html", + context={ + "checkboxOptions": format_checkbox_options(request.GET.get("checkboxOptions")), + "topics": RESOURCE_META_TAGS.get("topics"), + "tag_types": RESOURCE_META_TAGS.get("type"), + "payment_tiers": RESOURCE_META_TAGS.get("payment_tiers"), + "complexities": RESOURCE_META_TAGS.get("complexity") + } + ) -- cgit v1.2.3 From 4ad4e73cf3d2c25130dcdf6fbc933b5dd0326b72 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sat, 24 Jul 2021 20:34:09 -0400 Subject: Updated type annotations; get_resources_meta now returns a dict of sorted lists of strings in title-case. --- pydis_site/apps/resources/utils.py | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 3c8571ef..bb812ec0 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -15,26 +15,18 @@ default_categories = [ ] -def get_resources_meta() -> dict: - all_resources = get_resources() +def get_resources() -> list[dict[str, t.Union[list[str], str]]]: + """Loads resource YAMLs from provided path.""" + return [yaml.safe_load(item.read_text()) for item in RESOURCES_PATH.rglob("*.yaml")] - resource_meta_tags = {x: set() for x in default_categories} - for resource in all_resources: - tags = resource.get("tags") +def get_resources_meta() -> dict[str, list[str]]: + """Combines the tags from each resource into one dictionary of unique tags.""" + resource_meta_tags = {x: set() for x in default_categories} - for tag_key, tag_values in tags.items(): + for resource in get_resources(): + for tag_key, tag_values in resource.get("tags").items(): for tag_item in tag_values: - resource_meta_tags[tag_key].add(tag_item) - - return resource_meta_tags - - -def get_resources() -> t.List[t.Dict]: - """Loads resource YAMLs from provided path.""" - resources = [] - - for item in RESOURCES_PATH.rglob("*.yaml"): - resources.append(yaml.safe_load(item.read_text())) + resource_meta_tags[tag_key].add(tag_item.title().replace('And', 'and', -1)) - return resources + return {key: sorted(value) for key, value in resource_meta_tags.items()} -- cgit v1.2.3 From 95e7b11df812e09baffe9ef16807e7d02a5e6f1d Mon Sep 17 00:00:00 2001 From: fisher60 Date: Sun, 25 Jul 2021 19:49:01 -0500 Subject: working demo of smart resources search I have incorporated a search that allows users to check boxes to filter resources. This is a working version, but the algo for searching likely needs to be modified. The frontend also needs some style updates. All necessary functionality should be present now though. --- pydis_site/apps/resources/utils.py | 25 ++++++++++++-- pydis_site/apps/resources/views/resources.py | 10 +++--- pydis_site/apps/resources/views/resources_list.py | 4 +-- pydis_site/templates/resources/resources.html | 41 +++++++++++++++++++++-- 4 files changed, 69 insertions(+), 11 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index bb812ec0..7f238431 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -15,7 +15,28 @@ default_categories = [ ] -def get_resources() -> list[dict[str, t.Union[list[str], str]]]: +def yaml_file_matches_search(yaml_data: dict[str, t.Union[list[str], str]], search_terms: list[str]) -> bool: + match_count = 0 + search_len = len(search_terms) + for search in search_terms: + for _, values in yaml_data["tags"].items(): + if search.lower() in values: + match_count += 1 + if match_count >= search_len: + return True + return False + + +def get_resources_from_search(search_categories: list[str]) -> list[dict[str, t.Union[list[str], str]]]: + out = [] + for item in RESOURCES_PATH.rglob("*.yaml"): + this_dict = yaml.safe_load(item.read_text()) + if yaml_file_matches_search(this_dict, search_categories): + out.append(this_dict) + return out + + +def get_all_resources() -> list[dict[str, t.Union[list[str], str]]]: """Loads resource YAMLs from provided path.""" return [yaml.safe_load(item.read_text()) for item in RESOURCES_PATH.rglob("*.yaml")] @@ -24,7 +45,7 @@ def get_resources_meta() -> dict[str, list[str]]: """Combines the tags from each resource into one dictionary of unique tags.""" resource_meta_tags = {x: set() for x in default_categories} - for resource in get_resources(): + for resource in get_all_resources(): for tag_key, tag_values in resource.get("tags").items(): for tag_item in tag_values: resource_meta_tags[tag_key].add(tag_item.title().replace('And', 'and', -1)) diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 2414e48b..ffb4f4a8 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,26 +1,28 @@ from django.http import HttpRequest, HttpResponse from django.shortcuts import render -from pydis_site.apps.resources.utils import get_resources_meta +from pydis_site.apps.resources.utils import get_all_resources, get_resources_from_search, get_resources_meta RESOURCE_META_TAGS = get_resources_meta() def format_checkbox_options(options: str) -> list[str]: - """Split up the comma separated parameters into a list.""" + """Split up the comma separated query parameters for checkbox options into a list.""" return options.split(",")[:-1] if options else [] def resource_view(request: HttpRequest) -> HttpResponse: """View for resources index page.""" + checkbox_options = format_checkbox_options(request.GET.get("checkboxOptions")) return render( request, template_name="resources/resources.html", context={ - "checkboxOptions": format_checkbox_options(request.GET.get("checkboxOptions")), + "checkboxOptions": checkbox_options, "topics": RESOURCE_META_TAGS.get("topics"), "tag_types": RESOURCE_META_TAGS.get("type"), "payment_tiers": RESOURCE_META_TAGS.get("payment_tiers"), - "complexities": RESOURCE_META_TAGS.get("complexity") + "complexities": RESOURCE_META_TAGS.get("complexity"), + "resources": get_resources_from_search(checkbox_options) } ) diff --git a/pydis_site/apps/resources/views/resources_list.py b/pydis_site/apps/resources/views/resources_list.py index 0ec74d78..bd43be33 100644 --- a/pydis_site/apps/resources/views/resources_list.py +++ b/pydis_site/apps/resources/views/resources_list.py @@ -2,7 +2,7 @@ from typing import Any, Dict from django.views.generic import TemplateView -from pydis_site.apps.resources.utils import get_resources +from pydis_site.apps.resources.utils import get_all_resources class ResourcesListView(TemplateView): @@ -13,6 +13,6 @@ class ResourcesListView(TemplateView): def get_context_data(self, **kwargs) -> Dict[str, Any]: """Add resources and subcategories data into context.""" context = super().get_context_data(**kwargs) - context["resources"] = get_resources() + context["resources"] = get_all_resources() return context diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index fca3d0da..e2275e89 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -1,9 +1,11 @@ {% extends 'base/base.html' %} +{% load as_icon %} {% load static %} {% block title %}Resources{% endblock %} {% block head %} - + + {% endblock %} {% block content %} @@ -89,16 +91,49 @@ + + {% if resources|length > 0 %} +
+
+
+
+ {% for resource in resources %} + {% include "resources/resource_box.html" %} + {% endfor %} + + {% for subcategory in subcategories %} +

+ + {{ subcategory.category_info.name }} + +

+

{{ subcategory.category_info.description|safe }}

+ + {% for resource in subcategory.resources %} + {% with category_info=subcategory.category_info %} + {% include "resources/resource_box.html" %} + {% endwith %} + {% endfor %} + {% endfor %} +
+
+
+
+ {% else %} +

No resources matching search.

+ {% endif %} + {% endblock %} -- cgit v1.2.3 From c81c29fcfb752d41599406a511c0f1d814438c83 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 3 Aug 2021 10:36:11 -0400 Subject: Convert data structure for query. Was list[str], is now dict[str, set[str]], organized by category. --- pydis_site/apps/resources/views/resources.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 693eebaf..8ca08bd6 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -13,7 +13,16 @@ def format_checkbox_options(options: str) -> list[str]: def resource_view(request: HttpRequest) -> HttpResponse: """View for resources index page.""" - checkbox_options = format_checkbox_options(request.GET.get("checkboxOptions")) + checkbox_options = { + a: set(format_checkbox_options(request.GET.get(b))) + for a, b in ( + ('topics', 'topicOption'), + ('type', 'typeOption'), + ('payment_tiers', 'paymentOption'), + ('complexity', 'complexityOption'), + ) + } + return render( request, template_name="resources/resources.html", -- cgit v1.2.3 From a627dd97e9ca48441b21c60efc874850c23bf8ac Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 3 Aug 2021 10:36:33 -0400 Subject: Implement desired query logic. --- pydis_site/apps/resources/utils.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 6efa2d1a..63d82b7a 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -1,6 +1,8 @@ import typing as t from collections import defaultdict +from functools import reduce from itertools import chain +from operator import and_, or_ from pathlib import Path import yaml @@ -38,11 +40,16 @@ def yaml_file_matches_search(yaml_data: dict, search_terms: list[str]) -> bool: return len(matching_tags) >= len(search_terms) -def get_resources_from_search(search_categories: list[str]) -> list[Resource]: +def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]: """Returns a list of all resources that match the given search terms.""" - out = [] - for item in RESOURCES_PATH.rglob("*.yaml"): - this_dict = yaml.safe_load(item.read_text()) - if yaml_file_matches_search(this_dict, search_categories): - out.append(this_dict) - return out + resource_names_that_match = reduce( + and_, + ( + reduce( + or_, + (RESOURCE_TABLE[category][label] for label in labels) + ) + for category, labels in search_categories.items() + ) + ) + return [RESOURCES[name_] for name_ in resource_names_that_match] -- cgit v1.2.3 From 3065bba62145d1f2734c24490e8dcee0443368ce Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 3 Aug 2021 11:01:19 -0400 Subject: Add empty set as an initial value. Otherwise, the call to reduce will raise an error when no options for a given category are selected. --- pydis_site/apps/resources/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 63d82b7a..bc2d4a70 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -47,7 +47,8 @@ def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Re ( reduce( or_, - (RESOURCE_TABLE[category][label] for label in labels) + (RESOURCE_TABLE[category][label] for label in labels), + set() ) for category, labels in search_categories.items() ) -- cgit v1.2.3 From 7a15ab744b5c78be476e611827251ba16c7b3037 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 3 Aug 2021 11:01:38 -0400 Subject: Sort the columns in the UI. --- pydis_site/apps/resources/views/resources.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 8ca08bd6..5b6350de 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -28,10 +28,10 @@ def resource_view(request: HttpRequest) -> HttpResponse: template_name="resources/resources.html", context={ "checkboxOptions": checkbox_options, - "topics": RESOURCE_META_TAGS.get("topics"), - "tag_types": RESOURCE_META_TAGS.get("type"), - "payment_tiers": RESOURCE_META_TAGS.get("payment_tiers"), - "complexities": RESOURCE_META_TAGS.get("complexity"), + "topics": sorted(RESOURCE_META_TAGS.get("topics")), + "tag_types": sorted(RESOURCE_META_TAGS.get("type")), + "payment_tiers": sorted(RESOURCE_META_TAGS.get("payment_tiers")), + "complexities": sorted(RESOURCE_META_TAGS.get("complexity")), "resources": get_resources_from_search(checkbox_options) } ) -- cgit v1.2.3 From 7cd0f11993701fb360b392911520f6b2839b8ed1 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 3 Aug 2021 12:09:35 -0400 Subject: Delete unused `yaml_file_matches_search` method. --- pydis_site/apps/resources/utils.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index bc2d4a70..623dd7b6 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -1,7 +1,6 @@ import typing as t from collections import defaultdict from functools import reduce -from itertools import chain from operator import and_, or_ from pathlib import Path @@ -33,13 +32,6 @@ for name, resource in RESOURCES.items(): RESOURCE_TABLE[category][_transform_name(tag)].add(name) -def yaml_file_matches_search(yaml_data: dict, search_terms: list[str]) -> bool: - """Checks which resources contain tags for every search term passed.""" - search_terms = [x.lower() for x in search_terms] - matching_tags = [x for x in chain(*yaml_data["tags"].values()) if x in search_terms] - return len(matching_tags) >= len(search_terms) - - def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]: """Returns a list of all resources that match the given search terms.""" resource_names_that_match = reduce( -- cgit v1.2.3 From dd8a839effb832a7488d33a86d321595dfc840e7 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 3 Aug 2021 12:19:53 -0400 Subject: "python" -> "general" in tags/topics. As most of the resources are Python related, tagging them with "python" is uninformative. --- pydis_site/apps/resources/resources/microsoft_videos.yaml | 2 +- pydis_site/apps/resources/resources/python_cheat_sheet.yaml | 2 +- pydis_site/apps/resources/resources/talk_python_to_me.yaml | 2 +- pydis_site/apps/resources/resources/university_of_michigan.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/microsoft_videos.yaml b/pydis_site/apps/resources/resources/microsoft_videos.yaml index d0dbc4f4..df49adff 100644 --- a/pydis_site/apps/resources/resources/microsoft_videos.yaml +++ b/pydis_site/apps/resources/resources/microsoft_videos.yaml @@ -17,7 +17,7 @@ urls: color: blurple tags: topics: - - python + - general payment_tiers: - free complexity: diff --git a/pydis_site/apps/resources/resources/python_cheat_sheet.yaml b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml index 9bec6d57..da9b980f 100644 --- a/pydis_site/apps/resources/resources/python_cheat_sheet.yaml +++ b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml @@ -4,7 +4,7 @@ name: Python Cheat Sheet title_url: https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf tags: topics: - - python + - general payment_tiers: - free complexity: diff --git a/pydis_site/apps/resources/resources/talk_python_to_me.yaml b/pydis_site/apps/resources/resources/talk_python_to_me.yaml index ec7df8b5..00726203 100644 --- a/pydis_site/apps/resources/resources/talk_python_to_me.yaml +++ b/pydis_site/apps/resources/resources/talk_python_to_me.yaml @@ -4,7 +4,7 @@ name: Talk Python To Me title_url: https://talkpython.fm/ tags: topics: - - python + - general payment_tiers: - free complexity: diff --git a/pydis_site/apps/resources/resources/university_of_michigan.yaml b/pydis_site/apps/resources/resources/university_of_michigan.yaml index 0154e4dd..843b64ed 100644 --- a/pydis_site/apps/resources/resources/university_of_michigan.yaml +++ b/pydis_site/apps/resources/resources/university_of_michigan.yaml @@ -4,7 +4,7 @@ name: 'University of Michigan: Programming for Everybody' title_url: https://www.coursera.org/learn/python tags: topics: - - python + - general payment_tiers: - free complexity: -- cgit v1.2.3 From 1dbe8046c38d43bc87fe6a78b1bfc61a3599de01 Mon Sep 17 00:00:00 2001 From: dawnofmidnight Date: Tue, 3 Aug 2021 14:53:17 -0400 Subject: styles: filtering resources page --- pydis_site/apps/resources/utils.py | 2 +- pydis_site/static/css/resources/resources_list.css | 9 ++++++ pydis_site/templates/resources/resources.html | 34 ++++++++++------------ 3 files changed, 25 insertions(+), 20 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 623dd7b6..bc444df4 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -21,7 +21,7 @@ RESOURCES: dict[str, Resource] = {path.stem: yaml.safe_load(path.read_text()) fo RESOURCE_TABLE = {category: defaultdict(set) for category in ( "topics", - "payment_tiers", + "payment_tiers", "complexity", "type" )} diff --git a/pydis_site/static/css/resources/resources_list.css b/pydis_site/static/css/resources/resources_list.css index e6808a99..283a506b 100644 --- a/pydis_site/static/css/resources/resources_list.css +++ b/pydis_site/static/css/resources/resources_list.css @@ -53,3 +53,12 @@ i.resource-icon.is-black { i.has-icon-padding { padding: 0 10px 25px 0; } + +#tab-content p { + display: none; +} + +#tab-content p.is-active { +display: block; +} + \ No newline at end of file diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index f2d5a976..8105a557 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -17,58 +17,58 @@

Resources


-
+

Search Options

-
- Topic +
+
Topic
{% for topic in topics %}
-
{% endfor %}
-
- Type +
+
Type
{% for tag_type in tag_types %}
{% endfor %}
-
- Payment +
+
Payment
{% for payment_tier in payment_tiers %}
{% endfor %}
-
- Level +
+
Level
{% for complexity in complexities %}
{% endfor %} @@ -76,7 +76,6 @@
- @@ -84,12 +83,9 @@ -
-
-
{% if resources|length > 0 %} @@ -120,7 +116,7 @@
{% else %} -

No resources matching search.

+

No resources matching search.

{% endif %} {% endblock %} -- cgit v1.2.3 From 4adf44bb7aa524f06b81f18218376799f3a75319 Mon Sep 17 00:00:00 2001 From: Vivaan Verma Date: Mon, 16 Aug 2021 22:25:48 +0100 Subject: fix: Make select all buttons for each individual column --- pydis_site/templates/resources/resources.html | 42 +++++++++++++++++---------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 11f7ceab..0e4302c6 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -22,14 +22,14 @@
-
+
Topic
{% for topic in topics_1 %}
@@ -39,52 +39,64 @@ {% for topic in topics_2 %}
{% endfor %}
+ + +
-
+
Type
{% for tag_type in tag_types %}
{% endfor %} + + +
-
+
Payment
{% for payment_tier in payment_tiers %}
{% endfor %} + + +
-
+
Level
{% for complexity in complexities %}
{% endfor %} + + +
@@ -93,13 +105,9 @@ - + - - - -
@@ -178,10 +186,12 @@ }); } - function selectAllQueryParams(){ + function selectAllQueryParams(column){ checkboxOptions.forEach((option) => { document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { - checkbox.checked = true; + if (checkbox.className == column) { + checkbox.checked = true; + } }); }); } -- cgit v1.2.3 From a09b0b10fac6d84166779e72f4ed5fc4fcfcf0fb Mon Sep 17 00:00:00 2001 From: Vivaan Verma Date: Tue, 17 Aug 2021 10:23:58 +0100 Subject: Align select all buttons to center of column --- pydis_site/templates/resources/resources.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 0e4302c6..2ae28725 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -46,7 +46,7 @@ {% endfor %}
- +

@@ -62,7 +62,7 @@
{% endfor %} - +
@@ -78,7 +78,7 @@
{% endfor %} - + @@ -94,7 +94,7 @@ {% endfor %} - + -- cgit v1.2.3 From d2543b66695b2877ade93dca81693e01526c826e Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 17 Aug 2021 07:24:39 -0400 Subject: New Resource: vcokltfre's Discord bot tutorial. --- .../resources/vcokltfre_discord_bot_tutorial.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml new file mode 100644 index 00000000..02f9fe5a --- /dev/null +++ b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml @@ -0,0 +1,14 @@ +description: This tutorial, written by Python Discord staff member vcokltfre, + will walk you through all the aspects of creating your own Discord bot, + starting from from creating the bot user itself. +name: vcokltfre's Discord Bot Tutorial +title_url: https://vcokltfre.dev/ +tags: + topics: + - discord bots + payment_tiers: + - free + complexity: + - intermediate + type: + - tutorial -- cgit v1.2.3 From a267f336c0d3e7f081447bf8313c1e10c3775e6a Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sun, 22 Aug 2021 10:07:19 -0400 Subject: Make video resource boxes consistent. The title now links to the YouTube channels rather than a YouTube icon. Channels with an associated Discord server are also tagged "community". --- pydis_site/apps/resources/resources/corey_schafer.yaml | 4 +--- pydis_site/apps/resources/resources/jetbrains_videos.yaml | 6 ++---- pydis_site/apps/resources/resources/jim_shaped_coding.yaml | 6 ++---- pydis_site/apps/resources/resources/microsoft_videos.yaml | 8 ++++---- pydis_site/apps/resources/resources/python_discord_videos.yaml | 8 ++------ pydis_site/apps/resources/resources/sentdex.yaml | 6 ++---- 6 files changed, 13 insertions(+), 25 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/corey_schafer.yaml b/pydis_site/apps/resources/resources/corey_schafer.yaml index c4d9ad5e..cb20bc24 100644 --- a/pydis_site/apps/resources/resources/corey_schafer.yaml +++ b/pydis_site/apps/resources/resources/corey_schafer.yaml @@ -9,10 +9,8 @@ description: 'Corey has a number of exceptionally high quality tutorial series Check out his channel for more video series! ' title_image: https://i.imgur.com/KIfWw3b.png +title_url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g - color: youtube-red - icon: regular/link url: https://coreyms.com/ color: teal diff --git a/pydis_site/apps/resources/resources/jetbrains_videos.yaml b/pydis_site/apps/resources/resources/jetbrains_videos.yaml index f13ecbb7..aba7c687 100644 --- a/pydis_site/apps/resources/resources/jetbrains_videos.yaml +++ b/pydis_site/apps/resources/resources/jetbrains_videos.yaml @@ -2,13 +2,11 @@ description: A collection of videos made by the PyCharm team at JetBrains on sub Django, pytest and much more!

Episodes of their "What does this package do?" series go over all sorts of libraries in Python both in the standard library and from the community and give a video explanation of the key concepts. +name: JetBrains YouTube Channel icon_image: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/JetBrains_Logo_2016.svg/1200px-JetBrains_Logo_2016.svg.png icon_size: 50 title_image: https://resources.jetbrains.com/storage/products/pycharm/img/meta/pycharm_logo_300x300.png -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw - color: youtube-red +title_url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw tags: topics: - general diff --git a/pydis_site/apps/resources/resources/jim_shaped_coding.yaml b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml index a217183e..30992ef2 100644 --- a/pydis_site/apps/resources/resources/jim_shaped_coding.yaml +++ b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml @@ -5,11 +5,9 @@ description: 'JimShapedCoding contains a set of YouTube tutorials covering thing
  • Django tutorials
  • Check out his channel for more videos!' +name: JimShapedCoding title_image: https://i.imgur.com/DlovZPf.png -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg - color: youtube-red +title_url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg tags: topics: - general diff --git a/pydis_site/apps/resources/resources/microsoft_videos.yaml b/pydis_site/apps/resources/resources/microsoft_videos.yaml index df49adff..39187650 100644 --- a/pydis_site/apps/resources/resources/microsoft_videos.yaml +++ b/pydis_site/apps/resources/resources/microsoft_videos.yaml @@ -7,11 +7,10 @@ description: A trove of tutorials & guides for developers from Microsoft's Devel Microsoft's Python Development Team also runs a Discord Server for discussions of Python in the Microsoft ecosystem, including Visual Studio Code and Azure. -title_image: http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2qVsJ?ver=3f74 +name: Microsoft Developer +title_image: https://upload.wikimedia.org/wikipedia/commons/4/44/Microsoft_logo.svg +title_url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g - color: youtube-red - icon: branding/discord url: https://aka.ms/python-discord color: blurple @@ -24,3 +23,4 @@ tags: - beginner type: - video + - community diff --git a/pydis_site/apps/resources/resources/python_discord_videos.yaml b/pydis_site/apps/resources/resources/python_discord_videos.yaml index 2a8fed08..bf44083f 100644 --- a/pydis_site/apps/resources/resources/python_discord_videos.yaml +++ b/pydis_site/apps/resources/resources/python_discord_videos.yaml @@ -1,11 +1,7 @@ -description: It's our channel! We are slowly gathering content here directly related to Python, +description: It's our YouTube channel! We are slowly gathering content here directly related to Python, our community and the events we host. Come check us out! title_image: https://raw.githubusercontent.com/python-discord/branding/master/logos/logo_banner/logo_site_banner_dark_512.png -position: 2 -urls: - - icon: branding/youtube - url: https://www.youtube.com/pythondiscord - color: youtube-red +title_url: https://www.youtube.com/pythondiscord tags: topics: - general diff --git a/pydis_site/apps/resources/resources/sentdex.yaml b/pydis_site/apps/resources/resources/sentdex.yaml index 21acd4e9..96fc8c3a 100644 --- a/pydis_site/apps/resources/resources/sentdex.yaml +++ b/pydis_site/apps/resources/resources/sentdex.yaml @@ -9,11 +9,8 @@ description: 'An enormous amount of Python content for all skill levels Check out his channel for more video series! ' title_image: https://i.imgur.com/kJgWZIu.png -position: 1 +title_url: https://www.youtube.com/user/sentdex urls: - - icon: branding/youtube - url: https://www.youtube.com/user/sentdex - color: youtube-red - icon: branding/discord url: https://discord.gg/sentdex color: blurple @@ -32,3 +29,4 @@ tags: - intermediate type: - video + - community -- cgit v1.2.3 From d2c1fb326ba4fd1b4081a74bbab7cfae71977c1a Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sun, 22 Aug 2021 13:18:37 -0400 Subject: Add nedbat's kindling projects. This is the first "project ideas" resource. --- .../apps/resources/resources/netbats_project_ideas.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pydis_site/apps/resources/resources/netbats_project_ideas.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/netbats_project_ideas.yaml b/pydis_site/apps/resources/resources/netbats_project_ideas.yaml new file mode 100644 index 00000000..faa029f9 --- /dev/null +++ b/pydis_site/apps/resources/resources/netbats_project_ideas.yaml @@ -0,0 +1,14 @@ +description: A repository of project ideas to help one apply what they're learning, maintained by Python + community member Ned Batchelder, known on Python Discord as nedbat. +name: Ned Batchelder's Kindling Projects +title_url: https://nedbatchelder.com/text/kindling.html +tags: + topics: + - general + payment_tiers: + - free + complexity: + - beginner + - intermediate + type: + - project ideas -- cgit v1.2.3 From 595b6728edee309f8b098c2f7efb5a285c3be070 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sun, 22 Aug 2021 13:19:14 -0400 Subject: Make icon dict a constant; add project ideas icon. --- .../resources/templatetags/get_category_icon.py | 61 +++++++++++----------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/templatetags/get_category_icon.py b/pydis_site/apps/resources/templatetags/get_category_icon.py index d8b47476..cfac7832 100644 --- a/pydis_site/apps/resources/templatetags/get_category_icon.py +++ b/pydis_site/apps/resources/templatetags/get_category_icon.py @@ -2,37 +2,38 @@ from django import template register = template.Library() +_ICONS = { + "Algorithms And Data Structures": "fa-cogs", + "Data Science": "fa-flask", + "Databases": "fa-server", + "Game Development": "fa-joystick", + "General": "fa-book", + "Microcontrollers": "fa-microchip", + "Other": "fa-question-circle", + "Project Ideas": "fa-lightbulb-o", + "Software Design": "fa-paint-brush", + "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", + "Tutorial": "fa-clipboard-list", + "Video": "fa-video", + "Free": "fa-first-aid", + "Paid": "fa-sack", + "Subscription": "fa-credit-card", + "Beginner": "fa-play-circle", + "Intermediate": "fa-align-center" +} + @register.filter def get_category_icon(name: str) -> str: """Get icon of a specific resource category.""" - icons = { - "Algorithms And Data Structures": "fa-cogs", - "Data Science": "fa-flask", - "Databases": "fa-server", - "Game Development": "fa-joystick", - "General": "fa-book", - "Microcontrollers": "fa-microchip", - "Other": "fa-question-circle", - "Software Design": "fa-paint-brush", - "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", - "Tutorial": "fa-clipboard-list", - "Video": "fa-video", - "Free": "fa-first-aid", - "Paid": "fa-sack", - "Subscription": "fa-credit-card", - "Beginner": "fa-play-circle", - "Intermediate": "fa-align-center" - } - icon_name = icons[name] - return f'fa {icon_name}' + return f'fa {_ICONS[name]}' -- cgit v1.2.3 From c99409545b1f04e49cd2d7170f165ef233103dcd Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Fri, 27 Aug 2021 22:26:58 -0400 Subject: Use MappingProxyType to freeze non-private dictionaries. This is intended to make those mappings safer. --- pydis_site/apps/resources/utils.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 623dd7b6..8454451a 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -3,6 +3,7 @@ from collections import defaultdict from functools import reduce from operator import and_, or_ from pathlib import Path +from types import MappingProxyType import yaml from django.conf import settings @@ -16,10 +17,12 @@ Resource = dict[str, t.Union[str, list[dict[str, str]], dict[str, list[str]]]] RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") -RESOURCES: dict[str, Resource] = {path.stem: yaml.safe_load(path.read_text()) for path - in RESOURCES_PATH.rglob("*.yaml")} +RESOURCES: MappingProxyType[str, Resource] = MappingProxyType({ + path.stem: yaml.safe_load(path.read_text()) + for path in RESOURCES_PATH.rglob("*.yaml") +}) -RESOURCE_TABLE = {category: defaultdict(set) for category in ( +_resource_table = {category: defaultdict(set) for category in ( "topics", "payment_tiers", "complexity", @@ -29,7 +32,13 @@ RESOURCE_TABLE = {category: defaultdict(set) for category in ( for name, resource in RESOURCES.items(): for category, tags in resource['tags'].items(): for tag in tags: - RESOURCE_TABLE[category][_transform_name(tag)].add(name) + _resource_table[category][_transform_name(tag)].add(name) + +# Freeze the resources table +RESOURCE_TABLE = MappingProxyType({ + category: MappingProxyType(d) + for category, d in _resource_table.items() +}) def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]: -- cgit v1.2.3 From 248698bb33e961266bd0efe14bf17b694cfe9de9 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sat, 28 Aug 2021 08:45:58 -0400 Subject: Make title for all resources a link. When the resource is for a Discord server, the title links to a website and the Discord icon is the server invite. --- pydis_site/apps/resources/resources/adafruit.yaml | 5 +---- .../apps/resources/resources/automate_the_boring_stuff_book.yaml | 4 +--- pydis_site/apps/resources/resources/byte_of_python.yaml | 4 +--- pydis_site/apps/resources/resources/code_combat.yaml | 4 +--- pydis_site/apps/resources/resources/data_science_from_scratch.yaml | 4 +--- pydis_site/apps/resources/resources/effective_python.yaml | 4 +--- pydis_site/apps/resources/resources/exercism.yaml | 4 +--- pydis_site/apps/resources/resources/flask_web_development.yaml | 4 +--- pydis_site/apps/resources/resources/fluent_python.yaml | 4 +--- pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml | 4 +--- pydis_site/apps/resources/resources/inferential_thinking.yaml | 5 +---- pydis_site/apps/resources/resources/microsoft.yaml | 5 +---- pydis_site/apps/resources/resources/mission_python.yaml | 4 +--- .../resources/resources/neural_networks_from_scratch_in_python.yaml | 4 +--- pydis_site/apps/resources/resources/pallets.yaml | 5 +---- pydis_site/apps/resources/resources/pyglet.yaml | 5 +---- pydis_site/apps/resources/resources/python_cookbook.yaml | 4 +--- pydis_site/apps/resources/resources/python_crash_course.yaml | 4 +--- pydis_site/apps/resources/resources/python_tricks.yaml | 4 +--- pydis_site/apps/resources/resources/think_python.yaml | 4 +--- pydis_site/apps/resources/resources/two_scoops_of_django.yaml | 4 +--- 21 files changed, 21 insertions(+), 68 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/adafruit.yaml b/pydis_site/apps/resources/resources/adafruit.yaml index 1945274c..e8eeee37 100644 --- a/pydis_site/apps/resources/resources/adafruit.yaml +++ b/pydis_site/apps/resources/resources/adafruit.yaml @@ -4,14 +4,11 @@ description: Adafruit is an open-source electronics manufacturer provide help with your projects, and the Adafruit devs do all the CircuitPython Development right out in the open. title_image: https://www.mouser.com/images/suppliers/logos/adafruit.png -title_url: https://discord.gg/adafruit +title_url: https://adafruit.com/ urls: - icon: branding/discord url: https://discord.gg/adafruit color: blurple - - icon: regular/link - url: https://adafruit.com/ - color: teal tags: topics: - microcontrollers diff --git a/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml index deaca948..bc0e19ec 100644 --- a/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml @@ -4,10 +4,8 @@ description: One of the best books out there for Python beginners. This book wil the web, manipulating files and automating keyboard and mouse input. Ideal for an office worker who wants to make himself more useful. name: Automate the Boring Stuff with Python +title_url: https://automatetheboringstuff.com/ urls: -- icon: regular/book - url: https://automatetheboringstuff.com/ - color: black - icon: branding/goodreads url: https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python color: goodreads-cream diff --git a/pydis_site/apps/resources/resources/byte_of_python.yaml b/pydis_site/apps/resources/resources/byte_of_python.yaml index 618578d1..5f6788e7 100644 --- a/pydis_site/apps/resources/resources/byte_of_python.yaml +++ b/pydis_site/apps/resources/resources/byte_of_python.yaml @@ -2,10 +2,8 @@ description: A free book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you. name: A Byte of Python +title_url: https://python.swaroopch.com/ urls: -- icon: regular/link - url: https://python.swaroopch.com/ - color: teal - icon: regular/book url: http://www.lulu.com/shop/swaroop-c-h/a-byte-of-python/paperback/product-21142968.html color: black diff --git a/pydis_site/apps/resources/resources/code_combat.yaml b/pydis_site/apps/resources/resources/code_combat.yaml index 41dac6b6..ab4a4aed 100644 --- a/pydis_site/apps/resources/resources/code_combat.yaml +++ b/pydis_site/apps/resources/resources/code_combat.yaml @@ -1,10 +1,8 @@ description: Learn Python while gaming - an open-source project with thousands of contributors, which teaches you Python through a deep, top-down RPG. name: Code Combat +title_url: https://codecombat.com/ urls: -- icon: regular/link - url: https://codecombat.com/ - color: teal - icon: branding/github url: https://github.com/codecombat/codecombat color: black diff --git a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml index 14cba1f4..8ba95e9b 100644 --- a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml +++ b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml @@ -3,10 +3,8 @@ description: Data Science from Scratch is a good introduction to data science fo started. While either edition of this book is useful for those with prior Python experience, complete beginners should use the second edition, which contains more up-to-date code examples and better practices. name: Data Science from Scratch +title_url: https://www.oreilly.com/library/view/data-science-from/9781492041122/ urls: - - icon: regular/link - url: https://www.oreilly.com/library/view/data-science-from/9781492041122/ - color: teal - icon: branding/goodreads url: https://www.goodreads.com/en/book/show/52059715-data-science-from-scratch color: goodreads-cream diff --git a/pydis_site/apps/resources/resources/effective_python.yaml b/pydis_site/apps/resources/resources/effective_python.yaml index 5ca94c63..4e361bcb 100644 --- a/pydis_site/apps/resources/resources/effective_python.yaml +++ b/pydis_site/apps/resources/resources/effective_python.yaml @@ -1,10 +1,8 @@ description: A book that gives 90 best practices for writing excellent Python. Great for intermediates. name: Effective Python +title_url: https://effectivepython.com/ urls: -- icon: regular/link - url: https://effectivepython.com/ - color: teal - icon: branding/goodreads url: https://www.goodreads.com/book/show/48566725-effective-python color: goodreads-cream diff --git a/pydis_site/apps/resources/resources/exercism.yaml b/pydis_site/apps/resources/resources/exercism.yaml index 7885bb9a..ba8cd2df 100644 --- a/pydis_site/apps/resources/resources/exercism.yaml +++ b/pydis_site/apps/resources/resources/exercism.yaml @@ -3,10 +3,8 @@ description: Level up your programming skills with more than 2600 exercises acro where you can get your code reviewed for each solution you submit. The mentors will give you insightful advice to make you a better programmer. name: exercism.io +title_url: https://exercism.io/ urls: -- icon: regular/link - url: https://exercism.io/ - color: teal - icon: branding/github url: https://github.com/exercism/python color: black diff --git a/pydis_site/apps/resources/resources/flask_web_development.yaml b/pydis_site/apps/resources/resources/flask_web_development.yaml index 27e75fe6..95b75a5b 100644 --- a/pydis_site/apps/resources/resources/flask_web_development.yaml +++ b/pydis_site/apps/resources/resources/flask_web_development.yaml @@ -1,10 +1,8 @@ description: A comprehensive Flask walkthrough that has you building a complete social blogging application from scratch. name: Flask Web Development +title_url: http://shop.oreilly.com/product/0636920031116.do urls: -- icon: regular/link - url: http://shop.oreilly.com/product/0636920031116.do - color: teal - icon: branding/goodreads url: https://www.goodreads.com/book/show/18774655-flask-web-development color: goodreads-cream diff --git a/pydis_site/apps/resources/resources/fluent_python.yaml b/pydis_site/apps/resources/resources/fluent_python.yaml index 24c2b150..e35c0134 100644 --- a/pydis_site/apps/resources/resources/fluent_python.yaml +++ b/pydis_site/apps/resources/resources/fluent_python.yaml @@ -1,10 +1,8 @@ description: A veritable tome of intermediate and advanced Python information. A must-read for any Python professional. By far the most recommended book for intermediates. name: Fluent Python +title_url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ urls: -- icon: regular/link - url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ - color: teal - icon: branding/goodreads url: https://www.goodreads.com/book/show/22800567-fluent-python color: goodreads-cream diff --git a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml index e50f6297..bfac404a 100644 --- a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml +++ b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml @@ -1,10 +1,8 @@ description: A best practice handbook for both novice and expert Python developers to the installation, configuration, and usage of Python on a daily basis. name: The Hitchhiker's Guide to Python +title_url: https://python-guide.org/ urls: -- icon: regular/link - url: https://python-guide.org/ - color: teal - icon: branding/goodreads url: https://www.goodreads.com/book/show/28321007-the-hitchhiker-s-guide-to-python color: goodreads-cream diff --git a/pydis_site/apps/resources/resources/inferential_thinking.yaml b/pydis_site/apps/resources/resources/inferential_thinking.yaml index 92963948..20409f3a 100644 --- a/pydis_site/apps/resources/resources/inferential_thinking.yaml +++ b/pydis_site/apps/resources/resources/inferential_thinking.yaml @@ -2,10 +2,7 @@ description: Inferential Thinking is the textbook for the Date: Fri, 3 Sep 2021 16:48:35 -0400 Subject: Rename `utils.py` to `resource_search.py`. --- pydis_site/apps/resources/resource_search.py | 57 +++++++++++++++++++++++ pydis_site/apps/resources/tests/test_views.py | 2 +- pydis_site/apps/resources/utils.py | 57 ----------------------- pydis_site/apps/resources/views/resources.py | 2 +- pydis_site/apps/resources/views/resources_list.py | 2 +- 5 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 pydis_site/apps/resources/resource_search.py delete mode 100644 pydis_site/apps/resources/utils.py (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resource_search.py b/pydis_site/apps/resources/resource_search.py new file mode 100644 index 00000000..8454451a --- /dev/null +++ b/pydis_site/apps/resources/resource_search.py @@ -0,0 +1,57 @@ +import typing as t +from collections import defaultdict +from functools import reduce +from operator import and_, or_ +from pathlib import Path +from types import MappingProxyType + +import yaml +from django.conf import settings + + +def _transform_name(resource_name: str) -> str: + return resource_name.title().replace('And', 'and', -1) + + +Resource = dict[str, t.Union[str, list[dict[str, str]], dict[str, list[str]]]] + +RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") + +RESOURCES: MappingProxyType[str, Resource] = MappingProxyType({ + path.stem: yaml.safe_load(path.read_text()) + for path in RESOURCES_PATH.rglob("*.yaml") +}) + +_resource_table = {category: defaultdict(set) for category in ( + "topics", + "payment_tiers", + "complexity", + "type" +)} + +for name, resource in RESOURCES.items(): + for category, tags in resource['tags'].items(): + for tag in tags: + _resource_table[category][_transform_name(tag)].add(name) + +# Freeze the resources table +RESOURCE_TABLE = MappingProxyType({ + category: MappingProxyType(d) + for category, d in _resource_table.items() +}) + + +def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]: + """Returns a list of all resources that match the given search terms.""" + resource_names_that_match = reduce( + and_, + ( + reduce( + or_, + (RESOURCE_TABLE[category][label] for label in labels), + set() + ) + for category, labels in search_categories.items() + ) + ) + return [RESOURCES[name_] for name_ in resource_names_that_match] diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py index 568f4d13..2e9efc1d 100644 --- a/pydis_site/apps/resources/tests/test_views.py +++ b/pydis_site/apps/resources/tests/test_views.py @@ -25,7 +25,7 @@ class TestResourcesListView(TestCase): response = self.client.get(url) self.assertEqual(response.status_code, 200) - @patch("pydis_site.apps.resources.utils.RESOURCES_PATH", TESTING_RESOURCES_PATH) + @patch("pydis_site.apps.resources.resource_search.RESOURCES_PATH", TESTING_RESOURCES_PATH) def test_filter_resource_list(self): """TODO: Check that we can correctly filter resources with GET parameters.""" pass diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py deleted file mode 100644 index 8454451a..00000000 --- a/pydis_site/apps/resources/utils.py +++ /dev/null @@ -1,57 +0,0 @@ -import typing as t -from collections import defaultdict -from functools import reduce -from operator import and_, or_ -from pathlib import Path -from types import MappingProxyType - -import yaml -from django.conf import settings - - -def _transform_name(resource_name: str) -> str: - return resource_name.title().replace('And', 'and', -1) - - -Resource = dict[str, t.Union[str, list[dict[str, str]], dict[str, list[str]]]] - -RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") - -RESOURCES: MappingProxyType[str, Resource] = MappingProxyType({ - path.stem: yaml.safe_load(path.read_text()) - for path in RESOURCES_PATH.rglob("*.yaml") -}) - -_resource_table = {category: defaultdict(set) for category in ( - "topics", - "payment_tiers", - "complexity", - "type" -)} - -for name, resource in RESOURCES.items(): - for category, tags in resource['tags'].items(): - for tag in tags: - _resource_table[category][_transform_name(tag)].add(name) - -# Freeze the resources table -RESOURCE_TABLE = MappingProxyType({ - category: MappingProxyType(d) - for category, d in _resource_table.items() -}) - - -def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]: - """Returns a list of all resources that match the given search terms.""" - resource_names_that_match = reduce( - and_, - ( - reduce( - or_, - (RESOURCE_TABLE[category][label] for label in labels), - set() - ) - for category, labels in search_categories.items() - ) - ) - return [RESOURCES[name_] for name_ in resource_names_that_match] diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 087cdfb6..a7c631dc 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,7 +1,7 @@ from django.http import HttpRequest, HttpResponse from django.shortcuts import render -from pydis_site.apps.resources.utils import RESOURCE_TABLE, get_resources_from_search +from pydis_site.apps.resources.resource_search import RESOURCE_TABLE, get_resources_from_search RESOURCE_META_TAGS = {k: list(v) for k, v in RESOURCE_TABLE.items()} diff --git a/pydis_site/apps/resources/views/resources_list.py b/pydis_site/apps/resources/views/resources_list.py index 9d74be91..30498c8f 100644 --- a/pydis_site/apps/resources/views/resources_list.py +++ b/pydis_site/apps/resources/views/resources_list.py @@ -2,7 +2,7 @@ from typing import Any, Dict from django.views.generic import TemplateView -from pydis_site.apps.resources.utils import RESOURCES +from pydis_site.apps.resources.resource_search import RESOURCES class ResourcesListView(TemplateView): -- cgit v1.2.3 From 990eebae44ba6f9328d8c15d02319f8c2a07f850 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Sat, 4 Sep 2021 17:31:05 -0400 Subject: Drop -Option from {topic,type,etc}Option. Having -Option in the names was making the URL especially verbose. --- pydis_site/apps/resources/views/resources.py | 8 ++++---- pydis_site/templates/resources/resources.html | 13 ++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index a7c631dc..60ec6d8f 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -16,10 +16,10 @@ def resource_view(request: HttpRequest) -> HttpResponse: checkbox_options = { a: set(format_checkbox_options(request.GET.get(b))) for a, b in ( - ('topics', 'topicOption'), - ('type', 'typeOption'), - ('payment_tiers', 'paymentOption'), - ('complexity', 'complexityOption'), + ('topics', 'topic'), + ('type', 'type'), + ('payment_tiers', 'payment'), + ('complexity', 'complexity'), ) } diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 2ae28725..e9695fff 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -29,7 +29,7 @@ {% for topic in topics_1 %}
    @@ -39,7 +39,7 @@ {% for topic in topics_2 %}
    @@ -57,7 +57,7 @@ {% for tag_type in tag_types %}
    @@ -73,7 +73,7 @@ {% for payment_tier in payment_tiers %}
    @@ -89,7 +89,7 @@ {% for complexity in complexities %}
    @@ -147,8 +147,7 @@ {% endblock %} -- cgit v1.2.3 From e759cffd78591919a70b727c41d787f753431f7c Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 23 Jan 2022 13:34:15 +0100 Subject: Make GoodReads icons readable. --- pydis_site/static/css/resources/resources_list.css | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources_list.css b/pydis_site/static/css/resources/resources_list.css index 351030f8..c2151bee 100644 --- a/pydis_site/static/css/resources/resources_list.css +++ b/pydis_site/static/css/resources/resources_list.css @@ -34,20 +34,14 @@ i.resource-icon.is-youtube-red:hover { color: #f80000; } -i.resource-icon.is-goodreads-cream { - color: #f3f2e9; -} - -i.resource-icon.is-goodreads-cream:hover { - color: #ffffff; -} - +i.resource-icon.is-goodreads-cream, i.resource-icon.is-black { - color: #000000; + color: #2c3334; } -i.resource-icon.is-black { - color: #191919; +i.resource-icon.is-goodreads-cream:hover, +i.resource-icon.is-black:hover { + color: #475d6d; } i.has-icon-padding { -- cgit v1.2.3 From f316343e1dd9c14a2857503caa26e85cb58ea8f4 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 23 Jan 2022 14:06:59 +0100 Subject: Link icons belong close together. --- pydis_site/apps/resources/resources/kivy.yaml | 6 +++--- pydis_site/apps/resources/resources/panda3d.yaml | 6 +++--- pydis_site/apps/resources/resources/people_postgres_data.yaml | 6 +++--- pydis_site/apps/resources/resources/sentdex.yaml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/kivy.yaml b/pydis_site/apps/resources/resources/kivy.yaml index c4028647..0b8c9a9e 100644 --- a/pydis_site/apps/resources/resources/kivy.yaml +++ b/pydis_site/apps/resources/resources/kivy.yaml @@ -6,12 +6,12 @@ icon_size: 50 title_image: https://i.imgur.com/EVP3jZR.png title_url: https://discord.gg/djPtTRJ urls: + - icon: regular/link + url: https://kivy.org/ + color: teal - icon: branding/discord url: https://discord.gg/djPtTRJ color: blurple - - icon: regular/link - url: https://kivy.org/ - color: teal - icon: branding/github url: https://github.com/kivy color: black diff --git a/pydis_site/apps/resources/resources/panda3d.yaml b/pydis_site/apps/resources/resources/panda3d.yaml index 286e8b27..27c35244 100644 --- a/pydis_site/apps/resources/resources/panda3d.yaml +++ b/pydis_site/apps/resources/resources/panda3d.yaml @@ -4,12 +4,12 @@ title_image: http://www.panda3d.org/wp-content/uploads/2019/01/panda3d_logo.png title_url: https://discord.gg/9XsucTT position: 9 urls: - - icon: branding/discord - url: https://discord.gg/9XsucTT - color: blurple - icon: regular/link url: https://www.panda3d.org/ color: teal + - icon: branding/discord + url: https://discord.gg/9XsucTT + color: blurple tags: topics: - user interface diff --git a/pydis_site/apps/resources/resources/people_postgres_data.yaml b/pydis_site/apps/resources/resources/people_postgres_data.yaml index 4f84cb99..70088af2 100644 --- a/pydis_site/apps/resources/resources/people_postgres_data.yaml +++ b/pydis_site/apps/resources/resources/people_postgres_data.yaml @@ -6,12 +6,12 @@ description: People, Postgres, Data specializes in building users of Postgres title_image: https://media.discordapp.net/attachments/748954447857844318/750519488268730377/people_postgres_data.png title_url: https://discord.gg/Ujw8m8v urls: - - icon: branding/discord - url: https://discord.gg/Ujw8m8v - color: bluple - icon: regular/link url: https://postgresconf.org/ color: teal + - icon: branding/discord + url: https://discord.gg/Ujw8m8v + color: bluple - icon: branding/reddit url: https://reddit.com/r/postgresql color: orangered diff --git a/pydis_site/apps/resources/resources/sentdex.yaml b/pydis_site/apps/resources/resources/sentdex.yaml index 96fc8c3a..47a8852d 100644 --- a/pydis_site/apps/resources/resources/sentdex.yaml +++ b/pydis_site/apps/resources/resources/sentdex.yaml @@ -11,12 +11,12 @@ description: 'An enormous amount of Python content for all skill levels title_image: https://i.imgur.com/kJgWZIu.png title_url: https://www.youtube.com/user/sentdex urls: - - icon: branding/discord - url: https://discord.gg/sentdex - color: blurple - icon: regular/link url: https://pythonprogramming.net/ color: teal + - icon: branding/discord + url: https://discord.gg/sentdex + color: blurple tags: topics: - general -- cgit v1.2.3 From 6330e1917377103986580758c4436160edb341bd Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Thu, 27 Jan 2022 10:13:51 +0100 Subject: Fix broken yaml in kivy.yaml. --- pydis_site/apps/resources/resources/kivy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/kivy.yaml b/pydis_site/apps/resources/resources/kivy.yaml index 0b8c9a9e..5d7d3844 100644 --- a/pydis_site/apps/resources/resources/kivy.yaml +++ b/pydis_site/apps/resources/resources/kivy.yaml @@ -7,8 +7,8 @@ title_image: https://i.imgur.com/EVP3jZR.png title_url: https://discord.gg/djPtTRJ urls: - icon: regular/link - url: https://kivy.org/ - color: teal + url: https://kivy.org/ + color: teal - icon: branding/discord url: https://discord.gg/djPtTRJ color: blurple -- cgit v1.2.3 From 4ee8d527a2cf0ac7e4fd977ffd29e560b3cd48cb Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Thu, 27 Jan 2022 10:16:52 +0100 Subject: Greatly simplify the backend. Here we're getting rid of all filtering and search functionality on the backend. We'll be handling this on the client-side from now on. --- pydis_site/apps/resources/resource_search.py | 59 ---------------------- pydis_site/apps/resources/tests/test_views.py | 13 ----- pydis_site/apps/resources/urls.py | 3 +- pydis_site/apps/resources/views/__init__.py | 5 +- pydis_site/apps/resources/views/resources_list.py | 18 ------- pydis_site/templates/resources/resources_list.html | 52 ------------------- 6 files changed, 3 insertions(+), 147 deletions(-) delete mode 100644 pydis_site/apps/resources/resource_search.py delete mode 100644 pydis_site/apps/resources/views/resources_list.py delete mode 100644 pydis_site/templates/resources/resources_list.html (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resource_search.py b/pydis_site/apps/resources/resource_search.py deleted file mode 100644 index 1e23089b..00000000 --- a/pydis_site/apps/resources/resource_search.py +++ /dev/null @@ -1,59 +0,0 @@ -import typing as t -from collections import defaultdict -from functools import reduce -from operator import and_, or_ -from pathlib import Path -from types import MappingProxyType - -import yaml -from django.conf import settings - - -def _transform_name(resource_name: str) -> str: - return resource_name.title().replace('And', 'and', -1) - - -Resource = dict[str, t.Union[str, list[dict[str, str]], dict[str, list[str]]]] - -RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") - -RESOURCES: MappingProxyType[str, Resource] = MappingProxyType({ - path.stem: yaml.safe_load(path.read_text()) - for path in RESOURCES_PATH.rglob("*.yaml") -}) - -_resource_table = {category: defaultdict(set) for category in ( - "topics", - "payment_tiers", - "complexity", - "type" -)} - -for name, resource in RESOURCES.items(): - for category, tags in resource['tags'].items(): - for tag in tags: - _resource_table[category][_transform_name(tag)].add(name) - -# Freeze the resources table -RESOURCE_TABLE = MappingProxyType({ - category: MappingProxyType(d) - for category, d in _resource_table.items() -}) - -ALL_RESOURCE_NAMES = frozenset(RESOURCES.keys()) - - -def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]: - """Returns a list of all resources that match the given search terms.""" - resource_names_that_match = reduce( - and_, - ( - reduce( - or_, - (RESOURCE_TABLE[category][label] for label in labels), - set() - ) or ALL_RESOURCE_NAMES - for category, labels in search_categories.items() - ) - ) - return [RESOURCES[name_] for name_ in resource_names_that_match] diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py index 2e9efc1d..f96a04b0 100644 --- a/pydis_site/apps/resources/tests/test_views.py +++ b/pydis_site/apps/resources/tests/test_views.py @@ -16,16 +16,3 @@ class TestResourcesView(TestCase): url = reverse("resources:index") response = self.client.get(url) self.assertEqual(response.status_code, 200) - - -class TestResourcesListView(TestCase): - def test_valid_resource_list_200(self): - """Check does site return code 200 when visiting valid resource list.""" - url = reverse("resources:resources") - response = self.client.get(url) - self.assertEqual(response.status_code, 200) - - @patch("pydis_site.apps.resources.resource_search.RESOURCES_PATH", TESTING_RESOURCES_PATH) - def test_filter_resource_list(self): - """TODO: Check that we can correctly filter resources with GET parameters.""" - pass diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index c8d441df..3db26417 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -4,6 +4,5 @@ from pydis_site.apps.resources import views app_name = "resources" urlpatterns = [ - path("", views.resources.resource_view, name="index"), - path("list/", views.ResourcesListView.as_view(), name="resources") + path("", views.resources.ResourceView.as_view(), name="index"), ] diff --git a/pydis_site/apps/resources/views/__init__.py b/pydis_site/apps/resources/views/__init__.py index c89071c5..986f3e10 100644 --- a/pydis_site/apps/resources/views/__init__.py +++ b/pydis_site/apps/resources/views/__init__.py @@ -1,4 +1,3 @@ -from .resources import resource_view -from .resources_list import ResourcesListView +from .resources import ResourceView -__all__ = ["resource_view", "ResourcesListView"] +__all__ = ["ResourceView"] diff --git a/pydis_site/apps/resources/views/resources_list.py b/pydis_site/apps/resources/views/resources_list.py deleted file mode 100644 index 30498c8f..00000000 --- a/pydis_site/apps/resources/views/resources_list.py +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any, Dict - -from django.views.generic import TemplateView - -from pydis_site.apps.resources.resource_search import RESOURCES - - -class ResourcesListView(TemplateView): - """Shows specific resources list.""" - - template_name = "resources/resources_list.html" - - def get_context_data(self, **kwargs) -> Dict[str, Any]: - """Add resources and subcategories data into context.""" - context = super().get_context_data(**kwargs) - context["resources"] = RESOURCES - - return context diff --git a/pydis_site/templates/resources/resources_list.html b/pydis_site/templates/resources/resources_list.html deleted file mode 100644 index e2be3cb7..00000000 --- a/pydis_site/templates/resources/resources_list.html +++ /dev/null @@ -1,52 +0,0 @@ -{% extends "base/base.html" %} -{% load as_icon %} -{% load static %} - -{% block title %}{{ category_info.name }}{% endblock %} -{% block head %} - -{% endblock %} - -{% block content %} - {% include "base/navbar.html" %} - -
    - -
    -
    -
    -

    {{ category_info.name }}

    -

    {{ category_info.description|safe }}

    -
    - {% for resource in resources|dictsort:"position" %} - {% include "resources/resource_box.html" %} - {% endfor %} - - {% for subcategory in subcategories|dictsort:"category_info.position" %} -

    - - {{ subcategory.category_info.name }} - -

    -

    {{ subcategory.category_info.description|safe }}

    - - {% for resource in subcategory.resources|dictsort:"position" %} - {% with category_info=subcategory.category_info %} - {% include "resources/resource_box.html" %} - {% endwith %} - {% endfor %} - {% endfor %} -
    -
    -
    -
    -{% endblock %} -- cgit v1.2.3 From 008d6934d2ee5dfc5e2aabae8b39c92364634d5e Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Thu, 27 Jan 2022 10:17:32 +0100 Subject: Add a template tag for css-classifying things. --- pydis_site/apps/resources/templatetags/as_css_class.py | 18 ++++++++++++++++++ pydis_site/templates/resources/resource_box.html | 7 ++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 pydis_site/apps/resources/templatetags/as_css_class.py (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/templatetags/as_css_class.py b/pydis_site/apps/resources/templatetags/as_css_class.py new file mode 100644 index 00000000..8b628dc9 --- /dev/null +++ b/pydis_site/apps/resources/templatetags/as_css_class.py @@ -0,0 +1,18 @@ +from django import template + +register = template.Library() + + +@register.filter +def as_css_class(class_name: str) -> str: + """ + Convert any string to a css-class name. + + For example, convert + "Favorite FROOT_is_LEMON" to + "favorite-froot-is-lemon" + """ + class_name = class_name.lower() + class_name = class_name.replace(" ", "-") + class_name = class_name.replace("_", "-") + return class_name diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index 7de9ca18..09256751 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -1,7 +1,7 @@ {% load as_icon %} {% load get_category_icon %} -
    +
    {% if 'title_url' in resource %} {% include "resources/resource_box_header.html" %} @@ -13,7 +13,7 @@

    {{ resource.description|safe }}

    - {# Add primary link #} + {# Add primary link #} {% if 'title_url' in resource %} @@ -21,7 +21,8 @@ {% endif %} - {# Add all additional icon #} + + {#Add all additional icon #} {% for icon in resource.urls %} -- cgit v1.2.3 From 231ed09ec52ca9c05bc5697310f49824f05ff63e Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Thu, 27 Jan 2022 10:21:38 +0100 Subject: Add a FontAwesome token that we actually control. Previously we were using some sort of borrowed token, but it seems to not be working anymore for local sessions, so let's just get rid of it. --- pydis_site/settings.py | 2 +- pydis_site/templates/base/base.html | 5 +---- pydis_site/templates/base/navbar.html | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 5a8e9be7..3b146f2c 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -271,8 +271,8 @@ BULMA_SETTINGS = { "extensions": [ "bulma-dropdown", "bulma-navbar-burger", - "bulma-modal", ], + "fontawesome_token": "ff22cb6f41", } # Information about site repository diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index 906fc577..b7322f12 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -24,10 +24,7 @@ Python Discord | {% block title %}Website{% endblock %} {% bulma %} - - {# Font-awesome here is defined explicitly so that we can have Pro #} - - + {% font_awesome %} {% block head %}{% endblock %} diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index 18ff7efa..48ade189 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -67,9 +67,6 @@ Resources - - Tools - Events -- cgit v1.2.3 From 5f214647521a93fa6cb54fcac7d4e1ae66fb7cec Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Thu, 27 Jan 2022 10:23:11 +0100 Subject: Resource filtering on the client, pt 1. Here's the initial version of this system. We've got filtering, but only by clicking checkboxes. The overall look and style are pretty close to where we want them, but it's missing tons of polish to be complete. The following commits will contain that polish. --- pydis_site/apps/resources/views/resources.py | 125 ++++++++++++----- pydis_site/static/css/resources/resources.css | 48 +++---- pydis_site/static/js/resources.js | 178 +++++++++++++++++++----- pydis_site/templates/resources/resources.html | 192 ++++++++++---------------- 4 files changed, 336 insertions(+), 207 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index de6b2dac..57cb4f71 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,40 +1,103 @@ +from pathlib import Path + +import yaml +from django.core.handlers.wsgi import WSGIRequest from django.http import HttpRequest, HttpResponse from django.shortcuts import render +from django.views import View -from pydis_site.apps.resources.resource_search import RESOURCE_TABLE, get_resources_from_search +from pydis_site import settings -RESOURCE_META_TAGS = {k: set(v) for k, v in RESOURCE_TABLE.items()} +RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") -def _parse_checkbox_options(options: str) -> set[str]: - """Split up the comma separated query parameters for checkbox options into a list.""" - return set(options.split(",")[:-1]) +class ResourceView(View): + """Our curated list of good learning resources.""" + def __init__(self, *args, **kwargs): + """Set up all the resources.""" + super().__init__(*args, **kwargs) -def resource_view(request: HttpRequest) -> HttpResponse: - """View for resources index page.""" - checkbox_options = { - option: _parse_checkbox_options(request.GET.get(url_param, "")) - for option, url_param in ( - ('topics', 'topic'), - ('type', 'type'), - ('payment_tiers', 'payment'), - ('complexity', 'complexity'), - ) - } - - topics = sorted(RESOURCE_META_TAGS.get("topics")) - - return render( - request, - template_name="resources/resources.html", - context={ - "checkboxOptions": checkbox_options, - "topics_1": topics[:len(topics) // 2], - "topics_2": topics[len(topics) // 2:], - "tag_types": sorted(RESOURCE_META_TAGS.get("type")), - "payment_tiers": sorted(RESOURCE_META_TAGS.get("payment_tiers")), - "complexities": sorted(RESOURCE_META_TAGS.get("complexity")), - "resources": get_resources_from_search(checkbox_options) + # Load the resources from the yaml files in /resources/ + self.resources = { + path.stem: yaml.safe_load(path.read_text()) + for path in RESOURCES_PATH.rglob("*.yaml") + } + + # Parse out all current tags + resource_tags = { + "topics": set(), + "payment_tiers": set(), + "complexity": set(), + "type": set(), } - ) + for resource_name, resource in self.resources.items(): + css_classes = [] + for tag_type in resource_tags.keys(): + # Store the tags into `resource_tags` + tags = resource.get("tags", {}).get(tag_type, []) + for tag in tags: + tag = tag.title() + tag = tag.replace("And", "and") + resource_tags[tag_type].add(tag) + + # Make a CSS class friendly representation too, while we're already iterating. + for tag in tags: + css_tag = f"{tag_type}-{tag}" + css_tag = css_tag.replace("_", "-") + css_tag = css_tag.replace(" ", "-") + css_classes.append(css_tag) + + # Now add the css classes back to the resource, so we can use them in the template. + self.resources[resource_name]["css_classes"] = " ".join(css_classes) + + # Set up all the filter checkbox metadata + self.filters = { + "Complexity": { + "filters": sorted(resource_tags.get("complexity")), + "icon": "fas fa-brain", + "hidden": False, + }, + "Type": { + "filters": sorted(resource_tags.get("type")), + "icon": "fas fa-photo-video", + "hidden": False, + }, + "Payment tiers": { + "filters": sorted(resource_tags.get("payment_tiers")), + "icon": "fas fa-dollar-sign", + "hidden": True, + }, + "Topics": { + "filters": sorted(resource_tags.get("topics")), + "icon": "fas fa-lightbulb", + "hidden": True, + } + } + + @staticmethod + def _get_filter_options(request: WSGIRequest) -> dict[str, set]: + """Get the requested filter options out of the request object.""" + return { + option: set(request.GET.get(url_param, "").split(",")[:-1]) + for option, url_param in ( + ('topics', 'topics'), + ('type', 'type'), + ('payment_tiers', 'payment'), + ('complexity', 'complexity'), + ) + } + + def get(self, request: WSGIRequest) -> HttpResponse: + """List out all the resources, and any filtering options from the URL.""" + filter_options = self._get_filter_options(request) + + return render( + request, + template_name="resources/resources.html", + context={ + "resources": self.resources, + "filters": self.filters, + "filter_options": filter_options, + } + ) diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 488effc3..f70cbd64 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -1,29 +1,27 @@ -/*.box, .tile.is-parent {*/ -/* transition: 0.1s ease-out;*/ -/*}*/ -/*.box {*/ -/* min-height: 15vh;*/ -/*}*/ -/*.tile.is-parent:hover .box {*/ -/* box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);*/ -/*}*/ -/*.tile.is-parent:hover {*/ -/* padding: 0.65rem 0.85rem 0.85rem 0.65rem;*/ -/* filter: saturate(1.1) brightness(1.1);*/ -/*}*/ +/* Disable highlighting for all text in the filters. */ +.filter-checkbox, +.filter-panel label, +.card-header span { + user-select: none +} -/*#readingBlock {*/ -/* background-image: linear-gradient(141deg, #911eb4 0%, #b631de 71%, #cf4bf7 100%);*/ -/*}*/ +/* Remove pointless margin in panel header */ +#filter-panel-header { + margin-bottom: 0; +} -/*#interactiveBlock {*/ -/* background-image: linear-gradient(141deg, #d05600 0%, #da722a 71%, #e68846 100%);*/ -/*}*/ +/* Full width filter cards */ +#resource-filtering-panel .card .collapsible-content .card-content { + padding:0 +} -/*#communitiesBlock {*/ -/* background-image: linear-gradient(141deg, #3b756f 0%, #3a847c 71%, #41948b 100%);*/ -/*}*/ +/* Disable clicking on the checkbox itself. */ +/* Instead, we want to let the anchor tag handle clicks. */ +.filter-checkbox { + pointer-events: none; +} -/*#podcastsBlock {*/ -/* background-image: linear-gradient(141deg, #232382 0%, #30309c 71%, #4343ad 100%);*/ -/*}*/ +/* Blurple category icons */ +i.is-primary { + color: #7289da; +} diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index 5c353f97..dee59e52 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -1,48 +1,156 @@ "use strict"; -const initialParams = new URLSearchParams(window.location.search); -const checkboxOptions = ['topic', 'type', 'payment', 'complexity']; -const createQuerySelect = (opt) => { - return "input[name=" + opt + "]" -} +// Filters that are currently selected +var activeFilters = { + topics: [], + type: [], + "payment-tiers": [], + complexity: [] +}; -checkboxOptions.forEach((option) => { - document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { - if (initialParams.get(option).includes(checkbox.value)) { - checkbox.checked = true - } - }); -}); +/* Update the resources to match 'active_filters' */ +function update() { + let resources = $('.resource-box'); -function buildQueryParams() { - let params = new URLSearchParams(window.location.search); - checkboxOptions.forEach((option) => { - let tempOut = "" - document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { - if (checkbox.checked) { - tempOut += checkbox.value + ","; + // If there's nothing in the filters, show everything and return. + if ( + activeFilters.topics.length === 0 && + activeFilters.type.length === 0 && + activeFilters["payment-tiers"].length === 0 && + activeFilters.complexity.length === 0 + ) { + resources.show(); + return; + } + + // Otherwise, hide everything and then filter the resources to decide what to show. + resources.hide(); + resources.filter(function() { + let validation = { + topics: false, + type: false, + 'payment-tiers': false, + complexity: false + }; + let resourceBox = $(this); + + // Validate the filters + $.each(activeFilters, function(filterType, activeFilters) { + // If the filter list is empty, this passes validation. + if (activeFilters.length === 0) { + validation[filterType] = true; + return; } + + // Otherwise, we need to check if one of the classes exist. + $.each(activeFilters, function(index, filter) { + if (resourceBox.hasClass(filter)) { + validation[filterType] = true; + } + }); }); - params.set(option, tempOut); - }); - window.location.search = params; + // If validation passes, show the resource. + if (Object.values(validation).every(Boolean)) { + return true; + } else { + return false; + } + }).show(); } -function clearQueryParams() { - checkboxOptions.forEach((option) => { - document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { - checkbox.checked = false; - }); +// Executed when the page has finished loading. +document.addEventListener("DOMContentLoaded", function () { + + // If you collapse or uncollapse a filter group, swap the icon. + $('button.collapsible').click(function() { + let icon = $(this).find(".card-header-icon i"); + + if ($(icon).hasClass("fa-window-minimize")) { + $(icon).removeClass(["far", "fa-window-minimize"]); + $(icon).addClass(["fas", "fa-angle-down"]); + } else { + $(icon).removeClass(["fas", "fa-angle-down"]); + $(icon).addClass(["far", "fa-window-minimize"]); + } + }); + + // Update the filters on page load to reflect URL parameters. + + // If you click on the div surrounding the filter checkbox, it clicks the checkbox. + $('.filter-panel').click(function() { + let checkbox = $(this).find(".filter-checkbox"); + checkbox.prop("checked", !checkbox.prop("checked")); + checkbox.change(); }); -} -function selectAllQueryParams(column) { - checkboxOptions.forEach((option) => { - document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { - if (checkbox.className == column) { - checkbox.checked = true; + // When checkboxes are toggled, trigger a filter update. + $('.filter-checkbox').change(function () { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + let cssClass = filterName + "-" + filterItem; + var filterIndex = activeFilters[filterName].indexOf(cssClass); + + if (this.checked) { + if (filterIndex === -1) { + activeFilters[filterName].push(cssClass); } - }); + update(); + } else { + if (filterIndex !== -1) { + activeFilters[filterName].splice(filterIndex, 1); + } + update(); + } }); -} +}); + + + +// const initialParams = new URLSearchParams(window.location.search); +// const checkboxOptions = ['topic', 'type', 'payment', 'complexity']; +// +// const createQuerySelect = (opt) => { +// return "input[name=" + opt + "]" +// } +// +// checkboxOptions.forEach((option) => { +// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { +// if (initialParams.get(option).includes(checkbox.value)) { +// checkbox.checked = true +// } +// }); +// }); +// +// function buildQueryParams() { +// let params = new URLSearchParams(window.location.search); +// checkboxOptions.forEach((option) => { +// let tempOut = "" +// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { +// if (checkbox.checked) { +// tempOut += checkbox.value + ","; +// } +// }); +// params.set(option, tempOut); +// }); +// +// window.location.search = params; +// } +// +// function clearQueryParams() { +// checkboxOptions.forEach((option) => { +// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { +// checkbox.checked = false; +// }); +// }); +// } +// +// function selectAllQueryParams(column) { +// checkboxOptions.forEach((option) => { +// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { +// if (checkbox.className == column) { +// checkbox.checked = true; +// } +// }); +// }); +// } diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 427f417e..77723a8f 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -1,146 +1,106 @@ {% extends 'base/base.html' %} {% load as_icon %} +{% load as_css_class %} {% load static %} {% block title %}Resources{% endblock %} {% block head %} + + + + {% endblock %} {% block content %} {% include "base/navbar.html" %} - -
    -
    + {% if resources|length > 0 %} +
    + {# Headline #}

    Resources


    -
    -

    Search Options

    - -
    -
    -
    -
    Topic
    -
    -
    - {% for topic in topics_1 %} -
    - -
    - {% endfor %} -
    -
    - {% for topic in topics_2 %} -
    - -
    - {% endfor %} -
    -
    - - - -
    -
    -
    Type
    +
    + {# Filtering toolbox #} +
    +
    + +
    +
    - {% for payment_tier in payment_tiers %} -
    - -
    + {# Actual resources #} +
    +
    +
    + {% for resource in resources.values %} + {% include "resources/resource_box.html" %} {% endfor %} - - - -
    -
    -
    Level
    + {% for subcategory in subcategories %} +

    + + {{ subcategory.category_info.name }} + +

    +

    {{ subcategory.category_info.description|safe }}

    - {% for complexity in complexities %} -
    - -
    - {% endfor %} - - - + {% for resource in subcategory.resources %} + {% with category_info=subcategory.category_info %} + {% include "resources/resource_box.html" %} + {% endwith %} + {% endfor %} + {% endfor %}
    - -
    - - - - - - - -
    -
    -
    -
    - - {% if resources|length > 0 %} -
    -
    -
    -
    - {% for resource in resources %} - {% include "resources/resource_box.html" %} - {% endfor %} - - {% for subcategory in subcategories %} -

    - - {{ subcategory.category_info.name }} - -

    -

    {{ subcategory.category_info.description|safe }}

    - - {% for resource in subcategory.resources %} - {% with category_info=subcategory.category_info %} - {% include "resources/resource_box.html" %} - {% endwith %} - {% endfor %} - {% endfor %}
    -
    -
    +
    {% else %} -

    No resources matching search.

    +

    No resources matching search.

    {% endif %} {% endblock %} -- cgit v1.2.3 From 4bd629b3d8b0fb5a1edd1c3aa30772094dc9deec Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Thu, 27 Jan 2022 12:39:19 +0100 Subject: Reflect and retain filter state in URL params. This commits makes two important changes: - Whenever we click on filter checkboxes, the URL is immediately updated to include parameters that represent the chosen options. For example, if you select Beginner complexity, the url is updated with ?complexity=beginner. - Whenever the page is loaded, we deserialize any parameters that exist in the URL and change the filter state to match it. In other words, refreshing the page at any time retains the current state, and you can now link people to exactly the filter results that you want to share. --- pydis_site/static/js/resources.js | 130 +++++++++++++------------- pydis_site/templates/resources/resources.html | 1 + 2 files changed, 66 insertions(+), 65 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index dee59e52..836ef4ec 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -8,17 +8,67 @@ var activeFilters = { complexity: [] }; +/* Check if there are no filters */ +function noFilters() { + return ( + activeFilters.topics.length === 0 && + activeFilters.type.length === 0 && + activeFilters["payment-tiers"].length === 0 && + activeFilters.complexity.length === 0 + ); +} + +/* Update the URL with new parameters */ +function updateURL() { + // If there's nothing in the filters, we don't want anything in the URL. + if (noFilters()) { + window.history.replaceState(null, document.title, './'); + return; + } + + // Iterate through and get rid of empty ones + let searchParams = new URLSearchParams(activeFilters); + $.each(activeFilters, function(filterType, filters) { + if (filters.length === 0) { + searchParams.delete(filterType); + } + }); + + // Now update the URL + window.history.replaceState(null, document.title, `?${searchParams.toString()}`); +} + +/* Get the params out of the URL and use them. This is run when the page loads. */ +function deserializeURLParams() { + let searchParams = new window.URLSearchParams(window.location.search); + + // Work through the parameters and add them to the filter object + $.each(Object.keys(activeFilters), function(_, filterType) { + let paramFilterContent = searchParams.get(filterType); + + if (paramFilterContent !== null) { + // We use split here because we always want an array, not a string. + let paramFilterArray = paramFilterContent.split(","); + activeFilters[filterType] = paramFilterArray; + + // Check corresponding checkboxes, so the UI reflects the internal state. + $(paramFilterArray).each(function(_, filter) { + let checkbox = $(`.filter-checkbox[data-filter-name=${filterType}][data-filter-item=${filter}]`); + checkbox.prop("checked", true); + }); + } + }); +} + /* Update the resources to match 'active_filters' */ function update() { let resources = $('.resource-box'); + // Update the URL to match the new filters. + updateURL(); + // If there's nothing in the filters, show everything and return. - if ( - activeFilters.topics.length === 0 && - activeFilters.type.length === 0 && - activeFilters["payment-tiers"].length === 0 && - activeFilters.complexity.length === 0 - ) { + if (noFilters()) { resources.show(); return; } @@ -35,16 +85,16 @@ function update() { let resourceBox = $(this); // Validate the filters - $.each(activeFilters, function(filterType, activeFilters) { + $.each(activeFilters, function(filterType, filters) { // If the filter list is empty, this passes validation. - if (activeFilters.length === 0) { + if (filters.length === 0) { validation[filterType] = true; return; } // Otherwise, we need to check if one of the classes exist. - $.each(activeFilters, function(index, filter) { - if (resourceBox.hasClass(filter)) { + $.each(filters, function(index, filter) { + if (resourceBox.hasClass(`${filterType}-${filter}`)) { validation[filterType] = true; } }); @@ -61,6 +111,9 @@ function update() { // Executed when the page has finished loading. document.addEventListener("DOMContentLoaded", function () { + // Update the filters on page load to reflect URL parameters. + deserializeURLParams(); + update(); // If you collapse or uncollapse a filter group, swap the icon. $('button.collapsible').click(function() { @@ -75,8 +128,6 @@ document.addEventListener("DOMContentLoaded", function () { } }); - // Update the filters on page load to reflect URL parameters. - // If you click on the div surrounding the filter checkbox, it clicks the checkbox. $('.filter-panel').click(function() { let checkbox = $(this).find(".filter-checkbox"); @@ -88,12 +139,11 @@ document.addEventListener("DOMContentLoaded", function () { $('.filter-checkbox').change(function () { let filterItem = this.dataset.filterItem; let filterName = this.dataset.filterName; - let cssClass = filterName + "-" + filterItem; - var filterIndex = activeFilters[filterName].indexOf(cssClass); + var filterIndex = activeFilters[filterName].indexOf(filterItem); if (this.checked) { if (filterIndex === -1) { - activeFilters[filterName].push(cssClass); + activeFilters[filterName].push(filterItem); } update(); } else { @@ -104,53 +154,3 @@ document.addEventListener("DOMContentLoaded", function () { } }); }); - - - -// const initialParams = new URLSearchParams(window.location.search); -// const checkboxOptions = ['topic', 'type', 'payment', 'complexity']; -// -// const createQuerySelect = (opt) => { -// return "input[name=" + opt + "]" -// } -// -// checkboxOptions.forEach((option) => { -// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { -// if (initialParams.get(option).includes(checkbox.value)) { -// checkbox.checked = true -// } -// }); -// }); -// -// function buildQueryParams() { -// let params = new URLSearchParams(window.location.search); -// checkboxOptions.forEach((option) => { -// let tempOut = "" -// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { -// if (checkbox.checked) { -// tempOut += checkbox.value + ","; -// } -// }); -// params.set(option, tempOut); -// }); -// -// window.location.search = params; -// } -// -// function clearQueryParams() { -// checkboxOptions.forEach((option) => { -// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { -// checkbox.checked = false; -// }); -// }); -// } -// -// function selectAllQueryParams(column) { -// checkboxOptions.forEach((option) => { -// document.querySelectorAll(createQuerySelect(option)).forEach((checkbox) => { -// if (checkbox.className == column) { -// checkbox.checked = true; -// } -// }); -// }); -// } diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 77723a8f..134c826b 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -45,6 +45,7 @@ {% endif %} + {# Checkboxes #} {% if filter_data.hidden %}
    -- cgit v1.2.3 From 19ba068fbbc39c24aa1d1d1af50b9b752d941337 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Fri, 28 Jan 2022 00:50:44 +0100 Subject: Fix broken icon for Paid resources. --- pydis_site/apps/resources/templatetags/get_category_icon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/templatetags/get_category_icon.py b/pydis_site/apps/resources/templatetags/get_category_icon.py index 8111cda6..5a5e9887 100644 --- a/pydis_site/apps/resources/templatetags/get_category_icon.py +++ b/pydis_site/apps/resources/templatetags/get_category_icon.py @@ -18,7 +18,7 @@ _ICONS = { "Intermediate": "fa-align-center", "Microcontrollers": "fa-microchip", "Other": "fa-question-circle", - "Paid": "fa-sack", + "Paid": "fa-dollar-sign", "Podcast": "fa-microphone-alt", "Project Ideas": "fa-lightbulb-o", "Software Design": "fa-paint-brush", -- cgit v1.2.3 From da706784eef24e5b7bb45b50e2ebc1d8dd163a6c Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Fri, 28 Jan 2022 00:53:24 +0100 Subject: Make all tags interactive. Adds a bunch of tag-related quality of life improvements: - You can now see which filters you've added at the top left. - You can click on tags to start filtering to that tag. - You can click on tags in the filter box to remove the filter. - Tags will now show an outline when they are active. --- pydis_site/static/css/resources/resources.css | 91 +++++++++++++++++ pydis_site/static/js/resources.js | 123 +++++++++++++++++------ pydis_site/templates/resources/resource_box.html | 37 ++++++- pydis_site/templates/resources/resources.html | 123 ++++++++++++++++------- 4 files changed, 300 insertions(+), 74 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index f70cbd64..c6347eab 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -25,3 +25,94 @@ i.is-primary { color: #7289da; } + +/* A little space around the filter card, please! */ +.filter-tags { + padding-bottom: .5em; + padding-right: .5em; +} + +/* Set default display to inline-flex, for centering. */ +span.filter-box-tag { + display: inline-flex; + align-items: center; + cursor: pointer; + user-select: none; +} + +/* Make resource tags clickable */ +.resource-tag { + cursor: pointer; + user-select: none; +} + +/* Move the x down 1 pixel to align center */ +button.delete { + margin-top: 1px; +} + +/* Colors for delete button x's */ +button.delete.is-primary::before, +button.delete.is-primary::after { + background-color: #2a45a2; +} +button.delete.is-success::before, +button.delete.is-success::after { + background-color: #2c9659; +} +button.delete.is-danger::before, +button.delete.is-danger::after { + background-color: #c32841; +} +button.delete.is-info::before, +button.delete.is-info::after { + background-color: #237fbd; +} + +/* Give outlines to active tags */ +span.filter-box-tag, +span.resource-tag.active { + outline-width: 1px; + outline-style: solid; +} + +/* Make filter tags sparkle when selected! */ +@keyframes glow_success { + from { box-shadow: 0 0 2px 2px #aef4af; } + 33% { box-shadow: 0 0 2px 2px #87af7a; } + 66% { box-shadow: 0 0 2px 2px #9ceaac; } + to { box-shadow: 0 0 2px 2px #7cbf64; } +} + +@keyframes glow_primary { + from { box-shadow: 0 0 2px 2px #aeb8f3; } + 33% { box-shadow: 0 0 2px 2px #909ed9; } + 66% { box-shadow: 0 0 2px 2px #6d7ed4; } + to { box-shadow: 0 0 2px 2px #6383b3; } +} + +@keyframes glow_danger { + from { box-shadow: 0 0 2px 2px #c9495f; } + 33% { box-shadow: 0 0 2px 2px #92486f; } + 66% { box-shadow: 0 0 2px 2px #d455ba; } + to { box-shadow: 0 0 2px 2px #ff8192; } +} +@keyframes glow_info { + from { box-shadow: 0 0 2px 2px #4592c9; } + 33% { box-shadow: 0 0 2px 2px #6196bb; } + 66% { box-shadow: 0 0 2px 2px #5adade; } + to { box-shadow: 0 0 2px 2px #6bcfdc; } +} + +span.resource-tag.active.is-primary { + animation: glow_primary 4s infinite alternate; +} +span.resource-tag.active.has-background-danger-light { + animation: glow_danger 4s infinite alternate; +} +span.resource-tag.active.has-background-success-light { + animation: glow_success 4s infinite alternate; +} +span.resource-tag.active.has-background-info-light { + animation: glow_info 4s infinite alternate; +} diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index 836ef4ec..c9ce408b 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -8,6 +8,37 @@ var activeFilters = { complexity: [] }; +function addFilter(filterName, filterItem) { + // Push the filter into the stack + var filterIndex = activeFilters[filterName].indexOf(filterItem); + if (filterIndex === -1) { + activeFilters[filterName].push(filterItem); + } + updateUI(); + + // Show a corresponding filter box tag + $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).show(); + $(".filter-tags").css("padding-bottom", "0.5em"); + + // Make corresponding resource tags active + $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).addClass("active"); +} + +function removeFilter(filterName, filterItem) { + // Remove the filter from the stack + var filterIndex = activeFilters[filterName].indexOf(filterItem); + if (filterIndex !== -1) { + activeFilters[filterName].splice(filterIndex, 1); + } + updateUI(); + + // Hide the corresponding filter box tag + $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).hide(); + + // Make corresponding resource tags inactive + $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).removeClass("active"); +} + /* Check if there are no filters */ function noFilters() { return ( @@ -18,26 +49,6 @@ function noFilters() { ); } -/* Update the URL with new parameters */ -function updateURL() { - // If there's nothing in the filters, we don't want anything in the URL. - if (noFilters()) { - window.history.replaceState(null, document.title, './'); - return; - } - - // Iterate through and get rid of empty ones - let searchParams = new URLSearchParams(activeFilters); - $.each(activeFilters, function(filterType, filters) { - if (filters.length === 0) { - searchParams.delete(filterType); - } - }); - - // Now update the URL - window.history.replaceState(null, document.title, `?${searchParams.toString()}`); -} - /* Get the params out of the URL and use them. This is run when the page loads. */ function deserializeURLParams() { let searchParams = new window.URLSearchParams(window.location.search); @@ -51,18 +62,43 @@ function deserializeURLParams() { let paramFilterArray = paramFilterContent.split(","); activeFilters[filterType] = paramFilterArray; - // Check corresponding checkboxes, so the UI reflects the internal state. + // Update the corresponding filter UI, so it reflects the internal state. $(paramFilterArray).each(function(_, filter) { let checkbox = $(`.filter-checkbox[data-filter-name=${filterType}][data-filter-item=${filter}]`); + let filterTag = $(`.filter-box-tag[data-filter-name=${filterType}][data-filter-item=${filter}]`); + let resourceTags = $(`.resource-tag[data-filter-name=${filterType}][data-filter-item=${filter}]`); checkbox.prop("checked", true); + filterTag.show(); + resourceTags.addClass("active"); }); } }); } +/* Update the URL with new parameters */ +function updateURL() { + // If there's nothing in the filters, we don't want anything in the URL. + if (noFilters()) { + window.history.replaceState(null, document.title, './'); + return; + } + + // Iterate through and get rid of empty ones + let searchParams = new URLSearchParams(activeFilters); + $.each(activeFilters, function(filterType, filters) { + if (filters.length === 0) { + searchParams.delete(filterType); + } + }); + + // Now update the URL + window.history.replaceState(null, document.title, `?${searchParams.toString()}`); +} + /* Update the resources to match 'active_filters' */ -function update() { +function updateUI() { let resources = $('.resource-box'); + let filterTags = $('.filter-box-tag'); // Update the URL to match the new filters. updateURL(); @@ -70,6 +106,8 @@ function update() { // If there's nothing in the filters, show everything and return. if (noFilters()) { resources.show(); + filterTags.hide(); + $(".filter-tags").css("padding-bottom", "0"); return; } @@ -112,8 +150,9 @@ function update() { // Executed when the page has finished loading. document.addEventListener("DOMContentLoaded", function () { // Update the filters on page load to reflect URL parameters. + $('.filter-box-tag').hide(); deserializeURLParams(); - update(); + updateUI(); // If you collapse or uncollapse a filter group, swap the icon. $('button.collapsible').click(function() { @@ -128,29 +167,47 @@ document.addEventListener("DOMContentLoaded", function () { } }); - // If you click on the div surrounding the filter checkbox, it clicks the checkbox. + // If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox. $('.filter-panel').click(function() { let checkbox = $(this).find(".filter-checkbox"); checkbox.prop("checked", !checkbox.prop("checked")); checkbox.change(); }); + // If you click on one of the tags in the filter box, it unchecks the corresponding checkbox. + $('.filter-box-tag').click(function() { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + let checkbox = $(`.filter-checkbox[data-filter-name=${filterName}][data-filter-item=${filterItem}]`); + + removeFilter(filterName, filterItem); + checkbox.prop("checked", false); + }); + + // If you click on one of the tags in the resource cards, it clicks the corresponding checkbox. + $('.resource-tag').click(function() { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + let checkbox = $(`.filter-checkbox[data-filter-name=${filterName}][data-filter-item=${filterItem}]`) + + if (!$(this).hasClass("active")) { + addFilter(filterName, filterItem); + checkbox.prop("checked", true); + } else { + removeFilter(filterName, filterItem); + checkbox.prop("checked", false); + } + }); + // When checkboxes are toggled, trigger a filter update. $('.filter-checkbox').change(function () { let filterItem = this.dataset.filterItem; let filterName = this.dataset.filterName; - var filterIndex = activeFilters[filterName].indexOf(filterItem); if (this.checked) { - if (filterIndex === -1) { - activeFilters[filterName].push(filterItem); - } - update(); + addFilter(filterName, filterItem); } else { - if (filterIndex !== -1) { - activeFilters[filterName].splice(filterIndex, 1); - } - update(); + removeFilter(filterName, filterItem); } }); }); diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index 09256751..476a4841 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -1,4 +1,5 @@ {% load as_icon %} +{% load as_css_class %} {% load get_category_icon %}
    @@ -34,16 +35,44 @@ {# Tags #}
    {% for tag in resource.tags.topics %} - {{ tag|title }} + + + {{ tag|title }} + {% endfor %} {% for tag in resource.tags.type %} - {{ tag|title }} + + + {{ tag|title }} + {% endfor %} {% for tag in resource.tags.payment_tiers %} - {{ tag|title }} + + + {{ tag|title }} + {% endfor %} {% for tag in resource.tags.complexity %} - {{ tag|title }} + + + {{ tag|title }} + {% endfor %}
    diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 134c826b..87c28153 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -1,74 +1,123 @@ {% extends 'base/base.html' %} {% load as_icon %} {% load as_css_class %} +{% load get_category_icon %} {% load static %} {% block title %}Resources{% endblock %} {% block head %} - - - + + + {% endblock %} {% block content %} {% include "base/navbar.html" %} {% if resources|length > 0 %}
    - {# Headline #} -
    -

    Resources

    -
    -
    -
    {# Filtering toolbox #}
    -- cgit v1.2.3 From 72ca8758da4b80b638a83093a35a031210a8d9f2 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 12:39:21 +0100 Subject: Let the user know when there are no matches. --- pydis_site/static/css/resources/resources.css | 6 + pydis_site/static/js/resources.js | 11 ++ pydis_site/templates/resources/resources.html | 162 ++++++++++++-------------- 3 files changed, 91 insertions(+), 88 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index c6347eab..218d9a59 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -15,6 +15,12 @@ padding:0 } +/* Hide the no resources h2 by default */ +h2.no-resources-found { + display: none; + margin-top: 1em; +} + /* Disable clicking on the checkbox itself. */ /* Instead, we want to let the anchor tag handle clicks. */ .filter-checkbox { diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index c9ce408b..89b8ae06 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -112,6 +112,8 @@ function updateUI() { } // Otherwise, hide everything and then filter the resources to decide what to show. + let hasMatches = false; + console.log(hasMatches); resources.hide(); resources.filter(function() { let validation = { @@ -140,11 +142,20 @@ function updateUI() { // If validation passes, show the resource. if (Object.values(validation).every(Boolean)) { + hasMatches = true; return true; } else { return false; } }).show(); + + // If there are no matches, show the no matches message + console.log(hasMatches); + if (!hasMatches) { + $(".no-resources-found").show(); + } else { + $(".no-resources-found").hide(); + } } // Executed when the page has finished loading. diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 87c28153..b82f16e1 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -16,141 +16,127 @@ {% block content %} {% include "base/navbar.html" %} - {% if resources|length > 0 %} -
    -
    - {# Filtering toolbox #} -
    -
    -
    + {% endfor %} +
    +
    - {# Actual resources #} -
    -
    -
    - {% for resource in resources.values %} - {% include "resources/resource_box.html" %} - {% endfor %} - - {% for subcategory in subcategories %} -

    - - {{ subcategory.category_info.name }} - -

    -

    {{ subcategory.category_info.description|safe }}

    +
    + {# Message to display when there are no hits #} +

    No matching resources found!

    - {% for resource in subcategory.resources %} - {% with category_info=subcategory.category_info %} - {% include "resources/resource_box.html" %} - {% endwith %} - {% endfor %} - {% endfor %} -
    + {# Resource cards #} +
    +
    + {% for resource in resources.values %} + {% include "resources/resource_box.html" %} + {% endfor %}
    -
    - {% else %} -

    No resources matching search.

    - {% endif %} +

    +
    {% endblock %} + + -- cgit v1.2.3 From 473a15a3dbaf0ff2ccc7fdbeaafc96e0e853949e Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 12:42:12 +0100 Subject: Distill the resources page. This should allow Netlify Deploy Previews. --- pydis_site/apps/resources/urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index 3db26417..5d5ae7fb 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -1,8 +1,8 @@ -from django.urls import path +from django_distill import distill_path from pydis_site.apps.resources import views app_name = "resources" urlpatterns = [ - path("", views.resources.ResourceView.as_view(), name="index"), + distill_path("", views.resources.ResourceView.as_view(), name="index"), ] -- cgit v1.2.3 From 783bb2af9c5b5940f0fa2d3a0d0cbd34ec7e1316 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 12:58:10 +0100 Subject: Don't round edges of the filter category headers. --- pydis_site/static/css/resources/resources.css | 5 +++++ pydis_site/templates/resources/resources.html | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 218d9a59..db083a41 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -15,6 +15,11 @@ padding:0 } +/* Don't round the corners of the collapsibles */ +.filter-category-header { + border-radius: 0; +} + /* Hide the no resources h2 by default */ h2.no-resources-found { display: none; diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index b82f16e1..411ae056 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -80,19 +80,19 @@ {# Filter checkboxes #} {% for filter_name, filter_data in filters.items %} -
    - +
    + {# Checkboxes #} {% if filter_data.hidden %} -- cgit v1.2.3 From 2c563d61a63b3fa06c8884078ca0b796faceecbe Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 13:15:56 +0100 Subject: Use fullwidth icons so everything is aligned. --- pydis_site/templates/resources/resources.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 411ae056..166863c3 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -83,13 +83,13 @@
    -- cgit v1.2.3 From 113f22d388f09c3d55e51325a29136e8902ae305 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 13:19:05 +0100 Subject: Add Guides to the More menu. Since we've removed the resources landing page, there's no easy way to get to Guides anymore. For that reason, I'm adding it to the More menu so that it'll still be discoverable. --- pydis_site/templates/base/navbar.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index 48ade189..d7fb4f4c 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -76,6 +76,9 @@ FAQ + + Guides + Timeline -- cgit v1.2.3 From e54a3d18e208dd532533b5bbe146b1bff9875ba4 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 13:42:38 +0100 Subject: Complexity -> Difficulty. --- pydis_site/apps/resources/resources/adafruit.yaml | 2 +- pydis_site/apps/resources/resources/atom.yaml | 2 +- .../apps/resources/resources/automate_the_boring_stuff_book.yaml | 2 +- .../resources/resources/automate_the_boring_stuff_course.yaml | 2 +- .../apps/resources/resources/awesome_programming_discord.yaml | 2 +- pydis_site/apps/resources/resources/byte_of_python.yaml | 2 +- pydis_site/apps/resources/resources/code_combat.yaml | 2 +- pydis_site/apps/resources/resources/corey_schafer.yaml | 2 +- .../apps/resources/resources/data_science_from_scratch.yaml | 2 +- pydis_site/apps/resources/resources/edublocks.yaml | 2 +- pydis_site/apps/resources/resources/effective_python.yaml | 2 +- pydis_site/apps/resources/resources/exercism.yaml | 2 +- pydis_site/apps/resources/resources/flask_web_development.yaml | 2 +- pydis_site/apps/resources/resources/fluent_python.yaml | 2 +- .../apps/resources/resources/getting_started_with_kivy.yaml | 2 +- .../getting_started_with_python_for_non_programmers.yaml | 2 +- .../resources/getting_started_with_python_for_programmers.yaml | 2 +- pydis_site/apps/resources/resources/google_collab.yaml | 2 +- .../apps/resources/resources/hitchhikers_guide_to_python.yaml | 2 +- pydis_site/apps/resources/resources/inferential_thinking.yaml | 2 +- pydis_site/apps/resources/resources/jetbrains_academy.yaml | 2 +- pydis_site/apps/resources/resources/jetbrains_videos.yaml | 2 +- pydis_site/apps/resources/resources/jim_shaped_coding.yaml | 2 +- pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml | 2 +- pydis_site/apps/resources/resources/kivy.yaml | 2 +- pydis_site/apps/resources/resources/microsoft.yaml | 2 +- pydis_site/apps/resources/resources/microsoft_videos.yaml | 2 +- pydis_site/apps/resources/resources/mission_python.yaml | 2 +- .../mit_introduction_to_computer_science_and_programming.yaml | 2 +- pydis_site/apps/resources/resources/mu_editor.yaml | 2 +- pydis_site/apps/resources/resources/netbats_project_ideas.yaml | 2 +- .../resources/neural_networks_from_scratch_in_python.yaml | 2 +- pydis_site/apps/resources/resources/pallets.yaml | 2 +- pydis_site/apps/resources/resources/panda3d.yaml | 2 +- pydis_site/apps/resources/resources/people_postgres_data.yaml | 2 +- pydis_site/apps/resources/resources/podcast_dunder_init.yaml | 2 +- .../apps/resources/resources/practical_python_programming.yaml | 2 +- pydis_site/apps/resources/resources/pycharm.yaml | 2 +- pydis_site/apps/resources/resources/pyglet.yaml | 2 +- pydis_site/apps/resources/resources/python_bytes.yaml | 2 +- pydis_site/apps/resources/resources/python_cheat_sheet.yaml | 2 +- pydis_site/apps/resources/resources/python_cookbook.yaml | 2 +- pydis_site/apps/resources/resources/python_crash_course.yaml | 2 +- pydis_site/apps/resources/resources/python_developer_guide.yaml | 2 +- pydis_site/apps/resources/resources/python_discord_videos.yaml | 2 +- pydis_site/apps/resources/resources/python_morsels.yaml | 2 +- pydis_site/apps/resources/resources/python_subreddit.yaml | 2 +- pydis_site/apps/resources/resources/python_tricks.yaml | 2 +- pydis_site/apps/resources/resources/python_tutor.yaml | 2 +- pydis_site/apps/resources/resources/real_python.yaml | 2 +- pydis_site/apps/resources/resources/regex101.yaml | 2 +- pydis_site/apps/resources/resources/repl_it.yaml | 2 +- pydis_site/apps/resources/resources/screen_readers.yaml | 2 +- pydis_site/apps/resources/resources/sentdex.yaml | 2 +- pydis_site/apps/resources/resources/simple_guide_to_git.yaml | 2 +- pydis_site/apps/resources/resources/sololearn.yaml | 2 +- pydis_site/apps/resources/resources/spyder.yaml | 2 +- pydis_site/apps/resources/resources/sublime_text.yaml | 2 +- pydis_site/apps/resources/resources/talk_python_to_me.yaml | 2 +- pydis_site/apps/resources/resources/talon_voice.yaml | 2 +- pydis_site/apps/resources/resources/test_and_code.yaml | 2 +- pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml | 2 +- pydis_site/apps/resources/resources/the_real_python_podcast.yaml | 2 +- pydis_site/apps/resources/resources/think_python.yaml | 2 +- pydis_site/apps/resources/resources/thonny.yaml | 2 +- pydis_site/apps/resources/resources/two_scoops_of_django.yaml | 2 +- pydis_site/apps/resources/resources/university_of_michigan.yaml | 2 +- pydis_site/apps/resources/resources/university_of_toronto.yaml | 2 +- .../apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml | 2 +- pydis_site/apps/resources/resources/visual_studio_code.yaml | 2 +- pydis_site/apps/resources/resources/wtf_python.yaml | 2 +- pydis_site/apps/resources/views/resources.py | 8 ++++---- pydis_site/static/js/resources.js | 6 +++--- pydis_site/templates/resources/resource_box.html | 4 ++-- pydis_site/templates/resources/resources.html | 2 +- 75 files changed, 81 insertions(+), 81 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/adafruit.yaml b/pydis_site/apps/resources/resources/adafruit.yaml index e8eeee37..f9466bd8 100644 --- a/pydis_site/apps/resources/resources/adafruit.yaml +++ b/pydis_site/apps/resources/resources/adafruit.yaml @@ -14,7 +14,7 @@ tags: - microcontrollers payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/atom.yaml b/pydis_site/apps/resources/resources/atom.yaml index 3a46a45f..26e125b1 100644 --- a/pydis_site/apps/resources/resources/atom.yaml +++ b/pydis_site/apps/resources/resources/atom.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml index bc0e19ec..9bf9aba8 100644 --- a/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml @@ -15,7 +15,7 @@ tags: payment_tiers: - free - paid - complexity: + difficulty: - beginner type: - book diff --git a/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml index b93ef868..133033f7 100644 --- a/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - paid - complexity: + difficulty: - beginner type: - course diff --git a/pydis_site/apps/resources/resources/awesome_programming_discord.yaml b/pydis_site/apps/resources/resources/awesome_programming_discord.yaml index 4233f26e..0ef7aefc 100644 --- a/pydis_site/apps/resources/resources/awesome_programming_discord.yaml +++ b/pydis_site/apps/resources/resources/awesome_programming_discord.yaml @@ -11,7 +11,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/byte_of_python.yaml b/pydis_site/apps/resources/resources/byte_of_python.yaml index d2b8fa35..c4b671c2 100644 --- a/pydis_site/apps/resources/resources/byte_of_python.yaml +++ b/pydis_site/apps/resources/resources/byte_of_python.yaml @@ -16,7 +16,7 @@ tags: payment_tiers: - free - paid - complexity: + difficulty: - beginner type: - book diff --git a/pydis_site/apps/resources/resources/code_combat.yaml b/pydis_site/apps/resources/resources/code_combat.yaml index ab4a4aed..84597c4d 100644 --- a/pydis_site/apps/resources/resources/code_combat.yaml +++ b/pydis_site/apps/resources/resources/code_combat.yaml @@ -13,7 +13,7 @@ tags: payment_tiers: - free - subscription - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/corey_schafer.yaml b/pydis_site/apps/resources/resources/corey_schafer.yaml index cb20bc24..b73f4b5d 100644 --- a/pydis_site/apps/resources/resources/corey_schafer.yaml +++ b/pydis_site/apps/resources/resources/corey_schafer.yaml @@ -22,7 +22,7 @@ tags: - tooling payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml index 8ba95e9b..57e73a28 100644 --- a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml +++ b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml @@ -16,7 +16,7 @@ tags: - data science payment_tiers: - paid - complexity: + difficulty: - beginner type: - book diff --git a/pydis_site/apps/resources/resources/edublocks.yaml b/pydis_site/apps/resources/resources/edublocks.yaml index 9fd87945..3eaefc35 100644 --- a/pydis_site/apps/resources/resources/edublocks.yaml +++ b/pydis_site/apps/resources/resources/edublocks.yaml @@ -12,7 +12,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner type: - interactive diff --git a/pydis_site/apps/resources/resources/effective_python.yaml b/pydis_site/apps/resources/resources/effective_python.yaml index 4e361bcb..96a3b21a 100644 --- a/pydis_site/apps/resources/resources/effective_python.yaml +++ b/pydis_site/apps/resources/resources/effective_python.yaml @@ -15,7 +15,7 @@ tags: - software design payment_tiers: - paid - complexity: + difficulty: - intermediate type: - book diff --git a/pydis_site/apps/resources/resources/exercism.yaml b/pydis_site/apps/resources/resources/exercism.yaml index ba8cd2df..b8f53d72 100644 --- a/pydis_site/apps/resources/resources/exercism.yaml +++ b/pydis_site/apps/resources/resources/exercism.yaml @@ -13,7 +13,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/flask_web_development.yaml b/pydis_site/apps/resources/resources/flask_web_development.yaml index 95b75a5b..0bd418e5 100644 --- a/pydis_site/apps/resources/resources/flask_web_development.yaml +++ b/pydis_site/apps/resources/resources/flask_web_development.yaml @@ -14,7 +14,7 @@ tags: - web development payment_tiers: - paid - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/fluent_python.yaml b/pydis_site/apps/resources/resources/fluent_python.yaml index e35c0134..1d525baa 100644 --- a/pydis_site/apps/resources/resources/fluent_python.yaml +++ b/pydis_site/apps/resources/resources/fluent_python.yaml @@ -15,7 +15,7 @@ tags: - software design payment_tiers: - paid - complexity: + difficulty: - intermediate type: - book diff --git a/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml b/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml index 5dbcd387..06eb2c14 100644 --- a/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml +++ b/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml @@ -8,7 +8,7 @@ tags: - game development payment_tiers: - free - complexity: + difficulty: - beginner type: - tutorial diff --git a/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml b/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml index 85c061bd..6fab0114 100644 --- a/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml +++ b/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner type: - tutorial diff --git a/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml b/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml index 2565eedd..74b6efb9 100644 --- a/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml +++ b/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml @@ -8,7 +8,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - intermediate type: - tutorial diff --git a/pydis_site/apps/resources/resources/google_collab.yaml b/pydis_site/apps/resources/resources/google_collab.yaml index 65876c0e..067a79c9 100644 --- a/pydis_site/apps/resources/resources/google_collab.yaml +++ b/pydis_site/apps/resources/resources/google_collab.yaml @@ -10,7 +10,7 @@ tags: - data science payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml index bfac404a..c4b78af6 100644 --- a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml +++ b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml @@ -11,7 +11,7 @@ tags: - general payment_tiers: - paid - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/inferential_thinking.yaml b/pydis_site/apps/resources/resources/inferential_thinking.yaml index 20409f3a..a8cf2bc8 100644 --- a/pydis_site/apps/resources/resources/inferential_thinking.yaml +++ b/pydis_site/apps/resources/resources/inferential_thinking.yaml @@ -8,7 +8,7 @@ tags: - data science payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/jetbrains_academy.yaml b/pydis_site/apps/resources/resources/jetbrains_academy.yaml index 63c061ce..c3cb7657 100644 --- a/pydis_site/apps/resources/resources/jetbrains_academy.yaml +++ b/pydis_site/apps/resources/resources/jetbrains_academy.yaml @@ -12,7 +12,7 @@ tags: - data science payment_tiers: - subscription - complexity: + difficulty: - beginner type: - interactive diff --git a/pydis_site/apps/resources/resources/jetbrains_videos.yaml b/pydis_site/apps/resources/resources/jetbrains_videos.yaml index aba7c687..00d34e69 100644 --- a/pydis_site/apps/resources/resources/jetbrains_videos.yaml +++ b/pydis_site/apps/resources/resources/jetbrains_videos.yaml @@ -14,7 +14,7 @@ tags: - web development payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/jim_shaped_coding.yaml b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml index 30992ef2..c9727888 100644 --- a/pydis_site/apps/resources/resources/jim_shaped_coding.yaml +++ b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml @@ -15,7 +15,7 @@ tags: - web development payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml b/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml index a1907e0f..c8e72c6e 100644 --- a/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml +++ b/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml @@ -7,7 +7,7 @@ tags: - data science payment_tiers: - free - complexity: + difficulty: - intermediate type: - tutorial diff --git a/pydis_site/apps/resources/resources/kivy.yaml b/pydis_site/apps/resources/resources/kivy.yaml index 5d7d3844..dad29e9a 100644 --- a/pydis_site/apps/resources/resources/kivy.yaml +++ b/pydis_site/apps/resources/resources/kivy.yaml @@ -21,7 +21,7 @@ tags: - game development payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/microsoft.yaml b/pydis_site/apps/resources/resources/microsoft.yaml index cc5ca93f..e1d62955 100644 --- a/pydis_site/apps/resources/resources/microsoft.yaml +++ b/pydis_site/apps/resources/resources/microsoft.yaml @@ -12,7 +12,7 @@ tags: - tooling payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/microsoft_videos.yaml b/pydis_site/apps/resources/resources/microsoft_videos.yaml index 39187650..f45aef63 100644 --- a/pydis_site/apps/resources/resources/microsoft_videos.yaml +++ b/pydis_site/apps/resources/resources/microsoft_videos.yaml @@ -19,7 +19,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner type: - video diff --git a/pydis_site/apps/resources/resources/mission_python.yaml b/pydis_site/apps/resources/resources/mission_python.yaml index 4e7b30b0..e8e0a6b8 100644 --- a/pydis_site/apps/resources/resources/mission_python.yaml +++ b/pydis_site/apps/resources/resources/mission_python.yaml @@ -14,7 +14,7 @@ tags: - game development payment_tiers: - paid - complexity: + difficulty: - beginner type: - book diff --git a/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml b/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml index 4aa028ea..4e74936d 100644 --- a/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml +++ b/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml @@ -10,7 +10,7 @@ tags: payment_tiers: - free - paid - complexity: + difficulty: - beginner type: - course diff --git a/pydis_site/apps/resources/resources/mu_editor.yaml b/pydis_site/apps/resources/resources/mu_editor.yaml index 68c9b7db..b6318d0e 100644 --- a/pydis_site/apps/resources/resources/mu_editor.yaml +++ b/pydis_site/apps/resources/resources/mu_editor.yaml @@ -9,7 +9,7 @@ tags: - microcontrollers payment_tiers: - free - complexity: + difficulty: - beginner type: - tool diff --git a/pydis_site/apps/resources/resources/netbats_project_ideas.yaml b/pydis_site/apps/resources/resources/netbats_project_ideas.yaml index faa029f9..80ba771c 100644 --- a/pydis_site/apps/resources/resources/netbats_project_ideas.yaml +++ b/pydis_site/apps/resources/resources/netbats_project_ideas.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml index 5d3060a4..6313cabe 100644 --- a/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml +++ b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml @@ -13,7 +13,7 @@ tags: - data science payment_tiers: - paid - complexity: + difficulty: - intermediate type: - book diff --git a/pydis_site/apps/resources/resources/pallets.yaml b/pydis_site/apps/resources/resources/pallets.yaml index de3f7fad..0da2a625 100644 --- a/pydis_site/apps/resources/resources/pallets.yaml +++ b/pydis_site/apps/resources/resources/pallets.yaml @@ -12,7 +12,7 @@ tags: - web development payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/panda3d.yaml b/pydis_site/apps/resources/resources/panda3d.yaml index 0d488565..61ecba4b 100644 --- a/pydis_site/apps/resources/resources/panda3d.yaml +++ b/pydis_site/apps/resources/resources/panda3d.yaml @@ -16,7 +16,7 @@ tags: - game development payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/people_postgres_data.yaml b/pydis_site/apps/resources/resources/people_postgres_data.yaml index 70088af2..c2d63252 100644 --- a/pydis_site/apps/resources/resources/people_postgres_data.yaml +++ b/pydis_site/apps/resources/resources/people_postgres_data.yaml @@ -20,7 +20,7 @@ tags: - databases payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/podcast_dunder_init.yaml b/pydis_site/apps/resources/resources/podcast_dunder_init.yaml index ee3028a3..2751481a 100644 --- a/pydis_site/apps/resources/resources/podcast_dunder_init.yaml +++ b/pydis_site/apps/resources/resources/podcast_dunder_init.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/practical_python_programming.yaml b/pydis_site/apps/resources/resources/practical_python_programming.yaml index 85b3967a..12873b7c 100644 --- a/pydis_site/apps/resources/resources/practical_python_programming.yaml +++ b/pydis_site/apps/resources/resources/practical_python_programming.yaml @@ -12,7 +12,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner type: - course diff --git a/pydis_site/apps/resources/resources/pycharm.yaml b/pydis_site/apps/resources/resources/pycharm.yaml index 1fda3bff..574158bc 100644 --- a/pydis_site/apps/resources/resources/pycharm.yaml +++ b/pydis_site/apps/resources/resources/pycharm.yaml @@ -8,7 +8,7 @@ tags: payment_tiers: - free - paid - complexity: + difficulty: - intermediate type: - tool diff --git a/pydis_site/apps/resources/resources/pyglet.yaml b/pydis_site/apps/resources/resources/pyglet.yaml index d4a37fa8..a47c7e62 100644 --- a/pydis_site/apps/resources/resources/pyglet.yaml +++ b/pydis_site/apps/resources/resources/pyglet.yaml @@ -15,7 +15,7 @@ tags: - game development payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/python_bytes.yaml b/pydis_site/apps/resources/resources/python_bytes.yaml index 578fff2e..9beba4f4 100644 --- a/pydis_site/apps/resources/resources/python_bytes.yaml +++ b/pydis_site/apps/resources/resources/python_bytes.yaml @@ -8,7 +8,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/python_cheat_sheet.yaml b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml index da9b980f..56f61165 100644 --- a/pydis_site/apps/resources/resources/python_cheat_sheet.yaml +++ b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner type: - tutorial diff --git a/pydis_site/apps/resources/resources/python_cookbook.yaml b/pydis_site/apps/resources/resources/python_cookbook.yaml index 855adb2f..fbb1bdc8 100644 --- a/pydis_site/apps/resources/resources/python_cookbook.yaml +++ b/pydis_site/apps/resources/resources/python_cookbook.yaml @@ -15,7 +15,7 @@ tags: - software design payment_tiers: - paid - complexity: + difficulty: - intermediate type: - book diff --git a/pydis_site/apps/resources/resources/python_crash_course.yaml b/pydis_site/apps/resources/resources/python_crash_course.yaml index 379cf954..9de1a53c 100644 --- a/pydis_site/apps/resources/resources/python_crash_course.yaml +++ b/pydis_site/apps/resources/resources/python_crash_course.yaml @@ -21,7 +21,7 @@ tags: - game development payment_tiers: - paid - complexity: + difficulty: - beginner type: - book diff --git a/pydis_site/apps/resources/resources/python_developer_guide.yaml b/pydis_site/apps/resources/resources/python_developer_guide.yaml index f17c88ce..2806d75d 100644 --- a/pydis_site/apps/resources/resources/python_developer_guide.yaml +++ b/pydis_site/apps/resources/resources/python_developer_guide.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - intermediate type: - tutorial diff --git a/pydis_site/apps/resources/resources/python_discord_videos.yaml b/pydis_site/apps/resources/resources/python_discord_videos.yaml index bf44083f..15a04097 100644 --- a/pydis_site/apps/resources/resources/python_discord_videos.yaml +++ b/pydis_site/apps/resources/resources/python_discord_videos.yaml @@ -8,7 +8,7 @@ tags: - software design payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/python_morsels.yaml b/pydis_site/apps/resources/resources/python_morsels.yaml index de02be7f..bbc8133b 100644 --- a/pydis_site/apps/resources/resources/python_morsels.yaml +++ b/pydis_site/apps/resources/resources/python_morsels.yaml @@ -13,7 +13,7 @@ tags: - software design payment_tiers: - subscription - complexity: + difficulty: - intermediate type: - interactive diff --git a/pydis_site/apps/resources/resources/python_subreddit.yaml b/pydis_site/apps/resources/resources/python_subreddit.yaml index ef9f23d9..e94f84fc 100644 --- a/pydis_site/apps/resources/resources/python_subreddit.yaml +++ b/pydis_site/apps/resources/resources/python_subreddit.yaml @@ -9,7 +9,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/python_tricks.yaml b/pydis_site/apps/resources/resources/python_tricks.yaml index 17f40732..a38fa74b 100644 --- a/pydis_site/apps/resources/resources/python_tricks.yaml +++ b/pydis_site/apps/resources/resources/python_tricks.yaml @@ -13,7 +13,7 @@ tags: - software design payment_tiers: - paid - complexity: + difficulty: - intermediate type: - book diff --git a/pydis_site/apps/resources/resources/python_tutor.yaml b/pydis_site/apps/resources/resources/python_tutor.yaml index 4f6d5130..6bee0d69 100644 --- a/pydis_site/apps/resources/resources/python_tutor.yaml +++ b/pydis_site/apps/resources/resources/python_tutor.yaml @@ -6,7 +6,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/real_python.yaml b/pydis_site/apps/resources/resources/real_python.yaml index 1669638e..0d0b2ad3 100644 --- a/pydis_site/apps/resources/resources/real_python.yaml +++ b/pydis_site/apps/resources/resources/real_python.yaml @@ -15,7 +15,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/regex101.yaml b/pydis_site/apps/resources/resources/regex101.yaml index db3df957..45d00f1b 100644 --- a/pydis_site/apps/resources/resources/regex101.yaml +++ b/pydis_site/apps/resources/resources/regex101.yaml @@ -8,7 +8,7 @@ tags: - other payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/repl_it.yaml b/pydis_site/apps/resources/resources/repl_it.yaml index e1ba1d19..e0f6cbb3 100644 --- a/pydis_site/apps/resources/resources/repl_it.yaml +++ b/pydis_site/apps/resources/resources/repl_it.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/screen_readers.yaml b/pydis_site/apps/resources/resources/screen_readers.yaml index 9673a132..b086b301 100644 --- a/pydis_site/apps/resources/resources/screen_readers.yaml +++ b/pydis_site/apps/resources/resources/screen_readers.yaml @@ -10,7 +10,7 @@ tags: payment_tiers: - free - paid - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/sentdex.yaml b/pydis_site/apps/resources/resources/sentdex.yaml index 47a8852d..d9131039 100644 --- a/pydis_site/apps/resources/resources/sentdex.yaml +++ b/pydis_site/apps/resources/resources/sentdex.yaml @@ -24,7 +24,7 @@ tags: - data science payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/simple_guide_to_git.yaml b/pydis_site/apps/resources/resources/simple_guide_to_git.yaml index 6dacdf5c..3bb46e6d 100644 --- a/pydis_site/apps/resources/resources/simple_guide_to_git.yaml +++ b/pydis_site/apps/resources/resources/simple_guide_to_git.yaml @@ -8,7 +8,7 @@ tags: - tooling payment_tiers: - free - complexity: + difficulty: - beginner type: - tutorial diff --git a/pydis_site/apps/resources/resources/sololearn.yaml b/pydis_site/apps/resources/resources/sololearn.yaml index b9b59bca..998f5368 100644 --- a/pydis_site/apps/resources/resources/sololearn.yaml +++ b/pydis_site/apps/resources/resources/sololearn.yaml @@ -10,7 +10,7 @@ tags: payment_tiers: - free - subscription - complexity: + difficulty: - beginner type: - interactive diff --git a/pydis_site/apps/resources/resources/spyder.yaml b/pydis_site/apps/resources/resources/spyder.yaml index 8dc05542..668e9306 100644 --- a/pydis_site/apps/resources/resources/spyder.yaml +++ b/pydis_site/apps/resources/resources/spyder.yaml @@ -7,7 +7,7 @@ tags: - data science payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/sublime_text.yaml b/pydis_site/apps/resources/resources/sublime_text.yaml index 76aeac45..05596477 100644 --- a/pydis_site/apps/resources/resources/sublime_text.yaml +++ b/pydis_site/apps/resources/resources/sublime_text.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/talk_python_to_me.yaml b/pydis_site/apps/resources/resources/talk_python_to_me.yaml index 00726203..509922c3 100644 --- a/pydis_site/apps/resources/resources/talk_python_to_me.yaml +++ b/pydis_site/apps/resources/resources/talk_python_to_me.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/talon_voice.yaml b/pydis_site/apps/resources/resources/talon_voice.yaml index 0f28a328..3be5fe20 100644 --- a/pydis_site/apps/resources/resources/talon_voice.yaml +++ b/pydis_site/apps/resources/resources/talon_voice.yaml @@ -8,7 +8,7 @@ tags: - other payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/test_and_code.yaml b/pydis_site/apps/resources/resources/test_and_code.yaml index efe0c218..f0d1c3b3 100644 --- a/pydis_site/apps/resources/resources/test_and_code.yaml +++ b/pydis_site/apps/resources/resources/test_and_code.yaml @@ -8,7 +8,7 @@ tags: - tooling payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml b/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml index 514da947..151768a5 100644 --- a/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml +++ b/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml @@ -6,7 +6,7 @@ tags: - web development payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/the_real_python_podcast.yaml b/pydis_site/apps/resources/resources/the_real_python_podcast.yaml index 62ba32ce..647779d5 100644 --- a/pydis_site/apps/resources/resources/the_real_python_podcast.yaml +++ b/pydis_site/apps/resources/resources/the_real_python_podcast.yaml @@ -9,7 +9,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/think_python.yaml b/pydis_site/apps/resources/resources/think_python.yaml index aceaf951..f9211308 100644 --- a/pydis_site/apps/resources/resources/think_python.yaml +++ b/pydis_site/apps/resources/resources/think_python.yaml @@ -18,7 +18,7 @@ tags: - software design payment_tiers: - paid - complexity: + difficulty: - beginner type: - book diff --git a/pydis_site/apps/resources/resources/thonny.yaml b/pydis_site/apps/resources/resources/thonny.yaml index a60e4d1b..29ba9e07 100644 --- a/pydis_site/apps/resources/resources/thonny.yaml +++ b/pydis_site/apps/resources/resources/thonny.yaml @@ -8,7 +8,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner type: - tool diff --git a/pydis_site/apps/resources/resources/two_scoops_of_django.yaml b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml index 4eadc28d..63730ac9 100644 --- a/pydis_site/apps/resources/resources/two_scoops_of_django.yaml +++ b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml @@ -14,7 +14,7 @@ tags: - web development payment_tiers: - paid - complexity: + difficulty: - intermediate type: - book diff --git a/pydis_site/apps/resources/resources/university_of_michigan.yaml b/pydis_site/apps/resources/resources/university_of_michigan.yaml index 843b64ed..7aaaf2ae 100644 --- a/pydis_site/apps/resources/resources/university_of_michigan.yaml +++ b/pydis_site/apps/resources/resources/university_of_michigan.yaml @@ -7,7 +7,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner type: - course diff --git a/pydis_site/apps/resources/resources/university_of_toronto.yaml b/pydis_site/apps/resources/resources/university_of_toronto.yaml index d057eb39..94df96f2 100644 --- a/pydis_site/apps/resources/resources/university_of_toronto.yaml +++ b/pydis_site/apps/resources/resources/university_of_toronto.yaml @@ -13,7 +13,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml index 02f9fe5a..1a3dd457 100644 --- a/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml +++ b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml @@ -8,7 +8,7 @@ tags: - discord bots payment_tiers: - free - complexity: + difficulty: - intermediate type: - tutorial diff --git a/pydis_site/apps/resources/resources/visual_studio_code.yaml b/pydis_site/apps/resources/resources/visual_studio_code.yaml index f09efcf8..3cf858f8 100644 --- a/pydis_site/apps/resources/resources/visual_studio_code.yaml +++ b/pydis_site/apps/resources/resources/visual_studio_code.yaml @@ -6,7 +6,7 @@ tags: - general payment_tiers: - free - complexity: + difficulty: - beginner - intermediate type: diff --git a/pydis_site/apps/resources/resources/wtf_python.yaml b/pydis_site/apps/resources/resources/wtf_python.yaml index 7f67ccf9..6d90ba39 100644 --- a/pydis_site/apps/resources/resources/wtf_python.yaml +++ b/pydis_site/apps/resources/resources/wtf_python.yaml @@ -12,7 +12,7 @@ tags: - other payment_tiers: - free - complexity: + difficulty: - intermediate type: - tutorial diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 57cb4f71..14b3d0bf 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -28,7 +28,7 @@ class ResourceView(View): resource_tags = { "topics": set(), "payment_tiers": set(), - "complexity": set(), + "difficulty": set(), "type": set(), } for resource_name, resource in self.resources.items(): @@ -53,8 +53,8 @@ class ResourceView(View): # Set up all the filter checkbox metadata self.filters = { - "Complexity": { - "filters": sorted(resource_tags.get("complexity")), + "Difficulty": { + "filters": sorted(resource_tags.get("difficulty")), "icon": "fas fa-brain", "hidden": False, }, @@ -84,7 +84,7 @@ class ResourceView(View): ('topics', 'topics'), ('type', 'type'), ('payment_tiers', 'payment'), - ('complexity', 'complexity'), + ('difficulty', 'difficulty'), ) } diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index 89b8ae06..eaca3978 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -5,7 +5,7 @@ var activeFilters = { topics: [], type: [], "payment-tiers": [], - complexity: [] + difficulty: [] }; function addFilter(filterName, filterItem) { @@ -45,7 +45,7 @@ function noFilters() { activeFilters.topics.length === 0 && activeFilters.type.length === 0 && activeFilters["payment-tiers"].length === 0 && - activeFilters.complexity.length === 0 + activeFilters.difficulty.length === 0 ); } @@ -120,7 +120,7 @@ function updateUI() { topics: false, type: false, 'payment-tiers': false, - complexity: false + difficulty: false }; let resourceBox = $(this); diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index 476a4841..8a1017b5 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -64,10 +64,10 @@ {{ tag|title }} {% endfor %} - {% for tag in resource.tags.complexity %} + {% for tag in resource.tags.difficulty %} diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 166863c3..9ebebe1f 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -29,7 +29,7 @@
    {% for filter_name, filter_data in filters.items %} {% for filter_item in filter_data.filters %} - {% if filter_name == "Complexity" %} + {% if filter_name == "Difficulty" %} Date: Sat, 29 Jan 2022 14:55:01 +0100 Subject: Sort all the resources alphabetically. --- pydis_site/apps/resources/tests/test_views.py | 1 - pydis_site/apps/resources/views/resources.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py index f96a04b0..dab3599d 100644 --- a/pydis_site/apps/resources/tests/test_views.py +++ b/pydis_site/apps/resources/tests/test_views.py @@ -1,5 +1,4 @@ from pathlib import Path -from unittest.mock import patch from django.conf import settings from django.test import TestCase diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 14b3d0bf..d0b8bae7 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -2,7 +2,7 @@ from pathlib import Path import yaml from django.core.handlers.wsgi import WSGIRequest -from django.http import HttpRequest, HttpResponse +from django.http import HttpResponse from django.shortcuts import render from django.views import View @@ -24,6 +24,9 @@ class ResourceView(View): for path in RESOURCES_PATH.rglob("*.yaml") } + # Sort the resources alphabetically + self.resources = dict(sorted(self.resources.items())) + # Parse out all current tags resource_tags = { "topics": set(), -- cgit v1.2.3 From 92db284aab0ac64c7783a6019d2eb697ce973e95 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 16:02:17 +0100 Subject: Add redirects for all old resource endpoints. This will maintain backwards compatibility once this is merged. --- pydis_site/apps/redirect/redirects.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/apps/redirect/redirects.yaml b/pydis_site/apps/redirect/redirects.yaml index 8022e7bf..bee65103 100644 --- a/pydis_site/apps/redirect/redirects.yaml +++ b/pydis_site/apps/redirect/redirects.yaml @@ -87,6 +87,34 @@ resources_index_redirect: original_path: pages/resources/ redirect_route: "resources:index" +resources_reading_redirect: + original_path: resources/reading/ + redirect_route: "resources:index" + +resources_videos_redirect: + original_path: resources/videos/ + redirect_route: "resources:index" + +resources_interactive_redirect: + original_path: resources/interactive/ + redirect_route: "resources:index" + +resources_courses_redirect: + original_path: resources/courses/ + redirect_route: "resources:index" + +resources_communities_redirect: + original_path: resources/communities/ + redirect_route: "resources:index" + +resources_podcasts_redirect: + original_path: resources/podcasts/ + redirect_route: "resources:index" + +resources_tools_redirect: + original_path: resources/tools/ + redirect_route: "resources:index" + # Events events_index_redirect: original_path: pages/events/ -- cgit v1.2.3 From e53a3a15d0213b3854a3c9619390f0a0e35c4bf6 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 11:41:44 +0100 Subject: Redirects from old endpoints now filter correctly. For example, navigating to pydis.com/resources/communities will now correctly redirect to pydis.com/resources/?type=community. --- pydis_site/apps/redirect/redirects.yaml | 10 ++++++---- pydis_site/apps/resources/urls.py | 1 + pydis_site/apps/resources/views/resources.py | 25 ++++++++----------------- pydis_site/static/js/resources.js | 8 ++++++++ pydis_site/templates/resources/resources.html | 1 + 5 files changed, 24 insertions(+), 21 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/redirect/redirects.yaml b/pydis_site/apps/redirect/redirects.yaml index bee65103..533b9e25 100644 --- a/pydis_site/apps/redirect/redirects.yaml +++ b/pydis_site/apps/redirect/redirects.yaml @@ -90,30 +90,32 @@ resources_index_redirect: resources_reading_redirect: original_path: resources/reading/ redirect_route: "resources:index" + redirect_arguments: ["book"] resources_videos_redirect: original_path: resources/videos/ redirect_route: "resources:index" - -resources_interactive_redirect: - original_path: resources/interactive/ - redirect_route: "resources:index" + redirect_arguments: ["video"] resources_courses_redirect: original_path: resources/courses/ redirect_route: "resources:index" + redirect_arguments: ["course"] resources_communities_redirect: original_path: resources/communities/ redirect_route: "resources:index" + redirect_arguments: ["community"] resources_podcasts_redirect: original_path: resources/podcasts/ redirect_route: "resources:index" + redirect_arguments: ["podcast"] resources_tools_redirect: original_path: resources/tools/ redirect_route: "resources:index" + redirect_arguments: ["tool"] # Events events_index_redirect: diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index 5d5ae7fb..ed24dc99 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -5,4 +5,5 @@ from pydis_site.apps.resources import views app_name = "resources" urlpatterns = [ distill_path("", views.resources.ResourceView.as_view(), name="index"), + distill_path("/", views.resources.ResourceView.as_view(), name="index"), ] diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index d0b8bae7..b828d89a 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,8 +1,9 @@ from pathlib import Path +import typing as t import yaml from django.core.handlers.wsgi import WSGIRequest -from django.http import HttpResponse +from django.http import HttpResponse, HttpResponseNotFound from django.shortcuts import render from django.views import View @@ -78,22 +79,12 @@ class ResourceView(View): } } - @staticmethod - def _get_filter_options(request: WSGIRequest) -> dict[str, set]: - """Get the requested filter options out of the request object.""" - return { - option: set(request.GET.get(url_param, "").split(",")[:-1]) - for option, url_param in ( - ('topics', 'topics'), - ('type', 'type'), - ('payment_tiers', 'payment'), - ('difficulty', 'difficulty'), - ) - } - - def get(self, request: WSGIRequest) -> HttpResponse: + def get(self, request: WSGIRequest, resource_type: t.Optional[str] = None) -> HttpResponse: """List out all the resources, and any filtering options from the URL.""" - filter_options = self._get_filter_options(request) + + # Add type filtering if the request is made to somewhere like /resources/video + if resource_type and resource_type.title() not in self.filters['Type']['filters']: + return HttpResponseNotFound() return render( request, @@ -101,6 +92,6 @@ class ResourceView(View): context={ "resources": self.resources, "filters": self.filters, - "filter_options": filter_options, + "resource_type": resource_type, } ) diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index eaca3978..bf570097 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -160,6 +160,14 @@ function updateUI() { // Executed when the page has finished loading. document.addEventListener("DOMContentLoaded", function () { + /* Check if the user has navigated to one of the old resource pages, + like pydis.com/resources/communities. In this case, we'll rewrite + the URL before we do anything else. */ + let resourceTypeInput = $("#resource-type-input").val(); + if (resourceTypeInput.length !== 0) { + window.history.replaceState(null, document.title, `../?type=${resourceTypeInput}`); + } + // Update the filters on page load to reflect URL parameters. $('.filter-box-tag').hide(); deserializeURLParams(); diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 9ebebe1f..7a284fd6 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -16,6 +16,7 @@ {% block content %} {% include "base/navbar.html" %} +
    {# Filtering toolbox #} -- cgit v1.2.3 From 05a8f9a193b451cdf0333b16cf2d525e9d6eb8f4 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 12:01:58 +0100 Subject: Don't redirect if the resource_type is None! --- pydis_site/static/js/resources.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index bf570097..bfcd569d 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -113,7 +113,6 @@ function updateUI() { // Otherwise, hide everything and then filter the resources to decide what to show. let hasMatches = false; - console.log(hasMatches); resources.hide(); resources.filter(function() { let validation = { @@ -164,7 +163,7 @@ document.addEventListener("DOMContentLoaded", function () { like pydis.com/resources/communities. In this case, we'll rewrite the URL before we do anything else. */ let resourceTypeInput = $("#resource-type-input").val(); - if (resourceTypeInput.length !== 0) { + if (resourceTypeInput !== "None") { window.history.replaceState(null, document.title, `../?type=${resourceTypeInput}`); } -- cgit v1.2.3 From aa1420aeb91a9663a714cdceb0f957d9837740e7 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 12:33:20 +0100 Subject: Clean up hover effects. - We now have a hover effect for all icons. - We also now support hover effects for all tags. - However, we don't have any hover effect for icons in titles. That just looks weird. Additionally, we're getting rid of some bloat and consolidating the CSS into one place. --- pydis_site/static/css/resources/resources.css | 48 ++++++++++++++++++ pydis_site/static/css/resources/resources_list.css | 57 ---------------------- pydis_site/templates/resources/resource_box.html | 4 +- 3 files changed, 50 insertions(+), 59 deletions(-) delete mode 100644 pydis_site/static/css/resources/resources_list.css (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index db083a41..7038d0d7 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -1,3 +1,45 @@ +/* Colors for icons */ +i.resource-icon.is-orangered { + color: #FE640A; +} +i.resource-icon.is-blurple { + color: #7289DA; +} +i.resource-icon.is-teal { + color: #95DBE5; +} +i.resource-icon.is-youtube-red { + color: #BB0000; +} +i.resource-icon.is-black { + color: #2c3334; +} + +/* Colors when icons are hovered */ +i.resource-icon.is-hoverable:hover { + filter: brightness(125%); +} +i.resource-icon.is-hoverable.is-black:hover { + filter: brightness(170%); +} +i.resource-icon.is-hoverable.is-teal:hover { + filter: brightness(80%); +} + +/* Icon padding */ +.breadcrumb-section { + padding: 1rem; +} +i.has-icon-padding { + padding: 0 10px 25px 0; +} +#tab-content p { + display: none; +} +#tab-content p.is-active { +display: block; +} + /* Disable highlighting for all text in the filters. */ .filter-checkbox, .filter-panel label, @@ -57,6 +99,12 @@ span.filter-box-tag { user-select: none; } +/* When hovering tags, brighten them a bit. */ +.resource-tag:hover, +.filter-box-tag:hover { + filter: brightness(95%); +} + /* Move the x down 1 pixel to align center */ button.delete { margin-top: 1px; diff --git a/pydis_site/static/css/resources/resources_list.css b/pydis_site/static/css/resources/resources_list.css deleted file mode 100644 index c2151bee..00000000 --- a/pydis_site/static/css/resources/resources_list.css +++ /dev/null @@ -1,57 +0,0 @@ -.breadcrumb-section { - padding: 1rem; -} - -i.resource-icon.is-orangered { - color: #FE640A; -} - -i.resource-icon.is-orangered:hover { - color: #fe9840; -} - -i.resource-icon.is-blurple { - color: #7289DA; -} - -i.resource-icon.is-blurple:hover { - color: #93a8da; -} - -i.resource-icon.is-teal { - color: #95DBE5; -} - -i.resource-icon.is-teal:hover { - color: #a9f5ff; -} - -i.resource-icon.is-youtube-red { - color: #BB0000; -} - -i.resource-icon.is-youtube-red:hover { - color: #f80000; -} - -i.resource-icon.is-goodreads-cream, -i.resource-icon.is-black { - color: #2c3334; -} - -i.resource-icon.is-goodreads-cream:hover, -i.resource-icon.is-black:hover { - color: #475d6d; -} - -i.has-icon-padding { - padding: 0 10px 25px 0; -} - -#tab-content p { - display: none; -} - -#tab-content p.is-active { -display: block; -} diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index 8a1017b5..b06ffd31 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -18,7 +18,7 @@ {% if 'title_url' in resource %} - + {% endif %} @@ -27,7 +27,7 @@ {% for icon in resource.urls %} - + {% endfor %} -- cgit v1.2.3 From d8c5571a266438d5e2e0c9fd4a35adf469688730 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 12:34:29 +0100 Subject: Support dashful redirects. Previously, trying to go to `resources/project%20ideas` would crash the filtering JS. This has now been sorted out, so that these types of redirects have their spaces replaced by dashes, which makes them valid again. --- pydis_site/apps/resources/views/resources.py | 7 +++++-- pydis_site/static/js/resources.js | 11 +++++------ pydis_site/templates/resources/resources.html | 1 - 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index b828d89a..709fad6c 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -82,9 +82,12 @@ class ResourceView(View): def get(self, request: WSGIRequest, resource_type: t.Optional[str] = None) -> HttpResponse: """List out all the resources, and any filtering options from the URL.""" - # Add type filtering if the request is made to somewhere like /resources/video - if resource_type and resource_type.title() not in self.filters['Type']['filters']: + # Add type filtering if the request is made to somewhere like /resources/video. + # We also convert all spaces to dashes, so they'll correspond with the filters. + dashless_resource_type = resource_type.replace("-", " ") + if resource_type and dashless_resource_type.title() not in self.filters['Type']['filters']: return HttpResponseNotFound() + resource_type = resource_type.replace(" ", "-") return render( request, diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index bfcd569d..34587c81 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -64,9 +64,9 @@ function deserializeURLParams() { // Update the corresponding filter UI, so it reflects the internal state. $(paramFilterArray).each(function(_, filter) { - let checkbox = $(`.filter-checkbox[data-filter-name=${filterType}][data-filter-item=${filter}]`); - let filterTag = $(`.filter-box-tag[data-filter-name=${filterType}][data-filter-item=${filter}]`); - let resourceTags = $(`.resource-tag[data-filter-name=${filterType}][data-filter-item=${filter}]`); + let checkbox = $(`.filter-checkbox[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + let filterTag = $(`.filter-box-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + let resourceTags = $(`.resource-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); checkbox.prop("checked", true); filterTag.show(); resourceTags.addClass("active"); @@ -149,7 +149,6 @@ function updateUI() { }).show(); // If there are no matches, show the no matches message - console.log(hasMatches); if (!hasMatches) { $(".no-resources-found").show(); } else { @@ -196,7 +195,7 @@ document.addEventListener("DOMContentLoaded", function () { $('.filter-box-tag').click(function() { let filterItem = this.dataset.filterItem; let filterName = this.dataset.filterName; - let checkbox = $(`.filter-checkbox[data-filter-name=${filterName}][data-filter-item=${filterItem}]`); + let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); removeFilter(filterName, filterItem); checkbox.prop("checked", false); @@ -206,7 +205,7 @@ document.addEventListener("DOMContentLoaded", function () { $('.resource-tag').click(function() { let filterItem = this.dataset.filterItem; let filterName = this.dataset.filterName; - let checkbox = $(`.filter-checkbox[data-filter-name=${filterName}][data-filter-item=${filterItem}]`) + let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); if (!$(this).hasClass("active")) { addFilter(filterName, filterItem); diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 7a284fd6..4dd07270 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -7,7 +7,6 @@ {% block title %}Resources{% endblock %} {% block head %} - -- cgit v1.2.3 From 8e8a19eef5e5ae0bd88528e8600568957d7fef75 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 12:35:09 +0100 Subject: Replace is-goodreads-cream with is-black. The goodreads cream, while nice, has poor readability on a light background. So I'm ditching it and just going black with those icons. --- .../apps/resources/resources/automate_the_boring_stuff_book.yaml | 2 +- pydis_site/apps/resources/resources/byte_of_python.yaml | 2 +- pydis_site/apps/resources/resources/data_science_from_scratch.yaml | 2 +- pydis_site/apps/resources/resources/effective_python.yaml | 2 +- pydis_site/apps/resources/resources/flask_web_development.yaml | 2 +- pydis_site/apps/resources/resources/fluent_python.yaml | 2 +- pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml | 2 +- pydis_site/apps/resources/resources/mission_python.yaml | 2 +- .../resources/resources/neural_networks_from_scratch_in_python.yaml | 2 +- pydis_site/apps/resources/resources/python_cookbook.yaml | 2 +- pydis_site/apps/resources/resources/python_crash_course.yaml | 2 +- pydis_site/apps/resources/resources/python_tricks.yaml | 2 +- pydis_site/apps/resources/resources/real_python.yaml | 3 --- pydis_site/apps/resources/resources/think_python.yaml | 2 +- pydis_site/apps/resources/resources/two_scoops_of_django.yaml | 2 +- pydis_site/apps/resources/resources/university_of_toronto.yaml | 1 + 16 files changed, 15 insertions(+), 17 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml index 9bf9aba8..63f63193 100644 --- a/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml @@ -8,7 +8,7 @@ title_url: https://automatetheboringstuff.com/ urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python - color: goodreads-cream + color: black tags: topics: - general diff --git a/pydis_site/apps/resources/resources/byte_of_python.yaml b/pydis_site/apps/resources/resources/byte_of_python.yaml index c4b671c2..c2f6ab84 100644 --- a/pydis_site/apps/resources/resources/byte_of_python.yaml +++ b/pydis_site/apps/resources/resources/byte_of_python.yaml @@ -9,7 +9,7 @@ urls: color: black - icon: branding/goodreads url: https://www.goodreads.com/book/show/6762544-a-byte-of-python - color: goodreads-cream + color: black tags: topics: - general diff --git a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml index 57e73a28..86955fdb 100644 --- a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml +++ b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml @@ -7,7 +7,7 @@ title_url: https://www.oreilly.com/library/view/data-science-from/9781492041122/ urls: - icon: branding/goodreads url: https://www.goodreads.com/en/book/show/52059715-data-science-from-scratch - color: goodreads-cream + color: black - icon: branding/github url: https://github.com/joelgrus/data-science-from-scratch color: black diff --git a/pydis_site/apps/resources/resources/effective_python.yaml b/pydis_site/apps/resources/resources/effective_python.yaml index 96a3b21a..b82fa0c3 100644 --- a/pydis_site/apps/resources/resources/effective_python.yaml +++ b/pydis_site/apps/resources/resources/effective_python.yaml @@ -5,7 +5,7 @@ title_url: https://effectivepython.com/ urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/48566725-effective-python - color: goodreads-cream + color: black - icon: branding/github url: https://github.com/bslatkin/effectivepython color: black diff --git a/pydis_site/apps/resources/resources/flask_web_development.yaml b/pydis_site/apps/resources/resources/flask_web_development.yaml index 0bd418e5..6905b2b4 100644 --- a/pydis_site/apps/resources/resources/flask_web_development.yaml +++ b/pydis_site/apps/resources/resources/flask_web_development.yaml @@ -5,7 +5,7 @@ title_url: http://shop.oreilly.com/product/0636920031116.do urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/18774655-flask-web-development - color: goodreads-cream + color: black - icon: branding/github url: https://github.com/miguelgrinberg/flasky color: black diff --git a/pydis_site/apps/resources/resources/fluent_python.yaml b/pydis_site/apps/resources/resources/fluent_python.yaml index 1d525baa..c22fd388 100644 --- a/pydis_site/apps/resources/resources/fluent_python.yaml +++ b/pydis_site/apps/resources/resources/fluent_python.yaml @@ -5,7 +5,7 @@ title_url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/22800567-fluent-python - color: goodreads-cream + color: black - icon: branding/github url: https://github.com/fluentpython color: black diff --git a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml index c4b78af6..e48e5717 100644 --- a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml +++ b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml @@ -5,7 +5,7 @@ title_url: https://python-guide.org/ urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/28321007-the-hitchhiker-s-guide-to-python - color: goodreads-cream + color: black tags: topics: - general diff --git a/pydis_site/apps/resources/resources/mission_python.yaml b/pydis_site/apps/resources/resources/mission_python.yaml index e8e0a6b8..391a2983 100644 --- a/pydis_site/apps/resources/resources/mission_python.yaml +++ b/pydis_site/apps/resources/resources/mission_python.yaml @@ -7,7 +7,7 @@ title_url: https://www.sean.co.uk/books/mission-python/index.shtm urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/35545850-mission-python - color: goodreads-cream + color: black tags: topics: - general diff --git a/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml index 6313cabe..c4ad1e1b 100644 --- a/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml +++ b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml @@ -7,7 +7,7 @@ title_url: https://nnfs.io/ urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/55927899-neural-networks-from-scratch-in-python - color: goodreads-cream + color: black tags: topics: - data science diff --git a/pydis_site/apps/resources/resources/python_cookbook.yaml b/pydis_site/apps/resources/resources/python_cookbook.yaml index fbb1bdc8..bc05d743 100644 --- a/pydis_site/apps/resources/resources/python_cookbook.yaml +++ b/pydis_site/apps/resources/resources/python_cookbook.yaml @@ -5,7 +5,7 @@ title_url: http://shop.oreilly.com/product/0636920027072.do urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/17152735-python-cookbook - color: goodreads-cream + color: black - icon: branding/github url: https://github.com/dabeaz/python-cookbook color: black diff --git a/pydis_site/apps/resources/resources/python_crash_course.yaml b/pydis_site/apps/resources/resources/python_crash_course.yaml index 9de1a53c..d916075e 100644 --- a/pydis_site/apps/resources/resources/python_crash_course.yaml +++ b/pydis_site/apps/resources/resources/python_crash_course.yaml @@ -11,7 +11,7 @@ title_url: https://nostarch.com/pythoncrashcourse2e urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/23241059-python-crash-course - color: goodreads-cream + color: black - icon: branding/github url: https://ehmatthes.github.io/pcc/ color: black diff --git a/pydis_site/apps/resources/resources/python_tricks.yaml b/pydis_site/apps/resources/resources/python_tricks.yaml index a38fa74b..aa1b2fcd 100644 --- a/pydis_site/apps/resources/resources/python_tricks.yaml +++ b/pydis_site/apps/resources/resources/python_tricks.yaml @@ -6,7 +6,7 @@ title_url: https://realpython.com/products/python-tricks-book/ urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/36990732-python-tricks - color: goodreads-cream + color: black tags: topics: - general diff --git a/pydis_site/apps/resources/resources/real_python.yaml b/pydis_site/apps/resources/resources/real_python.yaml index 0d0b2ad3..2ddada03 100644 --- a/pydis_site/apps/resources/resources/real_python.yaml +++ b/pydis_site/apps/resources/resources/real_python.yaml @@ -4,9 +4,6 @@ title_image: https://i.imgur.com/WDqhZ36.png title_url: https://realpython.com/ position: 3 urls: - - icon: regular/link - url: https://realpython.com/ - color: teal - icon: branding/youtube url: https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA color: youtube-red diff --git a/pydis_site/apps/resources/resources/think_python.yaml b/pydis_site/apps/resources/resources/think_python.yaml index f9211308..7099afd8 100644 --- a/pydis_site/apps/resources/resources/think_python.yaml +++ b/pydis_site/apps/resources/resources/think_python.yaml @@ -8,7 +8,7 @@ title_url: https://greenteapress.com/wp/think-python-2e/ urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/14514306-think-python - color: goodreads-cream + color: black - icon: branding/github url: https://github.com/AllenDowney/ThinkPython2 color: black diff --git a/pydis_site/apps/resources/resources/two_scoops_of_django.yaml b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml index 63730ac9..96eafd28 100644 --- a/pydis_site/apps/resources/resources/two_scoops_of_django.yaml +++ b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml @@ -5,7 +5,7 @@ title_url: https://www.feldroy.com/collections/everything/products/two-scoops-of urls: - icon: branding/goodreads url: https://www.goodreads.com/book/show/55822151-two-scoops-of-django-3-x - color: goodreads-cream + color: black - icon: branding/github url: https://github.com/twoscoops/two-scoops-of-django-2.0-code-examples color: black diff --git a/pydis_site/apps/resources/resources/university_of_toronto.yaml b/pydis_site/apps/resources/resources/university_of_toronto.yaml index 94df96f2..c3b54f84 100644 --- a/pydis_site/apps/resources/resources/university_of_toronto.yaml +++ b/pydis_site/apps/resources/resources/university_of_toronto.yaml @@ -1,6 +1,7 @@ description: A 2-part course that teaches Python. Primarily intended for high school students and first-year university students who want to learn programming. name: 'University of Toronto: Learn to Program' +title_url: https://www.coursera.org/learn/learn-to-program urls: - icon: regular/graduation-cap url: https://www.coursera.org/learn/learn-to-program -- cgit v1.2.3 From 7183fa95f079c132383c8d4e3aace79aade1f5ff Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 12:38:07 +0100 Subject: Add plural redirects, like /books. This is an intuitive thing to link to, so let's support it for better UX --- pydis_site/apps/redirect/redirects.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/apps/redirect/redirects.yaml b/pydis_site/apps/redirect/redirects.yaml index 533b9e25..dc8b9359 100644 --- a/pydis_site/apps/redirect/redirects.yaml +++ b/pydis_site/apps/redirect/redirects.yaml @@ -92,6 +92,11 @@ resources_reading_redirect: redirect_route: "resources:index" redirect_arguments: ["book"] +resources_books_redirect: + original_path: resources/books/ + redirect_route: "resources:index" + redirect_arguments: [ "book" ] + resources_videos_redirect: original_path: resources/videos/ redirect_route: "resources:index" @@ -112,6 +117,11 @@ resources_podcasts_redirect: redirect_route: "resources:index" redirect_arguments: ["podcast"] +resources_tutorials_redirect: + original_path: resources/tutorials/ + redirect_route: "resources:index" + redirect_arguments: ["tutorial"] + resources_tools_redirect: original_path: resources/tools/ redirect_route: "resources:index" -- cgit v1.2.3 From bb401838ef8fa135a51d6a735dbbc3cc812d5e6c Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 12:42:06 +0100 Subject: Ensure "Other" is always the bottom topic. --- pydis_site/apps/resources/views/resources.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 709fad6c..a5c2cf7c 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,5 +1,5 @@ -from pathlib import Path import typing as t +from pathlib import Path import yaml from django.core.handlers.wsgi import WSGIRequest @@ -79,15 +79,21 @@ class ResourceView(View): } } + # The bottom topic should always be "Other". + self.filters["Topics"]["filters"].remove("Other") + self.filters["Topics"]["filters"].append("Other") + def get(self, request: WSGIRequest, resource_type: t.Optional[str] = None) -> HttpResponse: """List out all the resources, and any filtering options from the URL.""" - # Add type filtering if the request is made to somewhere like /resources/video. # We also convert all spaces to dashes, so they'll correspond with the filters. - dashless_resource_type = resource_type.replace("-", " ") - if resource_type and dashless_resource_type.title() not in self.filters['Type']['filters']: - return HttpResponseNotFound() - resource_type = resource_type.replace(" ", "-") + if resource_type: + dashless_resource_type = resource_type.replace("-", " ") + + if dashless_resource_type.title() not in self.filters['Type']['filters']: + return HttpResponseNotFound() + + resource_type = resource_type.replace(" ", "-") return render( request, -- cgit v1.2.3 From 2cbaeb129b793fa3dc162258dd4e60781e35d5f1 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 13:04:58 +0100 Subject: Show a duck pond when no filters match. --- pydis_site/static/css/resources/resources.css | 7 +++++++ pydis_site/static/images/resources/duck_pond_404.png | Bin 0 -> 2371374 bytes pydis_site/templates/resources/resources.html | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 pydis_site/static/images/resources/duck_pond_404.png (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 7038d0d7..b48beca6 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -93,6 +93,13 @@ span.filter-box-tag { user-select: none; } +/* Center the 404 div */ +.no-resources-found { + display: flex; + flex-direction: column; + align-items: center; +} + /* Make resource tags clickable */ .resource-tag { cursor: pointer; diff --git a/pydis_site/static/images/resources/duck_pond_404.png b/pydis_site/static/images/resources/duck_pond_404.png new file mode 100644 index 00000000..3aed4d62 Binary files /dev/null and b/pydis_site/static/images/resources/duck_pond_404.png differ diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 4dd07270..53feb255 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -124,7 +124,11 @@
    {# Message to display when there are no hits #} -

    No matching resources found!

    +
    +

    No matching resources found!

    + +
    + {# Resource cards #}
    -- cgit v1.2.3 From 4b17d714fb0cb7d1fd199a2ca123b6d18fe377e7 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 14:02:19 +0100 Subject: Fix resource redirects for deploy previews. This could probably be improved by making it less hardcoded, but since there's a bunch of special cases, and since it only affects deploy previews, I'm choosing to solve this with a simple solution. I don't think realistically that we're gonna be adding a ton of resource types down the line anyway. --- pydis_site/apps/content/urls.py | 2 +- pydis_site/apps/resources/urls.py | 40 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/content/urls.py b/pydis_site/apps/content/urls.py index fe7c2852..f8496095 100644 --- a/pydis_site/apps/content/urls.py +++ b/pydis_site/apps/content/urls.py @@ -30,7 +30,7 @@ def __get_all_files(root: Path, folder: typing.Optional[Path] = None) -> list[st def get_all_pages() -> typing.Iterator[dict[str, str]]: - """Yield a dict of all pag categories.""" + """Yield a dict of all page categories.""" for location in __get_all_files(Path("pydis_site", "apps", "content", "resources")): yield {"location": location} diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index ed24dc99..aa3892b6 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -1,9 +1,47 @@ +import typing + from django_distill import distill_path from pydis_site.apps.resources import views +# This is only used for `distill_path`, so that the Netlify Deploy Previews +# can successfully redirect to static pages. This could probably be improved by +# making it less hardcoded, but since there's a bunch of special cases, and since +# it only affects deploy previews, I'm choosing to solve this with a simple solution. +VALID_RESOURCE_TYPES = [ + "book", + "books", + "reading", + "podcast", + "podcasts", + "interactive", + "videos", + "video", + "courses", + "course", + "communities", + "community", + "tutorial", + "tutorials", + "tool", + "tools", + "project ideas", + "project-ideas", +] + + +def get_all_pages() -> typing.Iterator[dict[str, str]]: + for resource_type in VALID_RESOURCE_TYPES: + yield {"resource_type": resource_type} + + app_name = "resources" urlpatterns = [ distill_path("", views.resources.ResourceView.as_view(), name="index"), - distill_path("/", views.resources.ResourceView.as_view(), name="index"), + distill_path( + "/", + views.resources.ResourceView.as_view(), + name="index", + distill_func=get_all_pages, + ), ] -- cgit v1.2.3 From d1d5f2e8da74fc463bd5132ef920f7f77060759e Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 14:02:38 +0100 Subject: Get rid of the title_url for university of toronto --- pydis_site/apps/resources/resources/university_of_toronto.yaml | 1 - 1 file changed, 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/university_of_toronto.yaml b/pydis_site/apps/resources/resources/university_of_toronto.yaml index c3b54f84..94df96f2 100644 --- a/pydis_site/apps/resources/resources/university_of_toronto.yaml +++ b/pydis_site/apps/resources/resources/university_of_toronto.yaml @@ -1,7 +1,6 @@ description: A 2-part course that teaches Python. Primarily intended for high school students and first-year university students who want to learn programming. name: 'University of Toronto: Learn to Program' -title_url: https://www.coursera.org/learn/learn-to-program urls: - icon: regular/graduation-cap url: https://www.coursera.org/learn/learn-to-program -- cgit v1.2.3 From 295cd818e3d679083b962ee90e334ad4cbc9adba Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 14:03:10 +0100 Subject: Fix broken css for no-resource duck pond. --- pydis_site/static/css/resources/resources.css | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index b48beca6..aa47be8f 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -62,8 +62,15 @@ display: block; border-radius: 0; } +/* Center the 404 div */ +.no-resources-found { + display: flex; + flex-direction: column; + align-items: center; +} + /* Hide the no resources h2 by default */ -h2.no-resources-found { +.no-resources-found { display: none; margin-top: 1em; } @@ -93,13 +100,6 @@ span.filter-box-tag { user-select: none; } -/* Center the 404 div */ -.no-resources-found { - display: flex; - flex-direction: column; - align-items: center; -} - /* Make resource tags clickable */ .resource-tag { cursor: pointer; -- cgit v1.2.3 From df51385ab8adf715d61841eceebeb7cb2f220e77 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 14:14:51 +0100 Subject: Show a "No filters selected" indicator. --- pydis_site/static/js/resources.js | 10 ++++++++-- pydis_site/templates/resources/resource_box.html | 6 +++--- pydis_site/templates/resources/resources.html | 8 +++++++- 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js index 34587c81..718e1e88 100644 --- a/pydis_site/static/js/resources.js +++ b/pydis_site/static/js/resources.js @@ -18,10 +18,12 @@ function addFilter(filterName, filterItem) { // Show a corresponding filter box tag $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).show(); - $(".filter-tags").css("padding-bottom", "0.5em"); // Make corresponding resource tags active $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).addClass("active"); + + // Hide the "No filters selected" tag. + $(".no-tags-selected.tag").hide(); } function removeFilter(filterName, filterItem) { @@ -37,6 +39,11 @@ function removeFilter(filterName, filterItem) { // Make corresponding resource tags inactive $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).removeClass("active"); + + // Show "No filters selected" tag, if there are no filters active + if (noFilters()) { + $(".no-tags-selected.tag").show(); + } } /* Check if there are no filters */ @@ -107,7 +114,6 @@ function updateUI() { if (noFilters()) { resources.show(); filterTags.hide(); - $(".filter-tags").css("padding-bottom", "0"); return; } diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index b06ffd31..88ddee80 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -18,16 +18,16 @@ {% if 'title_url' in resource %} - + {% endif %} - {#Add all additional icon #} + {# Add all additional icon #} {% for icon in resource.urls %} - + {% endfor %} diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 53feb255..c3881092 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -27,6 +27,12 @@ {# Filter box tags #}
    + {# A filter tag for when there are no filters active #} + + + No filters selected + + {% for filter_name, filter_data in filters.items %} {% for filter_item in filter_data.filters %} {% if filter_name == "Difficulty" %} @@ -125,7 +131,7 @@
    {# Message to display when there are no hits #}
    -

    No matching resources found!

    +

    No matching resources found!

    -- cgit v1.2.3 From 301847a014c13e4929dcc00efa7e14349d34df0e Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 14:15:37 +0100 Subject: Remove italics from resource cards. --- pydis_site/templates/resources/resource_box.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index 88ddee80..8f634333 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -11,7 +11,7 @@ {% include "resources/resource_box_header.html" %} {% endif %} -

    {{ resource.description|safe }}

    +

    {{ resource.description|safe }}

    {# Add primary link #} -- cgit v1.2.3 From dda3e355ac31dc4b9629f2e9e63474bbba69d740 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 14:29:48 +0100 Subject: Refactor: collapsibles as a stand-alone component --- pydis_site/apps/resources/urls.py | 1 + pydis_site/static/css/collapsibles.css | 12 ++ pydis_site/static/css/content/page.css | 13 -- pydis_site/static/js/collapsibles.js | 13 ++ pydis_site/static/js/content/page.js | 13 -- pydis_site/static/js/resources.js | 236 -------------------------- pydis_site/static/js/resources/resources.js | 236 ++++++++++++++++++++++++++ pydis_site/templates/content/base.html | 3 +- pydis_site/templates/resources/resources.html | 6 +- 9 files changed, 267 insertions(+), 266 deletions(-) create mode 100644 pydis_site/static/css/collapsibles.css create mode 100644 pydis_site/static/js/collapsibles.js delete mode 100644 pydis_site/static/js/content/page.js delete mode 100644 pydis_site/static/js/resources.js create mode 100644 pydis_site/static/js/resources/resources.js (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index aa3892b6..044f7072 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -31,6 +31,7 @@ VALID_RESOURCE_TYPES = [ def get_all_pages() -> typing.Iterator[dict[str, str]]: + """Get all the valid options for the resource_type path selector.""" for resource_type in VALID_RESOURCE_TYPES: yield {"resource_type": resource_type} diff --git a/pydis_site/static/css/collapsibles.css b/pydis_site/static/css/collapsibles.css new file mode 100644 index 00000000..7b76d8d5 --- /dev/null +++ b/pydis_site/static/css/collapsibles.css @@ -0,0 +1,12 @@ +.collapsible { + cursor: pointer; + width: 100%; + border: none; + outline: none; +} + +.collapsible-content { + overflow: hidden; + max-height: 0; + transition: max-height 0.2s ease-out; +} \ No newline at end of file diff --git a/pydis_site/static/css/content/page.css b/pydis_site/static/css/content/page.css index 2d4bd325..d831f86d 100644 --- a/pydis_site/static/css/content/page.css +++ b/pydis_site/static/css/content/page.css @@ -77,16 +77,3 @@ ul.menu-list.toc { li img { margin-top: 0.5em; } - -.collapsible { - cursor: pointer; - width: 100%; - border: none; - outline: none; -} - -.collapsible-content { - overflow: hidden; - max-height: 0; - transition: max-height 0.2s ease-out; -} diff --git a/pydis_site/static/js/collapsibles.js b/pydis_site/static/js/collapsibles.js new file mode 100644 index 00000000..366a033c --- /dev/null +++ b/pydis_site/static/js/collapsibles.js @@ -0,0 +1,13 @@ +document.addEventListener("DOMContentLoaded", () => { + const headers = document.getElementsByClassName("collapsible"); + for (const header of headers) { + header.addEventListener("click", () => { + var content = header.nextElementSibling; + if (content.style.maxHeight){ + content.style.maxHeight = null; + } else { + content.style.maxHeight = content.scrollHeight + "px"; + } + }); + } +}); diff --git a/pydis_site/static/js/content/page.js b/pydis_site/static/js/content/page.js deleted file mode 100644 index 366a033c..00000000 --- a/pydis_site/static/js/content/page.js +++ /dev/null @@ -1,13 +0,0 @@ -document.addEventListener("DOMContentLoaded", () => { - const headers = document.getElementsByClassName("collapsible"); - for (const header of headers) { - header.addEventListener("click", () => { - var content = header.nextElementSibling; - if (content.style.maxHeight){ - content.style.maxHeight = null; - } else { - content.style.maxHeight = content.scrollHeight + "px"; - } - }); - } -}); diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js deleted file mode 100644 index 718e1e88..00000000 --- a/pydis_site/static/js/resources.js +++ /dev/null @@ -1,236 +0,0 @@ -"use strict"; - -// Filters that are currently selected -var activeFilters = { - topics: [], - type: [], - "payment-tiers": [], - difficulty: [] -}; - -function addFilter(filterName, filterItem) { - // Push the filter into the stack - var filterIndex = activeFilters[filterName].indexOf(filterItem); - if (filterIndex === -1) { - activeFilters[filterName].push(filterItem); - } - updateUI(); - - // Show a corresponding filter box tag - $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).show(); - - // Make corresponding resource tags active - $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).addClass("active"); - - // Hide the "No filters selected" tag. - $(".no-tags-selected.tag").hide(); -} - -function removeFilter(filterName, filterItem) { - // Remove the filter from the stack - var filterIndex = activeFilters[filterName].indexOf(filterItem); - if (filterIndex !== -1) { - activeFilters[filterName].splice(filterIndex, 1); - } - updateUI(); - - // Hide the corresponding filter box tag - $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).hide(); - - // Make corresponding resource tags inactive - $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).removeClass("active"); - - // Show "No filters selected" tag, if there are no filters active - if (noFilters()) { - $(".no-tags-selected.tag").show(); - } -} - -/* Check if there are no filters */ -function noFilters() { - return ( - activeFilters.topics.length === 0 && - activeFilters.type.length === 0 && - activeFilters["payment-tiers"].length === 0 && - activeFilters.difficulty.length === 0 - ); -} - -/* Get the params out of the URL and use them. This is run when the page loads. */ -function deserializeURLParams() { - let searchParams = new window.URLSearchParams(window.location.search); - - // Work through the parameters and add them to the filter object - $.each(Object.keys(activeFilters), function(_, filterType) { - let paramFilterContent = searchParams.get(filterType); - - if (paramFilterContent !== null) { - // We use split here because we always want an array, not a string. - let paramFilterArray = paramFilterContent.split(","); - activeFilters[filterType] = paramFilterArray; - - // Update the corresponding filter UI, so it reflects the internal state. - $(paramFilterArray).each(function(_, filter) { - let checkbox = $(`.filter-checkbox[data-filter-name='${filterType}'][data-filter-item='${filter}']`); - let filterTag = $(`.filter-box-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); - let resourceTags = $(`.resource-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); - checkbox.prop("checked", true); - filterTag.show(); - resourceTags.addClass("active"); - }); - } - }); -} - -/* Update the URL with new parameters */ -function updateURL() { - // If there's nothing in the filters, we don't want anything in the URL. - if (noFilters()) { - window.history.replaceState(null, document.title, './'); - return; - } - - // Iterate through and get rid of empty ones - let searchParams = new URLSearchParams(activeFilters); - $.each(activeFilters, function(filterType, filters) { - if (filters.length === 0) { - searchParams.delete(filterType); - } - }); - - // Now update the URL - window.history.replaceState(null, document.title, `?${searchParams.toString()}`); -} - -/* Update the resources to match 'active_filters' */ -function updateUI() { - let resources = $('.resource-box'); - let filterTags = $('.filter-box-tag'); - - // Update the URL to match the new filters. - updateURL(); - - // If there's nothing in the filters, show everything and return. - if (noFilters()) { - resources.show(); - filterTags.hide(); - return; - } - - // Otherwise, hide everything and then filter the resources to decide what to show. - let hasMatches = false; - resources.hide(); - resources.filter(function() { - let validation = { - topics: false, - type: false, - 'payment-tiers': false, - difficulty: false - }; - let resourceBox = $(this); - - // Validate the filters - $.each(activeFilters, function(filterType, filters) { - // If the filter list is empty, this passes validation. - if (filters.length === 0) { - validation[filterType] = true; - return; - } - - // Otherwise, we need to check if one of the classes exist. - $.each(filters, function(index, filter) { - if (resourceBox.hasClass(`${filterType}-${filter}`)) { - validation[filterType] = true; - } - }); - }); - - // If validation passes, show the resource. - if (Object.values(validation).every(Boolean)) { - hasMatches = true; - return true; - } else { - return false; - } - }).show(); - - // If there are no matches, show the no matches message - if (!hasMatches) { - $(".no-resources-found").show(); - } else { - $(".no-resources-found").hide(); - } -} - -// Executed when the page has finished loading. -document.addEventListener("DOMContentLoaded", function () { - /* Check if the user has navigated to one of the old resource pages, - like pydis.com/resources/communities. In this case, we'll rewrite - the URL before we do anything else. */ - let resourceTypeInput = $("#resource-type-input").val(); - if (resourceTypeInput !== "None") { - window.history.replaceState(null, document.title, `../?type=${resourceTypeInput}`); - } - - // Update the filters on page load to reflect URL parameters. - $('.filter-box-tag').hide(); - deserializeURLParams(); - updateUI(); - - // If you collapse or uncollapse a filter group, swap the icon. - $('button.collapsible').click(function() { - let icon = $(this).find(".card-header-icon i"); - - if ($(icon).hasClass("fa-window-minimize")) { - $(icon).removeClass(["far", "fa-window-minimize"]); - $(icon).addClass(["fas", "fa-angle-down"]); - } else { - $(icon).removeClass(["fas", "fa-angle-down"]); - $(icon).addClass(["far", "fa-window-minimize"]); - } - }); - - // If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox. - $('.filter-panel').click(function() { - let checkbox = $(this).find(".filter-checkbox"); - checkbox.prop("checked", !checkbox.prop("checked")); - checkbox.change(); - }); - - // If you click on one of the tags in the filter box, it unchecks the corresponding checkbox. - $('.filter-box-tag').click(function() { - let filterItem = this.dataset.filterItem; - let filterName = this.dataset.filterName; - let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); - - removeFilter(filterName, filterItem); - checkbox.prop("checked", false); - }); - - // If you click on one of the tags in the resource cards, it clicks the corresponding checkbox. - $('.resource-tag').click(function() { - let filterItem = this.dataset.filterItem; - let filterName = this.dataset.filterName; - let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); - - if (!$(this).hasClass("active")) { - addFilter(filterName, filterItem); - checkbox.prop("checked", true); - } else { - removeFilter(filterName, filterItem); - checkbox.prop("checked", false); - } - }); - - // When checkboxes are toggled, trigger a filter update. - $('.filter-checkbox').change(function () { - let filterItem = this.dataset.filterItem; - let filterName = this.dataset.filterName; - - if (this.checked) { - addFilter(filterName, filterItem); - } else { - removeFilter(filterName, filterItem); - } - }); -}); diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js new file mode 100644 index 00000000..718e1e88 --- /dev/null +++ b/pydis_site/static/js/resources/resources.js @@ -0,0 +1,236 @@ +"use strict"; + +// Filters that are currently selected +var activeFilters = { + topics: [], + type: [], + "payment-tiers": [], + difficulty: [] +}; + +function addFilter(filterName, filterItem) { + // Push the filter into the stack + var filterIndex = activeFilters[filterName].indexOf(filterItem); + if (filterIndex === -1) { + activeFilters[filterName].push(filterItem); + } + updateUI(); + + // Show a corresponding filter box tag + $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).show(); + + // Make corresponding resource tags active + $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).addClass("active"); + + // Hide the "No filters selected" tag. + $(".no-tags-selected.tag").hide(); +} + +function removeFilter(filterName, filterItem) { + // Remove the filter from the stack + var filterIndex = activeFilters[filterName].indexOf(filterItem); + if (filterIndex !== -1) { + activeFilters[filterName].splice(filterIndex, 1); + } + updateUI(); + + // Hide the corresponding filter box tag + $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).hide(); + + // Make corresponding resource tags inactive + $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).removeClass("active"); + + // Show "No filters selected" tag, if there are no filters active + if (noFilters()) { + $(".no-tags-selected.tag").show(); + } +} + +/* Check if there are no filters */ +function noFilters() { + return ( + activeFilters.topics.length === 0 && + activeFilters.type.length === 0 && + activeFilters["payment-tiers"].length === 0 && + activeFilters.difficulty.length === 0 + ); +} + +/* Get the params out of the URL and use them. This is run when the page loads. */ +function deserializeURLParams() { + let searchParams = new window.URLSearchParams(window.location.search); + + // Work through the parameters and add them to the filter object + $.each(Object.keys(activeFilters), function(_, filterType) { + let paramFilterContent = searchParams.get(filterType); + + if (paramFilterContent !== null) { + // We use split here because we always want an array, not a string. + let paramFilterArray = paramFilterContent.split(","); + activeFilters[filterType] = paramFilterArray; + + // Update the corresponding filter UI, so it reflects the internal state. + $(paramFilterArray).each(function(_, filter) { + let checkbox = $(`.filter-checkbox[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + let filterTag = $(`.filter-box-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + let resourceTags = $(`.resource-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + checkbox.prop("checked", true); + filterTag.show(); + resourceTags.addClass("active"); + }); + } + }); +} + +/* Update the URL with new parameters */ +function updateURL() { + // If there's nothing in the filters, we don't want anything in the URL. + if (noFilters()) { + window.history.replaceState(null, document.title, './'); + return; + } + + // Iterate through and get rid of empty ones + let searchParams = new URLSearchParams(activeFilters); + $.each(activeFilters, function(filterType, filters) { + if (filters.length === 0) { + searchParams.delete(filterType); + } + }); + + // Now update the URL + window.history.replaceState(null, document.title, `?${searchParams.toString()}`); +} + +/* Update the resources to match 'active_filters' */ +function updateUI() { + let resources = $('.resource-box'); + let filterTags = $('.filter-box-tag'); + + // Update the URL to match the new filters. + updateURL(); + + // If there's nothing in the filters, show everything and return. + if (noFilters()) { + resources.show(); + filterTags.hide(); + return; + } + + // Otherwise, hide everything and then filter the resources to decide what to show. + let hasMatches = false; + resources.hide(); + resources.filter(function() { + let validation = { + topics: false, + type: false, + 'payment-tiers': false, + difficulty: false + }; + let resourceBox = $(this); + + // Validate the filters + $.each(activeFilters, function(filterType, filters) { + // If the filter list is empty, this passes validation. + if (filters.length === 0) { + validation[filterType] = true; + return; + } + + // Otherwise, we need to check if one of the classes exist. + $.each(filters, function(index, filter) { + if (resourceBox.hasClass(`${filterType}-${filter}`)) { + validation[filterType] = true; + } + }); + }); + + // If validation passes, show the resource. + if (Object.values(validation).every(Boolean)) { + hasMatches = true; + return true; + } else { + return false; + } + }).show(); + + // If there are no matches, show the no matches message + if (!hasMatches) { + $(".no-resources-found").show(); + } else { + $(".no-resources-found").hide(); + } +} + +// Executed when the page has finished loading. +document.addEventListener("DOMContentLoaded", function () { + /* Check if the user has navigated to one of the old resource pages, + like pydis.com/resources/communities. In this case, we'll rewrite + the URL before we do anything else. */ + let resourceTypeInput = $("#resource-type-input").val(); + if (resourceTypeInput !== "None") { + window.history.replaceState(null, document.title, `../?type=${resourceTypeInput}`); + } + + // Update the filters on page load to reflect URL parameters. + $('.filter-box-tag').hide(); + deserializeURLParams(); + updateUI(); + + // If you collapse or uncollapse a filter group, swap the icon. + $('button.collapsible').click(function() { + let icon = $(this).find(".card-header-icon i"); + + if ($(icon).hasClass("fa-window-minimize")) { + $(icon).removeClass(["far", "fa-window-minimize"]); + $(icon).addClass(["fas", "fa-angle-down"]); + } else { + $(icon).removeClass(["fas", "fa-angle-down"]); + $(icon).addClass(["far", "fa-window-minimize"]); + } + }); + + // If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox. + $('.filter-panel').click(function() { + let checkbox = $(this).find(".filter-checkbox"); + checkbox.prop("checked", !checkbox.prop("checked")); + checkbox.change(); + }); + + // If you click on one of the tags in the filter box, it unchecks the corresponding checkbox. + $('.filter-box-tag').click(function() { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); + + removeFilter(filterName, filterItem); + checkbox.prop("checked", false); + }); + + // If you click on one of the tags in the resource cards, it clicks the corresponding checkbox. + $('.resource-tag').click(function() { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); + + if (!$(this).hasClass("active")) { + addFilter(filterName, filterItem); + checkbox.prop("checked", true); + } else { + removeFilter(filterName, filterItem); + checkbox.prop("checked", false); + } + }); + + // When checkboxes are toggled, trigger a filter update. + $('.filter-checkbox').change(function () { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + + if (this.checked) { + addFilter(filterName, filterItem); + } else { + removeFilter(filterName, filterItem); + } + }); +}); diff --git a/pydis_site/templates/content/base.html b/pydis_site/templates/content/base.html index 00f4fce4..4a19a275 100644 --- a/pydis_site/templates/content/base.html +++ b/pydis_site/templates/content/base.html @@ -7,7 +7,8 @@ - + + {% endblock %} {% block content %} diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index c3881092..80577c2b 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -7,10 +7,10 @@ {% block title %}Resources{% endblock %} {% block head %} - + - - + + {% endblock %} {% block content %} -- cgit v1.2.3 From efc24acb63e4faf10644fb22b3c72aa13d792b79 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 20:01:27 +0100 Subject: Hide the filter tags initially. Helps prevent a flash of tags. --- pydis_site/static/css/resources/resources.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index aa47be8f..ebd946d9 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -94,12 +94,17 @@ i.is-primary { /* Set default display to inline-flex, for centering. */ span.filter-box-tag { - display: inline-flex; + display: none; align-items: center; cursor: pointer; user-select: none; } +/* Make sure jQuery will use inline-flex when setting `show()` again. */ +span.filter-box-tag[style*='display: block'] { + display: inline-flex !important; +} + /* Make resource tags clickable */ .resource-tag { cursor: pointer; -- cgit v1.2.3 From bc6829b93246e2f8833b5b418d3d7bd8eadc99cf Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 20:02:06 +0100 Subject: Make the category headers smaller on mobile. --- pydis_site/static/css/resources/resources.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index ebd946d9..59f8b78e 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -187,3 +187,15 @@ span.resource-tag.active.has-background-success-light { span.resource-tag.active.has-background-info-light { animation: glow_info 4s infinite alternate; } + +/* Smaller filter category headers when on mobile */ +@media screen and (max-width: 480px) { + .filter-category-header .card-header .card-header-title { + font-size: 14px; + padding: 0; + } + .filter-panel { + padding-top: 4px; + padding-bottom: 4px; + } +} \ No newline at end of file -- cgit v1.2.3 From ca45357255f5957cf779c109fc24e83de904a195 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 20:25:34 +0100 Subject: Collapse category headers on load for mobile only. --- pydis_site/static/css/resources/resources.css | 8 ++++++++ pydis_site/static/js/resources/resources.js | 13 ++++++++++++- pydis_site/templates/resources/resources.html | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 59f8b78e..b24fcb5b 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -198,4 +198,12 @@ span.resource-tag.active.has-background-info-light { padding-top: 4px; padding-bottom: 4px; } +} + +/* Disable transitions */ +.no-transition { + -webkit-transition: none !important; + -moz-transition: none !important; + -o-transition: none !important; + transition: none !important; } \ No newline at end of file diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js index 718e1e88..44d4db5c 100644 --- a/pydis_site/static/js/resources/resources.js +++ b/pydis_site/static/js/resources/resources.js @@ -178,7 +178,7 @@ document.addEventListener("DOMContentLoaded", function () { updateUI(); // If you collapse or uncollapse a filter group, swap the icon. - $('button.collapsible').click(function() { + $('button.collapsible').on("click", function() { let icon = $(this).find(".card-header-icon i"); if ($(icon).hasClass("fa-window-minimize")) { @@ -190,6 +190,17 @@ document.addEventListener("DOMContentLoaded", function () { } }); + // If this is a mobile device, collapse the categories to win back some screen real estate. + if (screen.width < 480) { + let categoryHeaders = $(".filter-category-header .collapsible-content"); + let icons = $('.filter-category-header button .card-header-icon i'); + categoryHeaders.addClass("no-transition"); + categoryHeaders.css("max-height", 0); + icons.removeClass(["far", "fa-window-minimize"]); + icons.addClass(["fas", "fa-angle-down"]); + categoryHeaders.removeClass("no-transition"); + } + // If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox. $('.filter-panel').click(function() { let checkbox = $(this).find(".filter-checkbox"); diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 80577c2b..a7b25f5c 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -104,7 +104,7 @@ {% if filter_data.hidden %}
    {% else %} -
    +
    {% endif %}
    {% for filter_item in filter_data.filters %} -- cgit v1.2.3 From b07f1c9c268f96ea031531a3d1086fa6b694b4ba Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 20:45:23 +0100 Subject: Kaizen: Clean up some indentation. --- pydis_site/templates/resources/resources.html | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index a7b25f5c..dcf520f6 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -106,23 +106,23 @@ {% else %}
    {% endif %} -
    - {% for filter_item in filter_data.filters %} - - - - {% endfor %} -
    -
    -
    +
    + {% for filter_item in filter_data.filters %} + + + + {% endfor %} +
    +
    +
    {% endfor %}
    -- cgit v1.2.3 From 3b213bbdfcdf2a17c4b29692bd75094a47440cd6 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 30 Jan 2022 21:15:32 +0100 Subject: Revert ugly deploy preview redirect hack. --- pydis_site/apps/resources/urls.py | 41 +-------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index 044f7072..ed24dc99 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -1,48 +1,9 @@ -import typing - from django_distill import distill_path from pydis_site.apps.resources import views -# This is only used for `distill_path`, so that the Netlify Deploy Previews -# can successfully redirect to static pages. This could probably be improved by -# making it less hardcoded, but since there's a bunch of special cases, and since -# it only affects deploy previews, I'm choosing to solve this with a simple solution. -VALID_RESOURCE_TYPES = [ - "book", - "books", - "reading", - "podcast", - "podcasts", - "interactive", - "videos", - "video", - "courses", - "course", - "communities", - "community", - "tutorial", - "tutorials", - "tool", - "tools", - "project ideas", - "project-ideas", -] - - -def get_all_pages() -> typing.Iterator[dict[str, str]]: - """Get all the valid options for the resource_type path selector.""" - for resource_type in VALID_RESOURCE_TYPES: - yield {"resource_type": resource_type} - - app_name = "resources" urlpatterns = [ distill_path("", views.resources.ResourceView.as_view(), name="index"), - distill_path( - "/", - views.resources.ResourceView.as_view(), - name="index", - distill_func=get_all_pages, - ), + distill_path("/", views.resources.ResourceView.as_view(), name="index"), ] -- cgit v1.2.3 From 8726a61b965988b30a7f28416a22d8c807177436 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 11:51:55 +0100 Subject: Shrink and center the duck pond 404. --- pydis_site/static/css/resources/resources.css | 10 +++++----- pydis_site/static/images/resources/duck_pond_404.jpg | Bin 0 -> 123824 bytes pydis_site/static/images/resources/duck_pond_404.png | Bin 2371374 -> 0 bytes pydis_site/templates/resources/resources.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 pydis_site/static/images/resources/duck_pond_404.jpg delete mode 100644 pydis_site/static/images/resources/duck_pond_404.png (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index b24fcb5b..55284605 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -64,15 +64,15 @@ display: block; /* Center the 404 div */ .no-resources-found { - display: flex; + display: none; flex-direction: column; align-items: center; + margin-top: 1em; } -/* Hide the no resources h2 by default */ -.no-resources-found { - display: none; - margin-top: 1em; +/* Make sure jQuery will use flex when setting `show()` again. */ +.no-resources-found[style*='display: block'] { + display: flex !important; } /* Disable clicking on the checkbox itself. */ diff --git a/pydis_site/static/images/resources/duck_pond_404.jpg b/pydis_site/static/images/resources/duck_pond_404.jpg new file mode 100644 index 00000000..29bcf1d6 Binary files /dev/null and b/pydis_site/static/images/resources/duck_pond_404.jpg differ diff --git a/pydis_site/static/images/resources/duck_pond_404.png b/pydis_site/static/images/resources/duck_pond_404.png deleted file mode 100644 index 3aed4d62..00000000 Binary files a/pydis_site/static/images/resources/duck_pond_404.png and /dev/null differ diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index dcf520f6..2fb0f543 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -132,7 +132,7 @@ {# Message to display when there are no hits #}

    No matching resources found!

    - +
    -- cgit v1.2.3 From 918e4d1aa3a63c4a390d127072ba83c1a146f5c6 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 12:00:09 +0100 Subject: Make a few minor corrections to resources. - Changes Google Collab to Colab - Updates the URL for the vcokltfre tutorial - Adds a category icon for Game Development. --- pydis_site/apps/resources/resources/google_colab.yaml | 17 +++++++++++++++++ pydis_site/apps/resources/resources/google_collab.yaml | 17 ----------------- .../resources/vcokltfre_discord_bot_tutorial.yaml | 2 +- .../apps/resources/templatetags/get_category_icon.py | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 pydis_site/apps/resources/resources/google_colab.yaml delete mode 100644 pydis_site/apps/resources/resources/google_collab.yaml (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/resources/google_colab.yaml b/pydis_site/apps/resources/resources/google_colab.yaml new file mode 100644 index 00000000..b8936674 --- /dev/null +++ b/pydis_site/apps/resources/resources/google_colab.yaml @@ -0,0 +1,17 @@ +description: Google Colab is a high-powered custom version of Jupyter Notebook which supports e.g. + !apt-get to install arbitrary Debian packages to the runtime, which is very generous with CPU and memory, + and well-integrated with Google Drive. + You can share your Colab Notebooks with other people and work collaboratively. +name: Google Colab +title_url: https://colab.research.google.com/notebooks/intro.ipynb +tags: + topics: + - general + - data science + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/google_collab.yaml b/pydis_site/apps/resources/resources/google_collab.yaml deleted file mode 100644 index 067a79c9..00000000 --- a/pydis_site/apps/resources/resources/google_collab.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: Google Collab is a high-powered custom version of Jupyter Notebook which supports e.g. - !apt-get to install arbitrary Debian packages to the runtime, which is very generous with CPU and memory, - and well-integrated with Google Drive. - You can share your Collab Notebooks with other people and work collaboratively. -name: Google Collab -title_url: https://colab.research.google.com/notebooks/intro.ipynb -tags: - topics: - - general - - data science - payment_tiers: - - free - difficulty: - - beginner - - intermediate - type: - - tool diff --git a/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml index 1a3dd457..32476dab 100644 --- a/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml +++ b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml @@ -2,7 +2,7 @@ description: This tutorial, written by Python Discord staff member vcokltfre, will walk you through all the aspects of creating your own Discord bot, starting from from creating the bot user itself. name: vcokltfre's Discord Bot Tutorial -title_url: https://vcokltfre.dev/ +title_url: https://tutorial.vcokltfre.dev/ tags: topics: - discord bots diff --git a/pydis_site/apps/resources/templatetags/get_category_icon.py b/pydis_site/apps/resources/templatetags/get_category_icon.py index 5a5e9887..71f1393f 100644 --- a/pydis_site/apps/resources/templatetags/get_category_icon.py +++ b/pydis_site/apps/resources/templatetags/get_category_icon.py @@ -12,7 +12,7 @@ _ICONS = { "Databases": "fa-server", "Discord Bots": "fa-robot", "Free": "fa-first-aid", - "Game Development": "fa-joystick", + "Game Development": "fa-gamepad", "General": "fa-book", "Interactive": "fa-mouse-pointer", "Intermediate": "fa-align-center", -- cgit v1.2.3 From 46702b73cc8a54409da633e4492846f72bb5a338 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 12:07:04 +0100 Subject: Make the resource link icons a size smaller. We also add a little breathing room to the tag container, so that it doesn't encroach on the personal space of the icons. --- pydis_site/static/css/resources/resources.css | 5 +++++ pydis_site/templates/resources/resource_box.html | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 55284605..3b235a05 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -111,6 +111,11 @@ span.filter-box-tag[style*='display: block'] { user-select: none; } +/* Give the resource tags a bit of breathing room */ +.resource-tag-container { + padding-left: 1.5rem; +} + /* When hovering tags, brighten them a bit. */ .resource-tag:hover, .filter-box-tag:hover { diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index 8f634333..0ba8b0ec 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -16,24 +16,24 @@
    {# Add primary link #} {% if 'title_url' in resource %} - + - + {% endif %} {# Add all additional icon #} {% for icon in resource.urls %} - + - + {% endfor %} {# Tags #} -
    +
    {% for tag in resource.tags.topics %} Date: Mon, 31 Jan 2022 12:20:40 +0100 Subject: Indent checkboxes under the headers. --- pydis_site/static/css/resources/resources.css | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 3b235a05..2465e9dc 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -62,6 +62,17 @@ display: block; border-radius: 0; } +/* Make the checkboxes indent under the filter headers */ +.filter-category-header .card-header .card-header-title { + padding-left: 0; +} +.filter-panel { + padding-left: 1.5rem; +} +.filter-checkbox { + margin-right: 0.25em !important; +} + /* Center the 404 div */ .no-resources-found { display: none; -- cgit v1.2.3 From 98ac8a963bc196e49b60899080b94bacc29f04e1 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 16:05:13 +0100 Subject: Added margins and max-width to filtering column. --- pydis_site/static/css/resources/resources.css | 20 ++++++++++++++------ pydis_site/templates/resources/resources.html | 4 ++-- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 2465e9dc..26ddc14e 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -163,6 +163,14 @@ span.resource-tag.active { outline-style: solid; } +/* Disable transitions */ +.no-transition { + -webkit-transition: none !important; + -moz-transition: none !important; + -o-transition: none !important; + transition: none !important; +} + /* Make filter tags sparkle when selected! */ @keyframes glow_success { from { box-shadow: 0 0 2px 2px #aef4af; } @@ -216,10 +224,10 @@ span.resource-tag.active.has-background-info-light { } } -/* Disable transitions */ -.no-transition { - -webkit-transition: none !important; - -moz-transition: none !important; - -o-transition: none !important; - transition: none !important; +/* Constrain the width of the filterbox */ +@media screen and (min-width: 769px) { + .filtering-column { + max-width: 25rem; + min-width: 18rem; + } } \ No newline at end of file diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 2fb0f543..13bba1f2 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -17,9 +17,9 @@ {% include "base/navbar.html" %}
    -
    +
    {# Filtering toolbox #} -
    +
    {% endblock %} - - -- cgit v1.2.3 From 24edd0ada26af34e946965d5692b6a35b7622ef9 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 22:16:20 +0100 Subject: Add a button for removing all active filters. --- pydis_site/static/css/resources/resources.css | 21 ++++- pydis_site/static/js/resources/resources.js | 67 +++++++++------ pydis_site/templates/resources/resources.html | 118 ++++++++++++++------------ 3 files changed, 123 insertions(+), 83 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 16226936..2fb3a9b5 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -97,12 +97,29 @@ i.is-primary { color: #7289da; } -/* A little space around the filter card, please! */ +/* A little space above the filter card, please! */ .filter-tags { padding-bottom: .5em; - padding-right: .5em; } +/* Style the close all filters button */ +.close-filters-button { + margin-left: auto; + display:none; +} +.close-filters-button a { + height: fit-content; + width: fit-content; + margin-right: 6px; +} +.close-filters-button a i { + color: #939bb3; +} +.close-filters-button a i:hover { + filter: brightness(115%); +} + + /* Set default display to inline-flex, for centering. */ span.filter-box-tag { display: none; diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js index 0e951c38..8627a359 100644 --- a/pydis_site/static/js/resources/resources.js +++ b/pydis_site/static/js/resources/resources.js @@ -8,42 +8,33 @@ var activeFilters = { difficulty: [] }; +/* Add a filter, and update the UI */ function addFilter(filterName, filterItem) { - // Push the filter into the stack var filterIndex = activeFilters[filterName].indexOf(filterItem); if (filterIndex === -1) { activeFilters[filterName].push(filterItem); } updateUI(); +} - // Show a corresponding filter box tag - $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).show(); - - // Make corresponding resource tags active - $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).addClass("active"); - - // Hide the "No filters selected" tag. - $(".no-tags-selected.tag").hide(); +/* Remove all filters, and update the UI */ +function removeAllFilters() { + activeFilters = { + topics: [], + type: [], + "payment-tiers": [], + difficulty: [] + }; + updateUI(); } +/* Remove a filter, and update the UI */ function removeFilter(filterName, filterItem) { - // Remove the filter from the stack var filterIndex = activeFilters[filterName].indexOf(filterItem); if (filterIndex !== -1) { activeFilters[filterName].splice(filterIndex, 1); } updateUI(); - - // Hide the corresponding filter box tag - $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).hide(); - - // Make corresponding resource tags inactive - $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).removeClass("active"); - - // Show "No filters selected" tag, if there are no filters active - if (noFilters()) { - $(".no-tags-selected.tag").show(); - } } /* Check if there are no filters */ @@ -76,7 +67,7 @@ function deserializeURLParams() { window.location.href = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"; } else if (String(filter) === "sneakers" && filterType === "topics") { window.location.href = "https://www.youtube.com/watch?v=NNZscmNE9QI"; - } else if (validFilters[filterType].includes(String(filter))) { + } else if (validFilters.hasOwnProperty(filterType) && validFilters[filterType].includes(String(filter))) { let checkbox = $(`.filter-checkbox[data-filter-name='${filterType}'][data-filter-item='${filter}']`); let filterTag = $(`.filter-box-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); let resourceTags = $(`.resource-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); @@ -91,9 +82,10 @@ function deserializeURLParams() { // Ditch all the params from the URL, and recalculate the URL params updateURL(); - // If we've added a filter, hide the no filters tag. + // If we've added a filter, hide stuff if (filterAdded) { $(".no-tags-selected.tag").hide(); + $(".close-filters-button").show(); } } }); @@ -123,15 +115,36 @@ function updateURL() { function updateUI() { let resources = $('.resource-box'); let filterTags = $('.filter-box-tag'); + let noTagsSelected = $(".no-tags-selected.tag"); + let closeFiltersButton = $(".close-filters-button"); // Update the URL to match the new filters. updateURL(); - // If there's nothing in the filters, show everything and return. + // If there's nothing in the filters, we can return early. if (noFilters()) { resources.show(); filterTags.hide(); + noTagsSelected.show(); + closeFiltersButton.hide(); + $(`.filter-checkbox:checked`).prop("checked", false) return; + } else { + $.each(activeFilters, function(filterType, filters) { + $.each(filters, function(index, filter) { + // Show a corresponding filter box tag + $(`.filter-box-tag[data-filter-name=${filterType}][data-filter-item=${filter}]`).show(); + + // Make corresponding resource tags active + $(`.resource-tag[data-filter-name=${filterType}][data-filter-item=${filter}]`).addClass("active"); + + // Hide the "No filters selected" tag. + noTagsSelected.hide(); + + // Show the close filters button + closeFiltersButton.show(); + }); + }); } // Otherwise, hide everything and then filter the resources to decide what to show. @@ -147,7 +160,6 @@ function updateUI() { let resourceBox = $(this); // Validate the filters - $.each(activeFilters, function(filterType, filters) { // If the filter list is empty, this passes validation. if (filters.length === 0) { @@ -256,6 +268,11 @@ document.addEventListener("DOMContentLoaded", function () { } }); + // When you click the little gray x, remove all filters. + $(".close-filters-button").on("click", function() { + removeAllFilters(); + }); + // When checkboxes are toggled, trigger a filter update. $('.filter-checkbox').on("change", function (event) { let filterItem = this.dataset.filterItem; diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index 4b7e9040..cebaace2 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -31,64 +31,70 @@ {# Filter box tags #}
    -
    - {# A little x in the top right, visible only when filters are active, which removes all filters. #} - - - {# A filter tag for when there are no filters active #} - - - No filters selected - +
    +
    + {# A filter tag for when there are no filters active #} + + + No filters selected + - {% for filter_name, filter_data in filters.items %} - {% for filter_item in filter_data.filters %} - {% if filter_name == "Difficulty" %} - - - {{ filter_item|title }} - - - {% endif %} - {% if filter_name == "Type" %} - - - {{ filter_item|title }} - - - {% endif %} - {% if filter_name == "Payment tiers" %} - - - {{ filter_item|title }} - - - {% endif %} - {% if filter_name == "Topics" %} - - - {{ filter_item|title }} - - - {% endif %} + {% for filter_name, filter_data in filters.items %} + {% for filter_item in filter_data.filters %} + {% if filter_name == "Difficulty" %} + + + {{ filter_item|title }} + + + {% endif %} + {% if filter_name == "Type" %} + + + {{ filter_item|title }} + + + {% endif %} + {% if filter_name == "Payment tiers" %} + + + {{ filter_item|title }} + + + {% endif %} + {% if filter_name == "Topics" %} + + + {{ filter_item|title }} + + + {% endif %} + {% endfor %} {% endfor %} - {% endfor %} +
    +
    + {# A little x in the top right, visible only when filters are active, which removes all filters. #} + + + + +
    -- cgit v1.2.3 From 71b1e7ec1ed5fd8f445015a759d74bfdd8828986 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 22:29:18 +0100 Subject: Revert changes to pyproject.toml. These changes were not necessary. I am very sorry for the things that I did. --- pydis_site/apps/resources/tests/test_views.py | 2 +- pyproject.toml | 33 ++++++++++++++------------- 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py index dab3599d..0af5ce5f 100644 --- a/pydis_site/apps/resources/tests/test_views.py +++ b/pydis_site/apps/resources/tests/test_views.py @@ -2,7 +2,7 @@ from pathlib import Path from django.conf import settings from django.test import TestCase -from django_hosts import reverse +from django.urls import reverse TESTING_RESOURCES_PATH = Path( settings.BASE_DIR, "pydis_site", "apps", "resources", "tests", "testing_resources" diff --git a/pyproject.toml b/pyproject.toml index 8525a16e..6392f871 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,26 +6,25 @@ authors = ["Python Discord "] license = "MIT" [tool.poetry.dependencies] +python = "3.9.*" django = "~=3.1.14" -django-distill = "~=2.9.0" django-environ = "~=0.4.5" django-filter = "~=21.1" -django-prometheus = "~=2.1" -django-simple-bulma = "~=2.4" djangorestframework = "~=3.12.0" -gunicorn = "~=20.0.4" -markdown = "~=3.3.4" psycopg2-binary = "~=2.8.0" -python = "3.9.*" -python-frontmatter = "~=1.0" -pyyaml = "~=5.1" +django-simple-bulma = "~=2.4" +whitenoise = "~=5.0" requests = "~=2.21" +pyyaml = "~=5.1" +gunicorn = "~=20.0.4" sentry-sdk = "~=0.19" -whitenoise = "~=5.0" +markdown = "~=3.3.4" +python-frontmatter = "~=1.0" +django-prometheus = "~=2.1" +django-distill = "~=2.9.0" [tool.poetry.dev-dependencies] coverage = "~=5.0" -coveralls = "~=2.1" flake8 = "~=3.7" flake8-annotations = "~=2.0" flake8-bandit = "~=2.1" @@ -39,18 +38,20 @@ mccabe = "~=0.6.1" pep8-naming = "~=0.9" pre-commit = "~=2.1" pyfakefs = "~=4.5" -python-dotenv = "~=0.17.1" +coveralls = "~=2.1" taskipy = "~=1.7.0" +python-dotenv = "~=0.17.1" [build-system] -build-backend = "poetry.core.masonry.api" requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" [tool.taskipy.tasks] +start = "python manage.py run --debug" +makemigrations = "python manage.py makemigrations" django_shell = "python manage.py shell" +test = "coverage run manage.py test" +report = "coverage report -m" lint = "pre-commit run --all-files" -makemigrations = "python manage.py makemigrations" precommit = "pre-commit install" -report = "coverage report -m" -start = "python manage.py run --debug" -test = "coverage run manage.py test" +static = "python manage.py distill-local build --traceback --force" -- cgit v1.2.3 From 47248a0a1e183871879ad1506b08a19a0b2042f4 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 22:52:08 +0100 Subject: Add more tests for the new resources page. Coverage is now 100%. --- pydis_site/apps/resources/tests/test_views.py | 12 ++++++++++++ pyproject.toml | 1 + 2 files changed, 13 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py index 0af5ce5f..a2a203ce 100644 --- a/pydis_site/apps/resources/tests/test_views.py +++ b/pydis_site/apps/resources/tests/test_views.py @@ -15,3 +15,15 @@ class TestResourcesView(TestCase): url = reverse("resources:index") response = self.client.get(url) self.assertEqual(response.status_code, 200) + + def test_resources_with_valid_argument(self): + """Check that you can resolve the resources when passing a valid argument.""" + url = reverse("resources:index", kwargs={"resource_type": "book"}) + response = self.client.get(url) + self.assertEqual(response.status_code, 200) + + def test_resources_with_invalid_argument(self): + """Check that you can resolve the resources when passing an invalid argument.""" + url = reverse("resources:index", kwargs={"resource_type": "urinal-cake"}) + response = self.client.get(url) + self.assertEqual(response.status_code, 404) diff --git a/pyproject.toml b/pyproject.toml index 6392f871..b350836e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ start = "python manage.py run --debug" makemigrations = "python manage.py makemigrations" django_shell = "python manage.py shell" test = "coverage run manage.py test" +coverage = "coverage run manage.py test --no-input; coverage report -m" report = "coverage report -m" lint = "pre-commit run --all-files" precommit = "pre-commit install" -- cgit v1.2.3 From 4dfde7fbf09a38134e997abe5b2b7ebe08fc0538 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 1 Feb 2022 01:18:57 +0100 Subject: Make resource tags correctly deactivate. --- pydis_site/static/js/resources/resources.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js index 8627a359..bffb5e91 100644 --- a/pydis_site/static/js/resources/resources.js +++ b/pydis_site/static/js/resources/resources.js @@ -115,6 +115,7 @@ function updateURL() { function updateUI() { let resources = $('.resource-box'); let filterTags = $('.filter-box-tag'); + let resourceTags = $('.resource-tag'); let noTagsSelected = $(".no-tags-selected.tag"); let closeFiltersButton = $(".close-filters-button"); @@ -127,9 +128,17 @@ function updateUI() { filterTags.hide(); noTagsSelected.show(); closeFiltersButton.hide(); + resourceTags.removeClass("active"); $(`.filter-checkbox:checked`).prop("checked", false) return; } else { + // Hide everything + $('.filter-box-tag').hide(); + $('.resource-tag').removeClass("active"); + noTagsSelected.show(); + closeFiltersButton.hide(); + + // Now conditionally show the stuff we want $.each(activeFilters, function(filterType, filters) { $.each(filters, function(index, filter) { // Show a corresponding filter box tag -- cgit v1.2.3 From 3c92f66890a67a19ba082acd50ebcd2df311f305 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 1 Feb 2022 01:21:21 +0100 Subject: When hovering titles, make them light, not black. --- pydis_site/static/css/resources/resources.css | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index 2fb3a9b5..b8456e38 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -119,6 +119,12 @@ i.is-primary { filter: brightness(115%); } +/* When hovering title anchors, just make the color a lighter primary, not black. */ +.resource-box a:hover { + filter: brightness(120%); + color: #7289DA; +} + /* Set default display to inline-flex, for centering. */ span.filter-box-tag { -- cgit v1.2.3 From d31340f8abeabc5df1c778d7d8eae4d0806fad0e Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 1 Feb 2022 02:13:34 +0100 Subject: Fix bug where transition wouldn't work on first collapse. --- pydis_site/static/css/collapsibles.css | 6 +++++- pydis_site/static/js/collapsibles.js | 6 +----- pydis_site/static/js/resources/resources.js | 7 ++++--- pydis_site/templates/resources/resources.html | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/collapsibles.css b/pydis_site/static/css/collapsibles.css index 8fdd1f12..d35e77ea 100644 --- a/pydis_site/static/css/collapsibles.css +++ b/pydis_site/static/css/collapsibles.css @@ -6,7 +6,11 @@ } .collapsible-content { + max-height: 40em; + transition: max-height 0.3s ease-out; +} + +.collapsible-content.collapsed { overflow: hidden; max-height: 0; - transition: max-height 0.2s ease-out; } diff --git a/pydis_site/static/js/collapsibles.js b/pydis_site/static/js/collapsibles.js index 366a033c..d12d9f86 100644 --- a/pydis_site/static/js/collapsibles.js +++ b/pydis_site/static/js/collapsibles.js @@ -3,11 +3,7 @@ document.addEventListener("DOMContentLoaded", () => { for (const header of headers) { header.addEventListener("click", () => { var content = header.nextElementSibling; - if (content.style.maxHeight){ - content.style.maxHeight = null; - } else { - content.style.maxHeight = content.scrollHeight + "px"; - } + content.classList.toggle('collapsed'); }); } }); diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js index bffb5e91..00bc6ad8 100644 --- a/pydis_site/static/js/resources/resources.js +++ b/pydis_site/static/js/resources/resources.js @@ -234,11 +234,12 @@ document.addEventListener("DOMContentLoaded", function () { if (screen.width < 480) { let categoryHeaders = $(".filter-category-header .collapsible-content"); let icons = $('.filter-category-header button .card-header-icon i'); - categoryHeaders.addClass("no-transition"); - categoryHeaders.css("max-height", ""); + categoryHeaders.addClass("no-transition collapsed"); icons.removeClass(["far", "fa-window-minimize"]); icons.addClass(["fas", "fa-angle-down"]); - categoryHeaders.removeClass("no-transition"); + + // Wait 10ms before removing this class, or else the transition will animate due to a race condition. + setTimeout(() => { categoryHeaders.removeClass("no-transition"); }, 10); } // If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox. diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index cebaace2..c221c8a3 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -116,9 +116,9 @@ {# Checkboxes #} {% if filter_data.hidden %} -
    +