Public project changes
Now we organize training content into 'courses' and 'workshops'. This commit updates various endpoints and menus to reflect that decision.
This commit is contained in:
@@ -6,6 +6,7 @@ from pillarsdk.exceptions import ResourceNotFound
|
|||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from flask import Blueprint, current_app, render_template, redirect, url_for
|
from flask import Blueprint, current_app, render_template, redirect, url_for
|
||||||
from pillar.web.utils import system_util, get_file, current_user_is_authenticated
|
from pillar.web.utils import system_util, get_file, current_user_is_authenticated
|
||||||
|
from pillar.web.utils import attach_project_pictures
|
||||||
|
|
||||||
blueprint = Blueprint('cloud', __name__)
|
blueprint = Blueprint('cloud', __name__)
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -110,6 +111,64 @@ def join():
|
|||||||
return redirect('https://store.blender.org/product/membership/')
|
return redirect('https://store.blender.org/product/membership/')
|
||||||
|
|
||||||
|
|
||||||
|
def get_projects(category):
|
||||||
|
"""Utility to get projects based on category. Should be moved on the API
|
||||||
|
and improved with more extensive filtering capabilities.
|
||||||
|
"""
|
||||||
|
api = system_util.pillar_api()
|
||||||
|
projects = Project.all({
|
||||||
|
'where': {
|
||||||
|
'category': category,
|
||||||
|
'is_private': False},
|
||||||
|
'sort': '-_created',
|
||||||
|
}, api=api)
|
||||||
|
for project in projects._items:
|
||||||
|
attach_project_pictures(project, api)
|
||||||
|
return projects
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.route('/courses')
|
||||||
|
def courses():
|
||||||
|
@current_app.cache.cached(timeout=3600, unless=current_user_is_authenticated)
|
||||||
|
def render_page():
|
||||||
|
projects = get_projects('course')
|
||||||
|
return render_template(
|
||||||
|
'projects_index_collection.html',
|
||||||
|
title='courses',
|
||||||
|
projects=projects._items,
|
||||||
|
api=system_util.pillar_api())
|
||||||
|
|
||||||
|
return render_page()
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.route('/open-projects')
|
||||||
|
def open_projects():
|
||||||
|
@current_app.cache.cached(timeout=3600, unless=current_user_is_authenticated)
|
||||||
|
def render_page():
|
||||||
|
projects = get_projects('film')
|
||||||
|
return render_template(
|
||||||
|
'projects_index_collection.html',
|
||||||
|
title='open-projects',
|
||||||
|
projects=projects._items,
|
||||||
|
api=system_util.pillar_api())
|
||||||
|
|
||||||
|
return render_page()
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.route('/workshops')
|
||||||
|
def workshops():
|
||||||
|
@current_app.cache.cached(timeout=3600, unless=current_user_is_authenticated)
|
||||||
|
def render_page():
|
||||||
|
projects = get_projects('workshop')
|
||||||
|
return render_template(
|
||||||
|
'projects_index_collection.html',
|
||||||
|
title='workshops',
|
||||||
|
projects=projects._items,
|
||||||
|
api=system_util.pillar_api())
|
||||||
|
|
||||||
|
return render_page()
|
||||||
|
|
||||||
|
|
||||||
def get_random_featured_nodes():
|
def get_random_featured_nodes():
|
||||||
|
|
||||||
import random
|
import random
|
||||||
|
@@ -159,6 +159,33 @@ html(lang="en")
|
|||||||
data-placement="left")
|
data-placement="left")
|
||||||
i.pi-character
|
i.pi-character
|
||||||
| Characters
|
| Characters
|
||||||
|
|
||||||
|
|
||||||
|
li(class="dropdown libraries")
|
||||||
|
a.navbar-item.dropdown-toggle(
|
||||||
|
href="",
|
||||||
|
data-toggle="dropdown",
|
||||||
|
title="Training")
|
||||||
|
span Training
|
||||||
|
i.pi-angle-down
|
||||||
|
|
||||||
|
ul.dropdown-menu
|
||||||
|
li
|
||||||
|
a.navbar-item(
|
||||||
|
href="{{ url_for('cloud.courses') }}",
|
||||||
|
title="Courses",
|
||||||
|
data-toggle="tooltip",
|
||||||
|
data-placement="left")
|
||||||
|
i.pi-graduation-cap
|
||||||
|
| Courses
|
||||||
|
li
|
||||||
|
a.navbar-item(
|
||||||
|
href="{{ url_for('cloud.workshops') }}",
|
||||||
|
title="Workshops",
|
||||||
|
data-toggle="tooltip",
|
||||||
|
data-placement="left")
|
||||||
|
i.pi-lightbulb
|
||||||
|
| Workshops
|
||||||
li
|
li
|
||||||
a.navbar-item(
|
a.navbar-item(
|
||||||
href="{{ url_for('projects.view', project_url='gallery') }}",
|
href="{{ url_for('projects.view', project_url='gallery') }}",
|
||||||
@@ -170,15 +197,7 @@ html(lang="en")
|
|||||||
|
|
||||||
li
|
li
|
||||||
a.navbar-item(
|
a.navbar-item(
|
||||||
href="{{ url_for('main.training') }}",
|
href="{{ url_for('cloud.open_projects') }}",
|
||||||
title="Training & Tutorials",
|
|
||||||
data-toggle="tooltip",
|
|
||||||
data-placement="bottom",
|
|
||||||
class="{% if category == 'training' %}active{% endif %}")
|
|
||||||
span Training
|
|
||||||
li
|
|
||||||
a.navbar-item(
|
|
||||||
href="{{ url_for('main.open_projects') }}",
|
|
||||||
title="Browse all the Open Projects",
|
title="Browse all the Open Projects",
|
||||||
data-toggle="tooltip",
|
data-toggle="tooltip",
|
||||||
data-placement="bottom",
|
data-placement="bottom",
|
||||||
|
@@ -1,21 +1,41 @@
|
|||||||
| {% extends 'layout.html' %}
|
| {% extends 'layout.html' %}
|
||||||
|
|
||||||
|
| {# Default case is Open Projects #}
|
||||||
|
| {% set page_title = 'Open Projects' %}
|
||||||
|
| {% set page_description = 'Full production data and tutorials from all open movies, for you to use freely' %}
|
||||||
|
| {% set page_header_image = url_for('static', filename='assets/img/backgrounds/background_agent327_01.jpg') %}
|
||||||
|
| {% set page_header_text = 'The iconic Blender Institute Open Movies. Featuring all the production files, assets, artwork, and never-seen-before content.' %}
|
||||||
|
|
||||||
|
| {% if title == 'courses' %}
|
||||||
|
| {% set page_title = 'Courses' %}
|
||||||
|
| {% set page_description = 'Production quality training by 3D professionals' %}
|
||||||
|
| {% set page_header_image = url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg') %}
|
||||||
|
| {% set page_header_text = 'Character modeling, 3D printing, VFX, rigging and more.' %}
|
||||||
|
|
||||||
|
| {% elif title == 'workshops' %}
|
||||||
|
| {% set page_title = 'Workshops' %}
|
||||||
|
| {% set page_description = 'Production quality training by 3D professionals' %}
|
||||||
|
| {% set page_header_image = url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg') %}
|
||||||
|
| {% set page_header_text = 'Enter the artist workshop and learn by example.' %}
|
||||||
|
|
||||||
|
| {% endif %}
|
||||||
|
|
||||||
| {% block og %}
|
| {% block og %}
|
||||||
meta(property="og:type", content="website")
|
meta(property="og:type", content="website")
|
||||||
meta(property="og:url", content="https://cloud.blender.org")
|
meta(property="og:url", content="https://cloud.blender.org")
|
||||||
|
|
||||||
meta(property="og:title", content="{% if title == 'open-projects' %}Open Projects{% elif title == 'training' %}Training{% endif %}")
|
meta(property="og:title", content="{{ page_title }} on Blender Cloud")
|
||||||
meta(name="twitter:title", content="{% if title == 'open-projects' %}Open Projects{% elif title == 'training' %}Training{% endif %} on Blender Cloud")
|
meta(name="twitter:title", content="{{ page_title }} on Blender Cloud")
|
||||||
|
|
||||||
meta(property="og:description", content="{% if title == 'open-projects' %}Full production data and tutorials from all open movies, for you to use freely{% elif title == 'training' %}Production quality training by 3D professionals{% endif %}")
|
meta(property="og:description", content="{{ page_description }}")
|
||||||
meta(name="twitter:description", content="{% if title == 'open-projects' %}Full production data and tutorials from all open movies, for you to use freely{% elif title == 'training' %}Production quality training by 3D professionals{% endif %}")
|
meta(name="twitter:description", content="{{ page_description }}")
|
||||||
|
|
||||||
meta(property="og:image", content="{% if title == 'training' %}{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg')}}{% else %}{{ url_for('static', filename='assets/img/backgrounds/background_agent327_01.jpg')}}{% endif %}")
|
meta(property="og:image", content="{{ page_header_image }}")
|
||||||
meta(name="twitter:image", content="{% if title == 'training' %}{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg')}}{% else %}{{ url_for('static', filename='assets/img/backgrounds/background_agent327_01.jpg')}}{% endif %}")
|
meta(name="twitter:image", content="{{ page_header_image }}")
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
|
|
||||||
| {% block page_title %}
|
| {% block page_title %}
|
||||||
| {% if title == 'open-projects' %}Open Projects{% elif title == 'training' %}Training{% else %}Projects{% endif %}
|
| {{ page_title }}
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
|
|
||||||
| {% block body %}
|
| {% block body %}
|
||||||
@@ -24,22 +44,13 @@ meta(name="twitter:image", content="{% if title == 'training' %}{{ url_for('stat
|
|||||||
|
|
||||||
#node_index-container
|
#node_index-container
|
||||||
#node_index-header.collection
|
#node_index-header.collection
|
||||||
img.background-header(src="{% if title == 'training' %}{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg')}}{% else %}{{ url_for('static', filename='assets/img/backgrounds/background_agent327_01.jpg')}}{% endif %}")
|
img.background-header(src="{{ page_header_image }}")
|
||||||
#node_index-collection-info
|
#node_index-collection-info
|
||||||
| {% if title == 'open-projects' %}
|
|
||||||
.node_index-collection-name
|
.node_index-collection-name
|
||||||
span Open Projects
|
span {{ page_title }}
|
||||||
.node_index-collection-description
|
.node_index-collection-description
|
||||||
span.
|
span.
|
||||||
The iconic Blender Institute Open Movies.
|
{{ page_header_text }}
|
||||||
Featuring all the production files, assets, artwork, and never-seen-before content.
|
|
||||||
| {% elif title == 'training' %}
|
|
||||||
.node_index-collection-name
|
|
||||||
span Training
|
|
||||||
.node_index-collection-description
|
|
||||||
span.
|
|
||||||
Character modeling, 3D printing, VFX, rigging and more.
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
.node_index-collection
|
.node_index-collection
|
||||||
|
|
||||||
|
@@ -51,7 +51,7 @@ meta(property="og:image", content="{{ url_for('static', filename='assets/img/bac
|
|||||||
#page-content
|
#page-content
|
||||||
section.page-card-header
|
section.page-card-header
|
||||||
h2
|
h2
|
||||||
a(href="{{ url_for('main.training') }}") Training & Tutorials
|
a(href="{{ url_for('main.courses') }}") Training & Tutorials
|
||||||
|
|
||||||
.page-triplet-container.homepage
|
.page-triplet-container.homepage
|
||||||
.row
|
.row
|
||||||
@@ -112,14 +112,14 @@ meta(property="og:image", content="{{ url_for('static', filename='assets/img/bac
|
|||||||
<a href="https://cloud.blender.org/p/chaos-evolution/">Advanced</a>
|
<a href="https://cloud.blender.org/p/chaos-evolution/">Advanced</a>
|
||||||
<a href="https://cloud.blender.org/p/blend-and-paint/">Digital Painting</a>
|
<a href="https://cloud.blender.org/p/blend-and-paint/">Digital Painting</a>
|
||||||
and
|
and
|
||||||
<a href="{{ url_for('main.training') }}">much more</a>!
|
<a href="{{ url_for('main.courses') }}">much more</a>!
|
||||||
|
|
||||||
|
|
||||||
.page-triplet-container-fluid.dark(
|
.page-triplet-container-fluid.dark(
|
||||||
style="background-image: url({{ url_for('static', filename='assets/img/backgrounds/pattern_01.jpg')}})")
|
style="background-image: url({{ url_for('static', filename='assets/img/backgrounds/pattern_01.jpg')}})")
|
||||||
section.page-card-header
|
section.page-card-header
|
||||||
h2
|
h2
|
||||||
a(href="{{ url_for('main.open_projects') }}") Browse all the Open Movies
|
a(href="{{ url_for('cloud.open_projects') }}") Browse all the Open Movies
|
||||||
|
|
||||||
.page-triplet-container.homepage
|
.page-triplet-container.homepage
|
||||||
.row
|
.row
|
||||||
@@ -166,7 +166,7 @@ meta(property="og:image", content="{{ url_for('static', filename='assets/img/bac
|
|||||||
<a href="https://cloud.blender.org/p/tears-of-steel/">Tears of Steel</a>,
|
<a href="https://cloud.blender.org/p/tears-of-steel/">Tears of Steel</a>,
|
||||||
<a href="https://cloud.blender.org/p/glass-half/">Glass Half</a>,
|
<a href="https://cloud.blender.org/p/glass-half/">Glass Half</a>,
|
||||||
and
|
and
|
||||||
<a href="{{ url_for('main.open_projects') }}">more</a>.
|
<a href="{{ url_for('cloud.open_projects') }}">more</a>.
|
||||||
|
|
||||||
|
|
||||||
section.page-card-header
|
section.page-card-header
|
||||||
|
Reference in New Issue
Block a user