|
1 | 1 | {# |
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 | + */ |
19 | 19 | #} |
20 | 20 | {% extends "Master/PanelController.html.twig" %} |
21 | 21 |
|
22 | 22 | {% block body %} |
23 | 23 | <div class="container-fluid"> |
24 | 24 | <div class="row"> |
25 | 25 | <div class="col"> |
26 | | - {# -- First view -- #} |
| 26 | + {# -- First tab -- #} |
27 | 27 | {% set firstView = fsc.views | first %} |
28 | 28 | {% set firstViewName = firstView.getViewName() %} |
29 | 29 | {% do fsc.setCurrentView(firstViewName) %} |
30 | 30 | {{ include(firstView.template) }} |
31 | 31 | </div> |
32 | 32 | </div> |
33 | 33 | {% 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 %} |
45 | 48 | {% elseif fsc.views | length > 2 %} |
| 49 | + {# -- More than two tabs: show pills -- #} |
46 | 50 | <div class="row"> |
47 | 51 | <div class="col"> |
48 | 52 | <div class="nav-pills-wrapper d-print-none"> |
|
53 | 57 | {% set contActiveTab = contActiveTab + 1 %} |
54 | 58 | <li class="nav-item"> |
55 | 59 | {% 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> |
58 | 64 | <span>{{ view.title }}</span> |
59 | 65 | {% if view.count > 0 %} |
60 | 66 | <span class="badge bg-secondary">{{ number(view.count, 0) }}</span> |
|
158 | 164 |
|
159 | 165 | // Centrar la pestaña activa si es posible |
160 | 166 | var targetScroll = pillLeft + scrollLeft - (wrapperWidth / 2) + (pillWidth / 2); |
161 | | - wrapper.animate({ scrollLeft: targetScroll }, 300); |
| 167 | + wrapper.animate({scrollLeft: targetScroll}, 300); |
162 | 168 | } |
163 | 169 | } |
164 | 170 | } |
|
0 commit comments