Skip to content

Commit

Permalink
Merge pull request #2518 from data-for-change/dev
Browse files Browse the repository at this point in the history
merge dev into master
  • Loading branch information
atalyaalon authored Dec 27, 2023
2 parents e016b66 + 0a9beb1 commit 3913462
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
7 changes: 7 additions & 0 deletions anyway/request_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions anyway/widgets/urban_widgets/vision_zero_10_50_90_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
8 changes: 5 additions & 3 deletions docs/DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down

0 comments on commit 3913462

Please sign in to comment.