Skip to content

Commit a78331b

Browse files
authored
Add home page v1 (#68)
* chore: split templates * feat: split template logic * feat: move mod_length to header, change strong target * feat: update header credits * feat: add home_page template variable * feat: add ModManager.get_default_mods * feat: home page v1 * up * feat: up i18n files * feat: update tbump regex version
1 parent 51ab8b3 commit a78331b

18 files changed

Lines changed: 516 additions & 288 deletions

File tree

db/mods.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3472,7 +3472,9 @@
34723472
"games": [
34733473
"BG"
34743474
],
3475-
"authors": [],
3475+
"authors": [
3476+
"CoM_Solaufein"
3477+
],
34763478
"team": [],
34773479
"notes": [
34783480
"Ce mod n'est plus disponible car il a été intégré dans le mod [[285]]."
@@ -8814,7 +8816,9 @@
88148816
"BG2",
88158817
"BGT"
88168818
],
8817-
"authors": [],
8819+
"authors": [
8820+
"Craig"
8821+
],
88188822
"team": [],
88198823
"notes": [],
88208824
"translation_state": "auto",
@@ -8823,7 +8827,7 @@
88238827
"status": "missing",
88248828
"last_update": "2004-01",
88258829
"compatibilities": {},
8826-
"tp2": ""
8830+
"tp2": "bottomless"
88278831
},
88288832
{
88298833
"id": 265,

db/mods_en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@
14791479
},
14801480
{
14811481
"id": 102,
1482-
"description": "Created for BG with its Tales of the Sword Coast expansion, this mod adds a new blacksmith located at the Friendly Arm Inn: Thorengrim Poingmarteau. He sells new items and, like Cromwell, can improve 11 others. In addition to its merchant aspect, this mod adds 3 new encounters: ogres in the Bandit Camp, a duergar and his menagerie in the Nashkel mines, and drunken sailors trying to rob you at Baldur's Gate.",
1482+
"description": "Created for BG with its Tales of the Sword Coast expansion, this mod adds a new blacksmith located at the Friendly Arm Inn: Thorengrim Hammerfist. He sells new items and, like Cromwell, can improve 11 others. In addition to its merchant aspect, this mod adds 3 new encounters: ogres in the Bandit Camp, a duergar and his menagerie in the Nashkel mines, and drunken sailors trying to rob you at Baldur's Gate.",
14831483
"description_meta": {
14841484
"status": "needs_review",
14851485
"source": "Créé pour BG avec son extension Tales of the Sword Coast, ce mod ajoute un nouveau forgeron situé à l'Auberge de Brasamical : Thorengrim Poingmarteau. Celui vend de nouveaux objets et, à l'instar de Cromwell, peut en améliorer 11 autres. Outre son aspect marchand, ce mod ajoute 3 nouvelles rencontres : des ogres dans le Camp des Bandits, un duergar et sa ménagerie dans les mines de Nashkel, et enfin des marins saouls qui tenteront de vous détrousser à la Porte de Baldur."

docs/static/css/list.css

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ label {
137137
padding: 5px 60px 13px 60px;
138138
border-radius: 3px 4px 3px 3px;
139139
box-shadow: 8px 8px 15px black;
140-
margin-bottom: 50px;
141140
}
142141

143142
#header .nav-2 {
@@ -150,10 +149,37 @@ label {
150149
text-shadow: 0.1rem 0.1rem 0.25rem black;
151150
}
152151

153-
#header .language-picker {
154-
text-align: center;
155-
margin-block: 10px;
152+
.breadcrumb {
153+
display: flex;
154+
gap: 10px;
155+
margin-block: 32px;
156+
font-size: 18px;
157+
}
158+
159+
.breadcrumb a::after {
160+
content: " /";
161+
}
162+
163+
.language-picker {
164+
display: flex;
165+
align-items: center;
166+
justify-content: center;
167+
}
168+
169+
170+
.language-picker a {
156171
font-size: 20px;
172+
padding: 10px;
173+
}
174+
175+
.language-picker a::before {
176+
content: "•  ";
177+
}
178+
179+
#header .credits div {
180+
display: grid;
181+
column-gap: 20px;
182+
grid-template-columns: 150px 1fr;
157183
}
158184

159185
.intro {
@@ -271,7 +297,8 @@ section {
271297
margin-bottom: 1rem;
272298
}
273299

274-
#maindiv .content {
300+
#maindiv .content,
301+
#homediv .content {
275302
color: #deded9;
276303
background: var(--color-background) url("../img/fond_descr_forum.avif");
277304
border: 1px solid var(--color-secondary);
@@ -281,7 +308,8 @@ section {
281308
display: block;
282309
}
283310

284-
#maindiv .content .text {
311+
#maindiv .content .text,
312+
#homediv .content .text {
285313
padding: 25px 5%;
286314
font-size: var(--font-size-medium);
287315
text-align: justify;
@@ -302,12 +330,29 @@ section {
302330
letter-spacing: .2rem;
303331
}
304332

305-
#maindiv .tables {
333+
#maindiv .tables,
334+
#homediv .tables {
306335
display: grid;
307336
grid-template-columns: 66% 34%;
308337
gap: 1rem;
309338
}
310339

340+
#homediv .stats {
341+
display: flex;
342+
flex-wrap: wrap;
343+
justify-content: center;
344+
align-items: center;
345+
gap: 16px;
346+
margin-block: 16px;
347+
}
348+
349+
#homediv .stats div {
350+
display: grid;
351+
border: 1px solid var(--color-primary);
352+
padding: 8px 16px;
353+
justify-items: center;
354+
}
355+
311356
.legend {
312357
font-size: var(--font-size-medium);
313358
border: 1px solid var(--color-secondary);
@@ -337,7 +382,7 @@ section {
337382
background: var(--background-secondary);
338383
}
339384

340-
details[open]>summary.category_name {
385+
#maindiv details[open]>summary.category_name {
341386
position: sticky;
342387
top: 102px;
343388
z-index: 5;

docs/templates/base.html

Lines changed: 7 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -14,108 +14,12 @@
1414
</head>
1515

1616
<body>
17-
<script src="{{ static }}js/main.js"></script>
18-
<a id="gotothetop" href="#top" title={{ _(trans["back"]) }}></a>
19-
<div id="cartouche">
20-
<div id="header">
21-
<h1>{{ _(trans["mod_list"]) }}</h1>
22-
<div class="language-picker">
23-
{% for language_url, flag in language_flags.items() %}
24-
<a href="https://riwspy.github.io/lcc-docs/{{ language_url }}/">{{ flag }}{% if not loop.last %} • {% endif %}</a>
25-
{% endfor %}
26-
</div>
27-
<hr>
28-
<div class="nav-2">
29-
<img class="main"
30-
src="{{ static }}img/logo_lcc.avif"
31-
title="La Couronne de Cuivre"
32-
alt="La Couronne de Cuivre"
33-
height="215"
34-
width="885" />
35-
<div class="credits">
36-
<p>
37-
<strong>{{ _(trans["author"]) }}</strong> <a href="https://www.baldursgateworld.fr/memberlist.php?mode=viewprofile&u=12382">Freddy_Gwendo (aka Gwendolyne)</a>
38-
</p>
39-
<p>
40-
<strong>{{ _(trans["maintainer"]) }}</strong> <a href="https://www.baldursgateworld.fr/memberlist.php?mode=viewprofile&u=12905">rivvers</a>
41-
</p>
42-
<p>
43-
<strong>Version :</strong> <span id="version">3.9.0</span>
44-
</p>
45-
<p>
46-
<a href="https://www.baldursgateworld.fr/viewtopic.php?t=34779">{{ _(trans["discussion"]) }} CC</a><a href="https://www.gibberlings3.net/forums/topic/40557-the-copper-coronet-mods-list/">{{ _(trans["discussion"]) }} G3</a><a href="https://github.com/RiwsPy/lcc-docs">GitHub</a>
47-
</p>
48-
</div>
49-
</div>
50-
</div>
51-
52-
<section id="maindiv">
53-
<!-- ================== I n t r o d u c t i o n ================== -->
54-
<a name="intro" id="intro"></a>
55-
<div class="content">
56-
<h2 class="background">{{ _(trans["introduction"]) }}</h2>
57-
<div class="text">
58-
<div class="intro">
59-
{% for intro in trans["intros"] %}
60-
<p>{{ _(intro) }}</p>
61-
{% endfor %}
62-
</div>
63-
<p class="title">{{ _(trans["mod_nb"]) }}<strong>{{ mod_length }}</strong></p>
64-
<div class="tables">
65-
<div class="legend">
66-
<p class="title">{{ _(trans["legend"]) }}</p>
67-
<p>
68-
<strong>{{ _(trans["mod_quality"]) }}</strong>
69-
</p>
70-
<ul>
71-
{% for icon_data in attrs_icon_data.safe.values() %}
72-
<li>{{ icon_data.icon }} {{ _(icon_data.label) }}</li>
73-
{% endfor %}
74-
</ul>
75-
<p>
76-
<strong>{{ _(trans["translation_state"]) }}</strong>
77-
</p>
78-
<ul>
79-
{% for icon_data in attrs_icon_data.translation_state_auto.values() %}
80-
<li>{{ icon_data.icon }} {{ _(icon_data.label) }}</li>
81-
{% endfor %}
82-
</ul>
83-
84-
<p>
85-
<strong>{{ _(trans["weidu_mod"]) }}</strong>
86-
</p>
87-
<ul>
88-
{% for icon_data in attrs_icon_data.is_weidu.values() %}
89-
<li>{{ icon_data.icon }} {{ _(icon_data.label) }}</li>
90-
{% endfor %}
91-
</ul>
92-
</div>
93-
<div class="warning">
94-
<p class="titre">⚠️ {{ _(trans["wargning_title"]) }} ⚠️</p>
95-
<ul>
96-
{% for warning in trans["warnings"] %}
97-
<li>{{ _(warning) }}</li>
98-
{% endfor %}
99-
</ul>
100-
</div>
101-
</div>
102-
</div>
103-
</div>
104-
</section>
105-
<section class="table">
106-
<h2 id="top" class="background">{{ _(trans["advanced_filters"]) }}</h2>
107-
<div id="search">{% include "search.html" %}</div>
108-
</section>
109-
<section id="search_text" class="table">
110-
<h3>{{ _(trans["search"]) }}</h3>
111-
<input id="search-text"
112-
type="text"
113-
placeholder={{ _(trans["mod_name"]) }}
114-
oninput="filterMod()">
115-
</section>
116-
117-
{% for category, mods in categories.items() %}<section class="table">{% include "category.html" %}</section>{% endfor %}
118-
119-
</div>
17+
{% include "header.html" %}
18+
19+
{% if is_home_page %}
20+
{% include "home_page.html" %}
21+
{% else %}
22+
{% include "list_page.html" %}
23+
{% endif %}
12024
</body>
12125
</html>

docs/templates/category.html

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<details class="category_container" data-name="{{ _(category.value) }}" open>
2-
<summary class="no-summary-style category_name h2-style" data-count="0" id="{{ category.id }}">{{ _(category.value) }}</summary>
2+
<summary class="no-summary-style category_name h2-style" data-count="{{ mods|length }}" id="{{ category.id }}">{{ _(category.value) }}</summary>
33
<div class="category">
44
<div class="row game">
55
<p>{{ _(trans["mod"]) }}</p>
@@ -10,58 +10,7 @@
1010
<img src="{{ static }}img/download.png" title="Téléchargement" alt="Image de téléchargement" width="42" height="42">
1111
</div>
1212
{% for mod in mods %}
13-
<div class="row mod" id="m{{ mod.id }}">
14-
<details class="column title update-hash-parent">
15-
<summary class="name">{{ mod.name }}</summary>
16-
</details>
17-
<div class="column icons">
18-
{% for icon in mod.icons %}<span aria-label='{{ _(icon.label) }}'>{{ icon.icon }}</span>{% endfor %}
19-
</div>
20-
<div class="column jeu">
21-
{% for game in mod.games_ordered %}<p>{{ game }}</p>{% endfor %}
22-
</div>
23-
{% if mod.authors|length <= 1 %}
24-
<div class="column team">
25-
{% for user in mod.authors %}<p>{{ user }}</p>{% endfor %}
26-
</div>
27-
{% else %}
28-
<details class="column team">
29-
<summary>{{ _(trans["team"]) }}</summary>
30-
<div class="content">{% for user in mod.authors %}<p>{{ user }}</p>{% endfor %}</div>
31-
</details>
32-
{% endif %}
33-
{% if mod.team|length <= 1 %}
34-
<div class="column team translator">
35-
{% for user in mod.team %}<p>{{ user }}</p>{% endfor %}
36-
</div>
37-
{% else %}
38-
<details class="column team translator">
39-
<summary>{{ _(trans["team"]) }}</summary>
40-
<div class="content">{% for user in mod.team %}<p>{{ user }}</p>{% endfor %}</div>
41-
</details>
42-
{% endif %}
43-
<div class="column url">
44-
{% for url in mod.get_urls() %}
45-
<a href="{{ url.url }}" target="{% if url.is_external %}_blank{% else %}_self{% endif %}">
46-
{% if url.image %}
47-
{% set img = url.image %}
48-
<img src="{{ static }}{{ img.src }}" alt="{{ img.alt|default('Lien vers le mod',true) }}" width="{{ img.width }}" height="{{ img.height }}" title="{{ img.title }}" lazy="loading">
49-
{% else %}
50-
{{ _(trans["link"]) }}
51-
{% endif %}
52-
</a>
53-
{% endfor %}
54-
</div>
55-
<div class="column desc">
56-
<div class="content">
57-
{{ mod.get_description(mod_id_to_name=mod_id_to_name)|safe }}
58-
{% set notes = mod.get_notes(mod_id_to_name=mod_id_to_name) %}
59-
{% if notes|length > 0 %}
60-
<br/><br/>{% for note in notes %}{{ note|safe }}{% if not loop.last %}<br/>{% endif %}{% endfor %}
61-
{% endif %}
62-
</div>
63-
</div>
64-
</div>
13+
{% include "mod.html" %}
6514
{% endfor %}
6615
</div>
6716
</details>

docs/templates/header.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div id="header">
2+
<h1><a href="{{ home_page }}">{{ _(trans["mod_list"]) }}</a></h1>
3+
<div class="language-picker">
4+
{% for language_url, flag in language_flags.items() %}
5+
<a class="button" href="{{ home_page }}{{ language_url }}/" title="{{ language_url }}">{{ flag }}</a>
6+
{% endfor %}
7+
</div>
8+
<hr>
9+
<div class="nav-2">
10+
<img class="main"
11+
src="{{ static }}img/logo_lcc.avif"
12+
title="La Couronne de Cuivre"
13+
alt="La Couronne de Cuivre"
14+
height="215"
15+
width="885" />
16+
<div class="credits">
17+
<div>
18+
<p>{{ _(trans["version"]) }}</p>
19+
<p id="version"><strong>3.9.0</strong></p>
20+
</div>
21+
<div>
22+
<p>{{ _(trans["mod_nb"]) }}</p>
23+
<p><strong>{{ mod_length }}</strong></p>
24+
</div>
25+
<div>
26+
<p>{{ _(trans["author"]) }}</p>
27+
<p><a href="https://www.baldursgateworld.fr/memberlist.php?mode=viewprofile&u=12382"><strong>Freddy_Gwendo</strong></a> (aka Gwendolyne)</p>
28+
</div>
29+
<div>
30+
<p>{{ _(trans["maintainer"]) }}</p>
31+
<p><a href="https://www.baldursgateworld.fr/memberlist.php?mode=viewprofile&u=12905"><strong>rivvers</strong></a></p>
32+
</div>
33+
<p>
34+
<a href="https://www.baldursgateworld.fr/viewtopic.php?t=34779">{{ _(trans["discussion"]) }} CC</a><a href="https://www.gibberlings3.net/forums/topic/40557-the-copper-coronet-mods-list/">{{ _(trans["discussion"]) }} G3</a><a href="https://github.com/RiwsPy/lcc-docs">GitHub</a>
35+
</p>
36+
</div>
37+
</div>
38+
</div>
39+
<div class="breadcrumb">
40+
<a href="{{ home_page }}">👉 {{ _(trans["home"]) }}</a>
41+
{% if language %}
42+
<a href="{{ home_page }}/{{ language }}/">{{ language }}</a>
43+
{% endif %}
44+
</div>

0 commit comments

Comments
 (0)