From aafc5ded41c875bf1deea8502dc98658a9b62887 Mon Sep 17 00:00:00 2001
From: Benjamin Bertrand <benjamin.bertrand@ess.eu>
Date: Mon, 3 Feb 2020 17:17:08 +0100
Subject: [PATCH] Make pages title more explicit

- Remove "- CSEntry" (logo is already displayed in tabs depending on the
  browser)
- Specify name of the instance in view and edit pages

JIRA INFRA-1726 #action In Progress
---
 app/templates/403.html                            | 2 +-
 app/templates/404.html                            | 2 +-
 app/templates/500.html                            | 2 +-
 app/templates/admin/index.html                    | 2 +-
 app/templates/inventory/attributes.html           | 2 +-
 app/templates/inventory/attributes_favorites.html | 2 +-
 app/templates/inventory/create_item.html          | 2 +-
 app/templates/inventory/edit_item.html            | 2 +-
 app/templates/inventory/items.html                | 2 +-
 app/templates/inventory/scanner.html              | 2 +-
 app/templates/inventory/view_item.html            | 2 +-
 app/templates/network/create_domain.html          | 2 +-
 app/templates/network/create_group.html           | 2 +-
 app/templates/network/create_host.html            | 2 +-
 app/templates/network/create_interface.html       | 2 +-
 app/templates/network/create_network.html         | 2 +-
 app/templates/network/create_scope.html           | 2 +-
 app/templates/network/domains.html                | 2 +-
 app/templates/network/edit_group.html             | 2 +-
 app/templates/network/edit_host.html              | 2 +-
 app/templates/network/edit_interface.html         | 2 +-
 app/templates/network/edit_network.html           | 2 +-
 app/templates/network/groups.html                 | 2 +-
 app/templates/network/hosts.html                  | 2 +-
 app/templates/network/networks.html               | 2 +-
 app/templates/network/scopes.html                 | 2 +-
 app/templates/network/view_group.html             | 2 +-
 app/templates/network/view_host.html              | 2 +-
 app/templates/network/view_network.html           | 2 +-
 app/templates/network/view_scope.html             | 2 +-
 app/templates/task/tasks.html                     | 2 +-
 app/templates/task/view_task.html                 | 2 +-
 app/templates/user/login.html                     | 2 +-
 app/templates/user/profile.html                   | 2 +-
 tests/functional/test_web.py                      | 6 +++---
 35 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/app/templates/403.html b/app/templates/403.html
index de3fcf1..90a60ec 100644
--- a/app/templates/403.html
+++ b/app/templates/403.html
@@ -1,6 +1,6 @@
 {%- extends "base.html" %}
 
-{% block title %}Forbidden - CSEntry{% endblock %}
+{% block title %}Forbidden{% endblock %}
 
 {% block main %}
   <h1>Forbidden</h1>
diff --git a/app/templates/404.html b/app/templates/404.html
index 35155ba..2a026a0 100644
--- a/app/templates/404.html
+++ b/app/templates/404.html
@@ -1,6 +1,6 @@
 {%- extends "base.html" %}
 
-{% block title %}Page Not Found - CSEntry{% endblock %}
+{% block title %}Page Not Found{% endblock %}
 
 {% block main %}
   <h1>Page Not Found</h1>
diff --git a/app/templates/500.html b/app/templates/500.html
index 3129c10..ff3492a 100644
--- a/app/templates/500.html
+++ b/app/templates/500.html
@@ -1,6 +1,6 @@
 {%- extends "base.html" %}
 
-{% block title %}Internal Server Error - CSEntry{% endblock %}
+{% block title %}Internal Server Error{% endblock %}
 
 {% block main %}
   <h1>Internal Server Error</h1>
diff --git a/app/templates/admin/index.html b/app/templates/admin/index.html
index 996ac40..c86d3f4 100644
--- a/app/templates/admin/index.html
+++ b/app/templates/admin/index.html
@@ -1,6 +1,6 @@
 {% extends "admin/master.html" %}
 
