From 4bf208784e21a97e29474a7b5e7283d1105b14c9 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Fri, 12 Nov 2021 09:27:15 +0100 Subject: Content: update help channel claiming system This commit changes the following inside the help channel guide: * Only one help channel can be claimed at the same time * You can use the search to find your channel * The channel will close after 10 minutes if someone else sends a message --- .../apps/content/resources/guides/pydis-guides/help-channel-guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md index 8b7c5584..fe1c4747 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md @@ -42,14 +42,14 @@ There are always 3 available help channels waiting to be claimed in the **Python In order to claim one, simply start typing your question into one of these channels. Once your question has been posted, you have claimed this channel, and the channel will be moved down to the **Python Help: Occupied** category. -If you're unable to type into these channels, this means you're currently **on cooldown**. In order to prevent someone from claiming all the channels for themselves, **we only allow someone to claim a new help channel every 15 minutes**. However, if you close your help channel using the `!dormant` command, this cooldown is reset early. +If you're unable to type into these channels, this means you're currently **on cooldown**. In order to prevent someone from claiming all the channels for themselves, **we only allow someone to claim a single help channel at the same time**. You can search in the top right corner of your Discord client `from:yourusername#xxxx` to find back your channel. ![Channel available message](/static/images/content/help_channels/available_message.png) *This message is always posted when a channel becomes available for use.* ## Q: For how long is the channel mine? -The channel is yours until it has been inactive for **30 minutes**. When this happens, we move the channel down to the **Python Help: Dormant** category, and make the channel read-only. After a while, the channel will be rotated back into **Python Help: Available** for the next question. Please try to resist the urge to continue bumping the channel so that it never gets marked as inactive. If nobody is answering your question, you should try to reformulate the question to increase your chances of getting help. +The channel is yours until it has been inactive for **10 minutes**, or 30 minutes until someone participate in the channel. When this happens, we move the channel down to the **Python Help: Dormant** category, and make the channel read-only. After a while, the channel will be rotated back into **Python Help: Available** for the next question. Please try to resist the urge to continue bumping the channel so that it never gets marked as inactive. If nobody is answering your question, you should try to reformulate the question to increase your chances of getting help. ![Channel dormant message](/static/images/content/help_channels/dormant_message.png) *You'll see this message in your channel when the channel is marked as inactive.* -- cgit v1.2.3 From c1593a66e1fe8739ba881f76736330459d0ffc8e Mon Sep 17 00:00:00 2001 From: mina Date: Thu, 23 Dec 2021 13:13:26 -0500 Subject: Fix markdown error linking to recommended editors --- .../guides/python-guides/creating-python-environment-windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/python-guides/creating-python-environment-windows.md b/pydis_site/apps/content/resources/guides/python-guides/creating-python-environment-windows.md index 356d63bd..635c384f 100644 --- a/pydis_site/apps/content/resources/guides/python-guides/creating-python-environment-windows.md +++ b/pydis_site/apps/content/resources/guides/python-guides/creating-python-environment-windows.md @@ -29,7 +29,7 @@ You will also need a text editor for writing Python programs, and for subsequent Powerful programs called integrated development environments (IDEs) like PyCharm and Visual Studio Code contain text editors, but they also contain many other features with uses that aren't immediately obvious to new programmers. [Notepad++](https://notepad-plus-plus.org/) is a popular text editor for both beginners and advanced users who prefer a simpler interface. -Other editors we recommend can be found (https://pythondiscord.com/resources/tools/#editors)[here]. +Other editors we recommend can be found [here](https://pythondiscord.com/resources/tools/#editors). ## Installing Git Bash Git is a command line program that helps you keep track of changes to your code, among other things. -- cgit v1.2.3 From 0dc2e2a1c8bb7f8ee51bc37a311d3b60473fbad6 Mon Sep 17 00:00:00 2001 From: mina Date: Thu, 23 Dec 2021 16:25:56 -0500 Subject: Update wording in topical and general help channel sections --- .../guides/pydis-guides/help-channel-guide.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md index fe1c4747..5b0c773c 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md @@ -22,17 +22,15 @@ If your question fits into the domain of one of our topical help channels, and i ![List of topical help channels](/static/images/content/help_channels/topical_channels.png) -Some of the topical help channels have a broad scope, so they can cover many (somewhat) related topics. +Some of the topical help channels have a broad scope, so they can cover many related topics. For example, `#data-science-and-ai` covers scientific Python, statistics, and machine learning, while `#algos-and-data-structs` covers everything from data structures and algorithms to maths. -To help you navigate this, we've added a list of suggested topics in the topic of every channel. -If you're not sure where to post, feel free to ask us which channel is relevant for a topic in `#community-meta`. +Each channel on the server has a channel description which briefly describes the topics covered by that channel. If you're not sure where to post, feel free to ask us which channel is appropriate in `#community-meta`. # General Help Channels -Our general help channels move at a fast pace, and attract a far more diverse spectrum of helpers. -This is a great choice for a generic Python question, and a good choice if you need an answer as soon as possible. -It's particularly important to [ask good questions](../asking-good-questions) when asking in these channels, or you risk not getting an answer and having your help channel be claimed by someone else. +Our general help channels cycle quickly, with the advantage of attracting a more diverse spectrum of helpers, and getting individual attention and help for your question. These channels are a great choice for generic Python questions, but they can be used for domain-specific Python help as well. +Be sure to [ask good questions](../asking-good-questions) in order to give yourself the best chances of getting help. ## How To Claim a Channel @@ -40,12 +38,12 @@ There are always 3 available help channels waiting to be claimed in the **Python ![Available help channels](/static/images/content/help_channels/available_channels.png) -In order to claim one, simply start typing your question into one of these channels. Once your question has been posted, you have claimed this channel, and the channel will be moved down to the **Python Help: Occupied** category. +This message is posted when a channel becomes available for use: +![Channel available message](/static/images/content/help_channels/available_message.png) -If you're unable to type into these channels, this means you're currently **on cooldown**. In order to prevent someone from claiming all the channels for themselves, **we only allow someone to claim a single help channel at the same time**. You can search in the top right corner of your Discord client `from:yourusername#xxxx` to find back your channel. +In order to claim one, simply start typing your question into one of these channels. Once your question is posted, you have claimed this channel it will be moved down to the **Occupied Help Channels** category. -![Channel available message](/static/images/content/help_channels/available_message.png) -*This message is always posted when a channel becomes available for use.* +At this point you will have the **Help Cooldown** role which will remain on your profile until your help channel is closed (with the `!closed` command) or goes dormant due to inactivity. ## Q: For how long is the channel mine? -- cgit v1.2.3 From 5403f81215c7ea51aaebfc29148f8c9104b92430 Mon Sep 17 00:00:00 2001 From: mina Date: Thu, 23 Dec 2021 16:29:23 -0500 Subject: Add Frequently Asked Questions header --- .../apps/content/resources/guides/pydis-guides/help-channel-guide.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md index 5b0c773c..0f5a4f9c 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md @@ -45,6 +45,8 @@ In order to claim one, simply start typing your question into one of these chann At this point you will have the **Help Cooldown** role which will remain on your profile until your help channel is closed (with the `!closed` command) or goes dormant due to inactivity. +# Frequently Asked Questions + ## Q: For how long is the channel mine? The channel is yours until it has been inactive for **10 minutes**, or 30 minutes until someone participate in the channel. When this happens, we move the channel down to the **Python Help: Dormant** category, and make the channel read-only. After a while, the channel will be rotated back into **Python Help: Available** for the next question. Please try to resist the urge to continue bumping the channel so that it never gets marked as inactive. If nobody is answering your question, you should try to reformulate the question to increase your chances of getting help. -- cgit v1.2.3 From 75cde82850b683a563a23cbed813bfcb0322e92e Mon Sep 17 00:00:00 2001 From: mina Date: Thu, 23 Dec 2021 16:55:59 -0500 Subject: Update channel dormancy timings --- .../content/resources/guides/pydis-guides/help-channel-guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md index 0f5a4f9c..c0c7f896 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md @@ -47,12 +47,12 @@ At this point you will have the **Help Cooldown** role which will remain on your # Frequently Asked Questions -## Q: For how long is the channel mine? +## Q: How long does my help channel stay active? -The channel is yours until it has been inactive for **10 minutes**, or 30 minutes until someone participate in the channel. When this happens, we move the channel down to the **Python Help: Dormant** category, and make the channel read-only. After a while, the channel will be rotated back into **Python Help: Available** for the next question. Please try to resist the urge to continue bumping the channel so that it never gets marked as inactive. If nobody is answering your question, you should try to reformulate the question to increase your chances of getting help. +The channel remains open for **30 minutes** after your last message, but if another user posts in your channel, the closing will be delayed by 10 minutes. +*You'll see this message in your channel once it goes dormant:* ![Channel dormant message](/static/images/content/help_channels/dormant_message.png) -*You'll see this message in your channel when the channel is marked as inactive.* ## Q: I don't need my help channel anymore, my question was answered. What do I do? -- cgit v1.2.3 From 0219d94eb449f99dabf1f26dcf77f07ef92d13e0 Mon Sep 17 00:00:00 2001 From: mina Date: Thu, 23 Dec 2021 17:05:08 -0500 Subject: Add "no one answered me" question and answer --- .../content/resources/guides/pydis-guides/help-channel-guide.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md index c0c7f896..e74cc43f 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md @@ -54,6 +54,12 @@ The channel remains open for **30 minutes** after your last message, but if anot *You'll see this message in your channel once it goes dormant:* ![Channel dormant message](/static/images/content/help_channels/dormant_message.png) +## Q: No one answered my question. How come? + +The server has users active all over the world and all hours of the day, but some days are less active than others. If no one answered your question, feel free to claim another help channel a little later. + +If you still feel like your question is being overlooked, read our guide on [asking good questions](../asking-good-questions) to incease your chances of getting a response. + ## Q: I don't need my help channel anymore, my question was answered. What do I do? Once you have finished with your help channel you or a staff member can run `!dormant`. This will move the channel to the **Python Help: Dormant** category where it will sit until it is returned to circulation. You will only be able to run the command if you claimed the channel from the available category, you cannot close channels belonging to others. -- cgit v1.2.3 From 72234b1a2b6585e998d85cebd31d3b5ed7986cec Mon Sep 17 00:00:00 2001 From: mina Date: Thu, 23 Dec 2021 17:12:18 -0500 Subject: Edit "how do I close my channel" question and answer --- .../apps/content/resources/guides/pydis-guides/help-channel-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md index e74cc43f..5f41f442 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md @@ -62,7 +62,7 @@ If you still feel like your question is being overlooked, read our guide on [ask ## Q: I don't need my help channel anymore, my question was answered. What do I do? -Once you have finished with your help channel you or a staff member can run `!dormant`. This will move the channel to the **Python Help: Dormant** category where it will sit until it is returned to circulation. You will only be able to run the command if you claimed the channel from the available category, you cannot close channels belonging to others. +Go ahead and move your channel to the dormant category by running the `!closed` command. You will only be able to run this command in your own help channel, and likewise no one will be able to prematurely close your claimed help channel (with the exception of staff). ## Q: Are only Helpers supposed to answer questions? -- cgit v1.2.3 From 512b1659f5bb5d2dfb8029f42d7b8c7e3436ede1 Mon Sep 17 00:00:00 2001 From: Krish Date: Fri, 7 Jan 2022 12:19:29 +0530 Subject: Resource Suggestion: #639 solved --- .../pydis-guides/contributing/setting-test-server-and-bot-account.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/setting-test-server-and-bot-account.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/setting-test-server-and-bot-account.md index c14fe50d..43d1c8f5 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/setting-test-server-and-bot-account.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/setting-test-server-and-bot-account.md @@ -18,13 +18,11 @@ icon: fab fa-discord 4. Change your bot's `Public Bot` setting off so only you can invite it, save, and then get your **Bot Token** with the `Copy` button. > **Note:** **DO NOT** post your bot token anywhere public, or it can and will be compromised. 5. Save your **Bot Token** somewhere safe to use in the project settings later. -6. In the `General Information` tab, grab the **Client ID**. +6. In the `OAuth2` tab, grab the **Client ID**. 7. Replace `` in the following URL and visit it in the browser to invite your bot to your new test server. ```plaintext https://discordapp.com/api/oauth2/authorize?client_id=&permissions=8&scope=bot ``` -Optionally, you can generate your own invite url in the `OAuth` tab, after selecting `bot` as the scope. - --- ## Obtain the IDs -- cgit v1.2.3 From 7242fb9492f07c724d4b354ca34d07e2948e4a1f Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Wed, 26 Jan 2022 23:15:05 +0000 Subject: Fix pynews config in example file The python news cog relies on the python_news section of the config being filled in via a named alias. Since we were using the DEV_ prefix, this meant it was not being populated, leading to the cog throwing an error on boot. --- .../apps/content/resources/guides/pydis-guides/contributing/bot.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index b9589def..d31c6dbf 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -350,7 +350,7 @@ style: trashcan: "<:trashcan:�>" -##### << Optional - If you don't care about the filtering and help channel cogs, ignore the rest of this file >> ##### +##### << Optional - If you don't care about the filtering, help channel and py-news cogs, ignore the rest of this file >> ##### filter: # What do we filter? filter_domains: true @@ -426,6 +426,10 @@ help_channels: notify_roles: - *HELPERS_ROLE +python_news: + channel: *DEV_PY_NEWS + webhook: *PYNEWS_WEBHOOK + ##### << Add any additional sections you need to override from config-default.yml >> ##### -- cgit v1.2.3 From 8b50bef2f43d660679702c8043390b2e3ec62f03 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Wed, 26 Jan 2022 23:15:39 +0000 Subject: Add new incidents webhook to exmaple config.yml This was recently added to the bot. --- .../apps/content/resources/guides/pydis-guides/contributing/bot.md | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index d31c6dbf..ed9e3db3 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -196,6 +196,7 @@ guild: big_brother: � dev_log: � duck_pond: � + incidents: � incidents_archive: � python_news: &PYNEWS_WEBHOOK � talent_pool: � -- 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/apps/content') 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 e144d4d1b4d1ef2ec2f9f8b771b3606b581ace34 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 1 Feb 2022 22:43:15 +0100 Subject: Complete refactor of collapsibles. This is now a completely self-contained feature, which can be used in the same way on every page. I've moved all the collapsible-related logics out of the resources.js file and into collapsibles.js, and added documentation and other quality-of-life features that will apply to other pages, as well. Changes: - The icon will now always change when the collapsible opens or closes. - By adding the "collapsed" class, you can tell the collapsible to be collapsed by default. --- .../guides/pydis-guides/contributing/bot.md | 20 ++++---- pydis_site/static/css/collapsibles.css | 4 -- pydis_site/static/js/collapsibles.js | 60 ++++++++++++++++++++-- pydis_site/static/js/resources/resources.js | 15 +----- 4 files changed, 67 insertions(+), 32 deletions(-) (limited to 'pydis_site/apps/content') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index ed9e3db3..2aa10aa3 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -14,10 +14,10 @@ First things first, to run the bot's code and make changes to it, you need a loc -
+