Skip to content

Commit

Permalink
added impressum; changes in images
Browse files Browse the repository at this point in the history
  • Loading branch information
karlburkhart committed Jun 4, 2024
1 parent a955fdb commit 608186c
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 15 deletions.
25 changes: 21 additions & 4 deletions archiv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from io import BytesIO
import io

from django.conf import settings
from django.http import HttpResponse
import base64

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions archiv/templates/archiv/generic_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h2 style="text-align: center;">
<table class="table table-responsive table-hover">
{% for x in object.field_dict %}
{% if x.value and x.value != "None" %} <!-- Wenn keine Values zum Attribut vorhanden sind - nicht anzeigen-->
{% 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" %} <!-- Die einzelnen Einträge zu den Bildern nicht anzeigen-->
{% 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" %} <!-- Die einzelnen Einträge zu den Bildern nicht anzeigen-->
{% if user.is_authenticated or object.oa or not x.extra_fields or x.extra_fields.is_public %} <!-- User ist eingeloggt oder der Datensatz ist Open Access -->
<tr>
<th>
Expand Down Expand Up @@ -115,8 +115,8 @@ <h2 style="text-align: center;">
{% leaflet_map "yourmap" callback="window.map_init_basic" %}
{% endif %}

<!-- Zeige Bilder an wenn User eingeloggt oder Opeen Access -->
{% if user.is_authenticated or object.oa %}
<!-- Zeige Bilder an wenn User eingeloggt oder Opeen Access. Quarry Fotos immer anzeigen -->
{% if user.is_authenticated or object.oa or class_name == "Quarry" %}
{% if object.get_images %}

<section class="slider">
Expand Down
1 change: 1 addition & 0 deletions archiv/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ class QuarryListView(GenericListView):
'id', 'name','description'
]
enable_merge = False
ordering=['id']


class QuarryDetailView(BaseDetailView):
Expand Down
5 changes: 4 additions & 1 deletion djangobaseproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 =""
8 changes: 4 additions & 4 deletions webpage/static/webpage/css/flexslider.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions webpage/templates/webpage/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{% url 'infos:about-the-project' %}">About the project</a>
<!--<a class="dropdown-item" href="{% url 'infos:project-team' %}">Team</a>-->
<a class="dropdown-item" href="{% url 'webpage:staticpage' template='imprint' %}">Imprint | Impressum</a>
<a class="dropdown-item" href="{% url 'webpage:staticpage' template='imprint' %}" target="_blank">Imprint | Impressum</a>
</div>
</li>
<li class="nav-item ">
Expand Down Expand Up @@ -167,7 +167,7 @@
</div>
</div>
<div class="footer-imprint-bar" id="wrapper-footer-secondary" style="text-align:center; padding:0.4rem 0; font-size: 0.9rem;">
<a href="imprint.html">Impressum/Imprint</a>
<a href="{% url 'webpage:staticpage' template='imprint' %}" target="_blank">Impressum/Imprint</a>
{% if user.is_authenticated %}
{% if DB_NAME %}
<div class="footer-imprint-bar">
Expand Down
4 changes: 3 additions & 1 deletion webpage/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
from django.views.generic.base import RedirectView
from . import views
from django_spaghetti.views import Plate
from django.shortcuts import render, redirect


app_name = 'webpage'

favicon_view = RedirectView.as_view(url='/static/favicon.ico', permanent=True)

urlpatterns = [
path('imprint', views.ImprintView.as_view(), name="imprint"),
#path('imprint', views.ImprintView.as_view(), name="imprint"),
path('imprint', views.show_imprint, name="imprint"),
path(
'data-model',
Plate.as_view(
Expand Down
3 changes: 3 additions & 0 deletions webpage/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def get_template_names(self):
def show_archiv(request):
return render(request, "webpage/explore.html")

def show_imprint(request):
return HttpResponseRedirect("https://oeaw.ac.at/oeaw/impressum")

#################################################################
# views for login/logout #
#################################################################
Expand Down

0 comments on commit 608186c

Please sign in to comment.