-{% block title %}Admin - CSEntry{% endblock %}
+{% block title %}Admin{% endblock %}
 
 {% block body %}
 <h2>Use the admin interface with care</h2>
diff --git a/app/templates/inventory/attributes.html b/app/templates/inventory/attributes.html
index 2779a37..99a8749 100644
--- a/app/templates/inventory/attributes.html
+++ b/app/templates/inventory/attributes.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Attributes - CSEntry{% endblock %}
+{% block title %}Attributes{% endblock %}
 
 {% block main %}
   <ul class="nav nav-tabs">
diff --git a/app/templates/inventory/attributes_favorites.html b/app/templates/inventory/attributes_favorites.html
index cdb16b5..9f0e4cf 100644
--- a/app/templates/inventory/attributes_favorites.html
+++ b/app/templates/inventory/attributes_favorites.html
@@ -1,6 +1,6 @@
 {% extends "inventory/attributes.html" %}
 
-{% block title %}Attributes favorites - CSEntry{% endblock %}
+{% block title %}Attributes favorites{% endblock %}
 
 {% block attributes_main %}
   <table id="attributes_favorites_table" class="table table-bordered table-hover table-sm" cellspacing="0" width="100%">
diff --git a/app/templates/inventory/create_item.html b/app/templates/inventory/create_item.html
index ec13c71..6ed737a 100644
--- a/app/templates/inventory/create_item.html
+++ b/app/templates/inventory/create_item.html
@@ -1,7 +1,7 @@
 {% extends "inventory/items.html" %}
 {% from "_helpers.html" import render_field, figure %}
 
-{% block title %}Register Item - CSEntry{% endblock %}
+{% block title %}Register Item{% endblock %}
 
 {% block items_main %}
   <div class="row">
diff --git a/app/templates/inventory/edit_item.html b/app/templates/inventory/edit_item.html
index 724be0c..80f0791 100644
--- a/app/templates/inventory/edit_item.html
+++ b/app/templates/inventory/edit_item.html
@@ -1,7 +1,7 @@
 {% extends "inventory/items.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Edit Item - CSEntry{% endblock %}
+{% block title %}Edit {{ form.ics_id.data }} item{% endblock %}
 
 {% block items_nav %}
     <li class="nav-item">
diff --git a/app/templates/inventory/items.html b/app/templates/inventory/items.html
index 7c13e28..68ca6fb 100644
--- a/app/templates/inventory/items.html
+++ b/app/templates/inventory/items.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import is_active, waiting_for %}
 
-{% block title %}Items - CSEntry{% endblock %}
+{% block title %}Items{% endblock %}
 
 {% block main %}
   {{ waiting_for("Please wait while your file is being prepared...", "downloadExcelModal") }}
diff --git a/app/templates/inventory/scanner.html b/app/templates/inventory/scanner.html
index 81b541a..23c338f 100644
--- a/app/templates/inventory/scanner.html
+++ b/app/templates/inventory/scanner.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import figure %}
 
-{% block title %}Scanner - CSEntry{% endblock %}
+{% block title %}Scanner{% endblock %}
 
 {% block main %}
   <div class="col-md-8">
diff --git a/app/templates/inventory/view_item.html b/app/templates/inventory/view_item.html
index 336a04c..2774169 100644
--- a/app/templates/inventory/view_item.html
+++ b/app/templates/inventory/view_item.html
@@ -1,7 +1,7 @@
 {% extends "inventory/items.html" %}
 {% from "_helpers.html" import link_to_item, link_to_items, format_datetime, link_to_host, item_comment %}
 
