I have a portal with different customers (landlord, tenant)
There is a registration page for them. When they register, I tag them appropriately using roles.
When they log in, the first thing they have to do is fill in their profile. For this, I created a page profile.html...
Both these users have almost similar fields except few. I have some attributes for the landlord and some other for the tenant. But both of them have some similar fields like first_name, last_name, phone, age, sex, etc...
At the moment, I maintain two different profile tables and one profile.html page.
I send them to profile.html and I am using
{% if user == 'landlord' %}
<html
<body>
profile pagefor landlord
</body>
</html>
{% endif %}
{% if user == 'tenant' %}
<html
<body>
profile pagefor tenant
</body>
</html>
{% endif %}
The problem with the above structure if I am repeating the entire HTML block for each user.
Once a user fills in their profile, I show them read-only profile.html page like
{% if user == 'landlord' and profile_filled %}
<html
<body>
read only profile page for landlord
</body>
</html>
{% endif %}
{% if user == 'tenant' and profile_filled %}
<html
<body>
read only profile page for tenant
</body>
</html>
{% endif %}
The page profile.html gets too long with these IF's....
Is there a way to simplify this?