From f8fa56d50e8e1b6643c9911c0beeb8ad3f4e0270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Fern=C3=A1ndez=20Iglesias?= Date: Thu, 8 Jan 2026 20:41:14 +0100 Subject: [PATCH] Split experience timeline template into different cotton components --- changelog.md | 1 + .../templates/cotton/experience_timeline.html | 272 ------------------ .../cotton/experience_timeline/card.html | 73 +++++ .../experience_timeline/experience.html | 23 ++ .../cotton/experience_timeline/index.html | 6 + .../cotton/experience_timeline/modal.html | 101 +++++++ .../experience_timeline/sub_project.html | 61 ++++ .../experience_timeline/sub_project_list.html | 23 ++ .../tests/test_views/test_my_career_view.py | 2 +- src/locale/es/LC_MESSAGES/django.po | 16 +- 10 files changed, 297 insertions(+), 281 deletions(-) delete mode 100644 src/home/templates/cotton/experience_timeline.html create mode 100644 src/home/templates/cotton/experience_timeline/card.html create mode 100644 src/home/templates/cotton/experience_timeline/experience.html create mode 100644 src/home/templates/cotton/experience_timeline/index.html create mode 100644 src/home/templates/cotton/experience_timeline/modal.html create mode 100644 src/home/templates/cotton/experience_timeline/sub_project.html create mode 100644 src/home/templates/cotton/experience_timeline/sub_project_list.html diff --git a/changelog.md b/changelog.md index cd8e86a..abb4e60 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ - Improve UI - Change the structure of cookie consent banner +- Split experience timeline template into different cotton components ## 0.6.0 diff --git a/src/home/templates/cotton/experience_timeline.html b/src/home/templates/cotton/experience_timeline.html deleted file mode 100644 index 4bcec0d..0000000 --- a/src/home/templates/cotton/experience_timeline.html +++ /dev/null @@ -1,272 +0,0 @@ -{% load i18n %} -{% load filters %} - - diff --git a/src/home/templates/cotton/experience_timeline/card.html b/src/home/templates/cotton/experience_timeline/card.html new file mode 100644 index 0000000..ae7d3ea --- /dev/null +++ b/src/home/templates/cotton/experience_timeline/card.html @@ -0,0 +1,73 @@ +{% load i18n %} + +
+
+
+
+ +
+ {{ item.duration }} +
+
+
+ {{ item.title }} +
+ {% if item.institution %} +
+ + + + {{ item.institution }} +
+ {% endif %} +
+ + + + + {{ item.location }} +
+ {% if item.technologies %} +
+ {% for tech in item.technologies.all %} + + {{ tech.name }} + + {% endfor %} +
+ {% endif %} +
+ + +
+
+
+
diff --git a/src/home/templates/cotton/experience_timeline/experience.html b/src/home/templates/cotton/experience_timeline/experience.html new file mode 100644 index 0000000..6f74520 --- /dev/null +++ b/src/home/templates/cotton/experience_timeline/experience.html @@ -0,0 +1,23 @@ +{% load i18n %} +{% load filters %} + +
  • + {% if not is_first %} +
    + {% endif %} +
    +
    + + + +
    +
    + + + {% if not is_last %} +
    + {% endif %} +
  • diff --git a/src/home/templates/cotton/experience_timeline/index.html b/src/home/templates/cotton/experience_timeline/index.html new file mode 100644 index 0000000..aa51d56 --- /dev/null +++ b/src/home/templates/cotton/experience_timeline/index.html @@ -0,0 +1,6 @@ + diff --git a/src/home/templates/cotton/experience_timeline/modal.html b/src/home/templates/cotton/experience_timeline/modal.html new file mode 100644 index 0000000..0739ed3 --- /dev/null +++ b/src/home/templates/cotton/experience_timeline/modal.html @@ -0,0 +1,101 @@ +{% load i18n %} +{% load filters %} + + + + diff --git a/src/home/templates/cotton/experience_timeline/sub_project.html b/src/home/templates/cotton/experience_timeline/sub_project.html new file mode 100644 index 0000000..8b94093 --- /dev/null +++ b/src/home/templates/cotton/experience_timeline/sub_project.html @@ -0,0 +1,61 @@ +{% load filters %} + +
    + +
    + +

    + {{ sub_project.title }} +

    + + +
    + +
    + {{ sub_project.duration }} +
    +
    + + + {% if sub_project.client %} +
    + + + + {{ sub_project.client }} +
    + {% endif %} + + + {% if sub_project.technologies %} +
    + {% for tech in sub_project.technologies.all %} + + {{ tech.name }} + + {% endfor %} +
    + {% endif %} +
    +
    +
    +
    + {{ sub_project.description|md }} +
    +
    +
    diff --git a/src/home/templates/cotton/experience_timeline/sub_project_list.html b/src/home/templates/cotton/experience_timeline/sub_project_list.html new file mode 100644 index 0000000..dbbb139 --- /dev/null +++ b/src/home/templates/cotton/experience_timeline/sub_project_list.html @@ -0,0 +1,23 @@ +{% load i18n %} + +
    +
    + + + +

    + {% translate "Projects" %} +

    +
    +
    + {% for sub_project in item.sub_projects.all %} + + {% endfor %} +
    +
    diff --git a/src/home/tests/test_views/test_my_career_view.py b/src/home/tests/test_views/test_my_career_view.py index 548ee15..f7523bd 100644 --- a/src/home/tests/test_views/test_my_career_view.py +++ b/src/home/tests/test_views/test_my_career_view.py @@ -21,7 +21,7 @@ class BaseTestMyCareerViewContent(BaseViewTest): def test_response(self) -> None: self._assert_reponse_status_code(expected_status_code=200) self._assert_template_is_used("my-career.html") - self._assert_template_is_used("cotton/experience_timeline.html") + self._assert_template_is_used("cotton/experience_timeline/index.html") self._assert_template_is_used("cotton/base.html") def test_json_ld_context_and_structure(self) -> None: diff --git a/src/locale/es/LC_MESSAGES/django.po b/src/locale/es/LC_MESSAGES/django.po index 72fa364..33c54a5 100644 --- a/src/locale/es/LC_MESSAGES/django.po +++ b/src/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-08 12:29+0000\n" +"POT-Creation-Date: 2026-01-08 19:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,19 +22,19 @@ msgstr "" msgid "portfolio, CV, biography, career" msgstr "portfolio, CV, biografía, carrera" -#: base/templates/cotton/buttons/accept_button.html:21 +#: base/templates/cotton/cookie_consent_banner/buttons/accept_button.html:21 msgid "Accept" msgstr "Aceptar" -#: base/templates/cotton/buttons/settings_button.html:18 +#: base/templates/cotton/cookie_consent_banner/buttons/settings_button.html:18 msgid "Settings" msgstr "Opciones" -#: base/templates/cotton/buttons/settings_button.html:40 +#: base/templates/cotton/cookie_consent_banner/modal.html:15 msgid "Cookie Settings" msgstr "Configuración de Cookies" -#: base/templates/cotton/buttons/settings_button.html:84 +#: base/templates/cotton/cookie_consent_banner/modal.html:60 msgid "Save" msgstr "Guardar" @@ -43,7 +43,7 @@ msgid "Legal & Privacy" msgstr "Condiciones y Privacidad" #: base/templates/cotton/footer.html:57 -#: home/templates/cotton/experience_timeline.html:262 +#: home/templates/cotton/experience_timeline/modal.html:96 #: home/templates/index.html:90 msgid "Close" msgstr "Cerrar" @@ -121,11 +121,11 @@ msgstr[1] "%d meses" msgid "%(title)s at %(institution)s" msgstr "%(title)s en %(institution)s" -#: home/templates/cotton/experience_timeline.html:79 +#: home/templates/cotton/experience_timeline/card.html:61 msgid "View more" msgstr "Ver más" -#: home/templates/cotton/experience_timeline.html:179 +#: home/templates/cotton/experience_timeline/sub_project_list.html:15 msgid "Projects" msgstr "Proyectos"