diff --git a/.gitignore b/.gitignore index 4bfa561..741b96f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ venv +local +src +staticfiles archive_browser/settings_local.py __pycache__ *.pyc @@ -9,4 +12,4 @@ __pycache__ .eggs .idea .vscode -.static \ No newline at end of file +.static diff --git a/archive_browser/settings.py b/archive_browser/settings.py index e6fe88d..cb20111 100644 --- a/archive_browser/settings.py +++ b/archive_browser/settings.py @@ -12,6 +12,8 @@ import os +from archive_browser.settings_local import * + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -33,7 +35,7 @@ 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', -# 'dj_security_middleware.middleware.DJSecurityMiddleware', + 'dj_security_middleware.middleware.DJSecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', @@ -52,7 +54,7 @@ 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', - 'browser.context_processor.data_centre' + 'fwtheme_django_ceda_serv.context_processors.data_centre', ], }, }, @@ -60,8 +62,9 @@ WSGI_APPLICATION = 'archive_browser.wsgi.application' - SECURITY_LOGIN_SERVICE = "https://auth.ceda.ac.uk/account/signin" +ACCOUNT_COOKIE_NAME = 'ceda.session.1' + # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ @@ -78,6 +81,10 @@ # https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/' +STATICFILES_DIRS = [BASE_DIR + "/browser/static"] +STATIC_ROOT = BASE_DIR + "/staticfiles" +STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage" + THREDDS_SERVICE = 'https://dap.ceda.ac.uk' FTP_SERVICE = 'ftp://ftp.ceda.ac.uk' USE_FTP = False @@ -90,18 +97,4 @@ ACCESSCTL_URL = "https://accessctl.ceda.ac.uk/api/v1/rules/bypath/?format=json&path=" -from archive_browser.settings_local import * - CONTAINER_FLUID = False - -#NERC Datacentres - non CEDA Data Centres -DATACENTRES = { - 'pdc': 'pdc.html', - 'bodc': 'bodc.html', - 'eich': 'eich.html', - 'ngdc': 'ngdc.html', - 'ssdc': 'ssdc.html', - 'sparc': 'sparc.html', - 'edc': 'edc.html', - 'eds': 'eds.html' -} diff --git a/archive_browser/settings_local.py.template b/archive_browser/settings_local.py.template new file mode 100644 index 0000000..4448d36 --- /dev/null +++ b/archive_browser/settings_local.py.template @@ -0,0 +1,4 @@ +DEBUG = True +SECURITY_SHAREDSECRET='' +SECRET_KEY='' +DISABLE_LOGIN=True diff --git a/browser/context_processor.py b/browser/context_processor.py deleted file mode 100644 index f195f58..0000000 --- a/browser/context_processor.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import math -from hashlib import sha1 - -from django.conf import settings -from django.contrib import messages -from django.http import JsonResponse -from django.shortcuts import render, HttpResponseRedirect -from django.views.decorators.cache import cache_page -from django.views.decorators.csrf import csrf_exempt -from django.views.generic import TemplateView - -def data_centre(request): - """ - Determine which data centre template is extended - by browse.html - """ - - data_centre = "fwtheme_django/layout.html" #default template - dc_css = "browser/css/browser.css" - for dc in settings.DATACENTRES: - if request.path.startswith(f"/{dc}"): - data_centre = f"browser/data_centres/{settings.DATACENTRES[dc]}" - dc_css = f"browser/css/{dc}.css" - - context = { - "data_centre": data_centre, - "dc_css": dc_css - } - return context \ No newline at end of file diff --git a/browser/static/browser/css/bodc.css b/browser/static/browser/css/bodc.css deleted file mode 100644 index 572d49f..0000000 --- a/browser/static/browser/css/bodc.css +++ /dev/null @@ -1,184 +0,0 @@ -/* BODC */ -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; -} - -body { - /* Margin bottom by footer height */ - margin-bottom: 100px; -} - -body > .container { - padding-bottom: 100px; -} - -/* Match height of navbar to height of logo image */ -.navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ -} - -/* -* Start Bootstrap - Logo Nav (http://startbootstrap.com/) -* Copyright 2013-2016 Start Bootstrap -* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) -*/ - -.navbar.bg-primary{ - background: rgb(0,48,66) !important; -} - -.navbar.fixed-top { - padding: 10px 4px; -} - -.nav .navbar-brand { - padding: 0 0; -} - -.navbar-brand { - padding: 0 0; -} - -@media(min-width:768px) { - body { - padding-top: 114px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } -} - -p { - color: #000 -} - -a { - color: #2fd2ce; -} - - -.btn-primary { - background-color: rgb(0,48,66); - border-color: rgb(0,48,66) -} - -.btn-primary:hover { - color: #fff; - background-color: #00628d; - border-color: #00628d; -} - -.btn-outline-primary { - color: rgb(0,48,66); - border-color: rgb(0,48,66); -} - -.btn-outline-primary:hover { - color: #fff; - background-color: #00628d; - border-color: #00628d; -} - -.btn-secondary { - color: #fff; - background-color: rgb(0,48,66); - border-color: rgb(0,48,66); - } - -.btn-secondary:hover { - color: rgb(0,48,66); - background-color: #fff; - border-color: rgb(0,48,66); -} - -.btn-success { - color: #fff; - background-color: rgb(0,48,66); - border-color: rgb(0,48,66); -} - -.btn-success:hover { - color: #fff; - background-color: #00628d; - border-color: #00628d; -} - -.btn-outline-success { - color: #00628d; - border-color: #00628d; -} - -.btn-outline-success:hover { - color: #fff; - background-color: #00628d; - border-color: #00628d; -} - -.btn-info { - color: rgb(0,48,66); - background-color: #fff; - border-color: rgb(0,48,66); -} - -.btn-info:hover { - color: #fff; - background-color: #00628d; - border-color: #00628d; -} - -.btn-light { - color: rgb(0,48,66); - background-color: #ecf0f1; - border-color: #ecf0f1; -} - -.btn-light:hover { - color: rgb(0,48,66); - background-color: #d6dfe1; - border-color: #cfd9db; -} - - - - -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background: #fff; -} - -/* data browser specific*/ -.breadcrumb { - background-color: #f1f1f9 -} - -.dataset { - color: #5c5a5a; -} - -.collection { - color: #5c5a5a -} - -.hide { - display: none; -} - -/* arrivals service specific - stream progress bar */ -.stream-progress:before, -.stream-progress:after { - content: ""; - position: absolute; - z-index:-1; - background: rgb(0,48,66); -} - -.stream-progress:hover:before, -.stream-progress:hover:after { - background: #00628d; - text-decoration: none; -} \ No newline at end of file diff --git a/browser/static/browser/css/edc.css b/browser/static/browser/css/edc.css deleted file mode 100644 index 4d49215..0000000 --- a/browser/static/browser/css/edc.css +++ /dev/null @@ -1,108 +0,0 @@ -/* Energy Data Centre */ -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; - } - -body { - /* Margin bottom by footer height */ - margin-bottom: 100px; -} - -body > .container { - padding-bottom: 100px; -} - -/* Match height of navbar to height of logo image */ -a.navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ -} - -/* -* Start Bootstrap - Logo Nav (http://startbootstrap.com/) -* Copyright 2013-2016 Start Bootstrap -* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) -*/ - -.navbar.bg-primary{ - background-image: linear-gradient(to right, #01aa74, #007eb8); -} - -.navbar.fixed-top { - padding: 10px 4px; -} - -.nav .navbar-brand { - padding: 0 0; -} - -.navbar-brand { - padding: 0 0; -} - -@media(min-width:768px) { - body { - padding-top: 120px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } -} - - -p { - color: #000 -} - - -/* buttons */ -.btn-primary { - background-color: #007eb8; - border-color: #007eb8; -} -/* uses CEDA Theme for all other buttons */ - -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background-image: linear-gradient(to right, #01aa74, #007eb8); - -} - -/* data browser specific*/ -/* -.breadcrumb { - background-color: #f0f0f1 -} -*/ - -.dataset { - color: #4f81bd; -} - -.collection { - color: #4807b3 -} - -.hide { - display: none; -} - -/* arrivals service - specific - stream progress bar */ -/* use CEDA theme */ -.stream-progress:before, -.stream-progress:after { - content: ""; - position: absolute; - z-index:-1; - background: #b9bc2d; -} - -.stream-progress:hover:before, -.stream-progress:hover:after { - background: #9b9d26; - text-decoration: none; -} \ No newline at end of file diff --git a/browser/static/browser/css/eds.css b/browser/static/browser/css/eds.css deleted file mode 100644 index 5510092..0000000 --- a/browser/static/browser/css/eds.css +++ /dev/null @@ -1,192 +0,0 @@ -/* NERC Environmental Data Centre */ -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; - } - -body { - /* Margin bottom by footer height */ - margin-bottom: 100px; -} - -body > .container { - padding-bottom: 100px; -} - -/* Match height of navbar to height of logo image */ -a.navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ -} - -/* -* Start Bootstrap - Logo Nav (http://startbootstrap.com/) -* Copyright 2013-2016 Start Bootstrap -* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) -*/ - -.navbar.bg-primary{ - background: #fff !important; -} - -.navbar.fixed-top { - padding: 10px 4px; -} - -.nav .navbar-brand { - padding: 0 0; -} - -.navbar-brand { - padding: 0 0; -} - -@media(min-width:768px) { - body { - padding-top: 120px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } -} - -.navbar-dark .navbar-nav .nav-link { - color: #000; -} - -p { - color: #000 -} - -/* nav bar button */ -.navbar-dark .navbar-toggler { - background-color: #2e2d62; - border-color: rgba(255, 255, 255, 0.1); -} - -/* buttons */ -.btn-primary { - background-color: #2e2d62; - border-color: #2e2d62; -} - -.btn-primary:hover { - color: #2e2d62; - background-color: #fff; - border-color: #2e2d62; -} - -.btn-outline-primary { - color: #2e2d62; - border-color: #2e2d62; -} - -.btn-outline-primary:hover { - color: #fff; - background-color: #2e2d62; - border-color: #2e2d62; -} - -.btn-secondary { - color: #fff; - background-color: #2e2d62; - border-color: #2e2d62; - } - -.btn-secondary:hover { - color: #2e2d62; - background-color: #fff; - border-color: #2e2d62; -} - -.btn-success { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-success:hover { - color: #fff; - background-color: #9b9d26; - border-color: #919323; -} - -.btn-outline-success { - color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-outline-success:hover { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-info { - color: #fff; - background-color: #3498DB; - border-color: #3498DB; -} - -.btn-info:hover { - color: #fff; - background-color: #2384c6; - border-color: #217dbb; -} - -.btn-light { - color: #212529; - background-color: #ecf0f1; - border-color: #ecf0f1; -} - -.btn-light:hover { - color: #212529; - background-color: #d6dfe1; - border-color: #cfd9db; -} - - -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background: #fff; - -} - -/* data browser specific*/ - -/* -.breadcrumb { - background-color: #f0f0f1 -} -*/ - -.dataset { - color: #4f81bd; -} - -.collection { - color: #4807b3 -} - -.hide { - display: none; -} - -/* arrivals service specific - stream progress bar */ -.stream-progress:before, -.stream-progress:after { - content: ""; - position: absolute; - z-index:-1; - background: #2e2d62; -} - -.stream-progress:hover:before, -.stream-progress:hover:after { - background: #9b9d26; - text-decoration: none; -} \ No newline at end of file diff --git a/browser/static/browser/css/eidc.css b/browser/static/browser/css/eidc.css deleted file mode 100644 index 2c13107..0000000 --- a/browser/static/browser/css/eidc.css +++ /dev/null @@ -1,183 +0,0 @@ -/* EIDC */ -/*Environmental Information Data Centre - UK CEH */ - -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; -} - -body { - /* Margin bottom by footer height */ - margin-bottom: 100px; -} - -body > .container { - padding-bottom: 100px; -} - -/* Match height of navbar to height of logo image */ -.navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ -} - -/* -* Start Bootstrap - Logo Nav (http://startbootstrap.com/) -* Copyright 2013-2016 Start Bootstrap -* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) -*/ - -.navbar.bg-primary{ - background: #327085E6 !important; -} - -.navbar-toggler { - background-color: #327085E6 -} - -.navbar.fixed-top { - padding: 4px 4px; -} - -.nav .navbar-brand { - padding: 0 0; -} - -.navbar-brand { - padding: 0 0; -} - -@media(min-width:768px) { - body { - padding-top: 94px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } -} - -p { - color: #000 -} - -/* buttons */ -.btn-primary { - background-color: #327085E6; - border-color: #327085E6 -} - -.btn-primary:hover { - color: #327085E6; - background-color: #fff; - border-color: #327085E6; -} - -.btn-outline-primary { - color: #327085E6; - border-color: #327085E6; -} - -.btn-outline-primary:hover { - color: #fff; - background-color: #327085E6; - border-color: #327085E6; -} - -.btn-secondary { - color: #fff; - background-color: #327085E6; - border-color: #327085E6; - } - -.btn-secondary:hover { - color: #327085E6; - background-color: #fff; - border-color: #327085E6; -} - -.btn-success { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-success:hover { - color: #fff; - background-color: #9b9d26; - border-color: #919323; -} - -.btn-outline-success { - color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-outline-success:hover { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-info { - color: #fff; - background-color: #3498DB; - border-color: #3498DB; -} - -.btn-info:hover { - color: #fff; - background-color: #2384c6; - border-color: #217dbb; -} - -.btn-light { - color: #212529; - background-color: #ecf0f1; - border-color: #ecf0f1; -} - -.btn-light:hover { - color: #212529; - background-color: #d6dfe1; - border-color: #cfd9db; -} - -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background: #fff; -} - -/* data browser specific*/ -.breadcrumb { - background-color: #bfebf9e6 -} - -.dataset { - color: grey; -} - -.collection { - color: grey -} - -.hide { - display: none; -} - -/* arrivals service specific - stream progress bar */ -.stream-progress:before, -.stream-progress:after { - content: ""; - position: absolute; - z-index:-1; - background: #327085E6; -} - -.stream-progress:hover:before, -.stream-progress:hover:after { - background: #9b9d26; - text-decoration: none; -} \ No newline at end of file diff --git a/browser/static/browser/css/ngdc.css b/browser/static/browser/css/ngdc.css deleted file mode 100644 index 6943df0..0000000 --- a/browser/static/browser/css/ngdc.css +++ /dev/null @@ -1,177 +0,0 @@ -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; -} - -body { - /* Margin bottom by footer height */ - margin-bottom: 100px; -} - -body > .container { - padding-bottom: 100px; -} - -/* Match height of navbar to height of logo image */ -.navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ -} - -/* -* Start Bootstrap - Logo Nav (http://startbootstrap.com/) -* Copyright 2013-2016 Start Bootstrap -* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) -*/ - -.navbar.bg-primary{ - background: #002e40 !important; -} - -.navbar.fixed-top { - padding: 4px 4px; -} - -.nav .navbar-brand { - padding: 0 0; -} - -.navbar-brand { - padding: 0 0; -} - -@media(min-width:768px) { - body { - padding-top: 114px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } -} - -p { - color: #000 -} - -/* buttons */ -.btn-primary { - background-color: #002e40; - border-color: #002e40 -} - -.btn-primary:hover { - color: #002e40; - background-color: #fff; - border-color: #002e40; -} - -.btn-outline-primary { - color: #002e40; - border-color: #002e40; -} - -.btn-outline-primary:hover { - color: #fff; - background-color: #002e40; - border-color: #002e40; -} - -.btn-secondary { - color: #fff; - background-color: #002e40; - border-color: #002e40; - } - -.btn-secondary:hover { - color: #002e40; - background-color: #fff; - border-color: #002e40; -} - -.btn-success { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-success:hover { - color: #fff; - background-color: #9b9d26; - border-color: #919323; -} - -.btn-outline-success { - color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-outline-success:hover { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-info { - color: #fff; - background-color: #3498DB; - border-color: #3498DB; -} - -.btn-info:hover { - color: #fff; - background-color: #2384c6; - border-color: #217dbb; -} - -.btn-light { - color: #212529; - background-color: #ecf0f1; - border-color: #ecf0f1; -} - -.btn-light:hover { - color: #212529; - background-color: #d6dfe1; - border-color: #cfd9db; -} - - -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background: #fff; -} - -/* data browser specific*/ -.breadcrumb { - background-color: #F6F6F5 -} - -.dataset { - color: #4b4b4b; -} - -.collection { - color: #717070 -} - -.hide { - display: none; -} - -/* arrivals service specific - stream progress bar */ -.stream-progress:before, -.stream-progress:after { - content: ""; - position: absolute; - z-index:-1; - background: #002e40; -} - -.stream-progress:hover:before, -.stream-progress:hover:after { - background: #9b9d26; - text-decoration: none; -} \ No newline at end of file diff --git a/browser/static/browser/css/pdc.css b/browser/static/browser/css/pdc.css deleted file mode 100644 index a1c9e4d..0000000 --- a/browser/static/browser/css/pdc.css +++ /dev/null @@ -1,178 +0,0 @@ -/* British Antarctic Survey */ -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; - } - -body { - /* Margin bottom by footer height */ - margin-bottom: 100px; -} - -body > .container { - padding-bottom: 100px; -} - -/* Match height of navbar to height of logo image */ -a.navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ -} - -/* -* Start Bootstrap - Logo Nav (http://startbootstrap.com/) -* Copyright 2013-2016 Start Bootstrap -* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) -*/ - -.navbar.bg-primary{ - background: #000 !important; -} - -.navbar.fixed-top { - padding: 10px 4px; -} - -.nav .navbar-brand { - padding: 0 0; -} - -.navbar-brand { - padding: 0 0; -} - -@media(min-width:768px) { - body { - padding-top: 120px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } -} - -/* text */ -p { - color: #000 -} - -/* buttons */ -.btn-primary { - background-color: #212121; - border-color: #212121 -} - -.btn-primary:hover { - color: #fff; - background-color: #95a5a6; - border-color: #95a5a6; -} - -.btn-outline-primary { - color: #212121; - border-color: #212121; -} - -.btn-outline-primary:hover { - color: #fff; - background-color: #95a5a6; - border-color: #95a5a6; -} - -.btn-secondary { - color: #fff; - background-color: #212121; - border-color: #212121; - } - -.btn-secondary:hover { - color: #000; - background-color: #fff; - border-color: #000; -} - -.btn-success { - color: #fff; - background-color: #212121; - border-color: #212121; -} - -.btn-success:hover { - color: #fff; - background-color: #95a5a6; - border-color: #212121; -} - -.btn-outline-success { - color: #212121; - border-color: #212121; -} - -.btn-outline-success:hover { - color: #fff; - background-color: #95a5a6; - border-color: #95a5a6; -} - -.btn-info { - color: #000; - background-color: #fff; - border-color: #212121; -} - -.btn-info:hover { - color: #fff; - background-color: #212121; - border-color: #212121; -} - -.btn-light { - color: #000; - background-color: #ecf0f1; - border-color: #ecf0f1; -} - -.btn-light:hover { - color: #212529; - background-color: #d6dfe1; - border-color: #cfd9db; -} - -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background: #fff; -} - -/* data browser specific*/ -.dataset { - color: #4f81bd; -} - -.collection { - color: #4807b3 -} - -.hide { - display: none; -} - -.breadcrumb { - background-color: #f0f0f1 -} - -/* arrivals service specific - stream progress bar */ -.stream-progress:before, -.stream-progress:after { - content: ""; - position: absolute; - z-index:-1; - background: #333; -} - -.stream-progress:hover:before, -.stream-progress:hover:after { - background: #95a5a6; - text-decoration: none; -} \ No newline at end of file diff --git a/browser/static/browser/css/sparc.css b/browser/static/browser/css/sparc.css deleted file mode 100644 index bb2fa1b..0000000 --- a/browser/static/browser/css/sparc.css +++ /dev/null @@ -1,188 +0,0 @@ -/* SPARC */ -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; - } - -body { - /* Margin bottom by footer height */ - margin-bottom: 100px; -} - -body > .container { - padding-bottom: 100px; -} - -/* Match height of navbar to height of logo image */ -a.navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ -} - -/* -* Start Bootstrap - Logo Nav (http://startbootstrap.com/) -* Copyright 2013-2016 Start Bootstrap -* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) -*/ - -.navbar.bg-primary{ - background: #144a91 !important; -} - -.navbar.fixed-top { - padding: 10px 4px; -} - -.nav .navbar-brand { - padding: 0 0; -} - -.navbar-brand { - padding: 0 0; -} - -@media(min-width:768px) { - body { - padding-top: 200px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } -} - -.navbar-dark .navbar-nav .nav-link { - color: #fff; -} - -/* Text */ -p { - color: #000 -} - -/* buttons */ - -.btn-primary { - background-color: #144a91; - border-color: #144a91; -} - -.btn-primary:hover { - color: #fff; - background-color: #b1bdcb; - border-color: #b1bdcb; -} - -.btn-outline-primary { - color: #144a91; - border-color: #144a91; -} - -.btn-outline-primary:hover { - color: #fff; - background-color: #144a91; - border-color: #144a91; -} - -.btn-secondary { - color: #fff; - background-color: #144a91; - border-color: #144a91; - } - -.btn-secondary:hover { - color: #144a91; - background-color: #fff; - border-color: #144a91; -} - -.btn-success { - color: #fff; - background-color: #144a91; - border-color: #144a91; -} - -.btn-success:hover { - color: #fff; - background-color: #144a91; - border-color: #144a91; -} - -.btn-outline-success { - color: #144a91; - border-color: #144a91; -} - -.btn-outline-success:hover { - color: #fff; - background-color: #b1bdcb; - border-color: #b1bdcb; -} - -.btn-info { - color: #144a91; - background-color: #fff; - border-color: #144a91; -} - -.btn-info:hover { - color: #fff; - background-color: #144a91; - border-color: #144a91; -} - -.btn-light { - color: #000; - background-color: #b1bdcb; - border-color: #b1bdcb; -} - -.btn-light:hover { - color: #212529; - background-color: #d6dfe1; - border-color: #cfd9db; -} - - - -/* -.breadcrumb { - background-color: #f0f0f1 -} -*/ - -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background: #fff; - -} - -/* data browser specific*/ -.dataset { - color: #144a91; -} - -.collection { - color: #144a91; -} - -.hide { - display: none; -} - -/* arrivals service specific - stream progress bar */ -.stream-progress:before, -.stream-progress:after { - content: ""; - position: absolute; - z-index:-1; - background: #144a91; -} - -.stream-progress:hover:before, -.stream-progress:hover:after { - background: #b1bdcb; - text-decoration: none; -} \ No newline at end of file diff --git a/browser/static/browser/css/ssdc.css b/browser/static/browser/css/ssdc.css deleted file mode 100644 index 8157190..0000000 --- a/browser/static/browser/css/ssdc.css +++ /dev/null @@ -1,181 +0,0 @@ -/* SSDC */ -/* Solar System data centre */ - -/* Org customisations of Grunt-produced theme */ - -/* Change padding of top navbar to avoid overlapping page title text. Only for fixed-top navbar */ -html { - position: relative; - min-height: 100%; - } - body { - /* Margin bottom by footer height */ - margin-bottom: 100px; - } - body > .container { - padding-bottom: 100px; - } - - -.border-light{ - border-color: #333 !important; -} - - /* Match height of navbar to height of logo image */ - - .navbar-brand { - height: auto; /* Adjust this to the height of the logo image */ - } - - /* - * Start Bootstrap - Logo Nav (http://startbootstrap.com/) - * Copyright 2013-2016 Start Bootstrap - * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) - */ - - .navbar.bg-primary{ - background: #FFFFCC !important; - } - -.navbar-toggler{ background-color: darkgray} - - .navbar.fixed-top { - padding: 4px 4px; - } - - .nav .navbar-brand { - padding: 0 0; - } - - .navbar-brand { - padding: 0 0; - } - - .navbar-dark .navbar-nav .nav-link { - color: #333; -} - - @media(min-width:768px) { - body { - padding-top: 94px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */ - } - - .navbar-fixed-top .nav .navbar-brand { - padding: 0 0; - } - } - -a { - color: #333 -} - - -p { - color: #333 -} - - -.btn-primary { - background-color: grey; - border-color: grey -} - -.btn-primary:hover { - color: grey; - background-color: #fff; - border-color: grey; -} - -.btn-outline-primary { - color: grey; - border-color: grey; -} - -.btn-outline-primary:hover { - color: #fff; - background-color: grey; - border-color: grey; -} - -.btn-secondary { - color: #fff; - background-color: grey; - border-color: grey; - } - -.btn-secondary:hover { - color: grey; - background-color: #fff; - border-color: grey; -} - -btn-success { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-success:hover { - color: #fff; - background-color: #9b9d26; - border-color: #919323; -} - -.btn-outline-success { - color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-outline-success:hover { - color: #212529; - background-color: #b9bc2d; - border-color: #b9bc2d; -} - -.btn-info { - color: #fff; - background-color: #3498DB; - border-color: #3498DB; -} - -.btn-info:hover { - color: #fff; - background-color: #2384c6; - border-color: #217dbb; -} - -.btn-light { - color: #212529; - background-color: #ecf0f1; - border-color: #ecf0f1; -} - -.btn-light:hover { - color: #212529; - background-color: #d6dfe1; - border-color: #cfd9db; -} -/* footer */ -.row.d-flex.justify-content-around.border.border-light.border-bottom-0.border-left-0.border-right-0.pt-5.pb-2.mt-5{ - background: #FFFFCC; -} - -/* data browser specific*/ - -.breadcrumb { - background-color: lightgrey -} - -.dataset { - color: grey; -} - -.collection { - color: grey -} - -.hide { - display: none; -} - - diff --git a/browser/static/browser/img/bodc.png b/browser/static/browser/img/bodc.png deleted file mode 100644 index 863cdf1..0000000 Binary files a/browser/static/browser/img/bodc.png and /dev/null differ diff --git a/browser/static/browser/img/edc.gif b/browser/static/browser/img/edc.gif deleted file mode 100644 index 8808d81..0000000 Binary files a/browser/static/browser/img/edc.gif and /dev/null differ diff --git a/browser/static/browser/img/eds.svg b/browser/static/browser/img/eds.svg deleted file mode 100644 index 1706217..0000000 --- a/browser/static/browser/img/eds.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/browser/static/browser/img/favicon.ico b/browser/static/browser/img/favicon.ico deleted file mode 100644 index 0fc1ccf..0000000 Binary files a/browser/static/browser/img/favicon.ico and /dev/null differ diff --git a/browser/static/browser/img/ngdc.png b/browser/static/browser/img/ngdc.png deleted file mode 100644 index 7c79da5..0000000 Binary files a/browser/static/browser/img/ngdc.png and /dev/null differ diff --git a/browser/static/browser/img/pdc.png b/browser/static/browser/img/pdc.png deleted file mode 100644 index de56778..0000000 Binary files a/browser/static/browser/img/pdc.png and /dev/null differ diff --git a/browser/static/browser/img/sparc.jpg b/browser/static/browser/img/sparc.jpg deleted file mode 100644 index 6da981d..0000000 Binary files a/browser/static/browser/img/sparc.jpg and /dev/null differ diff --git a/browser/static/browser/img/ssdc.png b/browser/static/browser/img/ssdc.png deleted file mode 100644 index 4a4f441..0000000 Binary files a/browser/static/browser/img/ssdc.png and /dev/null differ diff --git a/browser/templates/browser/browse_base.html b/browser/templates/browser/browse_base.html index 713241a..e705b4c 100644 --- a/browser/templates/browser/browse_base.html +++ b/browser/templates/browser/browse_base.html @@ -1,8 +1,8 @@ -{% extends data_centre %} +{% extends data_centre_template %} {% load static %} {% load humanize %} -{% block head_title %}CEDA Archive Web Browser{% endblock %} +{% block head_title %}CEDA Archive Web browser{% endblock %} {% block extra_meta %} @@ -24,13 +24,6 @@ {% endblock head_js_extra %} -{% block stylesheets_extra %} - - - -{% endblock %} - - {% block content %}
@@ -95,7 +88,7 @@

