From 5c17e6a3aa6a101ab82892aa42e55b7d8274b7b7 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Wed, 13 Nov 2024 15:35:02 +0100 Subject: [PATCH] Split index to 3 views Each view is accessible from the landing page We could also use tabs (but then the url is not directly accessible to reach a given tab (we can set it up, but now make it change in the browser as we select a tab) --- app/projects/urls.py | 10 + app/projects/views.py | 24 ++ app/templates/index.html | 296 +---------------------- app/templates/landing/about.html | 42 ++++ app/templates/landing/cellular.html | 324 +++++++++++++++++++++++++ app/templates/landing/commune.html | 40 ++++ app/templates/landing/default.html | 332 ++++++++++++++++++++++++++ app/templates/landing/newsletter.html | 15 ++ 8 files changed, 800 insertions(+), 283 deletions(-) create mode 100644 app/templates/landing/about.html create mode 100644 app/templates/landing/cellular.html create mode 100644 app/templates/landing/commune.html create mode 100644 app/templates/landing/default.html create mode 100644 app/templates/landing/newsletter.html diff --git a/app/projects/urls.py b/app/projects/urls.py index cb841187..7e5fd11a 100644 --- a/app/projects/urls.py +++ b/app/projects/urls.py @@ -3,7 +3,17 @@ urlpatterns = [ path("", home, name="home"), + # TODO provide landing with different URL for different languages + # https://stackoverflow.com/questions/28675442/switch-language-in-django-with-the-translated-url-redirect + # https://docs.djangoproject.com/en/5.1/topics/http/urls/ + # TODO https://docs.djangoproject.com/en/5.1/topics/i18n/translation/#translating-url-patterns path("", home, name="home"), + path("commune", landing_commune, name="landing_commune"), + path("cellular", landing_cellular, name="landing_cellular"), + path("index", landing_default, name="landing_default"), + path("commune/", landing_commune, name="landing_commune"), + path("cellular/", landing_cellular, name="landing_cellular"), + path("index/", landing_default, name="landing_default"), # Project path("project/create/", project_create, name="project_create"), path("notimplementedyet/", not_implemented, name="not_implemented"), diff --git a/app/projects/views.py b/app/projects/views.py index d3f3d092..c0a7f8fa 100644 --- a/app/projects/views.py +++ b/app/projects/views.py @@ -71,6 +71,30 @@ def home(request, version=1): return render(request, "index.html", {"version": version}) +@require_http_methods(["GET"]) +def landing_commune(request, version=1): + if request.user.is_authenticated: + return HttpResponseRedirect(reverse("project_search")) + else: + return render(request, "landing/commune.html", {"version": version}) + + +@require_http_methods(["GET"]) +def landing_cellular(request, version=1): + if request.user.is_authenticated: + return HttpResponseRedirect(reverse("project_search")) + else: + return render(request, "landing/cellular.html", {"version": version}) + + +@require_http_methods(["GET"]) +def landing_default(request, version=1): + if request.user.is_authenticated: + return HttpResponseRedirect(reverse("project_search")) + else: + return render(request, "landing/default.html", {"version": version}) + + @login_required @require_http_methods(["POST"]) def scenario_upload(request, proj_id): diff --git a/app/templates/index.html b/app/templates/index.html index 43ddcd72..7b1e47f7 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -18,42 +18,32 @@
-

{% translate "We plan energy systems from a cellular perspective" %}

-

{% translate "In close collaboration with practitioners of energy modelling and energy project developers we developed an open-source planning tool" %}

+

{% translate "We plan to find a good title" %}

+

{% translate "In close collaboration we will manage to find a nice subtitle too" %}

Learn more + Is this button still useful?
- -{% if version == 1 %}
-

{% translate "Model your local energy system" %}

-
- -
+ - - - - - - -
-
- -
-

Cross-sectoral, open-source planning tool

-
-
-
-
- Heat and electricity inside a house -
-

Sector coupling

-

The tool is intended to be used for the optimised planning of energy cells for the (partial) supply of the electricity and heat requirements of neighbourhoods, industrial yards and industry in Germany. As active subsystems, energy cells can facilitate the integration of renewable energy and considerably reduce network expansion, since they can be planned and controlled among each other.

-
-
-
- Open science circle -
-

Open licence

-

The project will follow the promising open-science approach already implemented by RLI in many projects and will make all data, methods and program code available under a suitable open license. This is intended to comply with scientific standards, because only results generated with open and citable tools and data can be reproduced and reproduced in the field of software-based research.

-
-
-
- Stakeholders -
-

Stakeholder dialogue

-

Close cooperation within the consortium and with a wide range of stakeholders and users will expand the research network, opening up a broad field of new, significant and explicitly application-oriented research questions. The open_plan project complements other previous open-science research projects of RLI, such as open_eGO (OpenEnergyPlatfrom), open_FRED (feed-in time series on OpenEnergyPlatform) and enables the comparison, validation and improvement of energy system modelling.

-
-
-
-
- -
-
-
-

Features

-
-
-
-
- Sector coupling -
-

Sector coupling

-

Combination of different generation components and demand categories for designing optimized systems and operational strategies

-
-
-
- Data management -
-

Data management

-

Integration of open libraries, e.g. resource data and grid components and usage of open exchangeable formats

-
-
-
- Scenario analysis -
-

Scenario analysis

-

An automated creation of scenarios allows for an easy comparison of different options and to understand sensitivities

-
-
-
- Reproducibility -
-

Reproducibility

-

All results will be reproducible based on transparent calculations, both product-based and generic

-
-
-
- Modularity -
-

Modularity

-

A large variety of different energy cells requires modular components to represent different levels of complexity and functionalities

-
-
-
- User friendly -
-

User friendliness

-

The tool was developed with a strong focus on easy use without requiring programming language expertise

-
-
-
-
- - - - - -
-
-
-

Newsletter placeholder

-
-
- -
- (design would need Designer here) -
-
-
-
-
-
+{% include 'landing/newsletter.html' %} +{% include 'landing/about.html' %} -
-
- -
-
-
- - Deutsche Gesellschaft für Sonnenenergie logo - -
-
- - Reiner Lemoine Institut logo - -
-
- - Fraunhofer IFAM logo - -
-
-
- {% if "de" in LANGUAGE_NAME %} - - Federal Ministry for Economic Affairs and Energy logo - - {% else %} - - Federal Ministry for Economic Affairs and Energy logo - - {% endif %} -
-
-
-
+
+
+
+ + Deutsche Gesellschaft für Sonnenenergie logo + +
+
+ + Reiner Lemoine Institut logo + +
+
+ + Fraunhofer IFAM logo + +
+
+
+ {% if "de" in LANGUAGE_NAME %} + + Federal Ministry for Economic Affairs and Energy logo + + {% else %} + + Federal Ministry for Economic Affairs and Energy logo + + {% endif %} +
+
+
+
\ No newline at end of file diff --git a/app/templates/landing/cellular.html b/app/templates/landing/cellular.html new file mode 100644 index 00000000..34d9cf66 --- /dev/null +++ b/app/templates/landing/cellular.html @@ -0,0 +1,324 @@ +{% extends 'base.html' %} +{% load static %} +{% load i18n %} + + +{% block title %} {% translate "Cellular" %} {% endblock title %} + + + +{% block head_block %} + +{% endblock head_block %} + +{% block index %} + {% if not user.is_authenticated %} + {% get_current_language as LANGUAGE_NAME %} +
+ +
+
+
+

{% translate "We plan energy systems from a cellular perspective" %}

+

{% translate "In close collaboration with practitioners of energy modelling and energy project developers we developed an open-source planning tool" %}

+
+ +
+
+ + + + + + + + +
+
+ +
+

Cross-sectoral, open-source planning tool

+
+
+
+
+ Heat and electricity inside a house +
+

Sector coupling

+

The tool is intended to be used for the optimised planning of energy cells for the (partial) supply of the electricity and heat requirements of neighbourhoods, industrial yards and industry in Germany. As active subsystems, energy cells can facilitate the integration of renewable energy and considerably reduce network expansion, since they can be planned and controlled among each other.

+
+
+
+ Open science circle +
+

Open licence

+

The project will follow the promising open-science approach already implemented by RLI in many projects and will make all data, methods and program code available under a suitable open license. This is intended to comply with scientific standards, because only results generated with open and citable tools and data can be reproduced and reproduced in the field of software-based research.

+
+
+
+ Stakeholders +
+

Stakeholder dialogue

+

Close cooperation within the consortium and with a wide range of stakeholders and users will expand the research network, opening up a broad field of new, significant and explicitly application-oriented research questions. The open_plan project complements other previous open-science research projects of RLI, such as open_eGO (OpenEnergyPlatfrom), open_FRED (feed-in time series on OpenEnergyPlatform) and enables the comparison, validation and improvement of energy system modelling.

+
+
+
+
+ +
+
+
+

Features

+
+
+
+
+ Sector coupling +
+

Sector coupling

+

Combination of different generation components and demand categories for designing optimized systems and operational strategies

+
+
+
+ Data management +
+

Data management

+

Integration of open libraries, e.g. resource data and grid components and usage of open exchangeable formats

+
+
+
+ Scenario analysis +
+

Scenario analysis

+

An automated creation of scenarios allows for an easy comparison of different options and to understand sensitivities

+
+
+
+ Reproducibility +
+

Reproducibility

+

All results will be reproducible based on transparent calculations, both product-based and generic

+
+
+
+ Modularity +
+

Modularity

+

A large variety of different energy cells requires modular components to represent different levels of complexity and functionalities

+
+
+
+ User friendly +
+

User friendliness

+

The tool was developed with a strong focus on easy use without requiring programming language expertise

+
+
+
+
+ + + + + +
+
+
+

Newsletter placeholder

+
+
+ +
+ (design would need Designer here) +
+
+
+
+
+
+ + +
+
+ +
+
+
+ + Deutsche Gesellschaft für Sonnenenergie logo + +
+
+ + Reiner Lemoine Institut logo + +
+
+ + Fraunhofer IFAM logo + +
+
+
+ {% if "de" in LANGUAGE_NAME %} + + Federal Ministry for Economic Affairs and Energy logo + + {% else %} + + Federal Ministry for Economic Affairs and Energy logo + + {% endif %} +
+
+
+
+ + + + +
+ + + + {% endif %} +{% endblock index %} \ No newline at end of file diff --git a/app/templates/landing/commune.html b/app/templates/landing/commune.html new file mode 100644 index 00000000..14175083 --- /dev/null +++ b/app/templates/landing/commune.html @@ -0,0 +1,40 @@ +{% extends 'base.html' %} +{% load static %} +{% load i18n %} + + +{% block title %} {% translate "Commune" %} {% endblock title %} + + +{% block head_block %} + +{% endblock head_block %} + +{% block index %} + {% if not user.is_authenticated %} + {% get_current_language as LANGUAGE_NAME %} +
+ +
+
+
+

{% translate "Something about KEP" %}

+

{% translate "tbd" %}

+
+ +
+
+ + + {% include 'landing/newsletter.html' %} + {% include 'landing/about.html' %} + + +
+ + + + {% endif %} +{% endblock index %} \ No newline at end of file diff --git a/app/templates/landing/default.html b/app/templates/landing/default.html new file mode 100644 index 00000000..632e1f93 --- /dev/null +++ b/app/templates/landing/default.html @@ -0,0 +1,332 @@ +{% extends 'base.html' %} +{% load static %} +{% load i18n %} + + + + + +{% block head_block %} + +{% endblock head_block %} + +{% block index %} + {% if not user.is_authenticated %} + {% get_current_language as LANGUAGE_NAME %} +
+ +
+
+
+

+ {% translate "Model your local energy system" %} +

+ + {% translate "Use the GUI to include sector-coupling and optimize the energy system model subject to equality constraints" %} + + {% translate "Try out" %} +
+
+ + {% if "de" in LANGUAGE_NAME %} + Energy system GUI + {% else %} + Energy system GUI + {% endif %} +
+
+
+ + + + + + + +
+
+ +
+

Cross-sectoral, open-source planning tool

+
+
+
+
+ Heat and electricity inside a house +
+

Sector coupling

+

The tool is intended to be used for the optimised planning of energy cells for the (partial) supply of the electricity and heat requirements of neighbourhoods, industrial yards and industry in Germany. As active subsystems, energy cells can facilitate the integration of renewable energy and considerably reduce network expansion, since they can be planned and controlled among each other.

+
+
+
+ Open science circle +
+

Open licence

+

The project will follow the promising open-science approach already implemented by RLI in many projects and will make all data, methods and program code available under a suitable open license. This is intended to comply with scientific standards, because only results generated with open and citable tools and data can be reproduced and reproduced in the field of software-based research.

+
+
+
+ Stakeholders +
+

Stakeholder dialogue

+

Close cooperation within the consortium and with a wide range of stakeholders and users will expand the research network, opening up a broad field of new, significant and explicitly application-oriented research questions. The open_plan project complements other previous open-science research projects of RLI, such as open_eGO (OpenEnergyPlatfrom), open_FRED (feed-in time series on OpenEnergyPlatform) and enables the comparison, validation and improvement of energy system modelling.

+
+
+
+
+ +
+
+
+

Features

+
+
+
+
+ Sector coupling +
+

Sector coupling

+

Combination of different generation components and demand categories for designing optimized systems and operational strategies

+
+
+
+ Data management +
+

Data management

+

Integration of open libraries, e.g. resource data and grid components and usage of open exchangeable formats

+
+
+
+ Scenario analysis +
+

Scenario analysis

+

An automated creation of scenarios allows for an easy comparison of different options and to understand sensitivities

+
+
+
+ Reproducibility +
+

Reproducibility

+

All results will be reproducible based on transparent calculations, both product-based and generic

+
+
+
+ Modularity +
+

Modularity

+

A large variety of different energy cells requires modular components to represent different levels of complexity and functionalities

+
+
+
+ User friendly +
+

User friendliness

+

The tool was developed with a strong focus on easy use without requiring programming language expertise

+
+
+
+
+ + + + + +
+
+
+

Newsletter placeholder

+
+
+ +
+ (design would need Designer here) +
+
+
+
+
+
+ + +
+
+ +
+
+
+ + Deutsche Gesellschaft für Sonnenenergie logo + +
+
+ + Reiner Lemoine Institut logo + +
+
+ + Fraunhofer IFAM logo + +
+
+
+ {% if "de" in LANGUAGE_NAME %} + + Federal Ministry for Economic Affairs and Energy logo + + {% else %} + + Federal Ministry for Economic Affairs and Energy logo + + {% endif %} +
+
+
+
+ + + + +
+ + + + {% endif %} +{% endblock index %} \ No newline at end of file diff --git a/app/templates/landing/newsletter.html b/app/templates/landing/newsletter.html new file mode 100644 index 00000000..6dd83486 --- /dev/null +++ b/app/templates/landing/newsletter.html @@ -0,0 +1,15 @@ +
+
+
+

Newsletter placeholder

+
+
+ +
+ (design would need Designer here) +
+
+
+
+
+
\ No newline at end of file