When user arrives on the Campaign page we need to carry out the following steps on the client side:
# Determine whether this is Wiki-Loves campaign. Initially we can do this by checking for the existence of the country dropdown. **ONLY if it is a Wiki Loves campaign**, complete the following steps (otherwise nothing to do)
# Use internal api/get-campaign-categories call to get all the campaign categories on the client side
# Use the [[ https://www.mediawiki.org/wiki/API:Categorymembers | category members API call ]] to find the direct subcategories each Campaign category (using //cmtype=subcat// parameter)
# For each category in the combined list, take ONLY the text after "[root category name] in " to get the actual country names. If this text is not found, remove the category from the list as it means it is **not** a country subcategory (e.g. [[https://commons.wikimedia.org/wiki/Category:Images_from_Wiki_Loves_Africa_2019|Images Wiki Loves Africa 2019]] has a non country category listed first)
# Combine **all countries** found from each Campaign category into a single **unique ** list of countries
# Sort alphabetically and use to populate the <select> dropdown the top of the page (with "all countries" always added as the first option).
# When user selects a country, update href of "get started" button to include country in a URL parameter e.g. ?country=Nigeria at the end of the URL (this will be used on the participate page to build the subcategory names from each Campaign category, and to store the the "country" of the contribution in the database)