Skip to content

Commit e24ba86

Browse files
Update icons on maker table to not require legend
1 parent 6f05b8e commit e24ba86

File tree

5 files changed

+58
-6
lines changed

5 files changed

+58
-6
lines changed

symfony/assets/styles/main.scss

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,29 @@
2121
}
2222
}
2323

24+
span.maker-table-icon {
25+
color: var(--maker-icon-color);
26+
display: inline-flex;
27+
flex-direction: column;
28+
align-items: center;
29+
justify-content: center;
30+
31+
width: 40px;
32+
height: 40px;
33+
overflow: hidden;
34+
background: color-mix(in srgb, var(--maker-icon-color), #fff 80%);
35+
border-radius: 8px;
36+
line-height: 12px;
37+
38+
.fas {
39+
font-size: 22px;
40+
}
41+
42+
.text {
43+
font-size: 10px;
44+
}
45+
}
46+
2447
div#data-table-container {
2548
table .makerId,
2649
table .state,
@@ -82,6 +105,16 @@ table#creators-table {
82105
vertical-align: middle;
83106
}
84107

108+
td.icons {
109+
padding: 0 0.5rem;
110+
111+
.icons-container {
112+
display: flex;
113+
justify-content: space-evenly;
114+
gap: 0.5rem;
115+
}
116+
}
117+
85118
td.features,
86119
td.types,
87120
td.styles,

symfony/src/Twig/AppExtensions.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function getFunctions(): array
6868
new TwigFunction('get_cst_issue_text', $this->getCstIssueText(...)),
6969
new TwigFunction('has_good_completeness', $this->hasGoodCompleteness(...)),
7070
new TwigFunction('is_new', $this->isNew(...)),
71+
new TwigFunction('is_minor', $this->isMinor(...)),
7172
new TwigFunction('unique_int', fn () => $this->uniqueInt++),
7273
new TwigFunction('unknown_value', $this->unknownValue(...), SafeFor::HTML),
7374
];
@@ -108,6 +109,11 @@ public function isNew(Creator $creator): bool
108109
return NewArtisan::isNew($creator);
109110
}
110111

112+
public function isMinor(Creator $creator): bool
113+
{
114+
return Ages::MINORS === $creator->getAges();
115+
}
116+
111117
public function hasGoodCompleteness(Creator $creator): bool
112118
{
113119
return Completeness::hasGood($creator);

symfony/templates/main/htmx/creators_in_table.html.twig

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
inactive: creator.isHidden,
88
'matched-maker-id': creator.hasMakerId(searched_creator_id),
99
}) }}">
10+
<td class="icons">
11+
<div class="icons-container">
12+
{% if is_new(creator) %}
13+
{{ include('main/htmx/maker_icon.html.twig', { text: 'New', fa_icon: 'leaf', color: '#4cae4c'}) }}
14+
{% endif %}
15+
16+
{% if is_minor(creator) %}
17+
{{ include('main/htmx/maker_icon.html.twig', { text: 'Minor', fa_icon: 'child', color: '#E3963E'}) }}
18+
{% endif %}
19+
</div>
20+
</td>
1021
<td class="name" {{ card_open_attrs(creator.lastMakerId) }}>
1122
<span class="flag-icon flag-icon-{{ creator.country|lower }}"></span>&nbsp;
1223

@@ -15,12 +26,6 @@
1526
{%- if creator.isHidden -%}
1627
&nbsp;[hidden]{# grep-inactive-mark #}
1728
{%- endif -%}
18-
19-
<span class="text-nowrap">{{ ages_description(creator, false) }}</span>
20-
21-
{% if is_new(creator) %}
22-
<span class="text-nowrap new-creator"><i class="fa-solid fa-leaf"></i>&nbsp;recently added</span>
23-
{% endif %}
2429
</td>
2530

2631
<td class="makerId column-toggleable" {{ card_open_attrs(creator.lastMakerId) }}>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<span
2+
class="maker-table-icon"
3+
style="--maker-icon-color: {{ color }}"
4+
>
5+
<i class="fas fa-{{ fa_icon }}"></i>
6+
<span class="text">{{ text }}</span>
7+
</span>

symfony/templates/main/main.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<table id="creators-table" class="table table-striped table-sm table-hover">
9696
<thead class="table-dark">
9797
<tr>
98+
<th></th>
9899
<th class="name text-start">Fursuit maker /&nbsp;studio name</th>
99100
{% for column in columns %}
100101
<th class="{{ column.id }} {{ column.alignment_class }}">

0 commit comments

Comments
 (0)