diff --git a/archiv/models.py b/archiv/models.py index 897cffc..f123c79 100644 --- a/archiv/models.py +++ b/archiv/models.py @@ -20,6 +20,7 @@ from io import BytesIO import io +from django.conf import settings from django.http import HttpResponse import base64 @@ -859,12 +860,29 @@ def get_next(self): if next: return next.get_absolute_url() return False - + + def oa(self): + return self.open_access + def get_prev(self): prev = prev_in_order(self) if prev: return prev.get_absolute_url() return False + + def get_images(self): + Image = Images.objects.filter(analyse_id=self.id) + im_list = [] + + for x in Image: + if(x.image_stream != None): + im_dic={} + im_dic["beschreibung"]= x.description + im_dic["stream"]=x.image_stream + im_list.append(im_dic) + else: + im_list.append(Images.pictures(x.easydb_id, x.id)) + return im_list class Artifact(models.Model): @@ -2098,7 +2116,7 @@ class Images(models.Model): ) analyse = models.ForeignKey( "Analyse", - related_name="Images_Artefact", + related_name="Images_Analyse", on_delete=models.SET_NULL, null=True, blank=True, @@ -2162,9 +2180,8 @@ def pictures(easy_db, image_id): token = data['token'] #login on API - api_login = host+"api/v1/session/authenticate?token="+token+"&method=easydb&login=fwm&password=fwmOeai_!" + api_login = host+"api/v1/session/authenticate?token="+token+"&method=easydb&login="+settings.OEAIDAM_USER+"&password="+settings.OEAIDAM_USER_PW response = requests.post(api_login) - #get image from easyDB api_download = host+"api/v1/objects/id/"+str(easy_db)+"/?token="+token response_download = requests.get(api_download).json() diff --git a/archiv/templates/archiv/generic_detail.html b/archiv/templates/archiv/generic_detail.html index 5b45490..b2a22e1 100644 --- a/archiv/templates/archiv/generic_detail.html +++ b/archiv/templates/archiv/generic_detail.html @@ -48,7 +48,7 @@

{% for x in object.field_dict %} {% if x.value and x.value != "None" %} - {% if x.verbose_name != "images" and x.verbose_name != "Images_Quarry" and x.verbose_name != "Images_Artefact" and x.verbose_name != "Legacy ID" and x.verbose_name != "ID" and x.verbose_name != "Analyse_Project" and x.verbose_name != "Artefact_Project" and x.verbose_name != "Sample_Project" %} + {% if x.verbose_name != "images" and x.verbose_name != "Images_Quarry" and x.verbose_name != "Images_Analyse" and x.verbose_name != "Images_Artefact" and x.verbose_name != "Legacy ID" and x.verbose_name != "ID" and x.verbose_name != "Analyse_Project" and x.verbose_name != "Artefact_Project" and x.verbose_name != "Sample_Project" %} {% if user.is_authenticated or object.oa or not x.extra_fields or x.extra_fields.is_public %}
@@ -115,8 +115,8 @@

{% leaflet_map "yourmap" callback="window.map_init_basic" %} {% endif %} - - {% if user.is_authenticated or object.oa %} + + {% if user.is_authenticated or object.oa or class_name == "Quarry" %} {% if object.get_images %}
diff --git a/archiv/views.py b/archiv/views.py index f394a5f..57fb932 100644 --- a/archiv/views.py +++ b/archiv/views.py @@ -339,6 +339,7 @@ class QuarryListView(GenericListView): 'id', 'name','description' ] enable_merge = False + ordering=['id'] class QuarryDetailView(BaseDetailView): diff --git a/djangobaseproject/settings.py b/djangobaseproject/settings.py index 9056c6b..0380c61 100644 --- a/djangobaseproject/settings.py +++ b/djangobaseproject/settings.py @@ -37,7 +37,7 @@ if os.environ.get("DEBUG"): DEBUG = True else: - DEBUG = False + DEBUG = True ADD_ALLOWED_HOST = os.environ.get("ALLOWED_HOST", "*") ALLOWED_HOSTS = [ @@ -202,3 +202,6 @@ CELERY_RESULT_BACKEND = "django-db" CELERY_BROKER_URL = os.environ.get("amqp://") CELERY_TASK_TRACK_STARTED = True + +OEAIDAM_USER = "" +OEAIDAM_USER_PW ="" diff --git a/webpage/static/webpage/css/flexslider.css b/webpage/static/webpage/css/flexslider.css index f9967a4..ec973b9 100644 --- a/webpage/static/webpage/css/flexslider.css +++ b/webpage/static/webpage/css/flexslider.css @@ -127,7 +127,7 @@ html[xmlns] .flexslider .slides { overflow: hidden; opacity: 0; cursor: pointer; - color: rgba(0, 0, 0, 0.8); + color: rgba(250, 246, 246, 0.8); text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3); -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; @@ -139,12 +139,12 @@ html[xmlns] .flexslider .slides { font-family: "flexslider-icon"; font-size: 40px; display: inline-block; - content: '\f001'; - color: rgba(0, 0, 0, 0.8); + /*content: '\25B2';*/ + color: rgba(255, 255, 255, 0.8); text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3); } .flex-direction-nav a.flex-next:before { - content: '\f002'; + /*content: '\25B2';*/ } .flex-direction-nav .flex-prev { left: -50px; diff --git a/webpage/templates/webpage/base.html b/webpage/templates/webpage/base.html index 83fae63..cd767db 100644 --- a/webpage/templates/webpage/base.html +++ b/webpage/templates/webpage/base.html @@ -97,7 +97,7 @@