-
-
Notifications
You must be signed in to change notification settings - Fork 138
Dewikification - Create app for resources + index page of resources #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cc0fa3c
Create base resources app
ks129 cae8eb7
Create CSS for resources index
ks129 d5c6986
Create resources index HTML file
ks129 83239a5
Include resources app to settings
ks129 05fac08
Create view for resources index
ks129 42fb572
Create resources app URLs
ks129 dd950f2
Include resources app URLs to home app URLs
ks129 128def5
Create tests for resources app
ks129 638c323
Simplify resources index view
ks129 337b547
Update guides URL to match with latest changes in #393
ks129 469bbb9
Merge branch 'dewikification' into resources-home
ks129 7cb83b6
Remove breadcrumb from resources index page to avoid too much titles
ks129 2535d22
Remove resources index breadcrumb CSS
ks129 a991353
Remove unnecessary namespace from including resources app URLs
ks129 194e372
Change resources home name from resources -> index
ks129 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from django.apps import AppConfig | ||
|
|
||
|
|
||
| class ResourcesConfig(AppConfig): | ||
| """AppConfig instance for Resources app.""" | ||
|
|
||
| name = 'resources' |
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from django.test import TestCase | ||
| from django_hosts import reverse | ||
|
|
||
|
|
||
| class TestResourcesView(TestCase): | ||
| def test_resources_index_200(self): | ||
| """Check does index of resources app return 200 HTTP response.""" | ||
| url = reverse("resources:index") | ||
| response = self.client.get(url) | ||
| self.assertEqual(response.status_code, 200) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from django.urls import path | ||
|
|
||
| from pydis_site.apps.resources import views | ||
|
|
||
| app_name = "resources" | ||
| urlpatterns = [ | ||
| path("", views.ResourcesView.as_view(), name="index"), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from .resources import ResourcesView | ||
|
|
||
| __all__ = ["ResourcesView"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from django.views.generic import TemplateView | ||
|
|
||
|
|
||
| class ResourcesView(TemplateView): | ||
| """View for resources index page.""" | ||
|
|
||
| template_name = "resources/resources.html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| .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%); | ||
| } | ||
|
|
||
| #interactiveBlock { | ||
| background-image: linear-gradient(141deg, #d05600 0%, #da722a 71%, #e68846 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%); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| {% extends 'base/base.html' %} | ||
| {% load static %} | ||
|
|
||
| {% block title %}Resources{% endblock %} | ||
| {% block head %} | ||
| <link rel="stylesheet" href="{% static "css/resources/resources.css" %}"> | ||
| {% endblock %} | ||
|
|
||
| {% block content %} | ||
| {% include "base/navbar.html" %} | ||
|
|
||
| <section class="section"> | ||
| <div class="container"> | ||
| <div class="content"> | ||
| <h1>Resources</h1> | ||
|
|
||
| <div class="tile is-ancestor"> | ||
| <a class="tile is-parent" href="/articles/category/guides"> | ||
| <article class="tile is-child box hero is-primary is-bold"> | ||
| <p class="title is-size-1"><i class="fad fa-info-circle" aria-hidden="true"></i> Guides</p> | ||
| <p class="subtitle is-size-4">Made by us, for you</p> | ||
| </article> | ||
| </a> | ||
|
|
||
| <div class="tile is-vertical is-9"> | ||
| <div class="tile"> | ||
| <a class="tile is-8 is-parent" href="/resources/reading/"> | ||
| <article class="tile is-child box hero is-black" id="readingBlock"> | ||
| <p class="title is-size-1"><i class="fad fa-book-alt" aria-hidden="true"></i> Read</p> | ||
| <p class="subtitle is-size-4">Lovingly curated books to explore</p> | ||
| </article> | ||
| </a> | ||
|
|
||
| <div class="tile"> | ||
| <a class="tile is-parent" href="/resources/videos/"> | ||
| <article class="tile is-child box hero is-danger is-bold"> | ||
| <p class="title is-size-1"><i class="fad fa-video" aria-hidden="true"></i> Watch</p> | ||
| <p class="subtitle is-size-4">Visually engaging</p> | ||
| </article> | ||
| </a> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="tile"> | ||
| <a class="tile is-parent" href="/resources/interactive/"> | ||
| <article class="tile is-child box hero is-black" id="interactiveBlock"> | ||
| <p class="title is-size-1"><i class="fad fa-code" aria-hidden="true"></i> Try</p> | ||
| <p class="subtitle is-size-4">Interactively discover the possibilities</p> | ||
| </article> | ||
| </a> | ||
| <a class="tile is-8 is-parent" href="/resources/courses/"> | ||
| <article class="tile is-child box hero is-success is-bold"> | ||
| <p class="title is-size-1"><i class="fad fa-graduation-cap" aria-hidden="true"></i> Learn</p> | ||
| <p class="subtitle is-size-4">Structured courses with clear goals</p> | ||
| </article> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="tile is-ancestor"> | ||
| <div class="tile is-vertical is-9"> | ||
| <div class="tile"> | ||
| <a class="tile is-8 is-parent" href="/resources/communities/"> | ||
| <article class="tile is-child box hero is-black" id="communitiesBlock"> | ||
| <p class="title is-size-1"><i class="fad fa-users" aria-hidden="true"></i> Communities</p> | ||
| <p class="subtitle is-size-4">Some of our best friends</p> | ||
| </article> | ||
| </a> | ||
| <div class="tile"> | ||
| <a class="tile is-parent" href="/resources/podcasts/"> | ||
| <article class="tile is-child box hero is-black" id="podcastsBlock"> | ||
| <p class="title is-size-1"><i class="fad fa-podcast" aria-hidden="true"></i> Listen</p> | ||
| <p class="subtitle is-size-4">Regular podcasts to follow</p> | ||
| </article> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <a class="tile is-parent" href="/resources/tools/"> | ||
| <article class="tile is-child box hero is-dark"> | ||
| <p class="title is-size-1"><i class="fad fa-tools" aria-hidden="true"></i> Tools</p> | ||
| <p class="subtitle is-size-4">Things we love to use</p> | ||
| </article> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| {% endblock %} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware this endpoint hasn't been implemented yet, but just making a note here so you're aware:
It's preferable to use django's
{% url %}tag when referencing views, so we can reference it by namespace rather than the relative URL. When thearticlesendpoint exists we'll need to go back and use the url tag here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I this we should get this merged faster than content app one, as then I can make change there about it.