Bulk Download Options

@@ -113,6 +106,7 @@

Bulk Download Options

{{rule.licence.title}} {% endfor %}{% endif %} --> +
@@ -145,22 +139,34 @@
Aggregate information
{% if item.location == 'on_tape' %} {{item.icon|safe}} {{item.name}} - {{item.description|safe}} + {% if item.description == '' %} + + + + {% else %} + {{item.description|safe}} + {% endif %} {{item.size|filesizeformat}} - {% else %} - - {{item.icon|safe}}  - {{item.name}} - {{item.description|safe}} - {% if item.type == 'link' %} {{item.target}}{% endif %} - - {% if item.type == 'file' %}{{item.size|filesizeformat}}{% endif %} - {{item.actions|safe}} - - {% endif %} + {% else %} + + {{item.icon|safe}}  + {{item.name}} + {% if item.description == '' %} + + + + {% else %} + {{item.description|safe}} + {% if item.type == 'link' %} {{item.target}}{% endif %} + + {% endif %} + {% if item.type == 'file' %}{{item.size|filesizeformat}}{% endif %} + {{item.actions|safe}} + + {% endif %} {% endfor %} diff --git a/browser/templates/browser/cache.html b/browser/templates/browser/cache.html index a4729a9..88f66de 100644 --- a/browser/templates/browser/cache.html +++ b/browser/templates/browser/cache.html @@ -1,4 +1,4 @@ -{% extends data_centre %} +{% extends data_centre_template %} {% load static %} {% block head_title %}CEDA Archive Web Browser{% endblock %} @@ -15,7 +15,7 @@ {% endblock head_js_extra %} {% block stylesheets_extra %} - + {% endblock %} diff --git a/browser/templates/browser/data_centres/bodc.html b/browser/templates/browser/data_centres/bodc.html deleted file mode 100644 index ff56af7..0000000 --- a/browser/templates/browser/data_centres/bodc.html +++ /dev/null @@ -1,87 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - British Oceanography Data Centre{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block head_js_extra %} - -{% endblock head_js_extra %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/ceda.html b/browser/templates/browser/data_centres/ceda.html deleted file mode 100644 index a11d9c0..0000000 --- a/browser/templates/browser/data_centres/ceda.html +++ /dev/null @@ -1,89 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}CEDA Archive Web Browser{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block head_js_extra %} - -{% endblock head_js_extra %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/edc.html b/browser/templates/browser/data_centres/edc.html deleted file mode 100644 index 0752b9b..0000000 --- a/browser/templates/browser/data_centres/edc.html +++ /dev/null @@ -1,83 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - UKERC Energy Data Centre{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/eds.html b/browser/templates/browser/data_centres/eds.html deleted file mode 100644 index 89fc1b4..0000000 --- a/browser/templates/browser/data_centres/eds.html +++ /dev/null @@ -1,83 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - NERC Environmental Data Service{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/eidc.html b/browser/templates/browser/data_centres/eidc.html deleted file mode 100644 index 9aeb1d5..0000000 --- a/browser/templates/browser/data_centres/eidc.html +++ /dev/null @@ -1,87 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - Environmental Information Data Centre{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block head_js_extra %} - -{% endblock head_js_extra %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/ngdc.html b/browser/templates/browser/data_centres/ngdc.html deleted file mode 100644 index 8f42081..0000000 --- a/browser/templates/browser/data_centres/ngdc.html +++ /dev/null @@ -1,87 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - British Geological Survey{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block head_js_extra %} - -{% endblock head_js_extra %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/pdc.html b/browser/templates/browser/data_centres/pdc.html deleted file mode 100644 index aeef93b..0000000 --- a/browser/templates/browser/data_centres/pdc.html +++ /dev/null @@ -1,83 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - British Antarctic Survey{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/sparc.html b/browser/templates/browser/data_centres/sparc.html deleted file mode 100644 index 9a6baf4..0000000 --- a/browser/templates/browser/data_centres/sparc.html +++ /dev/null @@ -1,87 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - SPARC{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block head_js_extra %} - -{% endblock head_js_extra %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/data_centres/ssdc.html b/browser/templates/browser/data_centres/ssdc.html deleted file mode 100644 index e800a3e..0000000 --- a/browser/templates/browser/data_centres/ssdc.html +++ /dev/null @@ -1,83 +0,0 @@ -{% extends "fwtheme_django/layout.html" %} -{% load static %} - -{% block head_title %}Data - UK Solar System Data Centre{% endblock %} -{% block extra_meta %} - - -{% endblock %} -{% block page_title %} -{% endblock %} - -{% block stylesheets_extra %} - - -{% endblock %} - -{% block navbar_main %} - -{% endblock navbar_main %} - -{% block footer %} - -{% endblock footer %} diff --git a/browser/templates/browser/notfound.html b/browser/templates/browser/notfound.html index 8264e1a..6867073 100644 --- a/browser/templates/browser/notfound.html +++ b/browser/templates/browser/notfound.html @@ -1,4 +1,4 @@ -{% extends data_centre %} +{% extends data_centre_template %} {% load static %} {% block head_title %}CEDA Archive Web Browser{% endblock %} @@ -15,7 +15,7 @@ {% endblock head_js_extra %} {% block stylesheets_extra %} - + {% endblock %} diff --git a/browser/templates/browser/search.html b/browser/templates/browser/search.html index c3217dc..a6fd78f 100644 --- a/browser/templates/browser/search.html +++ b/browser/templates/browser/search.html @@ -1,4 +1,4 @@ -{% extends data_centre %} +{% extends data_centre_template %} {% load static %} {% load humanize %} @@ -24,7 +24,7 @@ {% endblock head_js_extra %} {% block stylesheets_extra %} - + {% endblock %} diff --git a/browser/templates/browser/storage_types.html b/browser/templates/browser/storage_types.html index 79ae30a..8658348 100644 --- a/browser/templates/browser/storage_types.html +++ b/browser/templates/browser/storage_types.html @@ -5,7 +5,7 @@ {% endblock %} {% block stylesheets_extra %} - + {% endblock %} {% block content %} diff --git a/browser/views.py b/browser/views.py index 46363b2..024a823 100644 --- a/browser/views.py +++ b/browser/views.py @@ -33,7 +33,6 @@ def getIcon(type, extension): def generate_actions(ext, path, item_type, download_service): - #print("actions") # Generate button for download action if item_type in ("dir", "link"): return "" @@ -59,7 +58,6 @@ def get_access_rules(path): if path == "/": return [] url = settings.ACCESSCTL_URL + path - print(url) with urllib.request.urlopen(settings.ACCESSCTL_URL + path) as page: data = json.loads(page.read().decode()) shortest = "x" * 1000 @@ -203,10 +201,11 @@ def browse(request): refresh = False if cat_info is not None and cat_info["record_type"] != "Dataset": for item in items: + item_desc = '' if item["type"] == "dir": item_desc = directory_desc(item.get("path")) if item_desc is None: - item_desc = '' + item_desc = '' # '' # loading.gif refresh = True if item_desc != path_desc: item["description"] = item_desc @@ -222,7 +221,7 @@ def browse(request): elif show_hidden: template = 'browser/browse_hidden.html' messages.info(request, f'Viewing hidden files. Normal view') - + context = { "path": path, "items": items, @@ -270,7 +269,7 @@ def storage_types(request): def robots(request): - return HttpResponseRedirect(f"/static/robots.txt") + return HttpResponseRedirect(f"/staticfiles/robots.txt") def search(request): q = '' diff --git a/requirements.txt b/requirements.txt index 172898e..8416145 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,12 +9,12 @@ chardet==3.0.4 charset-normalizer==2.0.7 crypto-cookie==0.3.1 cryptography==3.4.6 -git+https://github.com/cedadev/dj-security-middleware.git#egg=dj-security-middleware==0.5.0 Django==4.0.7 +git+https://github.com/cedadev/dj-security-middleware.git#egg=dj-security-middleware==0.5.0 django-classy-tags==2.0.0 -django-cookie-law==2.0.3 -git+https://github.com/cedadev/fwtheme-django.git#egg=fwtheme-django==1.0.1 -git+https://github.com/cedadev/fwtheme-django-ceda-serv.git#egg=fwtheme-django-ceda-serv==1.5.0 +django-cookie-law==2.2.0 +git+https://github.com/cedadev/fwtheme-django.git@1b39b17e795a354bda2583cb18c82a9ad7bcd538#egg=fwtheme_django +git+https://github.com/cedadev/fwtheme-django-ceda-serv.git@455239f#egg=fwtheme-django-ceda-serv idna==2.10 pycparser==2.20 pytest-runner==5.2