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

T1643 - Letter writing child selection #34

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions my_compassion/static/src/js/my_children.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ const child_images = document.getElementsByClassName("child-image");
const child_name = document.getElementsByClassName("child-name");
const child_local_id = document.getElementsByClassName("child-local_id");

// Change the href of the links to include the child_id
const current_child_id = new URLSearchParams(window.location.search).get(
"child_id"
);
selector = document.querySelector('a[href="/my/letter"]');
selector.href = selector.href + "?child_id=" + current_child_id;
selector = document.querySelector('a[href="/my/children"]');
selector.href = selector.href + "?child_id=" + current_child_id;

function selectChild(selected_child_id, reload) {
// Change url to display selected child
const search_params = new URLSearchParams(window.location.search);
Expand Down
Loading