From f58a6f5778249e093c3e97c8bbbdc1306737e936 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch <p.jentsch@uni-bielefeld.de> Date: Tue, 25 Feb 2020 09:59:49 +0100 Subject: [PATCH] Changes for page title --- app/templates/nopaque.html.j2 | 21 +++++++++++++------ .../services/corpus_analysis.html.j2 | 2 +- app/templates/services/nlp.html.j2 | 2 +- app/templates/services/ocr.html.j2 | 2 +- app/templates/services/setup_files.html.j2 | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/templates/nopaque.html.j2 b/app/templates/nopaque.html.j2 index 24c0c47a..c7326544 100644 --- a/app/templates/nopaque.html.j2 +++ b/app/templates/nopaque.html.j2 @@ -5,11 +5,12 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - {% if title %} - <title>nopaque – {{ title }}</title> - {% else %} - <title>nopaque</title> - {% endif %} + <title> + nopaque + {% if title and not url_for(request.endpoint) == url_for('main.index') %} + – {{ title }} + {% endif %} + </title> <link rel="icon" href="{{ url_for('static', filename='images/nopaque_logo.png') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='fonts/Material_design_icons/material-icons.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/Materialize/materialize.min.css') }}"> @@ -105,7 +106,15 @@ {% endif %} <div class="row"> <div class="col s12"> - <h2>{% if title %}{{ title }}{% else %}Unnamed page{% endif %}</h2> + <h2> + {% if headline %} + {{ headline }} + {% elif title %} + {{ title }} + {% else %} + Unnamed page + {% endif %} + </h2> </div> {{ insert_page_content() }} </div> diff --git a/app/templates/services/corpus_analysis.html.j2 b/app/templates/services/corpus_analysis.html.j2 index 551b0a42..68a12ec2 100644 --- a/app/templates/services/corpus_analysis.html.j2 +++ b/app/templates/services/corpus_analysis.html.j2 @@ -1,6 +1,6 @@ {% extends "nopaque.html.j2" %} -{% set title = '<i class="material-icons left service" data-service="corpus_analysis" style="font-size: inherit;"></i>Corpus analysis' %} +{% set headline = '<i class="material-icons left service" data-service="corpus_analysis" style="font-size: inherit;"></i>Corpus analysis' %} {% block page_content %} <div class="col s12 m9 l10"> diff --git a/app/templates/services/nlp.html.j2 b/app/templates/services/nlp.html.j2 index a7463b42..e53ad862 100644 --- a/app/templates/services/nlp.html.j2 +++ b/app/templates/services/nlp.html.j2 @@ -1,6 +1,6 @@ {% extends "nopaque.html.j2" %} -{% set title = '<i class="material-icons left service" data-service="nlp" style="font-size: inherit;"></i>Natural Language Processing' %} +{% set headline = '<i class="material-icons left service" data-service="nlp" style="font-size: inherit;"></i>Natural Language Processing' %} {% block page_content %} <div class="col s12 m9 l10"> diff --git a/app/templates/services/ocr.html.j2 b/app/templates/services/ocr.html.j2 index a968b1e2..8ae0834c 100644 --- a/app/templates/services/ocr.html.j2 +++ b/app/templates/services/ocr.html.j2 @@ -1,6 +1,6 @@ {% extends "nopaque.html.j2" %} -{% set title = '<i class="material-icons left service" data-service="ocr" style="font-size: inherit;"></i>Optical Character Recognition' %} +{% set headline = '<i class="material-icons left service" data-service="ocr" style="font-size: inherit;"></i>Optical Character Recognition' %} {% block page_content %} <div class="col s12 m9 l10"> diff --git a/app/templates/services/setup_files.html.j2 b/app/templates/services/setup_files.html.j2 index 8611a0e2..f8c0afcb 100644 --- a/app/templates/services/setup_files.html.j2 +++ b/app/templates/services/setup_files.html.j2 @@ -1,6 +1,6 @@ {% extends "nopaque.html.j2" %} -{% set title = '<i class="material-icons left service" data-service="setup_files" style="font-size: inherit;"></i>File setup' %} +{% set headline = '<i class="material-icons left service" data-service="setup_files" style="font-size: inherit;"></i>File setup' %} {% block page_content %} <div class="col s12 m9 l10"> -- GitLab