From 774acbfc835600f38ca9897c04fde875daf7c70a Mon Sep 17 00:00:00 2001 From: hedy Date: Wed, 7 Feb 2024 19:11:27 +0800 Subject: Resources: Add guidelines on YAML files --- pydis_site/apps/resources/README.md | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/resources/README.md b/pydis_site/apps/resources/README.md index 6f41319a..e8229d3b 100644 --- a/pydis_site/apps/resources/README.md +++ b/pydis_site/apps/resources/README.md @@ -3,13 +3,38 @@ This Django application powering the resources list [on our website](https://www.pythondiscord.com/resources/). -## Directory structure - The main point of interest here lies in the `resources` directory: every `.yaml` file in here represents a resource that is listed on our website. If -you are looking for the place to suggest new resources, said directory is the -place to create a new YAML file. In regards to the required keys and our -values, it's best to check the other files we have for a reference. +you are looking for the place to add new resources, said directory is the +place to create a new YAML file. + +In regards to the required keys and our values, it's best to check the other +files we have for a reference. + +Here are some general guidelines: + +- The `description` text can include HTML elements, such as a simple bullet-list + to further describe the resource item. Markdown is not yet supported. + +- If branding icons (like Goodreads or GitHub through the `icon` field under + `urls`) are included, set `color: dark` rather than `color: black` to ensure it + displays correctly in dark mode. + +- For books, please include a link to the Goodreads URL under `urls`. + +- If a logo is included, use `icon_image` rather than `title_image` to have the + logo display together next to the title (rather than replacing it). Unless + the logo includes the name of the resources that is clearly visible. + +- All images used must be readable in both light and dark modes. If an image does + not suit both themes simultaneously, please include image URLs for each mode + separately using the optional `*_dark` keys: + - `icon_image`, `icon_image_dark` + - `title_image`, `title_image_dark` + - `title_icon`, `title_icon_dark` + + +## Directory structure The app has a single view in `views.py` that takes care of reading the `.yaml` file. This is a standard Django view, mounted in `urls.py` as usual. -- cgit v1.2.3 From 3bec3c32dea8ebb939f7e65916905161d8ded30c Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 20 Feb 2024 15:14:37 +0000 Subject: Ensure messages returned for metricity data do not match all excluded channels --- pydis_site/apps/api/models/bot/metricity.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/api/models/bot/metricity.py b/pydis_site/apps/api/models/bot/metricity.py index f1277b21..7d5d5f0b 100644 --- a/pydis_site/apps/api/models/bot/metricity.py +++ b/pydis_site/apps/api/models/bot/metricity.py @@ -49,7 +49,7 @@ class Metricity: WHERE author_id = '%s' AND NOT is_deleted - AND channel_id != ANY(%s) + AND channel_id != ALL(%s) """, [user_id, EXCLUDE_CHANNELS] ) @@ -77,7 +77,7 @@ class Metricity: WHERE author_id='%s' AND NOT is_deleted - AND channel_id != ANY(%s) + AND channel_id != ALL(%s) GROUP BY interval ) block_query; """, @@ -147,7 +147,7 @@ class Metricity: WHERE author_id = ANY(%s) AND NOT is_deleted - AND channel_id != ANY(%s) + AND channel_id != ALL(%s) AND created_at > now() - interval '%s days' GROUP BY author_id """, -- cgit v1.2.3