diff --git a/VIPSWeb/local_settings_sample.py b/VIPSWeb/local_settings_sample.py index 466a2c166494e8bb09326682fc199d5ef5e3a4f2..bb5d07d25691cac25d39f2a0cd5a1db09475aea6 100755 --- a/VIPSWeb/local_settings_sample.py +++ b/VIPSWeb/local_settings_sample.py @@ -106,6 +106,12 @@ CACHES = { # Site name - appears in header of all pages. HTML is allowed SITE_NAME = "Example site title" +# Path to the site's logo. +# E.g. "images/logo_vips_newest.png" -> /VIPSWeb/static/images/logo_vips_newest.png +# E.g. "fibl/images/fibl_logo.png" -> /fibl/static/fibl_images/fibl_logo.png +SITE_LOGO_PATH = "fibl/images/fibl_logo.png" + + # Insert Web Analytics Script? # Could have more than 1 INSERT_WEB_ANALYTICS = False diff --git a/VIPSWeb/settings.py b/VIPSWeb/settings.py index ee36cbb49cc99254eea6d7fdf9d709ead9fd2e80..f83623ba42d3f001ac39d46978026fafff6c05a9 100755 --- a/VIPSWeb/settings.py +++ b/VIPSWeb/settings.py @@ -154,6 +154,7 @@ INSTALLED_APPS = ( 'security', 'spatial', 'mock', + 'fibl', 'VIPSWeb' ) diff --git a/VIPSWeb/static/css/vipsweb.css b/VIPSWeb/static/css/vipsweb.css index b2d983cf2fd697b06d1343b3730bf31b8b80b1c2..c0e3b997078added2925e08b24b643468edd3c1a 100755 --- a/VIPSWeb/static/css/vipsweb.css +++ b/VIPSWeb/static/css/vipsweb.css @@ -755,6 +755,10 @@ td.dateCell { display: none; } +div.containerBackground { + background-color: #d9e6e4; +} + #loginAndLanguageInfo { position: absolute; top: 0px; diff --git a/VIPSWeb/templates/base.html b/VIPSWeb/templates/base.html index 77361848906a985c3b5cbf741485ab6689040a9a..84befff5ff5723b6e6825943de9bcfbd038a9b0e 100755 --- a/VIPSWeb/templates/base.html +++ b/VIPSWeb/templates/base.html @@ -61,7 +61,7 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand" href="/"><img src="{% static "images/logo_vips_newest.png" %}" alt="VIPS logo"/></a><span id="siteTitle" class="navbar-brand">{{settings.SITE_NAME|safe}}</span> + <a class="navbar-brand" href="/"><img src="{% static settings.SITE_LOGO_PATH %}" alt="VIPS logo"/></a><span id="siteTitle" class="navbar-brand">{{settings.SITE_NAME|safe}}</span> {% if settings.SYSTEM_TIME_OFFSET_MONTHS != 0 or settings.SYSTEM_TIME_EXACT != None %} <span class="navbar-brand" style="margin-left: 0px; padding-left: 0px; padding-top: 15px; font-size: 0.8em">[{% get_system_time "%Y-%m-%d" %}]</span> {% endif %} @@ -107,7 +107,7 @@ </div> </nav> </div> -<div style="background-color: #d9e6e4;"> +<div class="containerBackground"> <div class="container" id="contentContainer" > <div class="row"> <!-- Start contents container --> diff --git a/fibl/__init__.py b/fibl/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/fibl/admin.py b/fibl/admin.py new file mode 100644 index 0000000000000000000000000000000000000000..8c38f3f3dad51e4585f3984282c2a4bec5349c1e --- /dev/null +++ b/fibl/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/fibl/apps.py b/fibl/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..db54cf93cfe2be0d99ca0ec71c23cfd3ab0c29b1 --- /dev/null +++ b/fibl/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class FiblConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'fibl' diff --git a/fibl/migrations/__init__.py b/fibl/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/fibl/models.py b/fibl/models.py new file mode 100644 index 0000000000000000000000000000000000000000..71a836239075aa6e6e4ecb700e9c42c95c022d91 --- /dev/null +++ b/fibl/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/fibl/static/fibl/css/fibl.css b/fibl/static/fibl/css/fibl.css new file mode 100644 index 0000000000000000000000000000000000000000..f6b7cc0230c4c60d878488f3ee319c663581265b --- /dev/null +++ b/fibl/static/fibl/css/fibl.css @@ -0,0 +1,7 @@ +body { + /*background-color: black;*/ +} + +div.containerBackground { + background-color: #bcd3dd; +} diff --git a/fibl/static/fibl/images/fibl_logo.png b/fibl/static/fibl/images/fibl_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d96df21defdc289ca3124d3ba274411fd011fd58 Binary files /dev/null and b/fibl/static/fibl/images/fibl_logo.png differ diff --git a/fibl/templates/fibl/fibl_base.html b/fibl/templates/fibl/fibl_base.html new file mode 100644 index 0000000000000000000000000000000000000000..101980a4bcb014da49cfe2832d3246d3fc813f28 --- /dev/null +++ b/fibl/templates/fibl/fibl_base.html @@ -0,0 +1,24 @@ +{% extends "base.html" %} +{% load static %} +{% comment %} + +# +# Copyright (c) 2024 NIBIO <http://www.nibio.no/>. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +{% endcomment %} +{% block extendCSS %} +<link rel="stylesheet" href="{% static "fibl/css/fibl.css" %}"> +{% endblock %} diff --git a/fibl/templates/fibl/index.html b/fibl/templates/fibl/index.html new file mode 100644 index 0000000000000000000000000000000000000000..9ceaa4a7d67dd53277d2f899c8bf7604f10d266a --- /dev/null +++ b/fibl/templates/fibl/index.html @@ -0,0 +1,30 @@ +{% extends "fibl/fibl_base.html" %} +{% load static %} +{% comment %} + +# +# Copyright (c) 2024 NIBIO <http://www.nibio.no/>. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +{% endcomment %} +{% load i18n l10n %} +{% block title%}{% trans "FIBL" %}{%endblock%} +{% block content %} +Testing,testing +{% endblock %} + +{% block customJS %} + +{% endblock %} \ No newline at end of file diff --git a/fibl/tests.py b/fibl/tests.py new file mode 100644 index 0000000000000000000000000000000000000000..7ce503c2dd97ba78597f6ff6e4393132753573f6 --- /dev/null +++ b/fibl/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/fibl/urls.py b/fibl/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..542c94d41024d8c8bf597ac9d531a37ea8e06884 --- /dev/null +++ b/fibl/urls.py @@ -0,0 +1,80 @@ +# +# Copyright (c) 2013-2023 NIBIO. +# +# This file is part of VIPSWeb +# (see https://gitlab.nibio.no/VIPS/VIPSWeb). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# + + +from django.urls import re_path, path, include +#from django.views.generic import TemplateView +from django.views.static import serve +from django.views.i18n import JavaScriptCatalog +from django.conf import settings +from fibl import views +from VIPSWeb import views as VIPSWebViews + +# Uncomment the next two lines to enable the admin: +from django.contrib import admin +admin.autodiscover() + +# Enabling translation in JavaScript files +# See https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#internationalization-in-javascript-code +js_info_dict = { + 'packages': ['forecasts','vips_messages','VIPSWeb','roughage', 'spatial'], + 'domain': 'djangojs', +} + +#print "settings.MAINTENANCE_MODE=%s" % settings.MAINTENANCE_MODE + +if settings.MAINTENANCE_MODE is True: + urlpatterns = [ + re_path(r'^$', views.maintenance, name='maintenance') + ] +else: + urlpatterns = [ + # Examples: + # url(r'^$', 'VIPSWeb.views.home', name='home'), + # url(r'^VIPSWeb/', include('VIPSWeb.foo.urls')), + + # Uncomment the admin/doc line below to enable admin documentation: + # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + + #re_path(r'^spatial/', include('spatial.urls')), + #re_path(r'^cydiapomonella/', include('cydiapomonella.urls')), + #re_path(r'^forecasts/', include('forecasts.urls', namespace = "forecasts")), + re_path(r'^messages/', include('vips_messages.urls', namespace = "vips_messages")), + re_path(r'^observations/', include('observations.urls', namespace = "observations")), + re_path(r'^information/', include('information.urls', namespace = "information")), + re_path(r'^security/', include('security.urls', namespace = "security")), + #re_path(r'^mock/', include('mock.urls', namespace = "mock")), + # Uncomment the next line to enable the admin: + re_path(r'^admin/', admin.site.urls), + re_path(r'^tinymce/', include('tinymce.urls')), + # Static serving of media files + re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), + # Enabling translation in JavaScript files + # See https://docs.djangoproject.com/en/1.6/topics/i18n/translation/#internationalization-in-javascript-code + path('jsi18n/', JavaScriptCatalog.as_view(packages=js_info_dict['packages']), name='javascript-catalog'), + #path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'), + re_path(r'^i18n/', include('django.conf.urls.i18n')), + path('settings.js', VIPSWebViews.settings_js, name="VIPSWebViews.settings_js"), + re_path(r'^vipslogicproxy/(?P<path>.*)$', VIPSWebViews.vipslogicproxy), + # Default view is index + re_path(r'^$', views.index, name='index'), + #url(r'^$', TemplateView.as_view(template_name="index.html")) + ] diff --git a/fibl/views.py b/fibl/views.py new file mode 100644 index 0000000000000000000000000000000000000000..2ec153257f358ab0d99e9086cbbf69ea37b5700e --- /dev/null +++ b/fibl/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render +from django.conf import settings + +# Create your views here. + +def index(request): + context = { + "site_logo_path" : settings.SITE_LOGO_PATH + } + return render(request, 'fibl/index.html', context) \ No newline at end of file