fix(templates): FEEDBACK-167 привести layout к общему для курса виду - #31
Merged
Conversation
Layout лежал в templates/users/, хотя это общий шаблон сайта, а не шаблон раздела. Урок 200-templates-inheritance и все упражнения курса используют templates/layouts/layout.html, эталон расходился с ними на всех ветках после templates-inheritance.
На уроке 200-templates-inheritance страница пользователя наследует общий layout, а начиная со следующего урока показывалась голым фрагментом без шапки и меню.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Что не так
Layout лежал в
templates/users/layout.html, хотя это общий шаблон сайта, а не шаблон раздела. Урок200-templates-inheritanceкурса Flask и все упражнения курса, где есть наследование, используютtemplates/layouts/layout.html— эталон расходился с ними.Расхождение появилось из-за #11: тот фикс лёг только на ветку
templates-inheritance, аget-formи всё, что ниже по цепочке уроков, отпочковались раньше и остались со старым путём.Второе:
users/show.htmlнаследовал layout только наtemplates-inheritance. Со следующего урока страница пользователя показывалась голым фрагментом без шапки и меню.Что сделано
templates/users/layout.html→templates/layouts/layout.html,extendsпоправленusers/show.htmlобёрнут в{% extends %}+{% block content %}То же самое отдельными коммитами раскатано на 10 веток-снимков уроков:
get-form,post-form,named-routes,flash,crud,crud-create,crud-update,crud-delete,cookies,database.Проверка
Резолв
extendsпроверен загрузчиком Jinja по AST каждого шаблона на всех ветках: 0 отказов. Контрольный прогон на состоянии до фикса #11 воспроизводитTemplateNotFound, то есть проверка отличает рабочее состояние от сломанного.Тикет: https://tracker.yandex.ru/FEEDBACK-167