diff --git a/README.md b/README.md index e22e4672..56240825 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Contributing ## Getting the code -### If you are setting up anyway on Windows using WSL - PLEASE MAKE SURE TO COMPLETE THE FOLLOWING STEPS FROM YOUR WSL TERMINAL!!! +### NOTE: If you are setting up anyway on Windows using WSL - PLEASE MAKE SURE TO COMPLETE THE FOLLOWING STEPS FROM YOUR WSL TERMINAL!!! 1. [Fork](https://github.com/data-for-change/anyway/fork) this repository on GitHub 1. `git clone https://github.com/*you*/anyway` diff --git a/anyway/request_params.py b/anyway/request_params.py index d775bb2d..d306a208 100644 --- a/anyway/request_params.py +++ b/anyway/request_params.py @@ -36,6 +36,7 @@ class RequestParams: end_time: datetime.date lang: str news_flash_description: Optional[str] + news_flash_title: Optional[str] = None def __str__(self): return ( @@ -54,6 +55,11 @@ def get_request_params_from_request_values(vals: dict) -> Optional[RequestParams if news_flash_obj is not None and news_flash_obj.description is not None else None ) + news_flash_title = ( + news_flash_obj.title + if news_flash_obj is not None and news_flash_obj.title is not None + else None + ) location = get_location_from_news_flash_or_request_values(news_flash_obj, vals) if location is None: return None @@ -98,6 +104,7 @@ def get_request_params_from_request_values(vals: dict) -> Optional[RequestParams end_time=end_time, lang=lang, news_flash_description=news_flash_description, + news_flash_title=news_flash_title, ) logging.debug(f"Ending get_request_params. params: {request_params}") return request_params diff --git a/anyway/widgets/urban_widgets/vision_zero_10_50_90_widget.py b/anyway/widgets/urban_widgets/vision_zero_10_50_90_widget.py index ad7cda59..69072cd8 100644 --- a/anyway/widgets/urban_widgets/vision_zero_10_50_90_widget.py +++ b/anyway/widgets/urban_widgets/vision_zero_10_50_90_widget.py @@ -24,6 +24,8 @@ def is_included(self) -> bool: for pedestrian_adjective in ["הולך רגל", "הולכת רגל", "הולכי רגל", "הולכות רגל"]: if self.request_params.news_flash_description and pedestrian_adjective in self.request_params.news_flash_description: return True + if self.request_params.news_flash_title and pedestrian_adjective in self.request_params.news_flash_title: + return True return False diff --git a/docs/DOCKER.md b/docs/DOCKER.md index 495b415e..2a89220d 100644 --- a/docs/DOCKER.md +++ b/docs/DOCKER.md @@ -104,13 +104,15 @@ $ sudo docker login docker.pkg.github.com -u USERNAME `sudo docker-compose up --build anyway` This will start the containers. It will take a few minutes until it's done. +Note - At some point you should gett the message "Waiting for postgres server, 40 remaining attempts..." and a "count-down" from 40 will start. This is normal, let it continue running. + Note - If the "anyway" container does not start because of the error: "exec /anyway/docker-entrypoint.sh: no such file or directory", run `dos2unix` on all files mentioned in "important" note under the Windows section and go back to step 7. **8.** **You're all set!** ANYWAY is up and running with the DB data - connect to http://127.0.0.1:8080 Note - you won't see the map since the key works in production. -If you need to see the map for development email us [anyway@anyway.co.il](mailto:anyway@anyway.co.il) to get a developer key. -The developer key need to replace the production key in the file /anyway/blob/dev/templates/index.html where you can find: "https://maps.googleapis.com/maps/api/js?key=AIzaSyDUIWsBLkvIUwzLHMHos9qFebyJ63hEG2M&libraries=places,visualization&language=iw" (google maps url) -So if the developer key is "12345" the new url need to be is: "https://maps.googleapis.com/maps/api/js?key=12345&libraries=places,visualization&language=iw" +You now need to see the map for development, so contact us via email [anyway@anyway.co.il](mailto:anyway@anyway.co.il) to get a developer key. +The developer key needs to replace the production key in the file /anyway/blob/dev/templates/index.html where you can find: "https://maps.googleapis.com/maps/api/js?key=AIzaSyDUIWsBLkvIUwzLHMHos9qFebyJ63hEG2M&libraries=places,visualization&language=iw" (google maps url) +So, for example, if the developer key is "12345" the new url need to be is: "https://maps.googleapis.com/maps/api/js?key=12345&libraries=places,visualization&language=iw" **9.** To stop the containers run: `sudo docker-compose down`