diff --git a/funnel/templates/account_menu.html.jinja2 b/funnel/templates/account_menu.html.jinja2 index 382e9e75f..fcaf35c39 100644 --- a/funnel/templates/account_menu.html.jinja2 +++ b/funnel/templates/account_menu.html.jinja2 @@ -36,7 +36,7 @@ {%- for orgmem in orgmemlist.recent %}
  • - {%- if orgmem.account.logo_url.url %} 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 %} -
    -
      - {% for project in participated_projects %} -
    • - {{ projectcard(project, include_calendar=true, calendarwidget_compact=false) }} -
    • - {%- endfor -%} -
    + {% if profile.features.is_private() %} +
    +

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

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

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

    + {% endif %} +
    +
      + {% for project in participated_projects %} +
    • + {{ projectcard(project, include_calendar=true, calendarwidget_compact=false) }} +
    • + {%- endfor -%} +
    + {% 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 dd224508f..c16173794 100644 --- a/funnel/views/profile.py +++ b/funnel/views/profile.py @@ -62,6 +62,11 @@ 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): + return 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) @@ -72,7 +77,6 @@ def template_switcher(templateargs): class ProfileView(AccountViewMixin, UrlChangeCheck, UrlForView, ModelView): @route('', endpoint='profile') @render_with({'text/html': template_switcher}, json=True) - @requires_roles({'reader', 'admin'}) def view(self) -> ReturnRenderWith: template_name = None ctx = {} @@ -240,7 +244,6 @@ def view(self) -> ReturnRenderWith: @route('in/projects') @render_with('user_profile_projects.html.jinja2', json=True) - @requires_roles({'reader', 'admin'}) def user_participated_projects(self) -> ReturnRenderWith: if self.obj.is_organization_profile: abort(404) @@ -260,7 +263,6 @@ def user_participated_projects(self) -> ReturnRenderWith: @route('in/submissions') @route('in/proposals') # Legacy route, will be auto-redirected to `in/submissions` @render_with('user_profile_proposals.html.jinja2', json=True) - @requires_roles({'reader', 'admin'}) def user_proposals(self) -> ReturnRenderWith: if self.obj.is_organization_profile: abort(404)