From 74cf3b2135661ae17b4e390c91182c673645cad7 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 21 Jul 2019 22:50:57 -0700 Subject: Use variable to set title on base template instead of block --- youtube/templates/base.html | 2 +- youtube/templates/channel.html | 2 +- youtube/templates/comments_page.html | 4 +--- youtube/templates/delete_comment.html | 3 +-- youtube/templates/error.html | 3 +-- youtube/templates/local_playlist.html | 2 +- youtube/templates/local_playlists_list.html | 2 +- youtube/templates/login.html | 2 +- youtube/templates/playlist.html | 2 +- youtube/templates/post_comment.html | 3 +-- youtube/templates/search.html | 2 +- youtube/templates/status.html | 3 +-- youtube/templates/watch.html | 2 +- 13 files changed, 13 insertions(+), 19 deletions(-) (limited to 'youtube') diff --git a/youtube/templates/base.html b/youtube/templates/base.html index eafd369..3dda55d 100644 --- a/youtube/templates/base.html +++ b/youtube/templates/base.html @@ -2,7 +2,7 @@ - {% block page_title %}{{ title }}{% endblock %} + {{ page_title }} diff --git a/youtube/templates/channel.html b/youtube/templates/channel.html index 8a3f279..734769d 100644 --- a/youtube/templates/channel.html +++ b/youtube/templates/channel.html @@ -1,5 +1,5 @@ +{% set page_title = channel_name + ' - Channel' %} {% extends "base.html" %} -{% block page_title %}{{ channel_name + ' - Channel' }}{% endblock %} {% import "common_elements.html" as common_elements %} {% block style %} main{ diff --git a/youtube/templates/comments_page.html b/youtube/templates/comments_page.html index c7947fa..68c8537 100644 --- a/youtube/templates/comments_page.html +++ b/youtube/templates/comments_page.html @@ -1,9 +1,7 @@ +{% set page_title = ('Replies' if comments_info['is_replies'] else 'Comments page ' + comments_info['page_number']) %} {% extends "base.html" %} {% import "comments.html" as comments %} -{% block page_title %}{{ 'Replies' if comments_info['is_replies'] else 'Comments page ' + comments_info['page_number'] }}{% endblock %} - - {% block style %} main{ display:grid; diff --git a/youtube/templates/delete_comment.html b/youtube/templates/delete_comment.html index 4797240..71555ee 100644 --- a/youtube/templates/delete_comment.html +++ b/youtube/templates/delete_comment.html @@ -1,7 +1,6 @@ +{% set page_title = 'Delete comment?' %} {% extends "base.html" %} -{% block page_title %}Delete comment?{% endblock %} - {% block style %} main{ display: grid; diff --git a/youtube/templates/error.html b/youtube/templates/error.html index 1f33c44..e77c92c 100644 --- a/youtube/templates/error.html +++ b/youtube/templates/error.html @@ -1,7 +1,6 @@ +{% set page_title = 'Error' %} {% extends "base.html" %} -{% block page_title %}Error{% endblock %} - {% block main %} {{ error_message }} {% endblock %} diff --git a/youtube/templates/local_playlist.html b/youtube/templates/local_playlist.html index 27928df..a7564ca 100644 --- a/youtube/templates/local_playlist.html +++ b/youtube/templates/local_playlist.html @@ -1,5 +1,5 @@ +{% set page_title = playlist_name + ' - Local playlist' %} {% extends "base.html" %} -{% block page_title %}{{ playlist_name + ' - Local playlist' }}{% endblock %} {% import "common_elements.html" as common_elements %} {% block style %} main{ diff --git a/youtube/templates/local_playlists_list.html b/youtube/templates/local_playlists_list.html index 269c151..9b5f510 100644 --- a/youtube/templates/local_playlists_list.html +++ b/youtube/templates/local_playlists_list.html @@ -1,5 +1,5 @@ +{% set page_title = 'Local playlists' %} {% extends "base.html" %} -{% block page_title %}Local playlists{% endblock %} {% block main %}