Skip to content

Commit

Permalink
fix: hardcoded title html tag
Browse files Browse the repository at this point in the history
Fix hardcoded title html tag

Fix missing current page in title html tag

Remove title html tag written outside of head html tag on some pages

Resolve: #200
  • Loading branch information
dfranco committed Dec 17, 2023
1 parent 164023b commit 34066e4
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 124 deletions.
8 changes: 3 additions & 5 deletions application/views/templates/layouts/blank.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@

<head>
{{ include("partials/html-head.html.twig") }}

{% block title %} {% endblock %}
<title>{{ app_name }} - {% block title %}{% endblock %}</title>
</head>

<body>

<div class="container">
{{ include('partials/flash.html.twig') }}
</div>

<div class="wrapper d-flex flex-column min-vh-100 bg-light">
{% block body %} {% endblock %}
{% block body %} {% endblock %}
</div>

</body>

{{ include('partials/html-footer.html.twig') }}
</html>
19 changes: 14 additions & 5 deletions application/views/templates/layouts/default.html.twig
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{{ include("partials/html-head.html.twig") }}
<!doctype html>
<html lang="en">

{{ include("partials/navbar.html.twig") }}
<head>
{{ include("partials/html-head.html.twig") }}
<title>{{ app_name }} - {% block title %}{% endblock %}</title>
</head>

<body>

{% block title %} {% endblock %}
{{ include("partials/navbar.html.twig") }}

<div class="container">
{{ include('partials/flash.html.twig') }}
</div>

{% block body %} {% endblock %}
{% block body %}{% endblock %}

</body>
</html>
{{ include("partials/html-footer.html.twig") }}

{{ include("partials/html-footer.html.twig") }}
50 changes: 24 additions & 26 deletions application/views/templates/pages/backupjob-report.html.twig
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Backup job report'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Backup job report'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
<div class="container-fluid">

<div class="row">
<div class="col-md-12">
Expand Down Expand Up @@ -81,28 +79,28 @@
<th class="text-center">{{ 'Compression'|trans }}</th>
</tr>
{% for job in jobs %}
<tr>
<td>{{ job.jobid }}</td>
<td>{{ job.jobstatuslong }}</td>
<td>{{ job.joblevel }}</td>
<td class="text-right">
{% if job.jobfiles > 0 %}
<a href="{{ base_path() }}/jobfiles/{{ job.jobid }}">{{ job.jobfiles }}</a>
{% else %}
{{ job.jobfiles }}
{% endif %}
</td>
<td class="text-right">{{ job.jobbytes }}</td>
<td>{{ job.starttime }}</td>
<td>{{ job.endtime }}</td>
<td>{{ job.elapsedtime }}</td>
<td class="text-right">{{ job.speed }}</td>
<td>{{ job.compression }}</td>
</tr>
<tr>
<td>{{ job.jobid }}</td>
<td>{{ job.jobstatuslong }}</td>
<td>{{ job.joblevel }}</td>
<td class="text-right">
{% if job.jobfiles > 0 %}
<a href="{{ base_path() }}/jobfiles/{{ job.jobid }}">{{ job.jobfiles }}</a>
{% else %}
{{ job.jobfiles }}
{% endif %}
</td>
<td class="text-right">{{ job.jobbytes }}</td>
<td>{{ job.starttime }}</td>
<td>{{ job.endtime }}</td>
<td>{{ job.elapsedtime }}</td>
<td class="text-right">{{ job.speed }}</td>
<td>{{ job.compression }}</td>
</tr>
{% else %}
<tr>
<td colspan="9">{{ 'No job(s) to display'|trans }}</td>
</tr>
<tr>
<td colspan="9">{{ 'No job(s) to display'|trans }}</td>
</tr>
{% endfor %}
</table>
</div>
Expand Down Expand Up @@ -171,4 +169,4 @@
</div>
</div>

