Skip to content

Commit

Permalink
Merge pull request #534 from rl-institut/release/v1.3.0
Browse files Browse the repository at this point in the history
Release/v1.3.0
  • Loading branch information
henhuy authored Dec 14, 2020
2 parents 0cf02fa + 0dc4287 commit f2be844
Show file tree
Hide file tree
Showing 20 changed files with 762 additions and 262 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project tries to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0]
### Changed
- wording and image on mobile LP
- added buttons on mobile LP to skip onboarding
- default stations are set, if user skips route page
- desktop LP design (wording and image)

## [1.2.0] - 2020-10-05
### Added
- posthog event to distinguish between mobile/desktop device
Expand Down
2 changes: 1 addition & 1 deletion e_metrobus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.2.0"
__version__ = "1.3.0"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
Expand Down
7 changes: 5 additions & 2 deletions e_metrobus/navigation/tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from django.test import Client
from django.urls import reverse

from e_metrobus.navigation import stations


def test_landing_page():
client = Client()
Expand All @@ -19,11 +21,12 @@ def test_welcome_page():
assert response.status_code == 200


def test_route_redirect():
def test_default_route():
client = Client()
url = reverse("navigation:dashboard")
response = client.get(url)
assert response.status_code == 302
assert response.status_code == 200
assert client.session["stations"] == stations.DEFAULT_STATIONS


def test_route_page():
Expand Down
16 changes: 8 additions & 8 deletions e_metrobus/navigation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
)


class CheckStationsMixin:
class DefaultStationsMixin:
def get(self, request, *args, **kwargs):
if "stations" not in request.session:
return redirect("navigation:route")
return super(CheckStationsMixin, self).get(request, *args, **kwargs)
request.session["stations"] = stations.DEFAULT_STATIONS
return super(DefaultStationsMixin, self).get(request, *args, **kwargs)


class FeedbackMixin:
Expand Down Expand Up @@ -96,7 +96,7 @@ def get_stations():
return redirect("navigation:display_route")


class DashboardView(CheckStationsMixin, NavigationView):
class DashboardView(DefaultStationsMixin, NavigationView):
template_name = "navigation/dashboard.html"
footer_links = {
"info": {"enabled": True},
Expand Down Expand Up @@ -135,7 +135,7 @@ def get_context_data(self, **kwargs):
return context


class DisplayRouteView(CheckStationsMixin, NavigationView):
class DisplayRouteView(DefaultStationsMixin, NavigationView):
template_name = "navigation/display_route.html"
footer_links = {"dashboard": {"selected": True}}
back_url = "navigation:route"
Expand Down Expand Up @@ -180,7 +180,7 @@ def get(self, request, *args, **kwargs):
return super(DisplayRouteView, self).get(request, *args, **kwargs)


class ComparisonView(CheckStationsMixin, NavigationView):
class ComparisonView(DefaultStationsMixin, NavigationView):
template_name = "navigation/comparison.html"
footer_links = {"dashboard": {"selected": True}}
back_url = "navigation:route"
Expand All @@ -195,7 +195,7 @@ def get_context_data(self, **kwargs):
return context


class EnvironmentView(CheckStationsMixin, NavigationView):
class EnvironmentView(DefaultStationsMixin, NavigationView):
template_name = "navigation/environment.html"
footer_links = {
"info": {"enabled": True},
Expand Down Expand Up @@ -413,7 +413,7 @@ def post(self, request, **kwargs):
return redirect("navigation:legal")


class SummaryView(CheckStationsMixin, NavigationView):
class SummaryView(DefaultStationsMixin, NavigationView):
template_name = "navigation/summary.html"
footer_links = {
"info": {"enabled": True},
Expand Down
1 change: 1 addition & 0 deletions e_metrobus/static/images/LP_Berlin_Skyline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions e_metrobus/static/images/arrows_down_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f2be844

Please sign in to comment.