{{ otherItem.content|length > 140 ? otherItem.content|slice(0, 140) ~ '...' : otherItem.content }}
{% endif %}{% extends 'App::V2/base.html.twig' %}
{% set currentProfile = profileItem.profile is defined and profileItem.profile ? profileItem.profile : item.profile %}
{% set currentCategory = profileItem.category is defined and profileItem.category ? profileItem.category : item.category %}
{% set currentLocation = location|default(null) %}
{% set firstName %}
{% if currentProfile.user is defined and currentProfile.user and currentProfile.user.device == 'ANDROID' %}
{{ currentProfile.lastname|default('')|trim|upper }}
{% else %}
{{ currentProfile.firstname|default('')|trim|lower|capitalize }}
{% endif %}
{% endset %}
{% set lastName %}
{% if currentProfile.user is defined and currentProfile.user and currentProfile.user.device == 'ANDROID' %}
{{ currentProfile.firstname|default('')|trim|first|lower|capitalize }}
{% else %}
{{ currentProfile.lastname|default('')|trim|first|upper }}
{% endif %}
{% endset %}
{% set teacherName = (firstName ~ ' ' ~ lastName ~ '.')|trim %}
{% set city = currentProfile.city|default('') %}
{% set postalCode = currentProfile.department|default('') %}
{% set country = currentProfile.country|default('FR')|upper %}
{% set categoryName = currentCategory.name|default('Cours particuliers') %}
{% set categorySlug = currentCategory.slug|default('') %}
{% set isFormation = currentCategory.type is defined and currentCategory.type == 'formations' %}
{% set isCoach = categorySlug == 'coach-sportif' %}
{% set categoryKind = isFormation ? 'Formation' : (isCoach ? 'Séance' : 'Cours particuliers') %}
{% set dePrefix = categoryName|first|lower in ['a','e','i','o','u','h','é','è','ê','ë'] ? "d'" : 'de ' %}
{% set itemContent = item.content|default('')|trim %}
{% set profileContent = currentProfile.content|default('')|trim %}
{% set cleanContent = itemContent ?: profileContent %}
{% set bio = cleanContent ? (cleanContent|length > 220 ? cleanContent|slice(0, 220) ~ '...' : cleanContent) : 'Annonce de cours particuliers sur RueduProf.' %}
{% set longBio = cleanContent ?: 'Annonce de cours particuliers sur RueduProf.' %}
{% set avatar = (currentProfile.avatar is defined and currentProfile.avatar and currentProfile.avatar.path is defined and currentProfile.avatar.path)
? 'https://www.rueduprof.com/uploads/avatar/' ~ currentProfile.avatar.path
: null
%}
{% set subjects = [] %}
{% set levels = [] %}
{% set modes = [] %}
{% set pricing = [] %}
{% set otherSubjects = [] %}
{% set priceFrom = null %}
{% for categoryItem in currentProfile.categories|default([]) %}
{% if categoryItem.lang is not defined or categoryItem.lang == 'fr' %}
{% if categoryItem.category is defined and categoryItem.category and categoryItem.category.name is defined and categoryItem.category.name and categoryItem.category.name not in subjects %}
{% set subjects = subjects|merge([categoryItem.category.name]) %}
{% endif %}
{% if categoryItem.pricePerHour is defined and categoryItem.pricePerHour is not null %}
{% if priceFrom is null or categoryItem.pricePerHour < priceFrom %}
{% set priceFrom = categoryItem.pricePerHour %}
{% endif %}
{% endif %}
{% if categoryItem.primaire is defined and categoryItem.primaire and 'Primaire' not in levels %}
{% set levels = levels|merge(['Primaire']) %}
{% endif %}
{% if categoryItem.college is defined and categoryItem.college and 'Collège' not in levels %}
{% set levels = levels|merge(['Collège']) %}
{% endif %}
{% if categoryItem.lycee is defined and categoryItem.lycee and 'Lycée' not in levels %}
{% set levels = levels|merge(['Lycée']) %}
{% endif %}
{% if categoryItem.superieur is defined and categoryItem.superieur and 'Supérieur' not in levels %}
{% set levels = levels|merge(['Supérieur']) %}
{% endif %}
{% if categoryItem.webcam is defined and categoryItem.webcam and 'En ligne' not in modes %}
{% set modes = modes|merge(['En ligne']) %}
{% endif %}
{% if categoryItem.outPlace is defined and categoryItem.outPlace and 'À domicile' not in modes %}
{% set modes = modes|merge(['À domicile']) %}
{% endif %}
{% if categoryItem.inPlace is defined and categoryItem.inPlace and 'Chez le professeur' not in modes %}
{% set modes = modes|merge(['Chez le professeur']) %}
{% endif %}
{% set noteParts = [] %}
{% if categoryItem.webcam is defined and categoryItem.webcam %}
{% set noteParts = noteParts|merge(['En ligne']) %}
{% endif %}
{% if categoryItem.outPlace is defined and categoryItem.outPlace %}
{% set noteParts = noteParts|merge(['À domicile']) %}
{% endif %}
{% if categoryItem.inPlace is defined and categoryItem.inPlace %}
{% set noteParts = noteParts|merge(['Chez le professeur']) %}
{% endif %}
{% if categoryItem.category is defined and categoryItem.category and categoryItem.category.name is defined %}
{% set pricing = pricing|merge([{
'label': categoryItem.category.name,
'slug': categoryItem.category.slug|default(''),
'type': categoryItem.category.type|default(null),
'price': (categoryItem.pricePerHour is defined and categoryItem.pricePerHour is not null) ? categoryItem.pricePerHour ~ '€ / h' : 'Sur demande',
'description': categoryItem.content|default(''),
'note': noteParts|join(' · '),
'current': categoryItem.id is defined and profileItem.id is defined and categoryItem.id == profileItem.id
}]) %}
{% endif %}
{% if categoryItem.id is defined and profileItem.id is defined and categoryItem.id != profileItem.id and categoryItem.category is defined and categoryItem.category %}
{% set otherSubjects = otherSubjects|merge([categoryItem]) %}
{% endif %}
{% endif %}
{% endfor %}
{% set headline = categoryKind ~ ' ' ~ dePrefix ~ categoryName ~ (city ? ' à ' ~ city : '') %}
{% set heroTitle = categoryKind ~ ' ' ~ dePrefix ~ categoryName ~ ' avec ' ~ teacherName|trim %}
{% set heroMetaLocation = city ? (postalCode ? city ~ ' (' ~ postalCode ~ ')' : city) : postalCode %}
{% set zones = [] %}
{% if heroMetaLocation %}
{% set zones = zones|merge([heroMetaLocation]) %}
{% endif %}
{% if currentLocation and currentLocation.slug is defined and currentLocation.slug == 'en-ligne' and 'En ligne' not in zones %}
{% set zones = zones|merge(['En ligne']) %}
{% endif %}
{% set teacher = teacher|default({
'first_name': firstName ?: 'Professeur',
'last_name': lastName ?: '',
'headline': headline,
'city': heroMetaLocation,
'price_from': priceFrom ?? 0,
'rating': null,
'reviews_count': 0,
'students_count': 0,
'response_time': null,
'experience_years': null,
'verified': false,
'bio': bio,
'long_bio': longBio,
'avatar': avatar,
'teaches': subjects,
'levels': levels,
'modes': modes,
'zones': zones,
'languages': country == 'FR' ? ['Français'] : [country],
'badges': [],
'highlights': [],
'pricing': pricing,
'availability': [],
'reviews': [],
'faq': []
}) %}
{% set seoTitle %}{{ categoryKind }} {{ dePrefix }}{{ categoryName }}{% if heroMetaLocation %} à {{ heroMetaLocation }}{% endif %} avec {{ teacherName|trim }}{% endset %}
{% set seoUrl %}https://www.rueduprof.com/{{ currentProfile.id ~ '/professeur-' ~ currentProfile.department ~ '-' ~ (currentProfile.firstname|myslugify) ~ '-' ~ (currentProfile.lastname|first|myslugify) ~ '/' }}{% endset %}
{% set seoDescription %}Découvrez la fiche {{ categoryKind|lower }} {{ dePrefix }}{{ categoryName }} de {{ teacherName|trim }}{% if item.pricePerHour is defined and item.pricePerHour is not null %}, à partir de {{ item.pricePerHour }}€ / h{% endif %}.{% endset %}
{% block title %}{{ seoTitle|trim }}{% endblock %}
{% block meta_title %}{{ seoTitle|trim|raw }}{% endblock %}
{% block meta_description %}{{ seoDescription|trim }}{% endblock %}
{% block canonical %}{{ seoUrl|trim }}{% endblock %}
{% block open_graph %}
{% if teacher.avatar %}{% endif %}
{% endblock %}
{% block twitter_card %}
{% if teacher.avatar %}{% endif %}
{% endblock %}
{% block snippet_json %}
{% include 'App::schema/profile_category_show.html.twig' with {
location: currentLocation,
profileItem: profileItem,
item: item
} only %}
{% endblock %}
{% block body %}
{{ teacher.headline }} {{ teacher.bio }} {{ longBio|raw|nl2br }} {{ profileContent|raw|nl2br }} {{ teacher.levels is not empty ? teacher.levels|join(' · ') : 'Sur demande' }} {{ teacher.modes is not empty ? teacher.modes|join(' · ') : 'À préciser' }} {{ teacher.zones is not empty ? teacher.zones|join(' · ') : 'À préciser' }}
{{ otherItem.content|length > 140 ? otherItem.content|slice(0, 140) ~ '...' : otherItem.content }}
{% else %}
{{ heroTitle }}
{{ categoryKind }} {{ dePrefix }}{{ categoryName }}
Présentation générale
Matière, niveaux et modalités
Tarifs et autres matières de {{ teacher.first_name }} {{ teacher.last_name|first }}.