UI: Training templates fluid video layouts #104435

Merged
Márton Lente merged 13 commits from ui/training-layout-fluid into main 2024-08-23 16:50:27 +02:00
4 changed files with 86 additions and 74 deletions
Showing only changes of commit 54c698523e - Show all commits

View File

@ -692,7 +692,15 @@ button,
.top-level-comment .top-level-comment
background-color: var(--color-bg-primary) background-color: var(--color-bg-primary)
// TODO: revise training-group-item-nav display toggle on medium and small screens .training-group-item-content-detail
+margin(auto, x)
width: 100%
+media-xl
max-width: var(--container-width)
width: calc(100% - var(--training-group-item-nav-width))
// TODO: revise training-group-item-nav display toggle on medium and small screens
.training-group-item-nav .training-group-item-nav
+margin(3, bottom) +margin(3, bottom)
width: var(--training-group-item-nav-width) width: var(--training-group-item-nav-width)
@ -715,8 +723,6 @@ button,
.training-header-img-helper .training-header-img-helper
align-items: center align-items: center
display: flex
max-height: calc(var(--spacer) * 25)
overflow: hidden overflow: hidden
img img

View File

@ -7,9 +7,6 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% block training_header_image %}
{% endblock training_header_image %}
<div class="container-fluid pt-2 pt-md-3"> <div class="container-fluid pt-2 pt-md-3">
<div class="d-md-none mb-3 pt-2 row"> <div class="d-md-none mb-3 pt-2 row">
<div class="col-12"> <div class="col-12">

View File

@ -19,65 +19,70 @@
{% endblock %} {% endblock %}
{% block nexted_content %} {% block nexted_content %}
{% if chapter.thumbnail %} <div class="training-group-item-content-detail">
<div class="row mb-3"> {% if chapter.thumbnail %}
<div class="col"> <div class="row mb-3">
{% if section.is_free or request.user|has_active_subscription %} <div class="col">
{% firstof chapter.picture_header chapter.thumbnail as header %} {% if section.is_free or request.user|has_active_subscription %}
{% include "common/components/helpers/image_set.html" with alt=chapter.name classes="img-fluid img-width-100 rounded" img_source=header xsmall_width="600" small_width="800" medium_width="1000" large_width="1200" xlarge_width="1920" %} {% firstof chapter.picture_header chapter.thumbnail as header %}
{% else %} {% include "common/components/helpers/image_set.html" with alt=chapter.name classes="img-fluid img-width-100 rounded" img_source=header xsmall_width="600" small_width="800" medium_width="1000" large_width="1200" xlarge_width="1920" %}
{% include 'common/components/content_locked.html' with background=training.picture_header %} {% else %}
{% endif %} {% include 'common/components/content_locked.html' with background=training.picture_header %}
</div> {% endif %}
</div>
{% endif %}
<div class="mb-3 row ">
<div class="col">
<div class="align-items-start row">
<div class="col-12 col-md mb-3">
<div class="d-md-block d-none">
<p class="small text-muted">{{ training.name }}</p>
<h2 class="mb-0">{{ chapter.name }}</h2>
</div>
</div> </div>
<div class="col-12 col-md-auto mb-2 mb-md-0 mt-0 mt-md-3"> </div>
<div class="button-toolbar-container"> {% endif %}
<div class="button-toolbar">
{% if user.is_staff %}
<a href="{{ chapter.admin_url }}" class="btn btn-admin">
<i class="i-edit"></i>
<span>Edit</span>
</a>
{% endif %}
<button data-bs-toggle="dropdown" class="btn btn-link"> <div class="align-items-start row">
<i class="i-more-vertical"></i> <div class="col-12 col-md mb-3">
</button> <div class="d-md-block d-none">
<div class="dropdown-menu dropdown-menu-end"> <p class="small text-muted">{{ training.name }}</p>
<a href="https://projects.blender.org/studio/blender-studio/issues/new" target="_blank" class="dropdown-item"> <h2 class="mb-0">{{ chapter.name }}</h2>
<i class="i-flag"></i> </div>
<span>Report Problem</span> </div>
</a> <div class="col-12 col-md-auto mb-2 mb-md-0 mt-0 mt-md-3">
</div> <div class="button-toolbar-container">
<div class="button-toolbar">
{% if user.is_staff %}
<a href="{{ chapter.admin_url }}" class="btn btn-admin">
<i class="i-edit"></i>
<span>Edit</span>
</a>
{% endif %}
<button data-bs-toggle="dropdown" class="btn btn-link">
<i class="i-more-vertical"></i>
</button>
<div class="dropdown-menu dropdown-menu-end">
<a href="https://projects.blender.org/studio/blender-studio/issues/new" target="_blank" class="dropdown-item">
<i class="i-flag"></i>
<span>Report Problem</span>
</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
{% if chapter.description %} {% if chapter.description %}
<section class="markdown-text mb-3">{% with_shortcodes chapter.description|markdown %}</section> <section class="mb-3 row">
{% endif %} <div class="col col-lg-9">
<div class="markdown-text">
<div class="row"> {% with_shortcodes chapter.description|markdown %}
<div class="col-12">
<div class="cards card-layout-card-transparent files">
{% for section in chapter.sections.all %}
{% if section.is_published %}
{% include "common/components/file_section.html" with section=section %}
{% endif %}
{% endfor %}
</div> </div>
</div> </div>
</section>
{% endif %}
<div class="mb-3 row">
<div class="col-12">
<div class="cards card-layout-card-transparent files">
{% for section in chapter.sections.all %}
{% if section.is_published %}
{% include "common/components/file_section.html" with section=section %}
{% endif %}
{% endfor %}
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -11,24 +11,22 @@
{% javascript 'training' %} {% javascript 'training' %}
{% endblock scripts %} {% endblock scripts %}
{% block training_header_image %}
{% if training.picture_header_url %}
<div class="container">
<div class="mt-3 row">
<div class="col training-header-img-helper">
<img src="{{ training.picture_header_url }}" class="img-fluid img-width-100 rounded" alt="{{ training.name }}">
</div>
</div>
</div>
{% endif %}
{% endblock training_header_image %}
{% block nexted_content %} {% block nexted_content %}
<section>
<div class="row"> <section class="training-group-item training-group-item-content-detail">
<div class="col"> <div class="row">
<div class="row align-items-start mb-2"> <div class="col">
<div class="col-12 col-md"> <div class="mb-3 row">
martonlente marked this conversation as resolved Outdated

This entire div can be empty if {% if training.picture_header_url %} is false.
Adding a gap because of mb-3 without anything inside.

Move the check up here.

This entire div can be empty if `{% if training.picture_header_url %}` is false. Adding a gap because of `mb-3` without anything inside. Move the check up here.

Thanks, it has been fixed.

Thanks, it has been fixed.
<div class="col">
{% if training.picture_header_url %}
<div class="training-header-img-helper">
<img src="{{ training.picture_header_url }}" class="img-fluid img-width-100 rounded" alt="{{ training.name }}">
</div>
{% endif %}
</div>
</div>
<div class="align-items-start mb-3 row">
<div class="col-12 col-md">
<h1 class="mb-0">{{ training.name }}</h1> <h1 class="mb-0">{{ training.name }}</h1>
</div> </div>
<div class="col-12 col-md-auto"> <div class="col-12 col-md-auto">
@ -75,7 +73,13 @@
</div> </div>
{% endif %} {% endif %}
<section class="markdown-text mb-3">{% with_shortcodes training.summary_rendered %}</section> <section class="row">
<div class="col-12 col-lg-9">
<div class="markdown-text">
{% with_shortcodes training.summary_rendered %}
</div>
</div>
</section>
</div> </div>
</div> </div>
</section> </section>