diff --git a/scipost_django/scipost/templates/scipost/personal_page/_hx_communication.html b/scipost_django/scipost/templates/scipost/personal_page/_hx_communication.html new file mode 100644 index 0000000000000000000000000000000000000000..523f841887bee4af1b62e60853748c0bd61a9b79 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/personal_page/_hx_communication.html @@ -0,0 +1,24 @@ +{% include 'scipost/personal_page/_hx_tablist.html' with selected='communication' %} + + +<div class="row"> + <div class="col-12"> + <div class="card bg-light"> + <div class="card-body"> + <h2 class="card-title">Communication</h2> + <ul class="mb-0"> + </ul> + </div> + </div> + </div> +</div> + + +<div class="row"> + <div class="col-12"> + <h3 class="mb-3">Email addresses associated to your Profile:</h3> + + {% include 'profiles/_hx_profile_emails_table.html' with profile=contributor.profile %} + + </div> +</div> diff --git a/scipost_django/scipost/templates/scipost/personal_page/_hx_tablist.html b/scipost_django/scipost/templates/scipost/personal_page/_hx_tablist.html index 5aa5ba1fe3bec4dba1e3b1e7bb1944438ebf8585..888d953f556bf4dd272f0e249914c8d229654ad1 100644 --- a/scipost_django/scipost/templates/scipost/personal_page/_hx_tablist.html +++ b/scipost_django/scipost/templates/scipost/personal_page/_hx_tablist.html @@ -1,71 +1,73 @@ <div class="tablist"> - <a hx-get="{% url 'scipost:personal_page_hx_account' %}" - {% if selected == 'account' %}class="selected"{% endif %} - > - Account - </a> + <a hx-get="{% url 'scipost:personal_page_hx_account' %}" + {% if selected == 'account' %}class="selected"{% endif %} + >Account</a> + + <a hx-get="{% url 'scipost:personal_page_hx_communication' %}" + {% if selected == 'communication' %}class="selected"{% endif %} + >Communication</a> + {% if "scipost_admin" in user_roles or "finadmin" in user_roles or perms.scipost.can_vet_registration_requests %} - <a hx-get="{% url 'scipost:personal_page_hx_admin' %}" - {% if selected == 'admin' %}class="selected"{% endif %} - > - Admin - </a> + <a hx-get="{% url 'scipost:personal_page_hx_admin' %}" + {% if selected == 'admin' %}class="selected"{% endif %} + >Admin</a> {% endif %} + {% if "scipost_admin" in user_roles or "edadmin" in user_roles or "active_fellow" in user_roles or "advisory_board" in user_roles or "vetting_editor" in user_roles or "ambassador" in user_roles or "junior_ambassador" in user_roles %} - <a hx-get="{% url 'scipost:personal_page_hx_edadmin' %}" - {% if selected == 'edadmin' %}class="selected"{% endif %} - > - Editorial Actions - </a> + <a hx-get="{% url 'scipost:personal_page_hx_edadmin' %}" + {% if selected == 'edadmin' %}class="selected"{% endif %} + >Editorial Actions</a> {% endif %} + {% if perms.scipost.can_referee %} - <a hx-get="{% url 'scipost:personal_page_hx_refereeing' %}" - {% if selected == 'refereeing' %}class="selected"{% endif %} - > - Refereeing - </a> + <a hx-get="{% url 'scipost:personal_page_hx_refereeing' %}" + {% if selected == 'refereeing' %}class="selected"{% endif %} + >Refereeing</a> {% endif %} - <a hx-get="{% url 'scipost:personal_page_hx_publications' %}" - {% if selected == 'publications' %}class="selected"{% endif %} - > - Publications - </a> - <a hx-get="{% url 'scipost:personal_page_hx_submissions' %}" - {% if selected == 'submissions' %}class="selected"{% endif %} - > - Submissions - </a> - <a hx-get="{% url 'scipost:personal_page_hx_commentaries' %}" - {% if selected == 'commentaries' %}class="selected"{% endif %} - > - Commentaries - </a> - <a hx-get="{% url 'scipost:personal_page_hx_theses' %}" - {% if selected == 'theses' %}class="selected"{% endif %} - > - Theses - </a> + + <a hx-get="{% url 'scipost:personal_page_hx_publications' %}" + {% if selected == 'publications' %}class="selected"{% endif %} + >Publications</a> + <a hx-get="{% url 'scipost:personal_page_hx_submissions' %}" + {% if selected == 'submissions' %}class="selected"{% endif %} + >Submissions</a> + <a hx-get="{% url 'scipost:personal_page_hx_commentaries' %}" + {% if selected == 'commentaries' %}class="selected"{% endif %} + >Commentaries</a> + <a hx-get="{% url 'scipost:personal_page_hx_theses' %}" + {% if selected == 'theses' %}class="selected"{% endif %} + >Theses</a> {% with contributor.comments.regular_comments as regular_comments %} + {% if regular_comments %} {% with regular_comments.awaiting_vetting.count as count %} - <a hx-get="{% url 'scipost:personal_page_hx_comments' %}" - {% if selected == 'comments' %}class="selected"{% endif %} - > - Comments{% if count %} ({{count}} unvetted){% endif %} - </a> + <a hx-get="{% url 'scipost:personal_page_hx_comments' %}" + {% if selected == 'comments' %}class="selected"{% endif %} + > + Comments + + {% if count %}({{ count }} unvetted){% endif %} + + </a> {% endwith %} {% endif %} + {% endwith %} {% with contributor.comments.author_replies as replies %} + {% if replies %} {% with replies.awaiting_vetting.count as count %} - <a hx-get="{% url 'scipost:personal_page_hx_author_replies' %}" - {% if selected == 'author_replies' %}class="selected"{% endif %} - > - Author Replies{% if count %} ({{count}} unvetted){% endif %} - </a> + <a hx-get="{% url 'scipost:personal_page_hx_author_replies' %}" + {% if selected == 'author_replies' %}class="selected"{% endif %} + > + Author Replies + + {% if count %}({{ count }} unvetted){% endif %} + + </a> {% endwith %} {% endif %} + {% endwith %} </div> diff --git a/scipost_django/scipost/urls.py b/scipost_django/scipost/urls.py index 81e796af52b1ac4c10f16609e97135e42858e4af..dbcbd71a3231e171368ff280ea81effd33579ed0 100644 --- a/scipost_django/scipost/urls.py +++ b/scipost_django/scipost/urls.py @@ -386,6 +386,11 @@ urlpatterns = [ views.personal_page_hx_publications, name="personal_page_hx_publications", ), + path( + "personal_page/_hx_communication", + views.personal_page_hx_communication, + name="personal_page_hx_communication", + ), path( "personal_page/_hx_submissions", views.personal_page_hx_submissions, diff --git a/scipost_django/scipost/views.py b/scipost_django/scipost/views.py index 9f99071343f9b2b34850fdfcd979740ee6a064b7..de22df7a55e6872453e89e6a77005b6976e37e21 100644 --- a/scipost_django/scipost/views.py +++ b/scipost_django/scipost/views.py @@ -1170,6 +1170,16 @@ def personal_page_hx_publications(request): return render(request, "scipost/personal_page/_hx_publications.html", context) +@login_required +def personal_page_hx_communication(request): + """ + Personal Page tab: Communication. + """ + contributor = request.user.contributor + context = {"contributor": contributor} + return render(request, "scipost/personal_page/_hx_communication.html", context) + + @login_required def personal_page_hx_submissions(request): """