diff --git a/funnel/templates/profile_layout.html.jinja2 b/funnel/templates/profile_layout.html.jinja2 index 0a7a9a1a7..01c2e51cf 100644 --- a/funnel/templates/profile_layout.html.jinja2 +++ b/funnel/templates/profile_layout.html.jinja2 @@ -426,10 +426,10 @@ {% if profile.is_organization_profile %} {% trans %}Home{% endtrans %} {% trans %}Admins{% endtrans %} {{ faicon(icon='chevron-right', icon_size='subhead') }} - {% else %} - {% trans %}Sessions{% endtrans %} - {% trans %}Projects{% endtrans %}{{ faicon(icon='chevron-right', icon_size='subhead') }} - {% trans %}Submissions{% endtrans %}{{ faicon(icon='chevron-right', icon_size='subhead') }} + {% elif not profile.features.is_private() %} + {% trans %}Sessions{% endtrans %} + {% trans %}Projects{% endtrans %}{{ faicon(icon='chevron-right', icon_size='subhead') }} + {% trans %}Submissions{% endtrans %}{{ faicon(icon='chevron-right', icon_size='subhead') }} {% endif %} diff --git a/funnel/templates/user_profile.html.jinja2 b/funnel/templates/user_profile.html.jinja2 index 8e8fd02e6..cbe8c5929 100644 --- a/funnel/templates/user_profile.html.jinja2 +++ b/funnel/templates/user_profile.html.jinja2 @@ -35,18 +35,22 @@
{% block contentwrapper %} -
-
- {% if not tagged_sessions %} -

{% trans %}No tagged sessions yet{% endtrans %}

- {% endif %} -
- {% for session in tagged_sessions %} -
- {{ video_thumbnail(session) }} + {% if profile.features.is_private() %} +

{% trans %}This is a private account{% endtrans %}

+ {% else %} +
+
+ {% if not tagged_sessions %} +

{% trans %}No tagged sessions yet{% endtrans %}

+ {% endif %}
- {% endfor %} -
+ {% for session in tagged_sessions %} +
+ {{ video_thumbnail(session) }} +
+ {% endfor %} +
+ {% endif %} {% endblock contentwrapper %}
diff --git a/funnel/templates/user_profile_projects.html.jinja2 b/funnel/templates/user_profile_projects.html.jinja2 index feb9a523d..34578edd7 100644 --- a/funnel/templates/user_profile_projects.html.jinja2 +++ b/funnel/templates/user_profile_projects.html.jinja2 @@ -8,18 +8,24 @@ {% block contentwrapper %}
-
- {% if not participated_projects %} -

{% trans %}No participation yet{% endtrans %}

- {% endif %} -
- + {% if profile.features.is_private() %} +
+

{% trans %}This is a private account{% endtrans %}

+
+ {% else %} +
+ {% if not participated_projects %} +

{% trans %}No participation yet{% endtrans %}

+ {% endif %} +
+ + {% endif %}
{% endblock contentwrapper %} diff --git a/funnel/templates/user_profile_proposals.html.jinja2 b/funnel/templates/user_profile_proposals.html.jinja2 index f2b376aae..a750825ac 100644 --- a/funnel/templates/user_profile_proposals.html.jinja2 +++ b/funnel/templates/user_profile_proposals.html.jinja2 @@ -9,10 +9,14 @@ {% block contentwrapper %}
- {% if submitted_proposals %} - {{ proposal_list(submitted_proposals) }} + {% if profile.features.is_private() %} +

{% trans %}This is a private account{% endtrans %}

{% else %} -

{% trans %}No submissions{% endtrans %}

+ {% if submitted_proposals %} + {{ proposal_list(submitted_proposals) }} + {% else %} +

{% trans %}No submissions{% endtrans %}

+ {% endif %} {% endif %}
diff --git a/funnel/views/profile.py b/funnel/views/profile.py index 02e75ba97..d93b8d8f0 100644 --- a/funnel/views/profile.py +++ b/funnel/views/profile.py @@ -62,6 +62,16 @@ def feature_profile_make_private(obj: Account): return obj.current_roles.admin and obj.make_profile_private.is_available +@Account.features('is_private') +def feature_profile_is_private(obj: Account): + print('obj.current_roles.admin', obj.current_roles.admin, bool(obj.profile_state.PRIVATE)) + return ( + obj.is_user_profile + and not obj.current_roles.admin + and not bool(obj.profile_state.ACTIVE_AND_PUBLIC) + ) + + def template_switcher(templateargs): template = templateargs.pop('template') return render_template(template, **templateargs)