Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/index #33

Open
wants to merge 88 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
2fb1318
Add tailwind to project
henhuy Sep 24, 2024
59fe62d
Fix tailwind content path
henhuy Sep 25, 2024
41c2151
Added SCSS via django-libsass
henhuy Oct 7, 2024
c198d2a
Removed tailwind
henhuy Oct 7, 2024
3b1462d
add basic color variables
bmlancien Oct 8, 2024
e2651f7
update top navbar
bmlancien Oct 8, 2024
585d31d
add footer
bmlancien Oct 8, 2024
1ed9f22
add sidebar
bmlancien Oct 8, 2024
f886c53
add dummy main content
bmlancien Oct 8, 2024
f7f5e9a
increase help section on larger screens
bmlancien Oct 8, 2024
7ecfc3c
add footer navigation
bmlancien Oct 8, 2024
9ea3b35
fix footer position
bmlancien Oct 8, 2024
66523a9
remove space between footer and window bottom
bmlancien Oct 9, 2024
312812f
update button colors
bmlancien Oct 9, 2024
7d8c370
reduce help container width on smaller screens
bmlancien Oct 9, 2024
9e63192
center main content on larger screens
bmlancien Oct 9, 2024
adcf0ea
Add htmx and bootstrap to static vendors
henhuy Oct 30, 2024
2f752f5
Add htmx and bootstrap to base.html
henhuy Oct 30, 2024
e2919c4
Implement HttpResponses from States
henhuy Nov 1, 2024
0ad396e
Implemented flows
henhuy Nov 5, 2024
f671367
Add .idea to .gitignore
henhuy Nov 5, 2024
63f19cd
added forms and new states
josihoppe Nov 8, 2024
8690837
added docstring to state class
josihoppe Nov 8, 2024
943ebcc
added second layer to session and moved all accesses to that django_h…
josihoppe Nov 8, 2024
84a1664
added store_state and remove_state and docstring to FromState
josihoppe Nov 8, 2024
52918e2
added check_state to FormState to check with the form fields
josihoppe Nov 8, 2024
1617246
added more forms and transitions to RoofFlow
josihoppe Nov 8, 2024
c5538f0
added default switch case to roofView and fixed error in Switch Class
josihoppe Nov 11, 2024
723291c
Fix resetting nodes if switch lookups have never been set
henhuy Nov 11, 2024
95540c7
added min/max restraints to form field
josihoppe Nov 11, 2024
0c8aa35
added landing page template, url and view
josihoppe Nov 11, 2024
bd4880e
Refactored flows to return StateResponse instead of HTML
henhuy Nov 12, 2024
1e65c1e
Implement end state redirecting to next page
henhuy Nov 12, 2024
3ba461f
Refactor implementation of HTMX state forwarding
henhuy Nov 12, 2024
2ee6497
Allow multiple state responses per state
henhuy Nov 12, 2024
41cc29c
Implement first draft for state holding info text
henhuy Nov 12, 2024
4665191
added Cellar Flow and Forms
josihoppe Nov 15, 2024
f5f6ba9
landing page takes whole space and added functional link to starten b…
josihoppe Nov 15, 2024
8545647
added templates and views for the Abschnittsintros
josihoppe Nov 15, 2024
8b177fb
added explanation to readme how to add a new flow
josihoppe Nov 15, 2024
70c095a
removed old forms and view, renamed usage to consumption, structured …
josihoppe Nov 15, 2024
1de33ce
Removed duplicate roof insulation state
henhuy Nov 18, 2024
14981bd
Fix redirect state and response
henhuy Nov 18, 2024
e50b8b3
fixed list points on home
josihoppe Nov 18, 2024
3c6808d
added Building Type Flow
josihoppe Nov 18, 2024
fc9b882
added Building Data Flow
josihoppe Nov 18, 2024
82ec095
added headlines to templates
josihoppe Nov 18, 2024
4a53336
changed names of roofflow states
josihoppe Nov 18, 2024
d10a77f
modified formstate render so it displays form and helptext together i…
josihoppe Nov 18, 2024
d468590
added help texts for existing flow, formated templates accordingly
josihoppe Nov 18, 2024
ae7e92a
moved form content outside of sidebar
josihoppe Nov 18, 2024
e2aabd3
escaped space in helptexts, added roof helptext
josihoppe Nov 18, 2024
a661687
Use base flow template and integrate error state response
henhuy Nov 18, 2024
21c8898
updated readme with how to do helptext
josihoppe Nov 18, 2024
6b76c81
Fix state checking for flow with all or only latest parameters in req…
henhuy Nov 19, 2024
c02a96a
Rollback FormState rendering
henhuy Nov 19, 2024
c316831
Fix layout for simple forms
henhuy Nov 19, 2024
72d1790
Merge next button PR
henhuy Nov 19, 2024
fdb2d49
Add CSRF Token to rendered form state
henhuy Nov 19, 2024
3087a05
adjusted rest of flows to base_flow setup
josihoppe Nov 20, 2024
f44082e
added Hotwater Heating Flow
josihoppe Nov 20, 2024
23ec5c2
added ConsumptionInputFlow
josihoppe Nov 21, 2024
763fa24
added Consumption Result View
josihoppe Nov 21, 2024
5397390
added WindowFlow
josihoppe Nov 21, 2024
76bc532
added Facade Flow
josihoppe Nov 21, 2024
bd05693
added Heating Flow
josihoppe Nov 21, 2024
885a98b
added PV-System Flow
josihoppe Nov 22, 2024
3f45926
added Ventilation System Flow
josihoppe Nov 22, 2024
a0ebabd
added Financial Support Flow
josihoppe Nov 22, 2024
c4081d9
added Results view placeholder and fixed Financial support flow
josihoppe Nov 22, 2024
f355351
added Next Steps View
josihoppe Nov 22, 2024
099de6e
added dead end tenant
josihoppe Nov 22, 2024
162e788
added dead end monument protection, fixed helptexts of building type …
josihoppe Nov 22, 2024
0269eeb
added dead end heating
josihoppe Nov 22, 2024
ad6fe9a
changed text for dead end heating
josihoppe Nov 22, 2024
f43d79b
fixed errors in consumption input
josihoppe Nov 22, 2024
758469c
created base template for views so that they also can access next and…
josihoppe Nov 22, 2024
d46da86
fixed cleaned data for Date Field
josihoppe Nov 22, 2024
5c83715
added Mixin for Index
josihoppe Nov 26, 2024
33688d7
fixed urls
josihoppe Nov 26, 2024
4bb5843
handled categories diffrent from steps
josihoppe Nov 26, 2024
162f640
fixed navigation so intros show index as well
josihoppe Nov 26, 2024
89d7d2e
changed dead end layout to not show sidebar navigation
josihoppe Nov 26, 2024
3fb32ce
merged base_flow and base_view
josihoppe Nov 27, 2024
9205f07
moved sidebar navigation mixin to navigation and get_flows into mixin
josihoppe Nov 27, 2024
90f90ac
added finished method to flow and modified navigation
josihoppe Nov 27, 2024
3215a6f
Fix checking if flow has finished
henhuy Nov 28, 2024
5308a9f
Allow clicking on non visited flows
henhuy Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ typings/
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

