Skip to content

Commit 04b2ccb

Browse files
committed
Code style fixes in templates
1 parent d6896bd commit 04b2ccb

10 files changed

Lines changed: 16 additions & 14 deletions

templates/dashboard/index.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block page_title %}{{ ea.dashboardTitle }}{% endblock %}
44

55
{% block search_wrapper %}
6-
{% include 'dashboard/packages/_search_box.html.twig' %}
6+
{{ include('dashboard/packages/_search_box.html.twig', with_context: false) }}
77
{% endblock %}
88

99
{% block page_content %}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
{% set currentPage = currentPage|default(null) %}
2+
{% set attrActive = 'class="nav-link active" aria-current="page"' %}
3+
{% set attr = 'class="nav-link text-primary"' %}
24

35
<ul class="nav nav-pills nav-justified d-grid d-md-flex gap-1 pb-3 mb-3 border-bottom">
46
<li class="nav-item">
57
{% set packageInfoUrl = path('dashboard_packages_info', {packageName: package.name}) %}
6-
<a {% if currentPage == 'info' %}class="nav-link active" aria-current="page"{% else %}class="nav-link text-primary"{% endif%} href="{{ packageInfoUrl }}">{{ 'Info'|trans }}</a>
8+
<a {{ currentPage == 'info' ? attrActive : attr }} href="{{ packageInfoUrl }}">{{ 'Info'|trans }}</a>
79
</li>
810
<li class="nav-item">
911
{% set packageVersionsUrl = path('dashboard_packages_versions', {packageName: package.name}) %}
10-
<a {% if currentPage == 'versions' %}class="nav-link active" aria-current="page"{% else %}class="nav-link text-primary"{% endif%} href="{{ packageVersionsUrl }}">{{ 'Versions'|trans }}</a>
12+
<a {{ currentPage == 'versions' ? attrActive : attr }} href="{{ packageVersionsUrl }}">{{ 'Versions'|trans }}</a>
1113
</li>
1214
<li class="nav-item">
1315
{% set packageDependentsUrl = path('dashboard_packages_dependents', {packageName: package.name}) %}
14-
<a {% if currentPage == 'dependents' %}class="nav-link active" aria-current="page"{% else %}class="nav-link text-primary"{% endif%} href="{{ packageDependentsUrl }}">{{ 'Dependents'|trans }}</a>
16+
<a {{ currentPage == 'dependents' ? attrActive : attr }} href="{{ packageDependentsUrl }}">{{ 'Dependents'|trans }}</a>
1517
</li>
1618
<li class="nav-item">
1719
{% set packageStatisticsUrl = path('dashboard_packages_statistics', {packageName: package.name}) %}
18-
<a {% if currentPage == 'statistics' %}class="nav-link active" aria-current="page"{% else %}class="nav-link text-primary"{% endif%} href="{{ packageStatisticsUrl }}">{{ 'Statistics'|trans }}</a>
20+
<a {{ currentPage == 'statistics' ? attrActive : attr }} href="{{ packageStatisticsUrl }}">{{ 'Statistics'|trans }}</a>
1921
</li>
2022
</ul>

templates/dashboard/packages/_search_box.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="form-widget">
55
<i class="fas fa-search content-search-icon"></i>
66

7-
<label class="content-search-label" data-value="{{ app.request.get('query') }}">
7+
<label class="content-search-label">
88
<input
99
name="query"
1010
class="form-control {{ app.request.get('query') is null ? 'is-blank' }}"
@@ -13,7 +13,7 @@
1313
placeholder="{{ 'Search packages'|trans }}"
1414
spellcheck="false"
1515
autocorrect="off"
16-
{% if not searchAutofocus is defined or searchAutofocus %}autofocus="autofocus"{% endif %}
16+
{% if autofocus ?? true %}autofocus="autofocus"{% endif %}
1717
>
1818
</label>
1919

templates/dashboard/packages/list.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block page_title %}Packages{% endblock %}
44

55
{% block search_wrapper %}
6-
{% include 'dashboard/packages/_search_box.html.twig' %}
6+
{{ include('dashboard/packages/_search_box.html.twig', with_context: false) }}
77
{% endblock %}
88

99
{% block page_actions %}

templates/dashboard/packages/package_base.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends '@EasyAdmin/page/content.html.twig' %}
22

33
{% block search_wrapper %}
4-
{% include 'dashboard/packages/_search_box.html.twig' with {searchAutofocus: false} %}
4+
{{ include('dashboard/packages/_search_box.html.twig', {autofocus: false}, with_context: false) }}
55
{% endblock %}
66

77
{% block page_actions %}

templates/dashboard/packages/package_edit.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block page_title %}Edit Package{% endblock %}
44

55
{% block search_wrapper %}
6-
{% include 'dashboard/packages/_search_box.html.twig' with {searchAutofocus: false} %}
6+
{{ include('dashboard/packages/_search_box.html.twig', {autofocus: false}, with_context: false) }}
77
{% endblock %}
88

99
{% block page_actions %}

templates/dashboard/packages/package_info.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{% endblock %}
1414

1515
{% block page_content %}
16-
{% include 'dashboard/packages/_package_header.html.twig' with {currentPage: 'info'} %}
16+
{{ include('dashboard/packages/_package_header.html.twig', {currentPage: 'info'}) }}
1717

1818
<div class="row mb-3">
1919
<div class="col-md-8">

templates/dashboard/packages/package_links.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block page_title %}{{ package.name }} <small>{{ title|trans }}</small>{% endblock %}
44

55
{% block page_content %}
6-
{% include 'dashboard/packages/_package_header.html.twig' with {currentPage: title|lower} %}
6+
{{ include('dashboard/packages/_package_header.html.twig', {currentPage: title|lower}) }}
77

88
{{ include('dashboard/packages/_package_list.html.twig', {packages: packageLinks|map(packageLink => packageLink.package), paginator: paginator}, with_context: false) }}
99
{% endblock %}

templates/dashboard/packages/package_statistics.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block page_title %}{{ package.name }} <small>{{ 'Statistics'|trans }}</small>{% endblock %}
44

55
{% block page_content %}
6-
{% include 'dashboard/packages/_package_header.html.twig' with {currentPage: 'statistics'} %}
6+
{{ include('dashboard/packages/_package_header.html.twig', {currentPage: 'statistics'}) }}
77

88
<div class="mb-3">
99
<h2>{{ 'Installations'|trans }}</h2>

templates/dashboard/packages/package_versions.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block page_title %}{{ package.name }} <small>{{ 'Versions'|trans }}</small>{% endblock %}
44

55
{% block page_content %}
6-
{% include 'dashboard/packages/_package_header.html.twig' with {currentPage: 'versions'} %}
6+
{{ include('dashboard/packages/_package_header.html.twig', {currentPage: 'versions'}) }}
77

88
<div class="list-group list-group-flush mb-3">
99
{% for version in versions %}

0 commit comments

Comments
 (0)