Skip to content

Commit

Permalink
Merge branch 'subscriptions' of https://github.com/localcontexts/loca…
Browse files Browse the repository at this point in the history
…lcontextshub into CU-8688t8ecn-API-sp-updates
  • Loading branch information
arojas1 committed Oct 2, 2024
2 parents 0d966b5 + 94b8bfa commit 424cf06
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 57 deletions.
46 changes: 0 additions & 46 deletions accounts/decorators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from django.shortcuts import redirect
from django.contrib import messages
from researchers.utils import is_user_researcher
from localcontexts.utils import dev_prod_or_local


def unauthenticated_user(view_func):
Expand All @@ -15,46 +12,3 @@ def wrapper_func(request, *args, **kwargs):
return view_func(request, *args, **kwargs)

return wrapper_func


def zero_account_user(view_func):

def wrapper_func(request, *args, **kwargs):
if dev_prod_or_local(request.get_host()) == "SANDBOX":
messages.add_message(
request,
messages.INFO,
"This page is not available on the sandbox site. ")
return redirect('login')
if request.user.is_authenticated:
user = request.user
affiliations = (
user.user_affiliations.prefetch_related(
"institutions",
"service_providers",
)
.all()
)
has_institutions = any(
affiliation.institutions.exists()
for affiliation in affiliations
)
has_service_provider = any(
affiliation.service_providers.exists()
for affiliation in affiliations
)
if (
has_institutions or has_service_provider or
is_user_researcher(user)
):
messages.add_message(
request,
messages.INFO,
"Try creating an account using the Create an account button.")
return redirect('dashboard')
else:
return view_func(request, *args, **kwargs)
elif not request.user.is_authenticated:
return view_func(request, *args, **kwargs)

return wrapper_func
3 changes: 1 addition & 2 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from researchers.models import Researcher
from serviceproviders.models import ServiceProvider

from .decorators import unauthenticated_user, zero_account_user
from .decorators import unauthenticated_user
from maintenance_mode.decorators import force_maintenance_mode_off


Expand Down Expand Up @@ -851,7 +851,6 @@ def newsletter_unsubscription(request, emailb64):
return redirect("login")


@zero_account_user
def subscription_inquiry(request):
form = SubscriptionForm(request.POST or None)
form.fields.pop('account_type', None)
Expand Down
6 changes: 4 additions & 2 deletions communities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from .utils import *

# pdfs
from django.http import HttpResponse, Http404
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.urls import reverse
from django.template.loader import get_template
from xhtml2pdf import pisa

Expand Down Expand Up @@ -1248,7 +1249,8 @@ def apply_labels(request, pk, project_uuid):
project_id=project.id
)

return redirect('apply-labels', community.id, project.unique_id)
# return redirect('community-project-actions', community.id, project.unique_id)
return HttpResponseRedirect(f"{reverse('community-project-actions', args=[community.id, project.unique_id])}#labels")

context = {
'member_role': member_role,
Expand Down
5 changes: 4 additions & 1 deletion localcontexts/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,10 @@ i[data-tooltip]:hover:after {
}

.label-group:last-child:last-of-type { margin-bottom: 16px;}
.border-bottom-not-last:not(:last-child) { border-bottom: 1px solid #C4C4C4; }
.border-bottom-not-last:not(:last-child) {
border-bottom: 1px solid #C4C4C4;
padding-bottom: 16px;
}

.actions-card a {
margin: 8px 16px;
Expand Down
10 changes: 5 additions & 5 deletions templates/partials/_notices.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ <h2 class="mt-0">Attribution Incomplete Notice</h2>
<div class="w-80">
<p>
<span class="bold">Why use these Notices?</span><br>
The Collections Care (CC) Notices are used to recognize the cultural protocols that govern the care, display, and access to cultural materials. The CC Notices recognize that there are accompanying cultural rights, protocols, and responsibilities that govern the care, display, and access to cultural materials within collections. This reflects Indigenous sensibilities and worldviews where these collections are not objects but need to be cared for as relatives and relations.
The Collections Care (CC) Notices are visible identifiers developed specifically for institutions and repositories to support proper cultural care and stewardship of collections, led and guided by Indigenous protocols and authority.
<br><br>
These Notices can be applied after engaging with community-specific Indigenous experts to determine the culturally appropriate care and governance for relatives and relations held in the collections.
</p>
The CC Notices recognize that there are accompanying cultural rights, protocols, and responsibilities that govern the care, display, and access to cultural materials within collections. This reflects Indigenous sensibilities and worldviews where these collections are not objects but need to be cared for as relatives and relations.
<br><br>
These Notices can be applied after engaging with Indigenous community authorities to determine the culturally appropriate care and governance for relatives and relations held in the collections. </p>
<p>
<span class="bold">Where can I use these Notices?</span><br>
The CC Notices are for implementation by institutions and repositories internally and directly on collections in storage spaces and databases as well as within policy, workflows, and practices surrounding the care and stewardship of these important collections. The CC Notices can be used in print and digital formats.
</p>
The CC Notices are for implementation by institutions and repositories internally and directly on collections in storage spaces and databases as well as within policy, workflows, and practices surrounding the care and stewardship of these important collections. The CC Notices can be used in print and digital formats. </p>
<p>
<span class="bold">How can I use these Notices?</span><br>
Within the downloaded zip file are folders for each Notice containing its text, png, svg, QR code, and printable labels. Also included in the zip file is a poster with the Overall Notice. For transparency and staff awareness, we highly recommend that the poster with the Overall Notice is displayed in collections storage where the CC Notices are in use.
Expand Down
2 changes: 2 additions & 0 deletions templates/partials/_project-actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,8 @@ <h5 class="primary-black-text mt-0">This account needs to be confirmed before pu
</div>
{% endif %}

{% include 'partials/_alerts.html' %}

<script>
var notification_count = {{ subscription.notification_count }};
</script>
2 changes: 1 addition & 1 deletion templates/partials/footers/_auth-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<h4 class="underline bold w-100"> Creative Commons License</h4>
<p>
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.<br>
Traditional Knowledge and Biocultural Labels, Notices and Template Text © 2015-{% now "Y" %} Local Contexts. All Rights Reserved.<br><br>
All Labels and Notices Icons and Template Texts © 2010-{% now "Y" %} Local Contexts. All Rights Reserved.<br><br>

All images and marks are subject to copyright and trademark protection.<br>
All educational material is being shared collaboratively but does not constitute binding legal advice.<br>
Expand Down

0 comments on commit 424cf06

Please sign in to comment.