Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pydis_site/apps/home/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
path('logout', LogoutView.as_view(), name="logout"),

path('admin/', admin.site.urls),
path('resources/', include('pydis_site.apps.resources.urls')),
]
Empty file.
7 changes: 7 additions & 0 deletions pydis_site/apps/resources/apps.py
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.
10 changes: 10 additions & 0 deletions pydis_site/apps/resources/tests/test_views.py
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)
8 changes: 8 additions & 0 deletions pydis_site/apps/resources/urls.py
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"),
]
3 changes: 3 additions & 0 deletions pydis_site/apps/resources/views/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .resources import ResourcesView

__all__ = ["ResourcesView"]
7 changes: 7 additions & 0 deletions pydis_site/apps/resources/views/resources.py
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"
1 change: 1 addition & 0 deletions pydis_site/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
'pydis_site.apps.api',
'pydis_site.apps.home',
'pydis_site.apps.staff',
'pydis_site.apps.resources',

'django.contrib.admin',
'django.contrib.auth',
Expand Down
29 changes: 29 additions & 0 deletions pydis_site/static/css/resources/resources.css
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%);
}
90 changes: 90 additions & 0 deletions pydis_site/templates/resources/resources.html
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">
Copy link
Copy Markdown
Contributor

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 the articles endpoint exists we'll need to go back and use the url tag here.

Copy link
Copy Markdown
Contributor Author

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.

<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 %}