Skip to content

Commit 917b654

Browse files
author
Chris Mann
committed
GDVoisins Looks OK
1 parent 9ff0cc3 commit 917b654

18 files changed

Lines changed: 173 additions & 61 deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generated by Django 5.2.8 on 2025-11-19 19:42
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
("gdvoisins", "0001_initial"),
10+
("wagtail_village_blog", "0006_alter_blogindexpage_posts_per_page"),
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name="GDVoisinsAnnuairePage",
16+
fields=[
17+
(
18+
"gdvoisinspage_ptr",
19+
models.OneToOneField(
20+
auto_created=True,
21+
on_delete=django.db.models.deletion.CASCADE,
22+
parent_link=True,
23+
primary_key=True,
24+
serialize=False,
25+
to="gdvoisins.gdvoisinspage",
26+
),
27+
),
28+
(
29+
"annuaire_page",
30+
models.ForeignKey(
31+
null=True,
32+
on_delete=django.db.models.deletion.SET_NULL,
33+
to="wagtail_village_blog.directoryindexpage",
34+
),
35+
),
36+
],
37+
options={
38+
"abstract": False,
39+
},
40+
bases=("gdvoisins.gdvoisinspage",),
41+
),
42+
]

gdvoisins/models.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
from django.db import models
2+
from wagtail.admin.panels import PageChooserPanel
13
from wagtail.models import Page
24

5+
from wagtail_village_blog.models import DirectoryIndexPage
36

4-
class GDVoisinsPage(Page):
5-
pass
67

8+
class GDVoisinsPage(Page):
79
def get_context(self, request, tag=None, category=None, author=None, year=None, *args, **kwargs): # NOSONAR
810
# context = super(BlogIndexPage, self).get_context(request, *args, **kwargs)
911
context = super().get_context(request, *args, **kwargs)
1012
context["has_drop_down_menu"] = self.get_children().live().in_menu().exists()
1113
return context
14+
15+
16+
class GDVoisinsAnnuairePage(GDVoisinsPage):
17+
annuaire_page = models.ForeignKey(DirectoryIndexPage, models.SET_NULL, null=True)
18+
19+
content_panels = Page.content_panels + [PageChooserPanel("annuaire_page")]
20+
21+
def get_context(self, request, tag=None, category=None, author=None, year=None, *args, **kwargs): # NOSONAR
22+
# context = super(BlogIndexPage, self).get_context(request, *args, **kwargs)
23+
context = super().get_context(request, *args, **kwargs)
24+
context.update(
25+
self.annuaire_page.process_posts(
26+
request, self.annuaire_page.posts, tag=None, category=None, author=None, year=None
27+
)
28+
)
29+
return context

