Skip to content

Commit

Permalink
fix: titles for knowledge panels cards #6590 (#6593)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet authored Apr 12, 2022
1 parent 7469115 commit 0080f6b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"environment"
],
"title_element": {
"title": "[% lang('environment') %]",
"title": "[% lang('environment_card_title') %]",
},
"elements": [
{
Expand Down
102 changes: 55 additions & 47 deletions templates/web/panels/panel.tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
style="margin-top:0.5rem;margin-bottom:1.5rem;"
[% END %]
>
[% IF panel.title_element.defined %]
[% IF (panel.type == "card") %]
<h2 class="cpanel_title_[% panel.type %]">[% panel.title_element.title %]</h2>
[% ELSE %]
<h3 class="cpanel_title_[% panel.type %]">[% panel.title_element.title %]</h3>
[% END %]
[% END %]
[% ELSE %]
<ul data-accordion class="panel_accordion accordion" id="panel_[% panel_id | replace(':','-') %]"
[% IF panel.size == "small" %]
Expand All @@ -17,60 +24,61 @@
[% END %]
>
<li class="accordion-navigation">
[% END %]

[% IF panel.title_element.defined %]
<a href="#panel_[% panel_id | replace(':','-') %]_content" class="panel_title[% IF panel.title_element.type == "grade" %] grade_[% panel.title_element.grade %][% END %]"
[% IF panel.size == "small" %]
style="padding:0.1rem;padding-left:1rem;"
[% END %]
>
[% IF panel.title_element.icon_url.defined %]
<img src="[% panel.title_element.icon_url %]"
style="[% IF panel.title_element.icon_size == 'small' %]height:36px;[% ELSE %]height:72px;[% END %]float:left;margin-right:1rem;"
alt="[% IF panel.title_element.icon_alt.defined %][% panel.title_element.icon_alt %][% ELSE %]icon[% END %]"
[% IF panel.title_element.icon_color_from_evaluation %]
[% IF panel.evaluation == "good" %]
class="filter-green"
[% ELSIF panel.evaluation == "bad" %]
class="filter-red"
[% ELSIF panel.evaluation == "average" %]
class="filter-orange"
[% ELSIF panel.evaluation == "neutral" %]
class="filter-grey"
[% ELSIF panel.evaluation == "unknown" %]
class="filter-grey"
[% END %]
<a href="#panel_[% panel_id | replace(':','-') %]_content" class="panel_title[% IF panel.title_element.type == "grade" %] grade_[% panel.title_element.grade %][% END %]"
[% IF panel.size == "small" %]
style="padding:0.1rem;padding-left:1rem;"
[% END %]
>
[% END %]
<h3 [% IF panel.title_element.type == "grade" %]class="grade_[% panel.title_element.grade %]_title"[% END %]
[% IF panel.evaluation.defined %]class="evaluation_[%panel.evaluation %]_title"[% END %]
[% IF panel.size == "small" %]style="font-size:1.1rem;"[% END %]
>
[% IF panel.evaluation AND NOT panel.title_element.icon_url.defined %]
<span class="evaluation_[%panel.evaluation %]_title">
[% IF panel.evaluation == "good" %]
[% display_icon("check") %]
[% ELSIF panel.evaluation == "bad" %]
[% display_icon("cancel") %]
[% ELSIF panel.evaluation == "average" %]
[% display_icon("check") %]
[% ELSIF panel.evaluation == "neutral" %]
[% display_icon("check") %]
[% ELSIF panel.evaluation == "unknown" %]
[% display_icon("help") %]
[% IF panel.title_element.icon_url.defined %]
<img src="[% panel.title_element.icon_url %]"
style="[% IF panel.title_element.icon_size == 'small' %]height:36px;[% ELSE %]height:72px;[% END %]float:left;margin-right:1rem;"
alt="[% IF panel.title_element.icon_alt.defined %][% panel.title_element.icon_alt %][% ELSE %]icon[% END %]"
[% IF panel.title_element.icon_color_from_evaluation %]
[% IF panel.evaluation == "good" %]
class="filter-green"
[% ELSIF panel.evaluation == "bad" %]
class="filter-red"
[% ELSIF panel.evaluation == "average" %]
class="filter-orange"
[% ELSIF panel.evaluation == "neutral" %]
class="filter-grey"
[% ELSIF panel.evaluation == "unknown" %]
class="filter-grey"
[% END %]
[% END %]
</span>
>
[% END %]
[% panel.title_element.title %]
</h3>
[% IF panel.title_element.subtitle.defined %]
<h4>[% panel.title_element.subtitle %]</h4>
[% END %]
<hr class="floatclear">
</a>
<h3 [% IF panel.title_element.type == "grade" %]class="grade_[% panel.title_element.grade %]_title"[% END %]
[% IF panel.evaluation.defined %]class="evaluation_[%panel.evaluation %]_title"[% END %]
[% IF panel.size == "small" %]style="font-size:1.1rem;"[% END %]
>
[% IF panel.evaluation AND NOT panel.title_element.icon_url.defined %]
<span class="evaluation_[%panel.evaluation %]_title">
[% IF panel.evaluation == "good" %]
[% display_icon("check") %]
[% ELSIF panel.evaluation == "bad" %]
[% display_icon("cancel") %]
[% ELSIF panel.evaluation == "average" %]
[% display_icon("check") %]
[% ELSIF panel.evaluation == "neutral" %]
[% display_icon("check") %]
[% ELSIF panel.evaluation == "unknown" %]
[% display_icon("help") %]
[% END %]
</span>
[% END %]
[% panel.title_element.title %]
</h3>
[% IF panel.title_element.subtitle.defined %]
<h4>[% panel.title_element.subtitle %]</h4>
[% END %]
<hr class="floatclear">
</a>
[% END %]
[% END %]


[% IF panel.elements.defined %]
<div id="panel_[% panel_id | replace(':','-') %]_content" class="content panel_content[% IF (panel.type == 'card') OR (panel.type == 'inline') %]_[% panel.type %][% END %][% IF panel.expanded %] active[% END %]">
Expand Down

0 comments on commit 0080f6b

Please sign in to comment.