Files
blender-cloud/src/templates/_macros/_navigation.pug

171 lines
4.6 KiB
Plaintext
Raw Normal View History

2018-09-07 17:19:36 +02:00
include ../../../../pillar/src/templates/mixins/components
2018-09-06 12:54:15 +02:00
2018-09-19 11:20:17 +02:00
| {% macro navigation_homepage(title) %}
2018-09-06 12:54:15 +02:00
+nav-secondary()
+nav-secondary-link(
href="{{ url_for('cloud.open_projects') }}",
class="{% if title == 'open-projects' %}active{% endif %}")
span Open Projects
2018-09-06 12:54:15 +02:00
+nav-secondary-link(
2018-09-19 11:20:17 +02:00
href="{{ url_for('cloud.courses') }}")
span Courses
2018-09-06 12:54:15 +02:00
+nav-secondary-link(
2018-09-19 11:20:17 +02:00
href="{{ url_for('cloud.workshops') }}")
span Workshops
+nav-secondary-link(
href="{{ url_for('projects.view', project_url='textures') }}")
span Textures
+nav-secondary-link(
href="{{ url_for('projects.view', project_url='hdri') }}")
span HDRI
+nav-secondary-link(
class="{% if title == 'services' %}active{% endif %}",
href="{{ url_for('cloud.services') }}")
span Services
| {% endmacro %}
2018-09-15 05:36:23 +02:00
2018-09-19 11:20:17 +02:00
| {% macro navigation_collection(title) %}
+nav-secondary
| {% if title in ['courses', 'workshops', 'production'] %}
li
.nav-link.pointer-events-none.px-0
span Learn
li.px-1
i.pi-angle-right
2018-09-19 11:20:17 +02:00
+nav-secondary-link(
class="{% if title == 'courses' %}active{% endif %}",
href="{{ url_for('cloud.courses') }}")
span Courses
+nav-secondary-link(
class="{% if title == 'workshops' %}active{% endif %}",
href="{{ url_for('cloud.workshops') }}")
span Workshops
+nav-secondary-link(
class="{% if title == 'production' %}active{% endif %}",
href="{{ url_for('cloud.production') }}")
span.new Production Lessons
| {% elif title in ['open-projects'] %}
+nav-secondary-link(
class="{% if title == 'open-projects' %}active{% endif %}",
href="{{ url_for('projects.view', project_url='gallery') }}")
span Open Projects
| {% endif %}
2018-09-06 12:54:15 +02:00
| {% endmacro %}
2018-09-19 15:39:49 +02:00
| {% macro navigation_home_project(title) %}
+nav-secondary()
+nav-secondary-link(
href="{{ url_for('projects.index') }}",
class="{% if title == 'dashboard' %}active{% endif %}")
2018-09-19 15:42:33 +02:00
i.pi-star.pr-2
2018-09-19 15:39:49 +02:00
span My Projects
| {% if current_user.has_organizations() %}
+nav-secondary-link(
href="{{ url_for('pillar.web.organizations.index') }}",
class="{% if title == 'organizations' %}active{% endif %}")
2018-09-19 15:42:33 +02:00
i.pi-users.pr-2
2018-09-19 15:39:49 +02:00
span My Organizations
| {% endif %}
+nav-secondary-link(
href="{{ url_for('projects.home_project_shared_images')}}",
class="{% if title == 'images' %}active{% endif %}")
2018-09-19 15:42:33 +02:00
i.pi-picture.pr-2
2018-09-19 15:39:49 +02:00
span Image Sharing
+nav-secondary-link(
href="{{ url_for('projects.home_project') }}",
class="{% if title == 'blender-sync' %}active{% endif %}")
2018-09-19 15:42:33 +02:00
i.pi-blender.pr-2
2018-09-19 15:39:49 +02:00
span Blender Sync
| {% endmacro %}
| {% macro navigation_services(title) %}
+nav-secondary()
li
a.nav-link.active.px-0(href="{{ url_for('cloud.services') }}")
span Services
li.px-1
i.pi-angle-right
+nav-secondary-link(
href="/attract")
i.pi-attract.pr-2
span Attract
+nav-secondary-link(
href="/flamenco")
i.pi-flamenco.pr-2
span Flamenco
| {% endmacro %}
| {% macro navigation_project(project, navigation_links, title) %}
| {% if project.category == 'course' %}
| {% set category_url = url_for('cloud.courses') %}
| {% elif project.category == 'workshop' %}
| {% set category_url = url_for('cloud.workshops') %}
| {% elif project.category == 'film' %}
| {% set category_url = url_for('cloud.open_projects') %}
| {% else %}
| {% set category_url = url_for('main.homepage') %}
| {% endif %}
+nav-secondary()
| {% if project.url != 'blender-cloud' %}
| {% if not project.is_private %}
li.text-capitalize
a.nav-link.text-muted.px-0(href="{{ category_url }}")
| {% if project.category == 'film' %}
span Open Projects
| {% elif project.category == 'assets' %}
span Libraries
| {% else %}
span {{ project.category }}
| {% endif %}
li.px-1
i.pi-angle-right
| {% endif %}
+nav-secondary-link(
class="px-1 font-weight-bold{% if title == 'landing' %} active{% endif %}",
href="{{url_for('projects.view', project_url=project.url, _external=True)}}")
span {{ project.name }}
| {% endif %}
| {% for link in navigation_links %}
+nav-secondary-link(
href="{{ link['url'] }}",
class="{% if link['slug'] == title %}active{% endif %}")
span {{ link['label'] }}
| {% endfor %}
| {% if project.nodes_featured %}
| {# In some cases featured_nodes might might be embedded #}
| {% if '_id' in project.nodes_featured[0] %}
| {% set featured_node_id=project.nodes_featured[0]._id %}
| {% else %}
| {% set featured_node_id=project.nodes_featured[0] %}
| {% endif %}
+nav-secondary-link(
href="{{ url_for('projects.view_node', project_url=project.url, node_id=featured_node_id) }}",
title="Explore {{ project.name }}",
class="{% if title == 'project' %}active{% endif %}")
span Browse
| {% endif %}
| {% endmacro %}