.idea/
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
Expand Down
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.PHONY : update_vendor_assets

update_vendor_assets:
# Note: call this command from the same folder your Makefile is located
# Note: this run only update minor versions.
# Update major versions manually, you can use "ncu" for this.
# https://nodejs.dev/en/learn/update-all-the-nodejs-dependencies-to-their-latest-version/#update-all-packages-to-the-latest-version

# Update
npm update

# Bootstrap https://github.com/twbs/bootstrap
rm -r building_dialouge_webapp/static/vendors/bootstrap/scss/*
cp -r node_modules/bootstrap/scss/* building_dialouge_webapp/static/vendors/bootstrap/scss/
rm -r building_dialouge_webapp/static/vendors/bootstrap/js/*
cp node_modules/bootstrap/dist/js/bootstrap.min.js* building_dialouge_webapp/static/vendors/bootstrap/js/

# HTMX https://htmx.org/
rm -r building_dialouge_webapp/static/vendors/htmx/js/*
cp node_modules/htmx.org/dist/htmx.min.js building_dialouge_webapp/static/vendors/htmx/js/

# Done
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,81 @@ The following details how to deploy this application.
### Docker

See detailed [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html).


## Adding new Flows

### 1. Forms
add the forms needed for the flow.
For each moment in the flow where a decision in the form / from the user will cause a diffrent form being
rendered afterwards, that decision needs it's own form

### 2. Flow
start the Flow with a nice descriptive Name: for example "RoofFlow"
```
class RoofFlow(Flow):
template_name = "path_to_template/name_of_template.html"

def __init__(self):
super().__init__()
self.start = State(
...
).transition(
...,
)

# add more States in here

self.end = EndState(self, url="url_to_next_flow_or_view")
```

You can use these States:
- ```FormState(self, name="roof_type", form_class=forms.NameOfForm,)```
- ```EndState(self, url="url_to_next_flow_or_view")```
- if you want to add helptext to a Form, create a partial (a separate html file) and add it to the corresponding state with the ```template_name``` parameter

You can use these Transitions:
- ```Next("name_of_the_next_state")```
- ```Switch("name_of_the_field_that_will_cause_the_switch").case("returned value of the field", "name of next state").default("name_of_the_next_state")```
you can add as many cases as you need

It is important, that the name_of_the_next_state in the transition is the same as a state that you are
declaring later ```(self.name_of_the_next_state = State(...) )```
### 3. Template
Create a template with a fitting name: for example roof.html
use this base structure:
```
{% extends "base.html" %}

{% block content %}
<section class="position-relative h-100 flex-grow-1 pb-5">
<div class="help-background"></div>
<div class="step-title">
<div class="step-container">
<div class="main">
<h1>Title of Page</h1>
</div>
</div>
<div class="help"></div>
</div>
<div id="name_attribute_of_state">{{ name_attribute_of_state.content | safe }}</div>
</section>
{% endblock content %}
```

For a helptext partial you can use this structure: for example roof_help.html
```
<div class="step-question">
<div class="step-container">
<div class="main">{{ form }}</div>
</div>
<div class="help">
<span>Flachdach:&nbsp;</span>Ein Flachdach ist ein Dach mit einer sehr geringen Neigung, das fast waagerecht verläuft.
</div>
</div>
```
### 4. URL
add the Flow to the url like this:
```
path("roof/", flows.RoofFlow.as_view(), name="roof"),
```
Loading
Loading