{% endblock %}
{% endblock %}
4 changes: 1 addition & 3 deletions application/views/templates/pages/client-report.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Client report'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Client report'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/dashboard.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Dashboard'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Dashboard'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/directors.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Directors'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Directors'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
7 changes: 3 additions & 4 deletions application/views/templates/pages/jobfiles.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Job files'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Job files'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid" id="jobsreport">
Expand All @@ -28,7 +26,8 @@
<form action="{{ url_for('backupjob') }}" method="post">
<input type="hidden" name="backupjob_name" value="{{ job_info.name }}"/>
<input type="hidden" name="backupjob_period" value="7"/>
<button type="submit" class="btn btn-sm btn-primary">{{ 'View backup job'|trans }}</button>
<button type="submit"
class="btn btn-sm btn-primary">{{ 'View backup job'|trans }}</button>
</form>

</div>
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/joblogs.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Job logs'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Job logs'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/jobs.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Jobs report'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Jobs report'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid" id="jobsreport">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/login.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/blank.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Login'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Login'|trans }}{% endblock %}

{% block body %}
<div class="bg-light min-vh-100 d-flex flex-row align-items-center">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/pools.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Pools report'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Pools report'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/settings.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Settings'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Settings'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/test.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Test'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Test'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid" id="testpage">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/usersettings.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'User settings'|trans }}</title>
{% endblock %}
{% block title %}{{ 'User settings'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/volume.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Volume details'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Volume details'|trans }}{% endblock %}

{% block body %}

Expand Down
4 changes: 1 addition & 3 deletions application/views/templates/pages/volumes.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "layouts/default.html.twig" %}

{% block title %}
<title>Bacula-Web - {{ 'Volumes report'|trans }}</title>
{% endblock %}
{% block title %}{{ 'Volumes report'|trans }}{% endblock %}

{% block body %}
<div class="container-fluid">
Expand Down
4 changes: 0 additions & 4 deletions application/views/templates/partials/html-footer.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<script src="/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>

<script type="text/javascript" src="/js/default.js"></script>

</body>

</html>
86 changes: 42 additions & 44 deletions application/views/templates/partials/html-head.html.twig
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap css -->
<link href="/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css">

<!-- FontAwesome css -->
<link href="/css/all.css" rel="stylesheet">

<!-- nvd3 css -->
<link href="/css/nv.d3.css" rel="stylesheet" type="text/css">

<!-- nvd3 javascript -->
<script src="/js/d3.min.js" charset="utf-8"></script>
<script src="/js/nv.d3.js"></script>

<link rel="apple-touch-icon" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/img/favicon.ico">

<!-- Popperjs -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha256-BRqBN7dYgABqtY9Hd4ynE+1slnEw+roEPFzQ7TRRfcg=" crossorigin="anonymous"></script>

<!-- Tempus Dominus JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/js/tempus-dominus.min.js" integrity="sha384-MxHp+/TqTjbku1jSTIe1e/4l6CZTLhACLDbWyxYaFRgD3AM4oh99AY8bxsGhIoRc" crossorigin="anonymous"></script>

<!-- Tempus Dominus Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/css/tempus-dominus.min.css" crossorigin="anonymous">

<title>{{ app_name }}</title>

<style>
[id^="chart"] {
height: 300px;
width: 100%;
}
</style>

</head>
<body>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap css -->
<link href="/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css">

<!-- FontAwesome css -->
<link href="/css/all.css" rel="stylesheet">

<!-- nvd3 css -->
<link href="/css/nv.d3.css" rel="stylesheet" type="text/css">

<!-- nvd3 javascript -->
<script src="/js/d3.min.js" charset="utf-8"></script>
<script src="/js/nv.d3.js"></script>

<link rel="apple-touch-icon" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/img/favicon.ico">

<!-- Popperjs -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
integrity="sha256-BRqBN7dYgABqtY9Hd4ynE+1slnEw+roEPFzQ7TRRfcg=" crossorigin="anonymous"></script>

<!-- Tempus Dominus JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/js/tempus-dominus.min.js"
integrity="sha384-MxHp+/TqTjbku1jSTIe1e/4l6CZTLhACLDbWyxYaFRgD3AM4oh99AY8bxsGhIoRc"
crossorigin="anonymous"></script>

<!-- Tempus Dominus Styles -->
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/css/tempus-dominus.min.css"
crossorigin="anonymous">

<style>
[id^="chart"] {
height: 300px;
width: 100%;
}
</style>

0 comments on commit 34066e4

Please sign in to comment.