diff --git a/README.md b/README.md index 159e2ab..b11e7e1 100755 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Most of it is already implemented, you should at least do the following: # Further settings (not needed for initial setup) ## Configure Mail Server 1. Open .env file -2. Fill out +2. Add ``` EMAIL_HOST_USER=your-email EMAIL_HOST_PASSWORD=your-password diff --git a/evoks/Skosmos/skosmos.py b/evoks/Skosmos/skosmos.py index 4df79d5..377c68a 100755 --- a/evoks/Skosmos/skosmos.py +++ b/evoks/Skosmos/skosmos.py @@ -61,6 +61,9 @@ def add_vocabulary(self, config: SkosmosVocabularyConfig) -> None: g.add((URIRef(vocabulary_uri), URIRef('http://purl.org/net/skosmos#fullAlphabeticalIndex'), Literal(True))) + g.add((URIRef(vocabulary_uri), + URIRef('http://purl.org/net/skosmos#showTopConcepts'), Literal(True))) + g.add((URIRef(vocabulary_uri), URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), URIRef('http://purl.org/net/skosmos#Vocabulary'))) diff --git a/evoks/evoks/settings.py b/evoks/evoks/settings.py index 36304eb..a1f787e 100755 --- a/evoks/evoks/settings.py +++ b/evoks/evoks/settings.py @@ -94,6 +94,7 @@ def get_env(key, fallback): EMAIL_USE_TLS = True EMAIL_HOST_USER = get_env('EMAIL_HOST_USER', '') EMAIL_HOST_PASSWORD = get_env('EMAIL_HOST_PASSWORD', '') +EMAIL_CONFIGURED = bool(EMAIL_HOST_USER and EMAIL_HOST_PASSWORD) diff --git a/evoks/evoks/views.py b/evoks/evoks/views.py index 4f3d8eb..7cb8e85 100755 --- a/evoks/evoks/views.py +++ b/evoks/evoks/views.py @@ -12,7 +12,7 @@ from django.shortcuts import redirect from django.contrib.auth.models import User from django.core.mail import send_mail -from evoks.settings import EMAIL_HOST_USER +from evoks.settings import EMAIL_HOST_USER, EMAIL_CONFIGURED import django.contrib.auth.views from django.contrib.auth.models import User from django.contrib import admin @@ -103,14 +103,15 @@ def signup_view(request: HttpRequest) -> HttpResponse: url = request.build_absolute_uri(reverse("admin:%s_%s_change" % ( user.profile._meta.app_label, user.profile._meta.model_name), args=(user.profile.id,))) - send_mail( - 'Verify a new Evoks account', - 'Please visit the evoks admin panel {0} and verify the new user'.format( - url), - EMAIL_HOST_USER, - emails, - fail_silently=False, - ) + if EMAIL_CONFIGURED: + send_mail( + 'Verify a new Evoks account', + 'Please visit the evoks admin panel {0} and verify the new user'.format( + url), + EMAIL_HOST_USER, + emails, + fail_silently=False, + ) return HttpResponse('Your account will be usable as soon as an admin verifies it!') diff --git a/evoks/theme/templates/login.html b/evoks/theme/templates/login.html index a8af4f0..7ab8526 100755 --- a/evoks/theme/templates/login.html +++ b/evoks/theme/templates/login.html @@ -25,7 +25,7 @@
or - + create account
diff --git a/evoks/theme/templates/reset_password_complete.html b/evoks/theme/templates/reset_password_complete.html index a58b691..064affe 100755 --- a/evoks/theme/templates/reset_password_complete.html +++ b/evoks/theme/templates/reset_password_complete.html @@ -22,7 +22,7 @@ Your password has been set! You can login to your account. diff --git a/evoks/theme/templates/teams.html b/evoks/theme/templates/teams.html index 8bbe05d..7e130df 100755 --- a/evoks/theme/templates/teams.html +++ b/evoks/theme/templates/teams.html @@ -67,7 +67,7 @@