Skip to content
Snippets Groups Projects
Commit e22a2edd authored by Alexa Valentová's avatar Alexa Valentová
Browse files

add full name to candidate list

parent 38d364bd
No related branches found
No related tags found
2 merge requests!1044add full name to candidate list,!1043add full name to candidate list
Pipeline #18901 passed
...@@ -1922,6 +1922,8 @@ class MainPersonPageMixin( ...@@ -1922,6 +1922,8 @@ class MainPersonPageMixin(
FieldPanel("related_people"), FieldPanel("related_people"),
] ]
### OTHERS
def get_context(self, request) -> dict: def get_context(self, request) -> dict:
context = super().get_context(request) context = super().get_context(request)
...@@ -1933,7 +1935,18 @@ class MainPersonPageMixin( ...@@ -1933,7 +1935,18 @@ class MainPersonPageMixin(
return context return context
### OTHERS def get_full_name(self) -> str:
full_name = ""
if self.before_name:
full_name += f"{self.before_name} "
full_name += self.title
if self.after_name:
full_name += f", {self.after_name}"
return full_name
class Meta: class Meta:
verbose_name = "Detail osoby" verbose_name = "Detail osoby"
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
> >
<h4 <h4
class="text-xl font-bold w-64" class="text-xl font-bold w-64"
>{{ self.page.title }}</h4> >{{ self.page.get_full_name }}</h4>
<p class="lg:ml-6"> <p class="lg:ml-6">
{% if show_job and self.page.job %} {% if show_job and self.page.job %}
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
{% firstof candidate.description candidate.page.perex as description %} {% firstof candidate.description candidate.page.perex as description %}
{% if show_job %} {% if show_job %}
{% include "styleguide2/includes/molecules/candidates/candidate_primary_box.html" with name=candidate.page.title position=candidate.page.job description=description url=candidate.page.url candidate_image=resized_candidate_image %} {% include "styleguide2/includes/molecules/candidates/candidate_primary_box.html" with name=candidate.page.get_full_name position=candidate.page.job description=description url=candidate.page.url candidate_image=resized_candidate_image %}
{% else %} {% else %}
{% include "styleguide2/includes/molecules/candidates/candidate_primary_box.html" with name=candidate.page.title position=candidate.page.position description=description url=candidate.page.url candidate_image=resized_candidate_image %} {% include "styleguide2/includes/molecules/candidates/candidate_primary_box.html" with name=candidate.page.get_full_name position=candidate.page.position description=description url=candidate.page.url candidate_image=resized_candidate_image %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment