Skip to content

Commit 6bc11e1

Browse files
author
Carlos Garcia
committed
Ocultado el título de la segunda pestaña cuando no está activa.
1 parent 6cfa40c commit 6bc11e1

1 file changed

Lines changed: 38 additions & 32 deletions

File tree

Core/View/Master/PanelControllerBottom.html.twig

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,52 @@
11
{#
2-
/**
3-
* This file is part of FacturaScripts
4-
* Copyright (C) 2017-2025 Carlos Garcia Gomez <carlos@facturascripts.com>
5-
*
6-
* This program is free software: you can redistribute it and/or modify
7-
* it under the terms of the GNU Lesser General Public License as
8-
* published by the Free Software Foundation, either version 3 of the
9-
* License, or (at your option) any later version.
10-
*
11-
* This program is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* GNU Lesser General Public License for more details.
15-
*
16-
* You should have received a copy of the GNU Lesser General Public License
17-
* along with this program. If not, see http://www.gnu.org/licenses/.
18-
*/
2+
/**
3+
* This file is part of FacturaScripts
4+
* Copyright (C) 2017-2025 Carlos Garcia Gomez <carlos@facturascripts.com>
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Lesser General Public License as
8+
* published by the Free Software Foundation, either version 3 of the
9+
* License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program. If not, see http://www.gnu.org/licenses/.
18+
*/
1919
#}
2020
{% extends "Master/PanelController.html.twig" %}
2121

2222
{% block body %}
2323
<div class="container-fluid">
2424
<div class="row">
2525
<div class="col">
26-
{# -- First view -- #}
26+
{# -- First tab -- #}
2727
{% set firstView = fsc.views | first %}
2828
{% set firstViewName = firstView.getViewName() %}
2929
{% do fsc.setCurrentView(firstViewName) %}
3030
{{ include(firstView.template) }}
3131
</div>
3232
</div>
3333
{% if fsc.views | length == 2 %}
34-
<div class="row">
35-
<div class="col">
36-
{% set secondView = fsc.views | slice(1, 1) | first %}
37-
<h3 class="h4 mb-2">
38-
<i class="{{ secondView.icon }} me-2" aria-hidden="true"></i> {{ secondView.title }}
39-
{% if secondView.count > 0 %}
40-
<span class="badge bg-secondary">{{ number(secondView.count, 0) }}</span>
41-
{% endif %}
42-
</h3>
43-
</div>
44-
</div>
34+
{# -- Second tab -- #}
35+
{% set secondView = fsc.views | slice(1, 1) | first %}
36+
{% if secondView.settings.active %}
37+
<div class="row">
38+
<div class="col">
39+
<h3 class="h4 mb-2">
40+
<i class="{{ secondView.icon }} me-2" aria-hidden="true"></i> {{ secondView.title }}
41+
{% if secondView.count > 0 %}
42+
<span class="badge bg-secondary">{{ number(secondView.count, 0) }}</span>
43+
{% endif %}
44+
</h3>
45+
</div>
46+
</div>
47+
{% endif %}
4548
{% elseif fsc.views | length > 2 %}
49+
{# -- More than two tabs: show pills -- #}
4650
<div class="row">
4751
<div class="col">
4852
<div class="nav-pills-wrapper d-print-none">
@@ -53,8 +57,10 @@
5357
{% set contActiveTab = contActiveTab + 1 %}
5458
<li class="nav-item">
5559
{% set active = (viewName == fsc.active) or (fsc.active == firstViewName and contActiveTab == 1) ? ' active' : '' %}
56-
<a href="#{{ viewName }}" class="nav-link{{ active }}{{ disable }}" data-bs-toggle="tab" role="tab" aria-controls="{{ viewName }}">
57-
<i class="{{ view.icon }} fa-fw me-1 d-none d-sm-inline" aria-hidden="true"></i>
60+
<a href="#{{ viewName }}" class="nav-link{{ active }}{{ disable }}"
61+
data-bs-toggle="tab" role="tab" aria-controls="{{ viewName }}">
62+
<i class="{{ view.icon }} fa-fw me-1 d-none d-sm-inline"
63+
aria-hidden="true"></i>
5864
<span>{{ view.title }}</span>
5965
{% if view.count > 0 %}
6066
<span class="badge bg-secondary">{{ number(view.count, 0) }}</span>
@@ -158,7 +164,7 @@
158164
159165
// Centrar la pestaña activa si es posible
160166
var targetScroll = pillLeft + scrollLeft - (wrapperWidth / 2) + (pillWidth / 2);
161-
wrapper.animate({ scrollLeft: targetScroll }, 300);
167+
wrapper.animate({scrollLeft: targetScroll}, 300);
162168
}
163169
}
164170
}

0 commit comments

Comments
 (0)