-{% block title %}View Item - CSEntry{% endblock %}
+{% block title %}View {{ item.ics_id }} item{% endblock %}
 
 {% block items_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/create_domain.html b/app/templates/network/create_domain.html
index e54b4bd..bb1be1a 100644
--- a/app/templates/network/create_domain.html
+++ b/app/templates/network/create_domain.html
@@ -1,7 +1,7 @@
 {% extends "network/domains.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Register Domain - CSEntry{% endblock %}
+{% block title %}Register Domain{% endblock %}
 
 {% block domains_main %}
   <form id="DomainForm" method="POST">
diff --git a/app/templates/network/create_group.html b/app/templates/network/create_group.html
index 4cf377a..ac51c41 100644
--- a/app/templates/network/create_group.html
+++ b/app/templates/network/create_group.html
@@ -1,7 +1,7 @@
 {% extends "network/groups.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Register Ansible group - CSEntry{% endblock %}
+{% block title %}Register Ansible group{% endblock %}
 
 {% block groups_main %}
   <form id="groupForm" method="POST">
diff --git a/app/templates/network/create_host.html b/app/templates/network/create_host.html
index f234cd8..726ce2b 100644
--- a/app/templates/network/create_host.html
+++ b/app/templates/network/create_host.html
@@ -1,7 +1,7 @@
 {% extends "network/hosts.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Register Host - CSEntry{% endblock %}
+{% block title %}Register Host{% endblock %}
 
 {% block hosts_main %}
   <form id="hostForm" method="POST">
diff --git a/app/templates/network/create_interface.html b/app/templates/network/create_interface.html
index 160668f..8d8fe93 100644
--- a/app/templates/network/create_interface.html
+++ b/app/templates/network/create_interface.html
@@ -1,7 +1,7 @@
 {% extends "network/hosts.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Register Interface - CSEntry{% endblock %}
+{% block title %}Add Interface to {{ hostname }}{% endblock %}
 
 {% block hosts_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/create_network.html b/app/templates/network/create_network.html
index fb2e52f..a0fc80f 100644
--- a/app/templates/network/create_network.html
+++ b/app/templates/network/create_network.html
@@ -1,7 +1,7 @@
 {% extends "network/networks.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Register Network - CSEntry{% endblock %}
+{% block title %}Register Network{% endblock %}
 
 {% block networks_main %}
   <form id="networkForm" method="POST">
diff --git a/app/templates/network/create_scope.html b/app/templates/network/create_scope.html
index 41d3ad0..427bea9 100644
--- a/app/templates/network/create_scope.html
+++ b/app/templates/network/create_scope.html
@@ -1,7 +1,7 @@
 {% extends "network/scopes.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Register Network Scope - CSEntry{% endblock %}
+{% block title %}Register Network Scope{% endblock %}
 
 {% block scopes_main %}
   <form id="scopeForm" method="POST">
diff --git a/app/templates/network/domains.html b/app/templates/network/domains.html
index fa86984..5f53ae7 100644
--- a/app/templates/network/domains.html
+++ b/app/templates/network/domains.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import is_active %}
 
-{% block title %}Domains - CSEntry{% endblock %}
+{% block title %}Domains{% endblock %}
 
 {% block main %}
   {% set path = request.path %}
diff --git a/app/templates/network/edit_group.html b/app/templates/network/edit_group.html
index 3d27b1b..561a845 100644
--- a/app/templates/network/edit_group.html
+++ b/app/templates/network/edit_group.html
@@ -1,7 +1,7 @@
 {% extends "network/groups.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Edit Ansible group - CSEntry{% endblock %}
+{% block title %}Edit {{ form.name.data }} Ansible group{% endblock %}
 
 {% block groups_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/edit_host.html b/app/templates/network/edit_host.html
index f6f0bc1..04d56f0 100644
--- a/app/templates/network/edit_host.html
+++ b/app/templates/network/edit_host.html
@@ -1,7 +1,7 @@
 {% extends "network/hosts.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Edit Host - CSEntry{% endblock %}
+{% block title %}Edit {{ form.name.data }} host{% endblock %}
 
 {% block hosts_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/edit_interface.html b/app/templates/network/edit_interface.html
index cd751df..63e81a8 100644
--- a/app/templates/network/edit_interface.html
+++ b/app/templates/network/edit_interface.html
@@ -1,7 +1,7 @@
 {% extends "network/hosts.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Edit Interface - CSEntry{% endblock %}
+{% block title %}Edit {{ form.interface_name.data }} interface{% endblock %}
 
 {% block hosts_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/edit_network.html b/app/templates/network/edit_network.html
index d06182f..a16e0f0 100644
--- a/app/templates/network/edit_network.html
+++ b/app/templates/network/edit_network.html
@@ -1,7 +1,7 @@
 {% extends "network/networks.html" %}
 {% from "_helpers.html" import render_field %}
 
-{% block title %}Edit Network - CSEntry{% endblock %}
+{% block title %}Edit {{ form.vlan_name.data }} network{% endblock %}
 
 {% block networks_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/groups.html b/app/templates/network/groups.html
index 7d82d9d..ba96668 100644
--- a/app/templates/network/groups.html
+++ b/app/templates/network/groups.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import is_active %}
 
-{% block title %}Ansible Groups - CSEntry{% endblock %}
+{% block title %}Ansible Groups{% endblock %}
 
 {% block main %}
   {% set path = request.path %}
diff --git a/app/templates/network/hosts.html b/app/templates/network/hosts.html
index 42690a5..3357a25 100644
--- a/app/templates/network/hosts.html
+++ b/app/templates/network/hosts.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import is_active %}
 
-{% block title %}Hosts - CSEntry{% endblock %}
+{% block title %}Hosts{% endblock %}
 
 {% block main %}
   {% set path = request.path %}
diff --git a/app/templates/network/networks.html b/app/templates/network/networks.html
index ae98b32..9315038 100644
--- a/app/templates/network/networks.html
+++ b/app/templates/network/networks.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import is_active, link_to_network, link_to_scope %}
 
-{% block title %}Networks - CSEntry{% endblock %}
+{% block title %}Networks{% endblock %}
 
 {% block main %}
 {% set path = request.path %}
diff --git a/app/templates/network/scopes.html b/app/templates/network/scopes.html
index 3b50bd1..62276f5 100644
--- a/app/templates/network/scopes.html
+++ b/app/templates/network/scopes.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import is_active, link_to_scope %}
 
-{% block title %}Network Scopes - CSEntry{% endblock %}
+{% block title %}Network Scopes{% endblock %}
 
 {% block main %}
 {% set path = request.path %}
diff --git a/app/templates/network/view_group.html b/app/templates/network/view_group.html
index c2a0843..ac380ea 100644
--- a/app/templates/network/view_group.html
+++ b/app/templates/network/view_group.html
@@ -2,7 +2,7 @@
 {% from "_helpers.html" import link_to_hosts, link_to_ansible_groups,
    delete_button_with_confirmation %}
 
-{% block title %}View Ansible group - CSEntry{% endblock %}
+{% block title %}View {{ group.name }} Ansible group{% endblock %}
 
 {% block groups_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/view_host.html b/app/templates/network/view_host.html
index 080b746..5032f43 100644
--- a/app/templates/network/view_host.html
+++ b/app/templates/network/view_host.html
@@ -3,7 +3,7 @@
    link_to_ansible_groups, link_to_network,
    delete_button_with_confirmation, render_field, submit_button_with_confirmation %}
 
-{% block title %}View Host - CSEntry{% endblock %}
+{% block title %}View {{ host.name }} host{% endblock %}
 
 {% block hosts_nav %}
     <li class="nav-item">
diff --git a/app/templates/network/view_network.html b/app/templates/network/view_network.html
index b5676f0..ab43b7a 100644
--- a/app/templates/network/view_network.html
+++ b/app/templates/network/view_network.html
@@ -1,7 +1,7 @@
 {% extends "network/networks.html" %}
 {% from "_helpers.html" import link_to_interfaces_host, link_to_scope %}
 
-{% block title %}View Network - CSEntry{% endblock %}
+{% block title %}View {{ network.vlan_name }} network{% endblock %}
 
 {% block networks_nav %}
 <li class="nav-item">
diff --git a/app/templates/network/view_scope.html b/app/templates/network/view_scope.html
index ceddbd7..47cb6fb 100644
--- a/app/templates/network/view_scope.html
+++ b/app/templates/network/view_scope.html
@@ -1,7 +1,7 @@
 {% extends "network/scopes.html" %}
 {% from "_helpers.html" import link_to_networks %}
 
-{% block title %}View Network Scope - CSEntry{% endblock %}
+{% block title %}View {{ scope.name }} network Scope{% endblock %}
 
 {% block scopes_nav %}
 <li class="nav-item">
diff --git a/app/templates/task/tasks.html b/app/templates/task/tasks.html
index 64ea3fd..5d223dc 100644
--- a/app/templates/task/tasks.html
+++ b/app/templates/task/tasks.html
@@ -1,7 +1,7 @@
 {% extends "base-fluid.html" %}
 {% from "_helpers.html" import is_active %}
 
-{% block title %}Tasks - CSEntry{% endblock %}
+{% block title %}Tasks{% endblock %}
 
 {% block main %}
   {% set path = request.path %}
diff --git a/app/templates/task/view_task.html b/app/templates/task/view_task.html
index 15ae5fb..09b46be 100644
--- a/app/templates/task/view_task.html
+++ b/app/templates/task/view_task.html
@@ -1,7 +1,7 @@
 {% extends "task/tasks.html" %}
 {% from "_helpers.html" import link_to_task, link_to_tasks %}
 
-{% block title %}View Task - CSEntry{% endblock %}
+{% block title %}View {{ task.name }} task{% endblock %}
 
 {% block tasks_nav %}
     <li class="nav-item">
diff --git a/app/templates/user/login.html b/app/templates/user/login.html
index 34f55b9..f2f451e 100644
--- a/app/templates/user/login.html
+++ b/app/templates/user/login.html
@@ -1,6 +1,6 @@
 {% extends "base.html" %}
 
-{% block title %}Login - CSEntry{% endblock %}
+{% block title %}Login{% endblock %}
 
 {% block main %}
   <div class="col-sm-offset-2 col-sm-4">
diff --git a/app/templates/user/profile.html b/app/templates/user/profile.html
index 14b58be..2e7baa1 100644
--- a/app/templates/user/profile.html
+++ b/app/templates/user/profile.html
@@ -1,7 +1,7 @@
 {% extends "base.html" %}
 {% from "_helpers.html" import render_field, delete_button_with_confirmation %}
 
-{% block title %}Profile - CSEntry{% endblock %}
+{% block title %}Profile{% endblock %}
 
 {% block main %}
   {% if generated_token %}
diff --git a/tests/functional/test_web.py b/tests/functional/test_web.py
index 460db6d..8dd5e7e 100644
--- a/tests/functional/test_web.py
+++ b/tests/functional/test_web.py
@@ -58,14 +58,14 @@ def no_login_check_client(request, app):
 
 def test_login_logout(client):
     response = login(client, "unknown", "invalid")
-    assert b"<title>Login - CSEntry</title>" in response.data
+    assert b"<title>Login</title>" in response.data
     response = login(client, "user_rw", "invalid")
-    assert b"<title>Login - CSEntry</title>" in response.data
+    assert b"<title>Login</title>" in response.data
     response = login(client, "user_rw", "userrw")
     assert b"Control System Entry" in response.data
     assert b"User RW" in response.data
     response = logout(client)
-    assert b"<title>Login - CSEntry</title>" in response.data
+    assert b"<title>Login</title>" in response.data
 
 
 def test_index(logged_client):
-- 
GitLab