-
Notifications
You must be signed in to change notification settings - Fork 0
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
Work for Marple energy flexibility pilot #78
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Used to list the available challenges
used to track the current challenge
Falls back to a hardcoded challenge if it's not there for now
Falls back to hardcoded challenges if none available
to enable descriptions with HTML so you can use a default template for simplish challenges
struan
force-pushed
the
77-marple-pilot
branch
from
August 14, 2024 13:37
1613f73
to
9d0b29b
Compare
falls back to configurable default template if the template is missing
struan
force-pushed
the
77-marple-pilot
branch
from
August 14, 2024 14:05
3f70431
to
33029c5
Compare
zarino
force-pushed
the
77-marple-pilot
branch
from
October 4, 2024 09:44
f80b0f0
to
f8642c6
Compare
Boring Avatars (quite fairly) charges for their img src API now. So I’ve ported their JavaScript code to Django-flavoured Python, so we can render boring avatar SVGs directly into our pages.
Previously, teams only had a centroid point location (calculated from the postcode of the team’s founder). Now teams can additionally have a polygon boundary. The boundary isn’t used for anything yet, and isn’t displayed anywhere except in the Django Admin – but in the next commit, we’ll use Leaflet to draw the team’s boundary on the Team page. Team founders can’t yet define a boundary for their team via the front-end, but site admins can add a boundary through the Django admin (drawn by hand on the GeoDjango OSM map, or uploaded as a GeoJSON file). I’ve included a GeoJSON file for a team in Marple in the fixtures directory, and a new management command to create the team and import the boundary from the file.
zarino
force-pushed
the
77-marple-pilot
branch
from
October 4, 2024 09:55
f8642c6
to
15156a4
Compare
The Leaflet code we previously used on the local authority "Area" page has now been expanded to work on Team pages. If the team has a boundary set, it is displayed on the map. Otherwise, the map is just centred on the team’s centroid location. If the user has arrived on the team page after searching for their postcode on the Search page, then the location of that postcode is also displayed on the Team map, to make it visually obvious whether you’re within the team’s boundary or not (if it has one). We use the OSM HOT map tiles because they’re less visually distracting than the default "road atlas"-style OSM tiles, and the colours are coincidentally a better match with the Neighbourhood Warmth branding. The Leaflet.snogylop plugin dumped at the top of map.js allows us to shade *outside* the boundary area (rather than the Leaflet default of only being able to shade inside polygons) making it stand out better. The user’s last searched-for location is stored in their session. There is currently no way to clear it (other than deleting the django session cookie).
zarino
force-pushed
the
77-marple-pilot
branch
from
October 4, 2024 09:59
15156a4
to
2939b23
Compare
If the user has reached a Team page without submitting their postcode via the homepage / search page, and the team they’re looking at has a boundary, they can now press the “Am I in this team’s area?” button to enter their postcode, and plot themselves on the Team page map.
- "My account" page showing user details and linking to deletion form. - Link to "My account" page from user dropdown menu. - Dark Matter Labs removed from Privacy Policy as we are no longer in the alpha testing period. - Info about the postcode session storage added to Privacy Policy, along with various other small improvements.
- Prevent checkmark icons in team progress sidebar from shrinking or growing. - Make team challenge area narrower (for more readable line lengths) and progress sidebar wider.
An unnecessary `else` in `views.py` was causing custom challenge progress not to be shown on the team page if a user was logged in. And the challenge names/short_descriptions weren’t being displayed properly on the progress bar either. I‘ve also renamed the `challenges` environment variable to `public_challenges` to make it clear that it doesn’t include the full list of the team’s current challenges.
The `version` key was deprecated in Docker 25.05. Removing it prevents Docker from printing warnings when we run the scripts in `/scripts`.
zarino
force-pushed
the
77-marple-pilot
branch
from
October 4, 2024 13:56
2939b23
to
9277a30
Compare
zarino
force-pushed
the
77-marple-pilot
branch
from
October 4, 2024 14:00
9277a30
to
83dfc48
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Things to make the energy flexibility pilot work possible.
Removes the create a team option from the template.
Adds basic functionality to store challenges in the database to make administering this possible without editing the template. Can use either html, plain text or a custom template for the challenge description displayed on the team page. Also uses the challenges to populate the progress scale on the private and public team page.
If there is no challenge set for a Team then it will display thing things in the template as before. If you set a challenge then it will use that, and all the challenges in the database to display progress.
A challenge should have an order which will be used in the progress ladders.
It can be marked as not public in which case it doesn't appear on the non logged in team page.
The description can be one of:
Fixes #77