gdvoisins/static/assets/css/gdvoisins-tailwind.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,6 +3243,9 @@
32433243
.text-gray-700 {
32443244
color: var(--color-gray-700);
32453245
}
3246+
.text-gray-800 {
3247+
color: var(--color-gray-800);
3248+
}
32463249
.text-gray-900 {
32473250
color: var(--color-gray-900);
32483251
}
@@ -3400,6 +3403,12 @@
34003403
--btn-fg: var(--color-error-content);
34013404
}
34023405
}
3406+
.btn-neutral {
3407+
@layer daisyui.l1.l2.l3 {
3408+
--btn-color: var(--color-neutral);
3409+
--btn-fg: var(--color-neutral-content);
3410+
}
3411+
}
34033412
.btn-primary {
34043413
@layer daisyui.l1.l2.l3 {
34053414
--btn-color: var(--color-primary);

gdvoisins/templates/gdvoisins/fragments/main_menu_fab.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="fab fab-flower mb-16">
33
<!-- a focusable div with tabindex is necessary to work on all browsers. role="button" is necessary for accessibility -->
44
<div tabindex="0" role="button" class="btn btn-circle btn-lg btn-accent">
5-
{% include "gdvoisins/fragments/svg-pirate-map.html" %}
5+
{% include "gdvoisins/svg/svg-pirate-map.html" %}
66
</div>
77
<div class="fab-close">
88
{% translate "Close" %} <span class="btn btn-circle btn-lg btn-error"></span>
@@ -11,7 +11,7 @@
1111
<div class="tooltip tooltip-left"
1212
data-tip="Applications des Grands Voisins">
1313
<button class="btn btn-lg btn-circle" onclick="apps_modal.showModal()">
14-
{% include "gdvoisins/fragments/icon-tools.html" %}
14+
{% include "gdvoisins/svg/svg-icon-tools.html" %}
1515
<svg width="12px"
1616
height="12px"
1717
class="inline-block h-2 w-2 fill-current opacity-60"
@@ -29,7 +29,7 @@
2929
<div class="tooltip tooltip-left"
3030
data-tip="{% translate "Jeux de couleurs" %}">
3131
<button class="btn btn-lg btn-circle" onclick="themes_modal.showModal()">
32-
{% include "gdvoisins/fragments/svg-colors.html" %}
32+
{% include "gdvoisins/svg/svg-colors.html" %}
3333
</button>
3434
</div>
3535
<div class="tooltip tooltip-left"
Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,8 @@
11
{% load static wagtailcore_tags wagtailuserbar wagtailsettings_tags i18n gdvoisins_menu_tags %}
2-
<details class="dropdown">
3-
<!-- a focusable div with tabindex is necessary to work on all browsers. role="button" is necessary for accessibility -->
4-
<summary class="btn btn-circle btn-lg btn-accent">
5-
{% include "gdvoisins/fragments/svg-pirate-map.html" %}
6-
</summary>
7-
<ul class="menu dropdown-content">
8-
<!-- buttons that show up when FAB is open -->
9-
<li class="tooltip tooltip-left"
10-
data-tip="Applications des Grands Voisins">
11-
<button class="btn btn-lg btn-circle" onclick="apps_modal.showModal()">
12-
{% include "gdvoisins/fragments/icon-tools.html" %}
13-
<svg width="12px"
14-
height="12px"
15-
class="inline-block h-2 w-2 fill-current opacity-60"
16-
xmlns="http://www.w3.org/2000/svg"
17-
viewBox="0 0 2048 2048">
18-
<path d="M1799 349l242 241-1017 1017L7 590l242-241 775 775 775-775z"></path>
19-
</svg>
20-
</button>
21-
</li>
22-
<li class="tooltip tooltip-left" data-tip="{% translate "Languages" %}">
23-
<button class="btn btn-lg btn-circle" onclick="modal_languages.showModal()">
24-
{% get_language_info for LANGUAGE_CODE as current_lang %}{{ current_lang.code|upper }}
25-
</button>
26-
</li>
27-
<li class="tooltip tooltip-left"
28-
data-tip="{% translate "Jeux de couleurs" %}">
29-
<button class="btn btn-lg btn-circle" onclick="themes_modal.showModal()">
30-
{% include "gdvoisins/fragments/svg-colors.html" %}
2+
<button class="btn btn-circle btn-lg btn-accent" onclick="apps_modal.showModal()">
3+
{% include "gdvoisins/svg/svg-icon-tools.html" %}
314
</button>
32-
</li>
33-
<li class="tooltip tooltip-left"
34-
data-tip="{% translate "Rechercher sur ce site" %}">
35-
<button class="btn btn-lg btn-circle" onclick="search_modal.showModal()">
5+
<button class="btn btn-circle btn-lg btn-accent" onclick="search_modal.showModal()">
366
<svg xmlns="http://www.w3.org/2000/svg"
377
class="icon icon-tabler icon-tabler-search"
388
width="24"
@@ -48,6 +18,23 @@
4818
<line x1="21" y1="21" x2="15" y2="15"></line>
4919
</svg>
5020
</button>
21+
<details class="dropdown">
22+
<!-- a focusable div with tabindex is necessary to work on all browsers. role="button" is necessary for accessibility -->
23+
<summary class="btn btn-circle btn-lg btn-accent">
24+
{% include "gdvoisins/svg/svg-user-settings-outline.html" %}
25+
</summary>
26+
<ul class="menu dropdown-content">
27+
<!-- buttons that show up when FAB is open -->
28+
<li class="tooltip tooltip-left" data-tip="{% translate "Languages" %}">
29+
<button class="btn btn-lg btn-circle" onclick="modal_languages.showModal()">
30+
{% get_language_info for LANGUAGE_CODE as current_lang %}{{ current_lang.code|upper }}
31+
</button>
32+
</li>
33+
<li class="tooltip tooltip-left"
34+
data-tip="{% translate "Jeux de couleurs" %}">
35+
<button class="btn btn-lg btn-circle" onclick="themes_modal.showModal()">
36+
{% include "gdvoisins/svg/svg-colors.html" %}
37+
</button>
5138
</li>
5239
</ul>
5340
</details>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{% extends "wagtail_village_blog/directory_index_page.html" %}
2+
{% load static wagtailcore_tags wagtailuserbar wagtailsettings_tags i18n gdvoisins_menu_tags %}

gdvoisins/templates/gdvoisins/gd_voisins_page.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@ <h1 class="text-3xl font-bold ml-6 text-ellipsis">
2828
{% main_menu_down self tabindex="-1" class_name="hidden md:flex menu menu-horizontal bg-base-100 rounded-box m-auto w-full justify-center" %}
2929
{% endif %}
3030
</div>
31-
<div class="navbar-end pr-4 w-2/12">
31+
<div class="navbar-end pr-4 w-2/12 ">
3232
{% if page and has_drop_down_menu %}
3333
{% include "gdvoisins/fragments/main_menu_down.html" %}
3434
{% endif %}
3535
{% include "gdvoisins/fragments/navbar_end.html" %}
3636
</div>
3737
</div>
38+
{% endblock nav %}
39+
{% block modals %}
3840
{% include "gdvoisins/fragments/main_menu_fab.html" %}
3941
{% include "gdvoisins/fragments/search.html" %}
4042
{% include "gdvoisins/fragments/theme.html" %}
4143
{% include "gdvoisins/fragments/main_menu_lang.html" %}
4244
{% include "gdvoisins/fragments/app-menu.html" %}
43-
{% endblock nav %}
45+
{% endblock modals %}
4446
{% block header %}
4547
{% endblock header %}
4648
<main class="{% block main_class %}prose m-auto{% endblock main_class %}">
File renamed without changes.

gdvoisins/templates/gdvoisins/fragments/icon-tools.html renamed to gdvoisins/templates/gdvoisins/svg/svg-icon-tools.html

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)