diff --git a/scipost_django/scipost/static/scipost/assets/css/_navbar.scss b/scipost_django/scipost/static/scipost/assets/css/_navbar.scss index b5b04373b461345081345dbb713d2081e75d62ce..0fd57bb65b66afc1c4825bca34fec7b026e2e574 100644 --- a/scipost_django/scipost/static/scipost/assets/css/_navbar.scss +++ b/scipost_django/scipost/static/scipost/assets/css/_navbar.scss @@ -22,6 +22,190 @@ } } +.main-nav-pre202202 { + background-color: $scipost-blue50; + letter-spacing: 0.3px; + + .container { + position: relative; + } + + .separator { + color: $white; + display: none; + } + + a { + color: $white; + + &:hover { + color: $scipost-lightestblue; + text-decoration: underline; + } + } + + .nav-item .dropdown-toggle::after { + margin-left: 0.2em; + vertical-align: 0.1255em; // + font-weight: bold; + } + + .dropdown-menu { + min-width: 255px; + padding: 0.45rem 0.75rem; + background: $white; //$scipost-blue50; + color: $scipost-darkblue; //$white; + border-color: #e0e0e0; // + top: 36px; + box-shadow: 0px 1px 2px 0px #e0e0e0; + + .fa { + display: none; + } + + a:hover + .fa { + display: inline; + } + + .dropdown-item { + background-color: transparent; + padding: 0.5rem 0.625rem; // + line-height: 1.5; + color: $scipost-darkblue; // + white-space: normal; + + a { + color: $scipost-blue50; + transition: 0.08s; + + &:hover { + color: $scipost-darkblue; + } + } + } + } + + @media (min-width: 992px) { + .dropdown-menu { + &.mega-menu { + &.mega-menu-2 { + width: 700px; + } + + .row { + margin-bottom: 0; + } + + } + } + .full-height-bar { + z-index: 1; + position: absolute; + top: 0; + height: 100%; + width: 100%; + left: 0; + + > .container { + height: 100%; + } + + .form-wrapper { + margin-right: - $grid-gutter-width; + float: right; + height: 100%; + padding: $navbar-padding-y 0.5rem; + background: #343a40; + } + } + + .separator { + display: inline-block; + } + } + + @media (max-width: 991px) { + text-align: center; + + .dropdown-headline { + display: none; + } + + .dropdown-menu { + background: #7a94c5; // background: $scipost-blue50; + border: 0; //2px solid $scipost-darkblue; + box-shadow: none; + padding: 0.75rem 0 !important; + margin: 0; + text-align: center; + + &.mega-menu .row { + margin-bottom: 0; + } + + &.mega-menu .col-md-6 { + flex: auto; + max-width: 100%; + } + + .dropdown-item { + padding-top: 0.75rem 0.625rem; + white-space: normal; + } + + .dropdown-item a, + .dropdown-item a:hover, + .dropdown-item a:hover i { + color: $white; + } + + .dropdown-divider { + display: none; + } + } + + .nav-item { + padding-top: 0.25rem; + padding-bottom: 0.25rem; + text-transform: uppercase; + letter-spacing: 1px; + } + } + + .search-form { + position: relative; + + input { + border: 1px solid $scipost-darkblue; + border-radius: 0; + outline: none; + padding-right: 5rem; + box-shadow: none; + } + + .btn { + border: 0; + outline: none; + color: $scipost-darkblue; + position: absolute; + right: 0; + background: transparent; + height: 100%; + width: auto; + padding: 4px 10px; + + &:hover { + color: $scipost-lightblue; + + span { + text-decoration: underline; + } + } + } + } +} + + .main-nav { background-color: $scipost-blue50; letter-spacing: 0.3px; @@ -205,6 +389,7 @@ } } + @media (max-width: 992px) { .main-nav .search-form input { padding-top: 0.6rem; diff --git a/scipost_django/scipost/templates/scipost/_hx_sponsors.html b/scipost_django/scipost/templates/scipost/_hx_sponsors.html index e3be1bf9ed3d6c23aa973cf7226c8e44dca75235..ac34c8fe2a940cce18396d5bd8d7e86fc3910b1f 100644 --- a/scipost_django/scipost/templates/scipost/_hx_sponsors.html +++ b/scipost_django/scipost/templates/scipost/_hx_sponsors.html @@ -11,7 +11,7 @@ {% for sponsor in current_sponsors %} {% if sponsor.logo %} <li class="p-2"> - <img class="rounded" style="max-height: 10em;" + <img class="rounded" style="max-height: 8rem; max-width: 16rem;" src="{{ sponsor.logo.url }}" alt="{{ sponsor.name }} logo"> </li> {% endif %} diff --git a/scipost_django/scipost/templates/scipost/bare_base.html b/scipost_django/scipost/templates/scipost/bare_base.html index e1258f6d33fb72f6f94bc6f24a7ae8885c1c912d..c45c9ad876362e8a0f9c32ece68689a015e508f1 100644 --- a/scipost_django/scipost/templates/scipost/bare_base.html +++ b/scipost_django/scipost/templates/scipost/bare_base.html @@ -29,7 +29,7 @@ {% include 'scipost/header.html' %} {% endblock header %} {% block navbar %} - {% include 'scipost/navbar.html' %} + {% include 'scipost/navbar_pre202202.html' %} {% endblock navbar %} {% block breadcrumb %}{% endblock breadcrumb %} diff --git a/scipost_django/scipost/templates/scipost/navbar.html b/scipost_django/scipost/templates/scipost/navbar.html index 9a335f3225c6ad1ffc3aa390e6b72a4e43dfbbe2..743595cf9180c7a988b77c09e0bfff12ce8a0d33 100644 --- a/scipost_django/scipost/templates/scipost/navbar.html +++ b/scipost_django/scipost/templates/scipost/navbar.html @@ -7,14 +7,6 @@ {% is_active_fellow request.user as is_active_fellow %} -<!-- <nav class="navbar navbar-expand-sm main-nav"> - <div class="container"> - <button class="navbar-toggler p-0 border-0" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar" aria-label="Navbar toggler"> - <span class="navbar-toggler-icon">{% include 'bi/list.html' %}</span> - </button> - <div class="collapse navbar-collapse mt-3" id="main-navbar"> --> - - <nav class="navbar main-nav p-2"> <div class="container"> <div class="flex-fill" id="main-navbar"> @@ -23,7 +15,7 @@ role="tablist"> <li class="nav-item" role="presentation"> - {% if request.path == '/' %} + {% if request.path == '/portal' %} <button class="nav-link{% if not request.GET.tab %} active{% endif %}" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" @@ -32,12 +24,12 @@ Home </button> {% else %} - <a href="{% url 'scipost:index' %}">Home</a> + <a href="{% url 'scipost:portal' %}">Home</a> {% endif %} </li> <li class="nav-item" role="presentation"> - {% if request.path == '/' %} + {% if request.path == '/portal' %} <button class="nav-link{% if request.GET.tab == 'journals' %} active{% endif %}" id="journals-tab" data-bs-toggle="tab" data-bs-target="#journals" @@ -46,12 +38,12 @@ Journals </button> {% else %} - <a href="{% url 'scipost:index' %}?tab=journals">Journals</a> + <a href="{% url 'scipost:portal' %}?tab=journals">Journals</a> {% endif %} </li> <li class="nav-item" role="presentation"> - {% if request.path == '/' %} + {% if request.path == '/portal' %} <button class="nav-link{% if request.GET.tab == 'publications' %} active{% endif %}" id="publications-tab" data-bs-toggle="tab" data-bs-target="#publications" @@ -60,12 +52,12 @@ Publications </button> {% else %} - <a href="{% url 'scipost:index' %}?tab=publications">Publications</a> + <a href="{% url 'scipost:portal' %}?tab=publications">Publications</a> {% endif %} </li> <li class="nav-item" role="presentation"> - {% if request.path == '/' %} + {% if request.path == '/portal' %} <button class="nav-link{% if request.GET.tab == 'submissions' %} active{% endif %}" id="submissions-tab" data-bs-toggle="tab" data-bs-target="#submissions" @@ -74,12 +66,12 @@ Submissions </button> {% else %} - <a href="{% url 'scipost:index' %}?tab=submissions">Submissions</a> + <a href="{% url 'scipost:portal' %}?tab=submissions">Submissions</a> {% endif %} </li> <li class="nav-item" role="presentation"> - {% if request.path == '/' %} + {% if request.path == '/portal' %} <button class="nav-link border border-2 border-warning{% if request.GET.tab == 'reportsneeded' %} active{% endif %}" id="reports-needed-tab" data-bs-toggle="tab" data-bs-target="#reports-needed" @@ -88,7 +80,7 @@ Reports needed <span class="text-warning">{% include 'bi/exclamation-square-fill.html' %}</span> </button> {% else %} - <a href="{% url 'scipost:index' %}?tab=reportsneeded" + <a href="{% url 'scipost:portal' %}?tab=reportsneeded" class="border border-2 border-warning"> Reports needed <span class="text-warning">{% include 'bi/exclamation-square-fill.html' %}</span> @@ -97,7 +89,7 @@ </li> <!-- <li class="nav-item" role="presentation"> - {% if request.path == '/' %} + {% if request.path == '/portal' %} <button class="nav-link{% if request.GET.tab == 'reports' %} active{% endif %}" id="reports-tab" data-bs-toggle="tab" data-bs-target="#reports" @@ -106,12 +98,12 @@ Reports </button> {% else %} - <a href="{% url 'scipost:index' %}?tab=reports">Reports</a> + <a href="{% url 'scipost:portal' %}?tab=reports">Reports</a> {% endif %} </li> <li class="nav-item" role="presentation"> - {% if request.path == '/' %} + {% if request.path == '/portal' %} <button class="nav-link{% if request.GET.tab == 'comments' %} active{% endif %}" id="comments-tab" data-bs-toggle="tab" data-bs-target="#comments" @@ -120,7 +112,7 @@ Comments </button> {% else %} - <a href="{% url 'scipost:index' %}?tab=comments">Comments</a> + <a href="{% url 'scipost:portal' %}?tab=comments">Comments</a> {% endif %} </li> --> @@ -132,7 +124,7 @@ </li> {% if user.is_authenticated %} - <li class="nav-item dropdown mx-2 mx-lg-auto"> + <li class="nav-item dropdown mx-2 ms-lg-auto"> <a class="nav-link dropdown-toggle" href="#" id="PersonalDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover"> Logged in as {% if user.last_name %}{% if user.contributor %}{{ user.contributor.profile.get_title_display }} {% endif %}{{ user.first_name }} {{ user.last_name }}{% else %}{{ user.username }}{% endif %}</a> @@ -179,7 +171,7 @@ </li> {% else %} <li class="mx-2 mx-lg-auto nav-item{% if request.path == '/login/' %} active{% endif %}"> - <a class="nav-link" href="{% url 'scipost:login' %}?next={{request.path}}">Login or register</a> + <a class="nav-link" href="{% url 'scipost:login' %}?next={{ request.path }}">Login or register</a> </li> {% endif %} </ul> diff --git a/scipost_django/scipost/templates/scipost/navbar_pre202202.html b/scipost_django/scipost/templates/scipost/navbar_pre202202.html new file mode 100644 index 0000000000000000000000000000000000000000..7b15540bfc83dd7244486247885845a8c3203296 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/navbar_pre202202.html @@ -0,0 +1,248 @@ +{% load request_filters %} +{% load static %} +{% load scipost_extras %} +{% load journals_extras %} +{% load user_groups %} + +{% is_active_fellow request.user as is_active_fellow %} + + + + +<nav class="navbar navbar-expand-lg main-nav-pre202202"> + <div class="container"> + <button class="navbar-toggler p-0 border-0" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar" aria-label="Navbar toggler"> + <span class="navbar-toggler-icon">{% include 'bi/list.html' %}</span> + </button> + <div class="collapse navbar-collapse mt-lg-0 mt-3" id="main-navbar"> + <ul class="navbar-nav me-auto"> + + <li class="nav-item{% if request.path == '/' %} active{% endif %}"> + <a href="{% url 'scipost:index' %}" class="nav-link" aria-label="SciPost Home"> + <span class="d-none d-lg-inline-block" aria-hidden="true" style="min-width: 16px;">{% include 'bi/house-fill.html' %}</span> + <span class="d-lg-none d-inline-block">Home</span> + </a> + </li> + + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="JournalsDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Journals</a> + <div class="dropdown-menu mega-menu mega-menu-2" aria-labelledby="JournalsDropdown"> + <div class="row"> + <div class="col-md-6"> + <div class="dropdown-item"><a href="{% url 'journals:journals' %}">Journals homepage</a></div> + </div> + <div class="col-md-6"> + <div class="dropdown-item"><a href="{% url 'journals:publications' %}">View all publications</a></div> + </div> + </div> + <div class="dropdown-divider"></div> + + <table class="table table-bordered table-secondary"> + <thead class="table-dark"> + <tr> + <th class="px-2 py-1"><small>Branch of Science</small></th> + <th class="px-2 py-1"><small>Fields <em>(click to see field-specific detailed list)</em></small></th> + </tr> + </thead> + <tbody> + {% for branch in branches %} + {% if branch.journals.all|length > 0 %} + <tr> + <td class="align-middle"> + <small>{{ branch.name }}</small> + </td> + <td> + {% for acad_field in branch.academic_fields.all %} + {% if acad_field.journals.active.all|length > 0 %} + <a href={% url 'journals:journals' %}?field={{ acad_field.slug }} class="btn btn-primary btn-sm"><small>{{ acad_field.name }}</small></a> + {% endif %} + {% endfor %} + </td> + </tr> + {% endif %} + {% endfor %} + </tbody> + </table> + + </div> + </li> + + + + + <li class="nav-item{% if '/submissions/' in request.path %} active{% endif %} dropdown"> + <!-- <a class="nav-link" href="{% url 'submissions:submissions' %}">Submissions</a> --> + <a class="nav-link dropdown-toggle" href="#" id="SubmissionsDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover">Submissions</a> + <div class="dropdown-menu mega-menu mega-menu-2" aria-labelledby="SubmissionsDropdown"> + <div class="row"> + <div class="col-md-6"> + <div class="dropdown-item"><a href="{% url 'submissions:submissions' %}">View all Submissions</a></div> + </div> + <div class="col-md-6"> + <div class="dropdown-item"><a href="{% url 'submissions:submit_manuscript' %}">Submit a manuscript</a></div> + <div class="dropdown-item"><a href="{% url 'submissions:author_guidelines' %}">Author guidelines</a></div> + <div class="dropdown-item"><a href="{% url 'submissions:referee_guidelines' %}">Referee guidelines</a></div> + <div class="dropdown-item"><a href="{% url 'colleges:colleges' %}">Editorial Colleges</a></div> + </div> + </div> + <div class="dropdown-divider"></div> + <table class="table table-bordered table-secondary"> + <thead class="table-dark"> + <tr> + <th class="px-2 py-1"><small>Branch of Science</small></th> + <th class="px-2 py-1"><small>Fields <em>(click to see field-specific detailed list)</em></small></th> + </tr> + </thead> + <tbody> + {% for branch in branches %} + {% if branch.submissions.all|length > 0 %} + <tr> + <td class="align-middle"> + <small>{{ branch.name }}</small> + </td> + <td> + {% for acad_field in branch.academic_fields.all %} + {% if acad_field.submissions.all|length > 0 %} + <a href={% url 'submissions:submissions' %}?field={{ acad_field.slug }} class="btn btn-primary btn-sm"><small>{{ acad_field.name }}</small></a> + {% endif %} + {% endfor %} + </td> + </tr> + {% endif %} + {% endfor %} + </tbody> + </table> + </div> + </li> + + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="MoreDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover">More</a> + <div class="dropdown-menu" aria-labelledby="MoreDropdown"> + <div class="dropdown-item"> + <a href="{% url 'comments:comments' %}">Comments</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'commentaries:commentaries' %}">Commentaries</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'theses:theses' %}">Theses</a> + </div> + </div> + </li> + + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="AboutDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover">About SciPost</a> + <div class="dropdown-menu" aria-labelledby="AboutDropdown"> + <div class="dropdown-item"> + <a href="{% url 'scipost:contact' %}">Contact us</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:about' %}">About SciPost</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'scipost:foundation' %}">The Foundation</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'careers:jobopenings' %}">Careers@SciPost</a> + </div> + + <div class="dropdown-divider"></div> + + <div class="dropdown-item"> + <a href="{% url 'scipost:FAQ' %}">FAQ</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'news:news' %}">News</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'scipost:feeds' %}">Feeds</a> + </div> + + <div class="dropdown-divider"></div> + + <div class="dropdown-item"> + <a href="{% url 'finances:business_model' %}">Our Business Model</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'organizations:organizations' %}">Organizations<br/><span class="small">benefitting from our activities</span></a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'sponsors:sponsors' %}">Sponsors</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'finances:finances' %}">Finances</a> + </div> + + </div> + </li> + + </ul> + + <hr class="lg d-lg-none"> + + <ul class="navbar-nav me-0"> + {% if user.is_authenticated %} + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="PersonalDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover"> + Logged in as {% if user.last_name %}{% if user.contributor %}{{ user.contributor.profile.get_title_display }} {% endif %}{{ user.first_name }} {{ user.last_name }}{% else %}{{ user.username }}{% endif %}</a> + + {% if request.user.contributor and not request.user.contributor.is_currently_available %} + <button type="button" class="btn btn-link p-0 text-warning" data-bs-toggle="tooltip" data-bs-title="You are currently unavailable.<br>Check your availability on your Personal Page if this should not be the case." data-bs-html="true">{% include 'bi/exclamation-triangle-fill.html' %}</button> + + {% endif %} + <div class="dropdown-menu dropdown-menu-right" aria-labelledby="PersonalDropdown"> + {% if user.contributor %} + <div class="dropdown-item"> + <a href="{% url 'scipost:personal_page' %}">Personal Page</a> + </div> + {% if is_active_fellow %} + <div class="dropdown-item"> + <a href="{% url 'submissions:pool' %}">Submissions Pool</a> + </div> + {% endif %} + {% endif %} + {% if perms.scipost.can_view_production %} + <div class="dropdown-item"> + <a href="{% url 'production:production' %}">Production</a> + </div> + {% endif %} + {% if perms.scipost.can_manage_organizations or user.org_contact %} + <div class="dropdown-item"> + <a href="{% url 'organizations:dashboard' %}">Orgs dashboard</a> + </div> + {% endif %} + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'forums:forums' %}">Forums and Meetings</a> + </div> + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'helpdesk:helpdesk' %}">Helpdesk</a> + </div> + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'scipost:logout' %}?next={{ request.path }}">Logout</a> + </div> + </div> + </li> + + <li class="nav-item"> +  <a href="{% url 'helpdesk:ticket_create' %}" target="_blank" class="nav-link"><span style="font-size: 80%;" data-bs-toggle="tooltip" data-bs-html="true" title="Notice something wrong?<br/>Open a support ticket">{% include 'bi/sticky-fill.html' %}</span></a> + </li> + + {% else %} + <li class="nav-item{% if request.path == '/login/' %} active{% endif %}"> + <a class="nav-link" href="{% url 'scipost:login' %}?next={{request.path}}">Login or register</a> + </li> + {% endif %} + </ul> + </div> + </div> +</nav> diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html index 7b61400da11076b79b66eb45bc24ab4617544f0a..6332e1c885126ed3561870e31f8637ca8c15e908 100644 --- a/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html +++ b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html @@ -34,7 +34,7 @@ {% if reports_needed %} <div class="card m-2 border-2 text-center"> <div class="card-header m-0 p-0"> - <h2 class="m-0 p-2 text-white bg-danger"> + <h2 class="m-0 p-2 text-white bg-warning"> {% include 'bi/alarm-fill.html' %} Reports are needed on these Submissions </h2> </div> diff --git a/scipost_django/scipost/templates/scipost/portal/portal.html b/scipost_django/scipost/templates/scipost/portal/portal.html index c48e1bc8f3c87728fd1cb56f78da504de4726925..8ca364facf33a1b694cdab0593ce7c0611e33e3f 100644 --- a/scipost_django/scipost/templates/scipost/portal/portal.html +++ b/scipost_django/scipost/templates/scipost/portal/portal.html @@ -14,6 +14,9 @@ {% block meta_description %}{{ block.super }} homepage{% endblock meta_description %} {% block pagetitle %} Homepage{% endblock pagetitle %} +{% block navbar %} + {% include 'scipost/navbar.html' %} +{% endblock navbar %} {% block content %} @@ -24,7 +27,7 @@ role="tabpanel" aria-labelledby="home-tab"> <div hx-get="{% url 'scipost:portal_hx_home' %}" hx-trigger="{% if not request.GET.tab %}load, {% endif %}click delay:200ms from:#home-tab" - hx-push-url="{% url 'scipost:index' %}" + hx-push-url="{% url 'scipost:portal' %}" > </div> </div> @@ -34,7 +37,7 @@ role="tabpanel" aria-labelledby="journals-tab"> <div hx-get="{% url 'scipost:portal_hx_journals' %}" hx-trigger="{% if request.GET.tab == 'journals' %}load, {% endif %}click delay:200ms from:#journals-tab, session-acad-field-set from:body" - hx-push-url="{% url 'scipost:index' %}?tab=journals" + hx-push-url="{% url 'scipost:portal' %}?tab=journals" > </div> </div> @@ -44,7 +47,7 @@ role="tabpanel" aria-labelledby="publications-tab"> <div hx-get="{% url 'scipost:portal_hx_publications' %}" hx-trigger="{% if request.GET.tab == 'publications' %}load, {% endif %}click delay:200ms from:#publications-tab, session-acad-field-set from:body, session-specialty-set from:body" - hx-push-url="{% url 'scipost:index' %}?tab=publications" + hx-push-url="{% url 'scipost:portal' %}?tab=publications" > </div> </div> @@ -54,7 +57,7 @@ role="tabpanel" aria-labelledby="submissions-tab"> <div hx-get="{% url 'scipost:portal_hx_submissions' %}" hx-trigger="{% if request.GET.tab == 'submissions' %}load, {% endif %}click delay:200ms from:#submissions-tab, session-acad-field-set from:body, session-specialty-set from:body" - hx-push-url="{% url 'scipost:index' %}?tab=submissions" + hx-push-url="{% url 'scipost:portal' %}?tab=submissions" > </div> </div> @@ -64,7 +67,7 @@ role="tabpanel" aria-labelledby="reports-needed-tab"> <div hx-get="{% url 'scipost:portal_hx_submissions' %}?reports_needed=1" hx-trigger="{% if request.GET.tab == 'reportsneeded' %}load, {% endif %}click delay:200ms from:#reports-needed-tab, session-acad-field-set from:body, session-specialty-set from:body" - hx-push-url="{% url 'scipost:index' %}?tab=reportsneeded" + hx-push-url="{% url 'scipost:portal' %}?tab=reportsneeded" > </div> </div> @@ -74,7 +77,7 @@ role="tabpanel" aria-labelledby="reports-tab"> <div hx-get="{% url 'scipost:portal_hx_reports' %}" hx-trigger="{% if request.GET.tab == 'reports' %}load, {% endif %}click delay:200ms from:#reports-tab, session-acad-field-set from:body, session-specialty-set from:body" - hx-push-url="{% url 'scipost:index' %}?tab=reports" + hx-push-url="{% url 'scipost:portal' %}?tab=reports" > </div> </div> @@ -84,7 +87,7 @@ role="tabpanel" aria-labelledby="comments-tab"> <div hx-get="{% url 'scipost:portal_hx_comments' %}" hx-trigger="{% if request.GET.tab == 'comments' %}load, {% endif %}click delay:200ms from:#comments-tab, session-acad-field-set from:body, session-specialty-set from:body" - hx-push-url="{% url 'scipost:index' %}?tab=comments" + hx-push-url="{% url 'scipost:portal' %}?tab=comments" > </div> </div> diff --git a/scipost_django/scipost/urls.py b/scipost_django/scipost/urls.py index 5cd3eac9e3c925c77bac201c1d7ba3d5aa7776a3..85b8daa468bf93638365f57d5660a667b3a4844d 100644 --- a/scipost_django/scipost/urls.py +++ b/scipost_django/scipost/urls.py @@ -67,14 +67,14 @@ urlpatterns = [ # Homepage path( - 'index_pre202202', - views.index, - name='index_pre202202' + '', #'index_pre202202', + views.index_pre202202, + name='index', #name='index_pre202202' ), path( - '', - views.index, - name='index' + 'portal', + views.portal, + name='portal' ), # HTMX-delivered fragments diff --git a/scipost_django/scipost/views.py b/scipost_django/scipost/views.py index 786aa9ac651c8a8170f3f2735b4cee7ecb6a6857..85dc016c12c9d8d7513ee3b9bc4fff9b104e4d28 100644 --- a/scipost_django/scipost/views.py +++ b/scipost_django/scipost/views.py @@ -162,7 +162,7 @@ def index_pre202202(request): return render(request, 'scipost/index.html', context) -def index(request): +def portal(request): if request.GET.get('field', None): if request.GET['field'] != request.session['session_acad_field_slug']: request.session['session_specialty_slug'] = ''