Skip to content
Snippets Groups Projects
Commit 16801f1b authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Add FIBL app, support bespoke frontpage and layout

parent 3bf59b9d
Branches
No related tags found
No related merge requests found
......@@ -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
......
......@@ -154,6 +154,7 @@ INSTALLED_APPS = (
'security',
'spatial',
'mock',
'fibl',
'VIPSWeb'
)
......
......@@ -755,6 +755,10 @@ td.dateCell {
display: none;
}
div.containerBackground {
background-color: #d9e6e4;
}
#loginAndLanguageInfo {
position: absolute;
top: 0px;
......
......@@ -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 -->
......
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class FiblConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'fibl'
from django.db import models
# Create your models here.
body {
/*background-color: black;*/
}
div.containerBackground {
background-color: #bcd3dd;
}
fibl/static/fibl/images/fibl_logo.png

1.62 KiB

{% 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 %}
{% 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
from django.test import TestCase
# Create your tests here.
#
# 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"))
]
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment