├── src ├── blog │ ├── forms.py │ ├── __init__.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── apps.py │ ├── factories.py │ └── urls.py ├── data │ ├── admin.py │ ├── models.py │ ├── migrations │ │ └── __init__.py │ ├── __init__.py │ ├── apps.py │ ├── urls.py │ ├── sitemaps.py │ └── views.py ├── home │ ├── admin.py │ ├── models.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── templatetags │ │ ├── __init__.py │ │ └── mailing_list.py │ ├── __init__.py │ ├── apps.py │ └── sitemaps.py ├── stats │ ├── tests.py │ ├── api │ │ └── __init__.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0026_delete_aidmatchprojectevent.py │ │ ├── 0003_event_meta.py │ │ ├── 0004_event_source.py │ │ ├── 0008_aidsearchevent_text.py │ │ └── 0030_alter_aidoriginurlclickevent_options.py │ ├── __init__.py │ ├── apps.py │ └── templatetags │ │ └── stats.py ├── analytics │ ├── admin.py │ ├── models.py │ ├── views.py │ ├── migrations │ │ └── __init__.py │ ├── templatetags │ │ └── __init__.py │ ├── __init__.py │ └── apps.py ├── categories │ ├── views.py │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ └── 0005_alter_theme_short_description.py │ ├── apps.py │ └── api │ │ ├── urls.py │ │ └── serializers.py ├── emails │ ├── __init__.py │ ├── models.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ └── apps.py ├── minisites │ ├── admin.py │ ├── models.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── settings │ │ ├── __init__.py │ │ ├── local.py │ │ ├── production.py │ │ └── scalingo.py │ ├── apps.py │ ├── utils.py │ ├── factories.py │ └── __init__.py ├── tests │ └── tmp │ │ └── .gitkeep ├── upload │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── data │ │ │ └── test-image.png │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0002_reupload_files.py │ │ ├── 0003_change_verbose_name.py │ │ └── 0004_alter_uploadimage_uploaded_at.py │ ├── apps.py │ ├── README.md │ ├── urls.py │ ├── admin.py │ ├── models.py │ └── settings.py ├── .locales ├── Aptfile ├── admin_lite │ ├── __init__.py │ ├── models.py │ └── apps.py ├── aids │ ├── api │ │ └── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── test_sitemap.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0057_merge_20190215_1555.py │ │ ├── 0095_merge_20191213_1551.py │ │ ├── 0095_merge_20191213_1603.py │ │ ├── 0097_merge_20191220_1103.py │ │ ├── 0113_merge_20200923_0900.py │ │ ├── 0088_merge_20191121_1137.py │ │ ├── 0111_merge_20200922_1553.py │ │ ├── 0120_merge_20210222_0957.py │ │ ├── 0048_aid__tags_m2m.py │ │ ├── 0049_auto_20181115_1606.py │ │ ├── 0056_auto_20190213_1548.py │ │ ├── 0149_remove_aid_projects.py │ │ ├── 0079_remove_aid_subvention_rate.py │ │ ├── 0070_auto_20191008_1547.py │ │ ├── 0134_aid_import_raw_object.py │ │ ├── 0080_auto_20191104_1028.py │ │ ├── 0035_aid_slug.py │ │ ├── 0086_aid_contact.py │ │ ├── 0018_auto_20180906_1058.py │ │ ├── 0026_aid_application_url.py │ │ ├── 0033_aid_date_updated.py │ │ ├── 0109_auto_20200921_1707.py │ │ ├── 0130_generic_aid_as_boolean.py │ │ ├── 0059_set_import_ids_to_none.py │ │ ├── 0090_auto_20191125_1526.py │ │ ├── 0140_auto_20210625_1453.py │ │ ├── 0005_aid_eligibility.py │ │ ├── 0100_auto_20200203_1433.py │ │ ├── 0119_add_local_caracteristics.py │ │ ├── 0020_auto_20180912_1555.py │ │ ├── 0126_auto_20210413_1100.py │ │ ├── 0029_save_backers.py │ │ ├── 0056_aid_new_backer.py │ │ ├── 0011_auto_20180828_1427.py │ │ ├── 0050_aid_is_imported.py │ │ ├── 0054_auto_20190115_1124.py │ │ ├── 0103_auto_20200302_1043.py │ │ ├── 0171_aid_has_broken_link.py │ │ ├── 0082_aid_subvention_comment.py │ │ ├── 0064_aid_date_published.py │ │ ├── 0065_set_first_publication_date.py │ │ ├── 0096_auto_20191213_1604.py │ │ ├── 0177_alter_aid_loan_amount.py │ │ ├── 0047_auto_20181107_1537.py │ │ ├── 0028_aid_backers.py │ │ ├── 0045_aid_search_vector.py │ │ ├── 0098_auto_20191220_1103.py │ │ ├── 0114_aid_programs.py │ │ ├── 0086_auto_20191119_1517.py │ │ ├── 0154_alter_aid_date_updated.py │ │ ├── 0078_copy_subvention_rates.py │ │ ├── 0117_auto_20201211_1520.py │ │ ├── 0083_auto_20191105_1047.py │ │ ├── 0141_aid_search_vector_unaccented.py │ │ ├── 0115_auto_20201001_1428.py │ │ └── 0131_convert_generic_fk_to_boolean.py │ ├── templatetags │ │ └── __init__.py │ ├── apps.py │ ├── __init__.py │ └── sitemaps.py ├── alerts │ ├── tests │ │ ├── __init__.py │ │ └── emails.csv │ ├── management │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── __init__.py │ ├── apps.py │ ├── admin.py │ └── factories.py ├── core │ ├── tests │ │ ├── __init__.py │ │ └── test_templatetags.py │ ├── settings │ │ └── __init__.py │ ├── templatetags │ │ ├── __init__.py │ │ └── form_utils.py │ ├── constants.py │ ├── README.md │ ├── filters.py │ ├── __init__.py │ ├── api │ │ └── pagination.py │ ├── wsgi_scalingo.py │ ├── forms │ │ └── baseform.py │ ├── apps.py │ ├── wsgi.py │ └── celery.py ├── dataproviders │ ├── views.py │ ├── scrapers │ │ └── __init__.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── data │ │ ├── welcome_europe_programs_mapping.csv │ │ ├── welcome_europe_types_mapping.csv │ │ ├── pays_de_la_loire_types_mapping.csv │ │ ├── ademe_agir_audiences_mapping.csv │ │ └── ile_de_france_audiences_mapping.csv │ ├── apps.py │ ├── __init__.py │ ├── constants.py │ └── factories.py ├── eligibility │ ├── __init__.py │ ├── api │ │ ├── __init__.py │ │ ├── urls.py │ │ └── views.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── tests.py │ ├── apps.py │ └── constants.py ├── exporting │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ └── 0002_reupload_files.py │ ├── README.md │ ├── apps.py │ ├── utils.py │ └── admin.py ├── geofr │ ├── api │ │ ├── __init__.py │ │ └── urls.py │ ├── tests │ │ ├── __init__.py │ │ └── samples │ │ │ ├── sample_city_codes_5.csv │ │ │ ├── sample_city_codes_5.txt │ │ │ ├── sample_city_codes_tiny_invalid.txt │ │ │ └── README.md │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── populate_epcis.py │ │ │ ├── populate_communes.py │ │ │ ├── populate_regions.py │ │ │ ├── populate_countries.py │ │ │ ├── populate_overseas.py │ │ │ ├── populate_scots.py │ │ │ ├── import_mayors.py │ │ │ ├── populate_departments.py │ │ │ ├── populate_pnr.py │ │ │ └── import_emails_of_municipalities.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0002_remove_perimeter_country.py │ │ ├── 0005_remove_perimeter_commune.py │ │ ├── 0003_auto_20180904_1518.py │ │ ├── 0007_perimeter_is_overseas.py │ │ ├── 0008_auto_20180906_1426.py │ │ ├── 0006_auto_20180905_1557.py │ │ ├── 0025_perimeter_manually_created.py │ │ ├── 0013_auto_20180918_1050.py │ │ ├── 0027_update_basins.py │ │ ├── 0029_perimeter_is_visible_to_users.py │ │ ├── 0021_perimeter_contained_in.py │ │ └── 0046_alter_perimeterdata_options.py │ ├── forms │ │ ├── __init__.py │ │ └── fields.py │ ├── apps.py │ ├── __init__.py │ ├── services │ │ └── __init__.py │ ├── tasks.py │ ├── urls.py │ └── resources.py ├── keywords │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── apps.py │ ├── api │ │ └── urls.py │ └── factories.py ├── pages │ ├── tests │ │ ├── __init__.py │ │ └── test_views.py │ ├── migrations │ │ └── __init__.py │ ├── __init__.py │ ├── apps.py │ ├── urls.py │ └── sitemaps.py ├── projects │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── test_models.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0003_auto_20210318_1456.py │ │ ├── 0010_alter_project_due_date.py │ │ ├── 0007_project_due_date.py │ │ ├── 0012_alter_project_options.py │ │ ├── 0004_project_key_words.py │ │ └── 0008_project_organizations.py │ ├── templatetags │ │ ├── __init__.py │ │ └── projects.py │ ├── apps.py │ ├── constants.py │ └── fields.py ├── search │ ├── tests │ │ ├── __init__.py │ │ └── test_templatetags.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0016_merge_20200922_0934.py │ │ ├── 0015_auto_20200921_1715.py │ │ ├── 0014_auto_20200910_1041.py │ │ ├── 0022_searchpage_date_updated.py │ │ ├── 0024_reupload_files.py │ │ ├── 0028_searchpage_show_backers_field.py │ │ ├── 0021_searchpage_show_aid_type_field.py │ │ ├── 0040_searchpage_subdomain_enabled.py │ │ ├── 0036_searchpage_show_text_field.py │ │ ├── 0013_searchpage_show_mobilization_steps_field.py │ │ ├── 0020_searchpage_date_created.py │ │ └── 0005_searchpage_color_4.py │ ├── templatetags │ │ └── __init__.py │ ├── __init__.py │ ├── apps.py │ ├── views.py │ ├── urls.py │ └── factories.py ├── accounts │ ├── tests │ │ ├── __init__.py │ │ └── test_models.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0013_remove_user_watched_tags.py │ │ ├── 0014_rename_date_joined_user_date_created.py │ │ ├── 0011_auto_20210208_1628.py │ │ ├── 0003_user_is_certified.py │ │ ├── 0005_user_ml_consent.py │ │ ├── 0008_auto_20190115_1127.py │ │ ├── 0026_user_invitation_date.py │ │ ├── 0029_alter_user_options.py │ │ ├── 0009_update_emails_to_lowercase.py │ │ ├── 0027_user_join_organization_date.py │ │ └── 0006_user_similar_aids_alert.py │ ├── __init__.py │ └── apps.py ├── backers │ ├── tests │ │ └── __init__.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0014_reupload_medias.py │ │ ├── 0002_auto_20180921_1056.py │ │ ├── 0004_backer_slug.py │ │ ├── 0003_backer_is_corporate.py │ │ ├── 0008_add_description_field.py │ │ ├── 0005_set_backers_slug.py │ │ ├── 0012_edit_description_field.py │ │ ├── 0006_add_slug_help_text.py │ │ └── 0009_edit_slug_field.py │ ├── __init__.py │ ├── apps.py │ ├── api │ │ ├── urls.py │ │ └── serializers.py │ └── urls.py ├── notifications │ ├── __init__.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ └── 0002_alter_notification_message.py │ ├── management │ │ └── commands │ │ │ └── __init__.py │ ├── constants.py │ ├── apps.py │ └── factories.py ├── organizations │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── test_models.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0006_remove_organization_projects.py │ │ ├── 0002_alter_organization_ape_code.py │ │ ├── 0003_alter_organization_siren_code.py │ │ └── 0004_alter_organization_siret_code.py │ ├── management │ │ └── commands │ │ │ └── __init__.py │ ├── apps.py │ └── templatetags │ │ └── organizations.py ├── programs │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0005_remove_program_aids.py │ │ ├── 0003_remove_program_perimeter.py │ │ ├── 0007_reupload_files.py │ │ ├── 0013_alter_programtab_options.py │ │ ├── 0004_auto_20200928_1547.py │ │ └── 0008_program_date_created.py │ ├── apps.py │ ├── __init__.py │ ├── api │ │ ├── urls.py │ │ └── serializers.py │ ├── urls.py │ └── factories.py ├── static │ ├── lib │ │ └── remixicon-2.5.0 │ │ │ └── fonts │ │ │ ├── .keep │ │ │ ├── .keep 3 │ │ │ ├── remixicon.eot │ │ │ ├── remixicon.ttf │ │ │ ├── remixicon.woff │ │ │ └── remixicon.woff2 │ ├── well-known │ │ └── google7cbe5bb6ac545929.html │ ├── img │ │ ├── europe.jpg │ │ ├── portails.jpg │ │ ├── logo_AT_og.png │ │ ├── logo_AT_courbes.png │ │ ├── partners │ │ │ ├── logo-ge.png │ │ │ ├── logo-aesn.png │ │ │ ├── logo-afd.png │ │ │ ├── logo-bdt.png │ │ │ ├── logo-miqcp.png │ │ │ ├── logo-ofb.png │ │ │ ├── logo-seg.png │ │ │ ├── logo-adlrmc.png │ │ │ ├── logo-aesn-small.png │ │ │ ├── logo-afd-small.png │ │ │ ├── logo-bdt-small.png │ │ │ ├── logo-ge-small.png │ │ │ ├── logo-seg-small.png │ │ │ ├── logo-adlrmc-small.png │ │ │ ├── logo-guyane-small.png │ │ │ ├── logo-miqcp-small.png │ │ │ └── logo-agence-rhin-meuse.png │ │ ├── plan-de-relance.jpg │ │ ├── france-nation-verte.jpg │ │ ├── project_illustration.png │ │ └── logo-expertises-territoires.png │ ├── css │ │ └── styles.scss │ ├── favicons │ │ ├── favicon.ico │ │ ├── favicon.png │ │ └── favicon-32x32.png │ ├── fonts │ │ ├── Marianne-Bold.woff │ │ ├── Marianne-Bold.woff2 │ │ ├── Marianne-Light.woff │ │ ├── Marianne-Light.woff2 │ │ ├── Marianne-Regular.woff │ │ ├── Spectral-Regular.woff │ │ ├── Marianne-Regular.woff2 │ │ ├── Spectral-ExtraBold.woff │ │ ├── Spectral-Regular.woff2 │ │ ├── Marianne-Bold_Italic.woff │ │ ├── Marianne-Bold_Italic.woff2 │ │ ├── Marianne-Light_Italic.woff │ │ ├── Spectral-ExtraBold.woff2 │ │ ├── Marianne-Light_Italic.woff2 │ │ ├── Marianne-Regular_Italic.woff │ │ └── Marianne-Regular_Italic.woff2 │ └── js │ │ ├── aids │ │ ├── enable_softmaxlength.js │ │ ├── disable_delete_button.js │ │ ├── configure_preview_modal.js │ │ ├── destinations_autocomplete.js │ │ ├── mobilization_steps_autocomplete.js │ │ ├── sort_by.js │ │ ├── programs_autocomplete.js │ │ ├── aid_types_autocomplete.js │ │ ├── categories_autocomplete.js │ │ └── targeted_audiences_autocomplete.js │ │ ├── enable_rich_text_editor_simple.js │ │ ├── links_on_images.js │ │ ├── responsive_iframe.js │ │ ├── plugins │ │ └── datatables_i18n.js │ │ ├── search │ │ └── enable_softmaxlength.js │ │ ├── enable_rich_text_editor.js │ │ ├── programs │ │ └── tab_url_parameters.js │ │ ├── blog │ │ └── filter_article_by_categories.js │ │ └── url_parameters.js ├── .flake8 ├── templates │ ├── _base_light.html │ ├── minisites │ │ ├── _sticky-btn.html │ │ ├── 400.html │ │ ├── 403.html │ │ └── 404.html │ ├── forms │ │ └── widgets │ │ │ ├── autocomplete_select.html │ │ │ └── multiple_input.html │ ├── admin │ │ ├── search │ │ │ └── searchpagelite │ │ │ │ └── submit_line.html │ │ ├── change_form.html │ │ ├── projects │ │ │ └── change_list_template.html │ │ ├── aids │ │ │ └── aid │ │ │ │ └── submit_line.html │ │ ├── admin_lite │ │ │ └── change_form.html │ │ ├── base_site.html │ │ └── geofr │ │ │ └── perimeter │ │ │ └── submit_line.html │ ├── emails │ │ ├── import_perimeter_success.txt │ │ ├── log_admins.txt │ │ ├── find_broken_links.txt │ │ ├── new_aid_in_favorite_project.txt │ │ ├── leave_organization.txt │ │ ├── _base.html │ │ ├── new_aids_alert_body.txt │ │ ├── reject_invitation.txt │ │ ├── reviewable_aids_alert_body.txt │ │ ├── login_token.txt │ │ ├── reset_password.txt │ │ ├── search_results.txt │ │ ├── contact_form.txt │ │ ├── similar_aids_alert_body.txt │ │ ├── accept_invitation.txt │ │ ├── unread_notifications.txt │ │ └── suggested_aid_denied.txt │ ├── rest_framework │ │ └── api.html │ ├── home │ │ ├── _mailing_list_form.html │ │ └── ml_registration.html │ ├── _form_snippet.html │ ├── _js_catalog.html │ ├── django │ │ └── forms │ │ │ └── widgets │ │ │ ├── input_option.html │ │ │ ├── multiple_input.html │ │ │ └── checkbox_option.html │ ├── 400.html │ ├── robots.txt │ ├── aids │ │ └── _generic_to_local.html │ ├── _anonymous_menu.html │ ├── programs │ │ └── _program_result.html │ ├── 403.html │ └── _form_header.html ├── Procfile ├── pytest.ini ├── .buildpacks ├── scripts │ ├── dataproviders │ │ └── grand_est_download_json.sh │ ├── post_deploy.sh │ ├── start_celery_beat.sh │ ├── start_celery_events.sh │ └── start_web.sh ├── .coveragerc ├── ruff.toml ├── .env.scalingo.example ├── .pre-commit-config.yaml └── manage.py ├── docs └── releases │ ├── latest.md │ ├── 2.2.1.md │ └── 2.3.md └── .gitignore /src/blog/forms.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/data/admin.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/data/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/home/admin.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/home/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/stats/tests.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/analytics/admin.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/analytics/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/analytics/views.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/blog/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/categories/views.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/emails/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/emails/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/minisites/admin.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/minisites/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/tests/tmp/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/upload/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/.locales: -------------------------------------------------------------------------------- 1 | fr_FR 2 | en_US -------------------------------------------------------------------------------- /src/Aptfile: -------------------------------------------------------------------------------- 1 | gettext 2 | sassc -------------------------------------------------------------------------------- /src/admin_lite/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/admin_lite/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/aids/api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/aids/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/alerts/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/blog/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/categories/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/core/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dataproviders/views.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/eligibility/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/emails/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/exporting/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/geofr/api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/geofr/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/home/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/keywords/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pages/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/projects/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/search/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/stats/api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/stats/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/upload/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/accounts/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/aids/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/aids/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/aids/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/alerts/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/alerts/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/backers/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/blog/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/core/settings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/core/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/data/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/eligibility/api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/eligibility/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/emails/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/geofr/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/geofr/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/home/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/home/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/minisites/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/notifications/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/organizations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pages/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/programs/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/projects/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/search/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/stats/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/upload/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/upload/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/accounts/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/accounts/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/analytics/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/analytics/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/backers/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/backers/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/categories/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dataproviders/scrapers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/eligibility/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/exporting/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/keywords/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/minisites/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/minisites/settings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/notifications/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/organizations/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/programs/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/projects/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/projects/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/search/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/aids/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/backers/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dataproviders/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dataproviders/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/geofr/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/notifications/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/organizations/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/static/lib/remixicon-2.5.0/fonts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/upload/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/accounts/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/static/lib/remixicon-2.5.0/fonts/.keep 3: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dataproviders/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/notifications/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/organizations/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/eligibility/tests.py: -------------------------------------------------------------------------------- 1 | # Create your tests here. 2 | -------------------------------------------------------------------------------- /src/stats/__init__.py: -------------------------------------------------------------------------------- 1 | """The simple "stats" page.""" 2 | -------------------------------------------------------------------------------- /src/home/__init__.py: -------------------------------------------------------------------------------- 1 | """Some static views (home, tos, etc.)""" 2 | -------------------------------------------------------------------------------- /src/alerts/__init__.py: -------------------------------------------------------------------------------- 1 | """All code related to email alert management.""" 2 | -------------------------------------------------------------------------------- /src/alerts/tests/emails.csv: -------------------------------------------------------------------------------- 1 | email 2 | coucou@email.com 3 | coucou2@email.com -------------------------------------------------------------------------------- /src/data/__init__.py: -------------------------------------------------------------------------------- 1 | """Simple app to display the API documentation.""" 2 | -------------------------------------------------------------------------------- /src/pages/__init__.py: -------------------------------------------------------------------------------- 1 | """An override of django's flatpage extension.""" 2 | -------------------------------------------------------------------------------- /src/analytics/__init__.py: -------------------------------------------------------------------------------- 1 | """Tools and utilities for Matomo tag inclusion.""" 2 | -------------------------------------------------------------------------------- /src/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | exclude = migrations,settings 3 | max-line-length = 100 4 | -------------------------------------------------------------------------------- /src/backers/__init__.py: -------------------------------------------------------------------------------- 1 | """Model and widget for the aid backers choice field.""" 2 | -------------------------------------------------------------------------------- /src/geofr/tests/samples/sample_city_codes_5.csv: -------------------------------------------------------------------------------- 1 | 91634 2 | 22050 3 | 75056 4 | 97611 5 | 97121 -------------------------------------------------------------------------------- /src/geofr/tests/samples/sample_city_codes_5.txt: -------------------------------------------------------------------------------- 1 | 91634 2 | 22050 3 | 75056 4 | 97611 5 | 97121 -------------------------------------------------------------------------------- /src/search/__init__.py: -------------------------------------------------------------------------------- 1 | """Forms and views for the advanced, 4 steps search feature.""" 2 | -------------------------------------------------------------------------------- /src/core/constants.py: -------------------------------------------------------------------------------- 1 | YES_NO_CHOICES = ( 2 | ("Yes", "Oui"), 3 | ("No", "Non"), 4 | ) 5 | -------------------------------------------------------------------------------- /src/dataproviders/data/welcome_europe_programs_mapping.csv: -------------------------------------------------------------------------------- 1 | Programme Welcome Europe,Programme AT 1 2 | -------------------------------------------------------------------------------- /src/static/well-known/google7cbe5bb6ac545929.html: -------------------------------------------------------------------------------- 1 | google-site-verification: google7cbe5bb6ac545929.html -------------------------------------------------------------------------------- /src/exporting/README.md: -------------------------------------------------------------------------------- 1 | # App: exporting 2 | 3 | This app manages data export triggered asynchronously. 4 | -------------------------------------------------------------------------------- /src/geofr/forms/__init__.py: -------------------------------------------------------------------------------- 1 | from geofr.forms.forms import PerimeterUploadForm, PerimeterCombineForm # noqa 2 | -------------------------------------------------------------------------------- /src/geofr/tests/samples/sample_city_codes_tiny_invalid.txt: -------------------------------------------------------------------------------- 1 | 91634 2 | 22050 3 | 75056 4 | 97611 5 | 97121 6 | 14666 -------------------------------------------------------------------------------- /src/static/img/europe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/europe.jpg -------------------------------------------------------------------------------- /src/minisites/settings/local.py: -------------------------------------------------------------------------------- 1 | from core.settings.local import * # noqa 2 | 3 | ROOT_URLCONF = "minisites.urls" 4 | -------------------------------------------------------------------------------- /src/static/css/styles.scss: -------------------------------------------------------------------------------- 1 | @import 'globals'; 2 | @import 'custom'; 3 | @import 'select2'; 4 | @import 'select2-dsfr'; -------------------------------------------------------------------------------- /src/static/img/portails.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/portails.jpg -------------------------------------------------------------------------------- /src/aids/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AidsConfig(AppConfig): 5 | name = "aids" 6 | -------------------------------------------------------------------------------- /src/blog/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BlogConfig(AppConfig): 5 | name = "blog" 6 | -------------------------------------------------------------------------------- /src/data/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DataConfig(AppConfig): 5 | name = "data" 6 | -------------------------------------------------------------------------------- /src/geofr/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class GeofrConfig(AppConfig): 5 | name = "geofr" 6 | -------------------------------------------------------------------------------- /src/home/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class HomeConfig(AppConfig): 5 | name = "home" 6 | -------------------------------------------------------------------------------- /src/static/img/logo_AT_og.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/logo_AT_og.png -------------------------------------------------------------------------------- /src/stats/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class StatsConfig(AppConfig): 5 | name = "stats" 6 | -------------------------------------------------------------------------------- /src/templates/_base_light.html: -------------------------------------------------------------------------------- 1 | {% extends '_base.html' %} 2 | 3 | {% block body-class %}light-background{% endblock %} 4 | -------------------------------------------------------------------------------- /src/alerts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AlertsConfig(AppConfig): 5 | name = "alerts" 6 | -------------------------------------------------------------------------------- /src/backers/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BackersConfig(AppConfig): 5 | name = "backers" 6 | -------------------------------------------------------------------------------- /src/core/README.md: -------------------------------------------------------------------------------- 1 | # App: core 2 | 3 | This is the main settings app. 4 | 5 | Contains settings, base urls.py file, etc. 6 | -------------------------------------------------------------------------------- /src/minisites/settings/production.py: -------------------------------------------------------------------------------- 1 | from core.settings.production import * # noqa 2 | 3 | ROOT_URLCONF = "minisites.urls" 4 | -------------------------------------------------------------------------------- /src/minisites/settings/scalingo.py: -------------------------------------------------------------------------------- 1 | from core.settings.scalingo import * # noqa 2 | 3 | ROOT_URLCONF = "minisites.urls" 4 | -------------------------------------------------------------------------------- /src/pages/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class FlatpagesConfig(AppConfig): 5 | name = "pages" 6 | -------------------------------------------------------------------------------- /src/search/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class SearchConfig(AppConfig): 5 | name = "search" 6 | -------------------------------------------------------------------------------- /src/static/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/favicons/favicon.ico -------------------------------------------------------------------------------- /src/static/favicons/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/favicons/favicon.png -------------------------------------------------------------------------------- /src/programs/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ProgramsConfig(AppConfig): 5 | name = "programs" 6 | -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Bold.woff -------------------------------------------------------------------------------- /src/static/img/logo_AT_courbes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/logo_AT_courbes.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-ge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-ge.png -------------------------------------------------------------------------------- /src/static/img/plan-de-relance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/plan-de-relance.jpg -------------------------------------------------------------------------------- /src/accounts/__init__.py: -------------------------------------------------------------------------------- 1 | """User management app. 2 | 3 | Contains the user account model and user management related views. 4 | """ 5 | -------------------------------------------------------------------------------- /src/analytics/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AnalyticsConfig(AppConfig): 5 | name = "analytics" 6 | -------------------------------------------------------------------------------- /src/categories/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CategoriesConfig(AppConfig): 5 | name = "categories" 6 | -------------------------------------------------------------------------------- /src/minisites/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MinisitesConfig(AppConfig): 5 | name = "minisites" 6 | -------------------------------------------------------------------------------- /src/static/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Bold.woff2 -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Light.woff -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Light.woff2 -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Regular.woff -------------------------------------------------------------------------------- /src/static/fonts/Spectral-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Spectral-Regular.woff -------------------------------------------------------------------------------- /src/static/img/france-nation-verte.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/france-nation-verte.jpg -------------------------------------------------------------------------------- /src/static/img/partners/logo-aesn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-aesn.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-afd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-afd.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-bdt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-bdt.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-miqcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-miqcp.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-ofb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-ofb.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-seg.png -------------------------------------------------------------------------------- /src/upload/tests/data/test-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/upload/tests/data/test-image.png -------------------------------------------------------------------------------- /src/eligibility/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class EligibilityConfig(AppConfig): 5 | name = "eligibility" 6 | -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Regular.woff2 -------------------------------------------------------------------------------- /src/static/fonts/Spectral-ExtraBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Spectral-ExtraBold.woff -------------------------------------------------------------------------------- /src/static/fonts/Spectral-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Spectral-Regular.woff2 -------------------------------------------------------------------------------- /src/static/img/partners/logo-adlrmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-adlrmc.png -------------------------------------------------------------------------------- /src/static/img/project_illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/project_illustration.png -------------------------------------------------------------------------------- /src/templates/minisites/_sticky-btn.html: -------------------------------------------------------------------------------- 1 | Publier des aides -------------------------------------------------------------------------------- /src/dataproviders/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DataprovidersConfig(AppConfig): 5 | name = "dataproviders" 6 | -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Bold_Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Bold_Italic.woff -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Bold_Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Bold_Italic.woff2 -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Light_Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Light_Italic.woff -------------------------------------------------------------------------------- /src/static/fonts/Spectral-ExtraBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Spectral-ExtraBold.woff2 -------------------------------------------------------------------------------- /src/static/img/partners/logo-aesn-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-aesn-small.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-afd-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-afd-small.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-bdt-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-bdt-small.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-ge-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-ge-small.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-seg-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-seg-small.png -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Light_Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Light_Italic.woff2 -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Regular_Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Regular_Italic.woff -------------------------------------------------------------------------------- /src/static/img/partners/logo-adlrmc-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-adlrmc-small.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-guyane-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-guyane-small.png -------------------------------------------------------------------------------- /src/static/img/partners/logo-miqcp-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-miqcp-small.png -------------------------------------------------------------------------------- /src/templates/forms/widgets/autocomplete_select.html: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /src/static/fonts/Marianne-Regular_Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/fonts/Marianne-Regular_Italic.woff2 -------------------------------------------------------------------------------- /src/static/img/logo-expertises-territoires.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/logo-expertises-territoires.png -------------------------------------------------------------------------------- /src/upload/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UploadConfig(AppConfig): 5 | name = "upload" 6 | verbose_name = "upload" 7 | -------------------------------------------------------------------------------- /src/emails/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class EmailsConfig(AppConfig): 5 | name = "emails" 6 | verbose_name = "Courriels" 7 | -------------------------------------------------------------------------------- /src/static/img/partners/logo-agence-rhin-meuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/img/partners/logo-agence-rhin-meuse.png -------------------------------------------------------------------------------- /src/static/lib/remixicon-2.5.0/fonts/remixicon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/lib/remixicon-2.5.0/fonts/remixicon.eot -------------------------------------------------------------------------------- /src/static/lib/remixicon-2.5.0/fonts/remixicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/lib/remixicon-2.5.0/fonts/remixicon.ttf -------------------------------------------------------------------------------- /src/projects/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ProjectsConfig(AppConfig): 5 | name = "projects" 6 | verbose_name = "Projets" 7 | -------------------------------------------------------------------------------- /src/static/lib/remixicon-2.5.0/fonts/remixicon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/lib/remixicon-2.5.0/fonts/remixicon.woff -------------------------------------------------------------------------------- /src/static/lib/remixicon-2.5.0/fonts/remixicon.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MTES-MCT/aides-territoires/HEAD/src/static/lib/remixicon-2.5.0/fonts/remixicon.woff2 -------------------------------------------------------------------------------- /src/upload/README.md: -------------------------------------------------------------------------------- 1 | # App: upload 2 | 3 | This app manages file upload. 4 | 5 | We handle here the file that the admin person upload through the rich text editor. 6 | -------------------------------------------------------------------------------- /src/exporting/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ExportingConfig(AppConfig): 5 | name = "exporting" 6 | verbose_name = "export de données" 7 | -------------------------------------------------------------------------------- /src/Procfile: -------------------------------------------------------------------------------- 1 | web: bash scripts/start_web.sh 2 | postdeploy: bash scripts/post_deploy.sh 3 | events: bash scripts/start_celery_events.sh 4 | beat: bash scripts/start_celery_beat.sh 5 | -------------------------------------------------------------------------------- /src/data/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from data.views import DataDocView 4 | 5 | urlpatterns = [ 6 | path("", DataDocView.as_view(), name="data_doc"), 7 | ] 8 | -------------------------------------------------------------------------------- /src/geofr/__init__.py: -------------------------------------------------------------------------------- 1 | """Perimeter definition and management. 2 | 3 | Also contains the tasks to update the different perimeters (regions, 4 | departments, cities, etc.) 5 | """ 6 | -------------------------------------------------------------------------------- /docs/releases/latest.md: -------------------------------------------------------------------------------- 1 | # Aides Territoires >= 3.0 2 | 3 | Release documentation is now made automatically in the [releases page](https://github.com/MTES-MCT/aides-territoires/releases) -------------------------------------------------------------------------------- /src/dataproviders/__init__.py: -------------------------------------------------------------------------------- 1 | """Contains all the data management tools. 2 | 3 | - web scraping 4 | - content cleaning 5 | - data fetching from third party apis 6 | - etc. 7 | """ 8 | -------------------------------------------------------------------------------- /src/notifications/constants.py: -------------------------------------------------------------------------------- 1 | NOTIFICATION_SETTINGS_FREQUENCIES_LIST = [ 2 | ("daily", "Chaque jour"), 3 | ("weekly", "Chaque semaine"), 4 | ("never", "Jamais"), 5 | ] 6 | -------------------------------------------------------------------------------- /src/geofr/services/__init__.py: -------------------------------------------------------------------------------- 1 | """Perimeter definition and management. 2 | 3 | Also contains the tasks to update the different perimeters (regions, 4 | departments, cities, etc.) 5 | """ 6 | -------------------------------------------------------------------------------- /src/keywords/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class KeywordsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "keywords" 7 | -------------------------------------------------------------------------------- /src/pages/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from pages.views import PageView 3 | 4 | 5 | urlpatterns = [ 6 | path("", PageView.as_view(), name="page_view"), 7 | ] 8 | -------------------------------------------------------------------------------- /src/programs/__init__.py: -------------------------------------------------------------------------------- 1 | """Handles the "aid program" feature. 2 | 3 | This is an embryo of features that was never reviewed, hence never finished. 4 | Could probably be deleted. 5 | """ 6 | -------------------------------------------------------------------------------- /src/admin_lite/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AdminLiteConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "admin_lite" 7 | -------------------------------------------------------------------------------- /src/core/filters.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.filters import AllValuesFieldListFilter 2 | 3 | 4 | class DropdownFilter(AllValuesFieldListFilter): 5 | template = "admin/dropdown_filter.html" 6 | -------------------------------------------------------------------------------- /src/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | DJANGO_SETTINGS_MODULE = core.settings.test 3 | python_files = test_* 4 | filterwarnings = 5 | ignore:SelectableGroups dict interface is deprecated:DeprecationWarning 6 | -------------------------------------------------------------------------------- /src/templates/admin/search/searchpagelite/submit_line.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /src/accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | name = "accounts" 6 | 7 | def ready(self): 8 | import accounts.signals # noqa 9 | -------------------------------------------------------------------------------- /src/minisites/utils.py: -------------------------------------------------------------------------------- 1 | from core.utils import RedirectAidDetailView as BaseRedirectAidDetailView 2 | 3 | 4 | class RedirectAidDetailView(BaseRedirectAidDetailView): 5 | redirect_url = "/{slug}/" 6 | -------------------------------------------------------------------------------- /src/notifications/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class NotificationsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "notifications" 7 | -------------------------------------------------------------------------------- /src/organizations/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class OrganizationsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "organizations" 7 | -------------------------------------------------------------------------------- /src/templates/emails/import_perimeter_success.txt: -------------------------------------------------------------------------------- 1 | Bonjour {{ user_name }}, 2 | 3 | Votre périmètre {{ perimeter_name }} a été défini avec succès. 4 | 5 | 6 | Cordialement, 7 | L’équipe d’Aides-territoires. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | node_modules 3 | yarn-error.log 4 | 5 | /public/ 6 | 7 | site.retry 8 | .idea/ 9 | aides.iml 10 | .pytest_cache/ 11 | 12 | AT_svg/ 13 | 14 | src/tests/tmp 15 | 16 | .DS_Store -------------------------------------------------------------------------------- /src/core/__init__.py: -------------------------------------------------------------------------------- 1 | # This will make sure the app is always imported when 2 | # Django starts so that shared_task will use this app. 3 | from .celery import app as celery_app 4 | 5 | __all__ = ("celery_app",) 6 | -------------------------------------------------------------------------------- /src/dataproviders/data/welcome_europe_types_mapping.csv: -------------------------------------------------------------------------------- 1 | Types Welcome Europe,Types AT 1 2 | Appel à propositions,Subvention 3 | Appel à propositions ,Subvention 4 | Programme de prix,Subvention 5 | Prix,Subvention 6 | -------------------------------------------------------------------------------- /src/static/js/aids/enable_softmaxlength.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | 4 | $(document).ready(function () { 5 | $('form #id_name').softmaxlength(); 6 | }); 7 | }($ || django.jQuery)); 8 | -------------------------------------------------------------------------------- /src/aids/__init__.py: -------------------------------------------------------------------------------- 1 | """One of the main project apps. Aid management. 2 | 3 | Contains the main data model `Aid`, all forms and views for aid edition. 4 | Also contains the views for the main aid search page. 5 | """ 6 | -------------------------------------------------------------------------------- /src/geofr/tests/samples/README.md: -------------------------------------------------------------------------------- 1 | Sample files for PerimeterUpload function. 2 | 3 | The "invalid" files adds one additional invalid commune code ("74666") to the 4 | versions with 5 ("tiny") and all ("huge") city codes. -------------------------------------------------------------------------------- /src/.buildpacks: -------------------------------------------------------------------------------- 1 | https://github.com/Scalingo/apt-buildpack.git 2 | https://github.com/Scalingo/nodejs-buildpack.git 3 | https://github.com/Scalingo/python-buildpack.git 4 | https://github.com/Scalingo/locale-buildpack.git 5 | -------------------------------------------------------------------------------- /src/projects/constants.py: -------------------------------------------------------------------------------- 1 | EXPORT_FORMAT_CHOICES = [ 2 | ("csv", "Fichier CSV"), 3 | ("xlsx", "Tableur Excel"), 4 | ("pdf", "Document PDF"), 5 | ] 6 | 7 | EXPORT_FORMAT_KEYS = [i[0] for i in EXPORT_FORMAT_CHOICES] 8 | -------------------------------------------------------------------------------- /src/templates/emails/log_admins.txt: -------------------------------------------------------------------------------- 1 | Bonjour, 2 | 3 | Un événement requiert l’attention de l’équipe : 4 | 5 | {{ log_message }} 6 | 7 | {{ base_url }}{{ url }} 8 | 9 | Cordialement, 10 | Le serveur {{ base_url }} 11 | -------------------------------------------------------------------------------- /src/core/api/pagination.py: -------------------------------------------------------------------------------- 1 | from rest_framework.pagination import PageNumberPagination 2 | 3 | 4 | class ApiPagination(PageNumberPagination): 5 | page_size = 50 6 | page_size_query_param = "size" 7 | max_page_size = 1000 8 | -------------------------------------------------------------------------------- /src/search/views.py: -------------------------------------------------------------------------------- 1 | class SearchMixin: 2 | def get_context_data(self, **kwargs): 3 | context = super().get_context_data(**kwargs) 4 | context["querystring"] = self.request.GET.urlencode() 5 | return context 6 | -------------------------------------------------------------------------------- /src/static/js/enable_rich_text_editor_simple.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | $(document).ready(function () { 4 | $('textarea.textarea-wysiwyg').trumbowyg(trumbowygConfig); 5 | }); 6 | }($ || django.jQuery)); 7 | -------------------------------------------------------------------------------- /src/static/js/links_on_images.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | // We don't want the visual "after effect" on images links. 3 | let linksForImages = $("a:has(img)") 4 | linksForImages.addClass('at-link-blank__none') 5 | }); 6 | -------------------------------------------------------------------------------- /src/templates/emails/find_broken_links.txt: -------------------------------------------------------------------------------- 1 | Voici la liste des aides dont au moins l'un des liens renvoie vers une 404 : 2 | {% for aid in aids_list %} 3 | - {{ aid.name|safe }} 4 | https://{{ domain }}{{ aid.get_admin_url }} 5 | {% endfor %} 6 | -------------------------------------------------------------------------------- /src/templates/rest_framework/api.html: -------------------------------------------------------------------------------- 1 | {% extends "rest_framework/base.html" %} 2 | {% load static %} 3 | 4 | {% block style %} 5 | {{ block.super }} 6 | 7 | {% endblock %} -------------------------------------------------------------------------------- /src/templates/admin/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/change_form.html' %} 2 | {% load static %} 3 | 4 | {% block admin_change_form_document_ready %} 5 | {{ block.super }} 6 | 7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /src/backers/api/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework import routers 2 | 3 | from backers.api.views import BackerViewSet 4 | 5 | 6 | router = routers.SimpleRouter() 7 | router.register("", BackerViewSet, basename="backers") 8 | 9 | 10 | urlpatterns = router.urls 11 | -------------------------------------------------------------------------------- /src/geofr/tasks.py: -------------------------------------------------------------------------------- 1 | from core.celery import app 2 | 3 | from django.core import management 4 | 5 | 6 | @app.task 7 | def count_by_department(): 8 | """Count backers and programs by department.""" 9 | management.call_command("count_by_department") 10 | -------------------------------------------------------------------------------- /src/categories/api/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework import routers 2 | 3 | from categories.api.views import ThemeViewSet 4 | 5 | 6 | router = routers.SimpleRouter() 7 | router.register("", ThemeViewSet, basename="themes") 8 | 9 | 10 | urlpatterns = router.urls 11 | -------------------------------------------------------------------------------- /src/programs/api/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework import routers 2 | 3 | from programs.api.views import ProgramViewSet 4 | 5 | 6 | router = routers.SimpleRouter() 7 | router.register("", ProgramViewSet, basename="programs") 8 | 9 | 10 | urlpatterns = router.urls 11 | -------------------------------------------------------------------------------- /src/templates/minisites/400.html: -------------------------------------------------------------------------------- 1 | {% extends '400.html' %} 2 | 3 | {% block header %}{% endblock %} 4 | 5 | {% block footer %}{% endblock %} 6 | 7 | {% block extra_css %} 8 | {{ block.super }} 9 | {% include 'minisites/_css.html' %} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /src/templates/minisites/403.html: -------------------------------------------------------------------------------- 1 | {% extends '403.html' %} 2 | 3 | {% block header %}{% endblock %} 4 | 5 | {% block footer %}{% endblock %} 6 | 7 | {% block extra_css %} 8 | {{ block.super }} 9 | {% include 'minisites/_css.html' %} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /src/templates/minisites/404.html: -------------------------------------------------------------------------------- 1 | {% extends '404.html' %} 2 | 3 | {% block header %}{% endblock %} 4 | 5 | {% block footer %}{% endblock %} 6 | 7 | {% block extra_css %} 8 | {{ block.super }} 9 | {% include 'minisites/_css.html' %} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /src/pages/sitemaps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.sitemaps import Sitemap 2 | 3 | from pages.models import Page 4 | 5 | 6 | class PageSitemap(Sitemap): 7 | def items(self): 8 | """Return the list of all live aids.""" 9 | 10 | return Page.objects.all() 11 | -------------------------------------------------------------------------------- /src/upload/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from django.views.decorators.csrf import csrf_exempt 3 | 4 | from upload.views import UploadImageView 5 | 6 | 7 | urlpatterns = [ 8 | path("", csrf_exempt(UploadImageView.as_view()), name="upload_image"), 9 | ] 10 | -------------------------------------------------------------------------------- /src/keywords/api/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework import routers 2 | 3 | from keywords.api.views import SynonymListViewSet 4 | 5 | 6 | router = routers.SimpleRouter() 7 | router.register("", SynonymListViewSet, basename="synonymLists") 8 | 9 | 10 | urlpatterns = router.urls 11 | -------------------------------------------------------------------------------- /src/static/js/responsive_iframe.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | // Making the iframe responsive if not already present 3 | if (!$("iframe").parents('.at-responsive-video').length) { 4 | $("iframe").wrap("
"); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /src/projects/fields.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | 4 | class ProjectMultipleChoiceField(forms.ModelMultipleChoiceField): 5 | """Custom field to select projects.""" 6 | 7 | def label_from_instance(self, obj): 8 | return "{} : {}".format(obj.name.upper(), obj.description) 9 | -------------------------------------------------------------------------------- /src/scripts/dataproviders/grand_est_download_json.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -f .env.local ]; then 4 | export $(echo $(cat .env.local | sed 's/#.*//g'| xargs) | envsubst) 5 | fi 6 | 7 | echo "Downloading file from $GRAND_EST_FILE_PATH" 8 | wget --inet4-only -P /tmp/ $GRAND_EST_FILE_PATH 9 | -------------------------------------------------------------------------------- /src/eligibility/api/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework import routers 2 | 3 | from eligibility.api.views import EligibilityTestViewSet 4 | 5 | 6 | router = routers.SimpleRouter() 7 | router.register("", EligibilityTestViewSet, basename="eligibility") 8 | 9 | 10 | urlpatterns = router.urls 11 | -------------------------------------------------------------------------------- /src/programs/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from programs.views import ProgramList, ProgramDetail 4 | 5 | 6 | urlpatterns = [ 7 | path("", ProgramList.as_view(), name="program_list"), 8 | path("/", ProgramDetail.as_view(), name="program_detail"), 9 | ] 10 | -------------------------------------------------------------------------------- /src/backers/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from backers.views import BackerDetailView 3 | 4 | 5 | urlpatterns = [ 6 | path("/", BackerDetailView.as_view(), name="backer_detail_view"), 7 | path("-/", BackerDetailView.as_view(), name="backer_detail_view"), 8 | ] 9 | -------------------------------------------------------------------------------- /docs/releases/2.2.1.md: -------------------------------------------------------------------------------- 1 | # Aides Territoire 2.2.1 2 | 3 | ## Bugs 4 | 5 | - correction du lien Aides-Territoires dans le top-footer des pages personnalisées. #326 6 | - correction d'un bug lié à l'url des logos programmes sur les pages personnalisées. #329 7 | - révision du design des pages programmes. #326 8 | -------------------------------------------------------------------------------- /src/upload/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from upload.models import UploadImage 4 | 5 | 6 | @admin.register(UploadImage) 7 | class UploadImageAdmin(admin.ModelAdmin): 8 | list_display = ["id", "image", "description", "uploaded_at"] 9 | date_hierarchy = "uploaded_at" 10 | -------------------------------------------------------------------------------- /src/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | omit = 3 | */virtualenvs/* 4 | */tests/* 5 | */apps.py 6 | */migrations/* 7 | *manage.py 8 | *__init__.py 9 | */settings/* 10 | */factories.py 11 | *asgi* 12 | *wsgi* 13 | */admin.py 14 | */tasks.py 15 | */urls.py 16 | core/admin_* 17 | -------------------------------------------------------------------------------- /src/templates/emails/new_aid_in_favorite_project.txt: -------------------------------------------------------------------------------- 1 | Bonjour {{ user_name }}, 2 | 3 | {{ project_author_name }} a affilié une nouvelle aide, "{{ aid_name }}", à son projet {{ project_name }}. 4 | 5 | Consultez-le dès maintenant ! {{ full_project_url }} 6 | 7 | À très vite ! 8 | 9 | L’équipe d’Aides-territoires 10 | -------------------------------------------------------------------------------- /src/core/wsgi_scalingo.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for main site on scalingo. 3 | """ 4 | 5 | import os 6 | 7 | from django.core.wsgi import get_wsgi_application 8 | from dj_static import Cling 9 | 10 | 11 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings.scalingo") 12 | 13 | application = Cling(get_wsgi_application()) 14 | -------------------------------------------------------------------------------- /src/data/sitemaps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.sitemaps import Sitemap 2 | from django.urls import reverse 3 | 4 | 5 | class DataSitemap(Sitemap): 6 | """Add the "Données et API" page to the sitemap.""" 7 | 8 | def items(self): 9 | return ["data_doc"] 10 | 11 | def location(self, item): 12 | return reverse(item) 13 | -------------------------------------------------------------------------------- /src/templates/admin/projects/change_list_template.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_list.html" %} 2 | 3 | {% block object-tools-items %} 4 |
  • 5 | 6 | Importer des projets subventionnés 7 | 8 |
  • 9 | {{ block.super }} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /src/templates/emails/leave_organization.txt: -------------------------------------------------------------------------------- 1 | Bonjour {{ former_collaborator }}, 2 | 3 | {{ user_name }} a quitté votre structure {{ organization_name }} et n’a donc plus accès aux projets et aux aides de {{ organization_name }}. 4 | 5 | Cordialement, 6 | L’équipe d’Aides-territoires. 7 | 8 | Nous restons joignables sur aides-territoires@beta.gouv.fr -------------------------------------------------------------------------------- /src/exporting/utils.py: -------------------------------------------------------------------------------- 1 | from django.urls import reverse 2 | from django.utils.safestring import mark_safe 3 | 4 | 5 | def get_admin_export_message(): 6 | url = reverse("admin:exporting_dataexport_changelist") 7 | msg = f'Les données exportées seront disponibles ici : {url}' 8 | return mark_safe(msg) # nosec B308 B703 9 | -------------------------------------------------------------------------------- /src/pages/tests/test_views.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from django.urls import reverse 4 | 5 | pytestmark = pytest.mark.django_db 6 | 7 | 8 | def test_open_redirects_are_forbidden(client): 9 | base_url = reverse("page_view", args=["https://beta.gouv.fr"]) 10 | res = client.get(base_url) 11 | 12 | assert res.status_code == 403 13 | -------------------------------------------------------------------------------- /src/programs/api/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | 3 | from programs.models import Program 4 | 5 | 6 | class ProgramSerializer(serializers.ModelSerializer): 7 | 8 | perimeter = serializers.StringRelatedField() 9 | 10 | class Meta: 11 | model = Program 12 | fields = ("id", "name", "slug", "perimeter") 13 | -------------------------------------------------------------------------------- /src/aids/migrations/0057_merge_20190215_1555.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.5 on 2019-02-15 14:55 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0056_auto_20190213_1548"), 10 | ("aids", "0056_aid_new_backer"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/core/forms/baseform.py: -------------------------------------------------------------------------------- 1 | from dsfr.forms import DsfrBaseForm 2 | 3 | 4 | class AidesTerrBaseForm(DsfrBaseForm): 5 | # Subclassing the Dsfr base form to set autofocus on the first error found when applicable 6 | 7 | def __init__(self, *args, **kwargs): 8 | super().__init__(*args, **kwargs) 9 | self.set_autofocus_on_first_error() 10 | -------------------------------------------------------------------------------- /src/templates/emails/_base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {% block email_title %}{% endblock %} 7 | 8 | 9 | {% block content %}{% endblock %} 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/templates/emails/new_aids_alert_body.txt: -------------------------------------------------------------------------------- 1 | {% regroup new_aids by author as authors %} 2 | 3 | Voici la liste des aides créées lors des dernières 24h : 4 | {% for author, aids in authors %} 5 | * {{ author }} 6 | {% for aid in aids %} 7 | - {{ aid.name|safe }} 8 | https://{{ domain }}{{ aid.get_admin_url }} 9 | {% endfor %} 10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /src/templates/emails/reject_invitation.txt: -------------------------------------------------------------------------------- 1 | Bonjour {{ invitation_author }}, 2 | 3 | {{ invited_name }} a décliné votre invitation et ne rejoint donc pas votre structure. 4 | 5 | Si vous pensez qu’il s’agit d’une erreur, nous vous invitons à contacter directement cette personne, avant de recommencer l’opération. 6 | 7 | Cordialement, 8 | L’équipe d’Aides-territoires. -------------------------------------------------------------------------------- /src/aids/migrations/0095_merge_20191213_1551.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.7 on 2019-12-13 14:51 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0094_auto_20191209_1121"), 10 | ("aids", "0094_auto_20191212_1010"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/aids/migrations/0095_merge_20191213_1603.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.7 on 2019-12-13 15:03 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0094_auto_20191212_1010"), 10 | ("aids", "0094_auto_20191209_1121"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/aids/migrations/0097_merge_20191220_1103.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2019-12-20 10:03 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0095_merge_20191213_1551"), 10 | ("aids", "0096_auto_20191213_1604"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/aids/migrations/0113_merge_20200923_0900.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.16 on 2020-09-23 07:00 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0112_auto_20200922_1602"), 10 | ("aids", "0111_merge_20200922_1553"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/templates/emails/reviewable_aids_alert_body.txt: -------------------------------------------------------------------------------- 1 | {% regroup reviewable_aids by author as authors %} 2 | 3 | Voici la liste des aides en attente de revue: 4 | {% for author, aids in authors %} 5 | * {{ author }} 6 | {% for aid in aids %} 7 | - {{ aid.name|safe }} 8 | https://{{ domain }}{{ aid.get_admin_url }} 9 | {% endfor %} 10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /src/aids/migrations/0088_merge_20191121_1137.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.7 on 2019-11-21 10:37 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0087_fill_new_contact_field"), 10 | ("aids", "0086_auto_20191119_1517"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/aids/migrations/0111_merge_20200922_1553.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.16 on 2020-09-22 13:53 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0109_aid_in_france_relance"), 10 | ("aids", "0110_auto_20200921_1715"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/aids/migrations/0120_merge_20210222_0957.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.6 on 2021-02-22 08:57 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0118_auto_20210216_1000"), 10 | ("aids", "0119_add_local_caracteristics"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/aids/sitemaps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.sitemaps import Sitemap 2 | 3 | from aids.models import Aid 4 | 5 | 6 | class AidSitemap(Sitemap): 7 | def items(self): 8 | """Return the list of all live aids.""" 9 | 10 | return Aid.objects.live().order_by("-date_published") 11 | 12 | def lastmod(self, item): 13 | return item.date_updated 14 | -------------------------------------------------------------------------------- /src/core/templatetags/form_utils.py: -------------------------------------------------------------------------------- 1 | """Form template helpers.""" 2 | 3 | from django import template 4 | from django.forms import CheckboxInput 5 | 6 | register = template.Library() 7 | 8 | 9 | @register.filter 10 | def is_checkbox(field): 11 | """ "Is the given field a checkbox input?.""" 12 | 13 | return isinstance(field.field.widget, CheckboxInput) 14 | -------------------------------------------------------------------------------- /src/scripts/post_deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used by scalingo each time the application 4 | # is deployed. 5 | # For review apps, if a first-deploy hook is defined, then 6 | # that first deploy hook will override this post deploy hook. 7 | 8 | echo "Entering post deploy hook" 9 | python manage.py migrate 10 | echo "Completed post deploy hook" 11 | -------------------------------------------------------------------------------- /src/search/migrations/0016_merge_20200922_0934.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.16 on 2020-09-22 07:34 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("search", "0015_auto_20200921_1219"), 10 | ("search", "0015_auto_20200921_1715"), 11 | ] 12 | 13 | operations = [] 14 | -------------------------------------------------------------------------------- /src/static/js/plugins/datatables_i18n.js: -------------------------------------------------------------------------------- 1 | let datatables_fr_strings = { 2 | search: "Filtrer :", 3 | zeroRecords: "Aucun résultat trouvé", 4 | lengthMenu: "Afficher _MENU_ éléments", 5 | paginate: { 6 | first: "Premier", 7 | previous: "Précédent", 8 | next: "Suivant", 9 | last: "Dernier" 10 | }, 11 | 12 | } -------------------------------------------------------------------------------- /src/static/js/search/enable_softmaxlength.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | 4 | $(document).ready(function () { 5 | $('form #id_title').softmaxlength(); 6 | $('form #id_slug').softmaxlength(); 7 | $('form #id_meta_title').softmaxlength(); 8 | $('form #id_meta_description').softmaxlength(); 9 | }); 10 | }($ || django.jQuery)); 11 | -------------------------------------------------------------------------------- /src/templates/emails/login_token.txt: -------------------------------------------------------------------------------- 1 | Bonjour {{ user_name }}, 2 | 3 | Vous avez demandé à vous connecter sur le site Aides-territoires. 4 | 5 | Pour ce faire, il vous suffit de cliquer sur le lien suivant : 6 | 7 | {{ full_login_url }} 8 | 9 | Si vous n’êtes pas à l’initiative de cette demande, vous n’avez rien à faire. 10 | 11 | Cordialement, 12 | L’équipe d’Aides-territoires. -------------------------------------------------------------------------------- /src/blog/factories.py: -------------------------------------------------------------------------------- 1 | import factory 2 | from factory.django import DjangoModelFactory 3 | 4 | 5 | from blog.models import BlogPost 6 | 7 | 8 | class BlogPostFactory(DjangoModelFactory): 9 | """Factory for blog post.""" 10 | 11 | class Meta: 12 | model = BlogPost 13 | 14 | title = factory.Faker("company") 15 | text = factory.Faker("text", locale="fr_FR") 16 | -------------------------------------------------------------------------------- /src/minisites/factories.py: -------------------------------------------------------------------------------- 1 | import factory 2 | 3 | from search.factories import SearchPageFactory 4 | 5 | 6 | class MinisiteFactory(SearchPageFactory): 7 | 8 | color_1 = "#cccccc" 9 | color_2 = "#cccccc" 10 | color_3 = "#cccccc" 11 | color_4 = "#cccccc" 12 | color_5 = "#cccccc" 13 | logo = factory.Faker("file_path") 14 | logo_link = factory.Faker("url") 15 | -------------------------------------------------------------------------------- /src/home/sitemaps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.sitemaps import Sitemap 2 | from django.urls import reverse 3 | 4 | 5 | class HomeSitemap(Sitemap): 6 | """Index pages with hard-coded urls (homepage, etc.).""" 7 | 8 | def items(self): 9 | return ["home", "legal_mentions", "privacy_policy", "accessibility"] 10 | 11 | def location(self, item): 12 | return reverse(item) 13 | -------------------------------------------------------------------------------- /src/templates/admin/aids/aid/submit_line.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/submit_line.html" %} 2 | 3 | {% block submit-row %} 4 | {{ block.super }} 5 | {% if original %} 6 | 7 | Exporter les projets liés en tâche de fond 8 | 9 | {% endif %} 10 | {% endblock submit-row %} 11 | -------------------------------------------------------------------------------- /src/templates/home/_mailing_list_form.html: -------------------------------------------------------------------------------- 1 | {% load i18n mailing_list %} 2 | 3 |

    4 | Laissez votre email pour être informé en priorité des nouvelles aides pour votre territoire. 5 |

    6 | 7 | 8 | S’inscrire à la lettre d’information 9 | Ouvre une nouvelle fenêtre 10 | 11 | -------------------------------------------------------------------------------- /src/templates/emails/reset_password.txt: -------------------------------------------------------------------------------- 1 | Bonjour {{ user_name }}, 2 | 3 | Vous avez demandé à réinitialiser votre mot de passe sur le site Aides-territoires. 4 | 5 | Retrouvez les accès à votre compte en cliquant sur le lien suivant : 6 | 7 | {{ full_login_url }} 8 | 9 | Si vous n’êtes pas à l’initiative de cette demande, vous n’avez rien à faire. 10 | 11 | À bientôt, 12 | L’équipe d’Aides-territoires. 13 | -------------------------------------------------------------------------------- /src/home/templatetags/mailing_list.py: -------------------------------------------------------------------------------- 1 | """Template helpers to render mailing list providers custom forms.""" 2 | 3 | from django import template 4 | from django.conf import settings 5 | 6 | register = template.Library() 7 | 8 | 9 | @register.simple_tag 10 | def mailing_list_url(): 11 | """ "returns the url of the Brevo mailing list registration form.""" 12 | 13 | return settings.MAILING_LIST_URL 14 | -------------------------------------------------------------------------------- /src/aids/migrations/0048_aid__tags_m2m.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.2 on 2018-11-14 11:48 2 | 3 | # This migration used the now removed tags app 4 | # and has been edited to remove reference to it. 5 | 6 | from django.db import migrations 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ("aids", "0047_auto_20181107_1537"), 13 | ] 14 | 15 | operations = [] 16 | -------------------------------------------------------------------------------- /src/aids/migrations/0049_auto_20181115_1606.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.2 on 2018-11-15 15:06 2 | 3 | # This migration used the now removed tags app 4 | # and has been edited to remove reference to it. 5 | 6 | from django.db import migrations 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ("aids", "0048_aid__tags_m2m"), 13 | ] 14 | 15 | operations = [] 16 | -------------------------------------------------------------------------------- /src/aids/migrations/0056_auto_20190213_1548.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.5 on 2019-02-13 14:48 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0055_update_search_vector"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField(model_name="aid", old_name="url", new_name="origin_url"), 14 | ] 15 | -------------------------------------------------------------------------------- /src/geofr/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path, re_path 2 | from geofr.views import ( 3 | MapView, 4 | DepartmentBackersView, 5 | ) 6 | 7 | 8 | urlpatterns = [ 9 | path("", MapView.as_view(), name="map_view"), 10 | re_path( 11 | r"^(?P[0-9AB]{2,3})-(?P[\w-]+)/porteurs/$", 12 | DepartmentBackersView.as_view(), 13 | name="department_backers_view", 14 | ), 15 | ] 16 | -------------------------------------------------------------------------------- /src/templates/_form_snippet.html: -------------------------------------------------------------------------------- 1 | {% load form_utils %} 2 | {{ form.media }} 3 | 4 | {% include '_form_header.html' with form=form %} 5 | 6 | {% for field in form.visible_fields %} 7 | 8 | {% if field|is_checkbox %} 9 | {% include '_checkbox_snippet.html' with field=field %} 10 | {% else %} 11 | {% include '_field_snippet.html' with field=field %} 12 | {% endif %} 13 | 14 | {% endfor %} 15 | -------------------------------------------------------------------------------- /src/stats/migrations/0026_delete_aidmatchprojectevent.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.6 on 2021-08-20 14:05 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("stats", "0025_auto_20210806_1540"), 10 | ] 11 | 12 | operations = [ 13 | migrations.DeleteModel( 14 | name="AidMatchProjectEvent", 15 | ), 16 | ] 17 | -------------------------------------------------------------------------------- /src/dataproviders/constants.py: -------------------------------------------------------------------------------- 1 | from model_utils import Choices 2 | 3 | 4 | IMPORT_LICENCES = Choices( 5 | ("unknown", "Inconnu"), 6 | ("openlicence20", "Licence ouverte 2.0"), 7 | ) 8 | 9 | # FREQUENCIES = Choices( 10 | # ('once', 'Une seule fois'), 11 | # ('daily', 'Quotidiennement'), 12 | # ('weekly', 'Hebdomadairement'), 13 | # ('monthly', 'Mensuellement'), 14 | # ('yearly', 'Annuellement') 15 | # ) 16 | -------------------------------------------------------------------------------- /src/geofr/resources.py: -------------------------------------------------------------------------------- 1 | from import_export import resources 2 | 3 | from geofr.models import Perimeter 4 | 5 | 6 | class PerimeterResource(resources.ModelResource): 7 | class Meta: 8 | model = Perimeter 9 | import_id_fields = "id" 10 | fields = ("code", "name", "scale", "population", "date_created", "is_obsolete") 11 | 12 | def dehydrate_scale(self, obj): 13 | return obj.get_scale_display() 14 | -------------------------------------------------------------------------------- /src/aids/migrations/0149_remove_aid_projects.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.6 on 2021-09-21 16:11 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0148_alter_aid_aid_types"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="aid", 15 | name="projects", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/data/views.py: -------------------------------------------------------------------------------- 1 | from django.views.generic import TemplateView 2 | from django.conf import settings 3 | 4 | 5 | class DataDocView(TemplateView): 6 | """Show aids api doc and licence.""" 7 | 8 | template_name = "data/doc.html" 9 | 10 | def get_context_data(self, **kwargs): 11 | context = super().get_context_data(**kwargs) 12 | context["api_version"] = settings.CURRENT_API_VERSION 13 | return context 14 | -------------------------------------------------------------------------------- /src/geofr/migrations/0002_remove_perimeter_country.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-09-04 13:13 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("geofr", "0001_initial"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="perimeter", 15 | name="country", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/programs/factories.py: -------------------------------------------------------------------------------- 1 | import factory 2 | from factory.django import DjangoModelFactory 3 | 4 | from django.utils.text import slugify 5 | 6 | from programs.models import Program 7 | 8 | 9 | class ProgramFactory(DjangoModelFactory): 10 | """Factory for programs.""" 11 | 12 | class Meta: 13 | model = Program 14 | 15 | name = factory.Faker("name") 16 | slug = factory.LazyAttribute(lambda o: slugify(o.name)) 17 | -------------------------------------------------------------------------------- /src/templates/forms/widgets/multiple_input.html: -------------------------------------------------------------------------------- 1 | {% with id=widget.attrs.id %} 2 | {% for group, options, index in widget.optgroups %} 3 | {% if group %}{{ group }}{% endif %} 4 | {% for option in options %} 5 | {% include option.template_name with widget=option %} 6 | {% endfor %} 7 | {% if group %}{% endif %} 8 | {% endfor %} 9 | {% endwith %} -------------------------------------------------------------------------------- /src/core/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CoreConfig(AppConfig): 5 | name = "core" 6 | verbose_name = "core" 7 | 8 | def ready(self): 9 | # Celery : 10 | # This will make sure the app is always imported when 11 | # Django starts so that shared_task will use this app. 12 | from core.celery import app as celery_app # noqa 13 | 14 | __all__ = ("celery_app",) # noqa 15 | -------------------------------------------------------------------------------- /src/core/tests/test_templatetags.py: -------------------------------------------------------------------------------- 1 | from core.templatetags.settings import phone, cloud_file_url 2 | 3 | 4 | def test_phone_number_is_converted(): 5 | assert phone("+33123456789") == "01 23 45 67 89" 6 | assert phone("0123456789") == "01 23 45 67 89" 7 | 8 | 9 | def test_cloud_file_url(): 10 | assert ( 11 | cloud_file_url("test_file.mp4") 12 | == "https://cloud.example.org/test-bucket/upload/test_file.mp4" 13 | ) 14 | -------------------------------------------------------------------------------- /src/programs/migrations/0005_remove_program_aids.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.16 on 2020-09-28 14:43 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("programs", "0004_auto_20200928_1547"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="program", 15 | name="aids", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/projects/templatetags/projects.py: -------------------------------------------------------------------------------- 1 | """Project rendering helpers.""" 2 | from django import template 3 | 4 | 5 | register = template.Library() 6 | 7 | 8 | @register.simple_tag 9 | def budget_percentage(obj, amount_obtained): 10 | """Display percentage of the budget represented by the obtained subvention""" 11 | if obj.budget: 12 | budget_percentage = (100 * amount_obtained) / obj.budget 13 | return int(budget_percentage) 14 | -------------------------------------------------------------------------------- /src/static/js/enable_rich_text_editor.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | $(document).ready(function () { 4 | // An admin can add images, justify text. 5 | trumbowygConfig.btns.push(['image']); 6 | trumbowygConfig.btns.push([ 7 | 'justifyLeft', 8 | 'justifyCenter', 9 | ]); 10 | $('textarea.textarea-wysiwyg').trumbowyg(trumbowygConfig); 11 | }); 12 | }($ || django.jQuery)); -------------------------------------------------------------------------------- /src/templates/_js_catalog.html: -------------------------------------------------------------------------------- 1 | {% load settings %} 2 | {# Variables sent from Django to JavaScript #} 3 | 4 | 12 | -------------------------------------------------------------------------------- /src/geofr/migrations/0005_remove_perimeter_commune.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-09-05 09:52 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("geofr", "0004_auto_20180905_1149"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="perimeter", 15 | name="commune", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/minisites/__init__.py: -------------------------------------------------------------------------------- 1 | """This app handles the "minisite" feature." 2 | 3 | A `minisite` is a customized subset of the main site that stands behind a 4 | subdomain, e.g francemobilites.aides-territoires.beta.gouv.fr. It can also 5 | be configured to respond to a completely custom domain, e.g 6 | aides.francemobilites.fr 7 | 8 | Each minisite needs to match a customized `SearchPage` and can be configured 9 | with custom content and colors. 10 | """ 11 | -------------------------------------------------------------------------------- /src/projects/tests/test_models.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from projects.factories import ProjectFactory 4 | from projects.models import image_upload_to 5 | 6 | pytestmark = pytest.mark.django_db 7 | 8 | 9 | def test_image_upload_to(): 10 | instance = ProjectFactory(name="Sample project") 11 | filename = "logo.png" 12 | upload_path = image_upload_to(instance, filename) 13 | 14 | assert upload_path == f"projects/{instance.slug}_image.png" 15 | -------------------------------------------------------------------------------- /src/accounts/migrations/0013_remove_user_watched_tags.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.4 on 2021-06-25 12:53 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("accounts", "0012_user_is_contributor"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="user", 15 | name="watched_tags", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/aids/migrations/0079_remove_aid_subvention_rate.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.5 on 2019-11-04 09:28 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0078_copy_subvention_rates"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="aid", 15 | name="subvention_rate", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/dataproviders/data/pays_de_la_loire_types_mapping.csv: -------------------------------------------------------------------------------- 1 | Types Pays de la Loire,Types AT 1 2 | Aide,Subvention 3 | Accompagnement,Ingénierie technique 4 | Aide en nature,Autre aide financière 5 | Appel à manifestations d'intérêt,Subvention 6 | Appel à projets,Autre aide financière 7 | Avance remboursable,Avance récupérable 8 | Garantie,Autre aide financière 9 | Prêt,Prêt 10 | Prêt d'honneur,Prêt 11 | Service,Autre aide financière 12 | Subvention,Subvention 13 | -------------------------------------------------------------------------------- /src/eligibility/constants.py: -------------------------------------------------------------------------------- 1 | QUESTION_TYPE_VF = "VF" 2 | QUESTION_TYPE_QCM = "QCM" 3 | QUESTION_TYPE_QCM_RM = "QCM-RM" 4 | QUESTION_TYPE_CHOICES = [ 5 | (QUESTION_TYPE_VF, "Vrai ou Faux"), 6 | (QUESTION_TYPE_QCM, "Questionnaire à choix multiples"), 7 | ( 8 | QUESTION_TYPE_QCM_RM, 9 | "Questionnaire à choix multiples avec réponses multiples", 10 | ), # noqa 11 | ] 12 | 13 | QUESTION_ANSWER_CHOICE_LIST = ["a", "b", "c", "d"] 14 | -------------------------------------------------------------------------------- /src/programs/migrations/0003_remove_program_perimeter.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.16 on 2020-09-28 13:43 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("programs", "0002_auto_20190927_1021"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="program", 15 | name="perimeter", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/static/js/aids/disable_delete_button.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | // Disable deletion button until confirmation checkbox was checked 3 | var deleteBtn = $('form#delete-form button[type=submit]'); 4 | var confirmCb = $('form#delete-form input[type=checkbox]'); 5 | 6 | deleteBtn.prop('disabled', true); 7 | confirmCb.on('click', function() { 8 | deleteBtn.prop('disabled', !confirmCb.prop('checked')); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /src/stats/templatetags/stats.py: -------------------------------------------------------------------------------- 1 | """Stat rendering helpers.""" 2 | 3 | from django import template 4 | from django.utils.safestring import mark_safe 5 | 6 | register = template.Library() 7 | 8 | 9 | @register.simple_tag 10 | def percent_display(part, whole, ndigits=2): 11 | """Percent rendering""" 12 | percent = 100 * float(part) / float(whole) 13 | round_percent = round(percent, ndigits) 14 | return mark_safe(f"{round_percent} %") 15 | -------------------------------------------------------------------------------- /src/static/js/programs/tab_url_parameters.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | // update url parameter when user click on a program-tab 3 | 4 | let tabBtns = $('article#program button[id^="tabpanel-"]'); 5 | 6 | tabBtns.each(function(index) { 7 | $(this).on('click', function() { 8 | let tabBtnId = $(this).attr("id").split("tabpanel-")[1] 9 | window.history.pushState({}, '', `?tab=${tabBtnId}`); 10 | }) 11 | }) 12 | }) 13 | -------------------------------------------------------------------------------- /src/search/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from minisites.views import SiteHome 4 | 5 | 6 | urlpatterns = [ 7 | path( 8 | "/", 9 | SiteHome.as_view(template_name="search/search_page.html"), 10 | name="search_page", 11 | ), 12 | path( 13 | "/", 14 | SiteHome.as_view(template_name="search/search_page.html"), 15 | name="search_minisite_view", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/core/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for core project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings.production") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /src/geofr/migrations/0003_auto_20180904_1518.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-09-04 13:18 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("geofr", "0002_remove_perimeter_country"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterUniqueTogether( 14 | name="perimeter", 15 | unique_together={("scale", "code")}, 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/templates/emails/search_results.txt: -------------------------------------------------------------------------------- 1 | Bonjour {{ user_name }}, 2 | 3 | Voici l’adresse permettant de retrouver votre recherche : 4 | 5 | {{ full_url|safe }} 6 | 7 | Cette recherche renvoie {{ nb_results }} résultats. 8 | 9 | Voici les premières aides correspondantes : 10 | {% for aid in aids %} 11 | - {{ aid.name|safe }} 12 | {{ scheme }}://{{ domain }}{{ aid.get_absolute_url }} 13 | {% endfor %} 14 | 15 | L’équipe d’Aides-territoires, 16 | {{ scheme }}://{{ domain }} -------------------------------------------------------------------------------- /src/eligibility/api/views.py: -------------------------------------------------------------------------------- 1 | from rest_framework import viewsets, mixins 2 | from drf_spectacular.utils import extend_schema 3 | 4 | from eligibility.models import EligibilityTest 5 | from eligibility.api.serializers import EligibilityTestSerializer 6 | 7 | 8 | @extend_schema(exclude=True) 9 | class EligibilityTestViewSet(mixins.RetrieveModelMixin, viewsets.GenericViewSet): 10 | serializer_class = EligibilityTestSerializer 11 | queryset = EligibilityTest.objects.all() 12 | -------------------------------------------------------------------------------- /src/static/js/blog/filter_article_by_categories.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | 3 | const URL_FRAGMENT_REGEX = /^[0-9a-z-_/]+$/; 4 | 5 | $('#select').on('change', function () { 6 | let url_fragment = $(this).val(); 7 | if (url_fragment.match(URL_FRAGMENT_REGEX)) { 8 | window.location.href = url_fragment; 9 | } else { 10 | console.log("Invalid URL fragment"); 11 | } 12 | return false; 13 | }); 14 | }) -------------------------------------------------------------------------------- /src/templates/django/forms/widgets/input_option.html: -------------------------------------------------------------------------------- 1 | {% include "django/forms/widgets/input.html" %} 2 | {% if widget.wrap_label %} 3 | 11 | {% endif %} -------------------------------------------------------------------------------- /src/backers/migrations/0014_reupload_medias.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-02-23 13:08 2 | 3 | from django.db import migrations 4 | from django.db.migrations.operations.special import RunPython 5 | from core.utils import reupload_files 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ("backers", "0013_fix_slug_length"), 12 | ] 13 | 14 | operations = [RunPython(reupload_files("backers.Backer", "logo"), RunPython.noop)] 15 | -------------------------------------------------------------------------------- /src/programs/migrations/0007_reupload_files.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-02-23 14:28 2 | 3 | from django.db import migrations 4 | from django.db.migrations.operations.special import RunPython 5 | from core.utils import reupload_files 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ("programs", "0006_program_logo"), 12 | ] 13 | 14 | operations = [RunPython(reupload_files("programs.Program", "logo"), RunPython.noop)] 15 | -------------------------------------------------------------------------------- /src/static/js/url_parameters.js: -------------------------------------------------------------------------------- 1 | function set_param_value(param, value) { 2 | /* update or remove a GET parameter from the current URL */ 3 | if ('URLSearchParams' in window) { 4 | let searchParams = new URLSearchParams(window.location.search); 5 | if (value) { 6 | searchParams.set(param, value); 7 | } else { 8 | searchParams.delete(param); 9 | } 10 | window.location.search = searchParams.toString(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/upload/migrations/0002_reupload_files.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-02-23 14:29 2 | 3 | from django.db import migrations 4 | from django.db.migrations import RunPython 5 | from core.utils import reupload_files 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ("upload", "0001_initial"), 12 | ] 13 | 14 | operations = [ 15 | RunPython(reupload_files("upload.UploadImage", "image"), RunPython.noop) 16 | ] 17 | -------------------------------------------------------------------------------- /src/exporting/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from exporting.models import DataExport 4 | 5 | 6 | class DataExportAdmin(admin.ModelAdmin): 7 | list_display = ["id", "exported_file", "author", "date_created"] 8 | search_fields = ["author__first_name", "author__last_name", "author__email"] 9 | list_filter = ["author"] 10 | raw_id_fields = ["author"] 11 | date_hierarchy = "date_created" 12 | 13 | 14 | admin.site.register(DataExport, DataExportAdmin) 15 | -------------------------------------------------------------------------------- /src/ruff.toml: -------------------------------------------------------------------------------- 1 | exclude = [ 2 | ".bzr", 3 | ".direnv", 4 | ".eggs", 5 | ".git", 6 | ".git-rewrite", 7 | ".hg", 8 | ".mypy_cache", 9 | ".nox", 10 | ".pants.d", 11 | ".pytype", 12 | ".ruff_cache", 13 | ".svn", 14 | ".tox", 15 | ".venv", 16 | "__pypackages__", 17 | "_build", 18 | "buck-out", 19 | "build", 20 | "dist", 21 | "node_modules", 22 | "venv", 23 | "migrations" 24 | ] 25 | 26 | line-length = 100 27 | -------------------------------------------------------------------------------- /src/organizations/migrations/0006_remove_organization_projects.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.15 on 2022-09-08 18:09 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("organizations", "0005_alter_organization_organization_type"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name="organization", 15 | name="projects", 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/geofr/api/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework import routers 2 | 3 | from geofr.api.views import ( 4 | PerimeterDataViewSet, 5 | PerimeterViewSet, 6 | PerimeterScalesViewSet, 7 | ) 8 | 9 | 10 | router = routers.SimpleRouter() 11 | router.register(r"scales", PerimeterScalesViewSet, basename="perimeter-scales") 12 | router.register(r"data", PerimeterDataViewSet, basename="perimeter-data") 13 | router.register("", PerimeterViewSet, basename="perimeters") 14 | 15 | urlpatterns = router.urls 16 | -------------------------------------------------------------------------------- /src/upload/migrations/0003_change_verbose_name.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.5 on 2021-07-28 10:13 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("upload", "0002_reupload_files"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterModelOptions( 14 | name="uploadimage", 15 | options={"verbose_name": "image", "verbose_name_plural": "images"}, 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /src/aids/migrations/0070_auto_20191008_1547.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.5 on 2019-10-08 13:47 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0069_auto_20190916_1104"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name="aid", 15 | old_name="amendment_author", 16 | new_name="amendment_author_name", 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/migrations/0134_aid_import_raw_object.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.2 on 2021-05-16 17:00 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0133_aid_projects"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="aid", 15 | name="import_raw_object", 16 | field=models.JSONField(null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/core/celery.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from celery import Celery 4 | 5 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings.production") 6 | 7 | from django.conf import settings # noqa 8 | 9 | 10 | app = Celery("aides") 11 | app.config_from_object("django.conf:settings", namespace="CELERY") 12 | app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) 13 | 14 | 15 | @app.task(bind=True) 16 | def celery_debug_task(self): 17 | print("This is a debug task to verify that Celery works") 18 | -------------------------------------------------------------------------------- /src/geofr/management/commands/populate_epcis.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand 2 | 3 | from geofr.services.populate import populate_epcis 4 | 5 | 6 | class Command(BaseCommand): 7 | """Import all epcis.""" 8 | 9 | def handle(self, *args, **options): 10 | result = populate_epcis() 11 | self.stdout.write( 12 | self.style.SUCCESS( 13 | f"{result['created']} created, {result['updated']} updated." 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /src/.env.scalingo.example: -------------------------------------------------------------------------------- 1 | ALLOWED_HOSTS=aides-territoires.osc-fr1.scalingo.io, 2 | DATABASE_URL=postgres://TODO:TODO@TODO:30600/TODO? 3 | DEBUG=True 4 | DJANGO_SETTINGS_MODULE=core.settings.scalingo 5 | ENV_NAME=scalingo 6 | MAILING_LIST_URL=TODO 7 | PROJECT_DIR=src 8 | SENTRY_URL=https://TODO@TODO/TODO 9 | SENTRY_TRACES_SAMPLE_RATE=1.0 10 | SCALINGO_POSTGRESQL_URL=postgres://TODO:TODO@TODO:30600/TODO? 11 | SECRET_KEY='some-secret' 12 | SIB_API_KEY='' 13 | SIB_EXPORT_CONTACTS_LIST_ID=0 14 | sslmode=prefer 15 | -------------------------------------------------------------------------------- /src/aids/migrations/0080_auto_20191104_1028.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.5 on 2019-11-04 09:28 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0079_remove_aid_subvention_rate"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name="aid", 15 | old_name="subvention_rate_range", 16 | new_name="subvention_rate", 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/migrations/0035_aid_slug.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-10-02 10:04 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0034_auto_20180928_1556"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="aid", 15 | name="slug", 16 | field=models.SlugField(blank=True, null=True, verbose_name="Slug"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/migrations/0086_aid_contact.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.7 on 2019-11-18 10:30 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0085_auto_20191118_1129"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="aid", 15 | name="contact", 16 | field=models.TextField(blank=True, verbose_name="Contact"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/accounts/migrations/0014_rename_date_joined_user_date_created.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.4 on 2021-07-15 18:30 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("accounts", "0013_remove_user_watched_tags"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name="user", 15 | old_name="date_joined", 16 | new_name="date_created", 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/alerts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from alerts.models import Alert 4 | 5 | 6 | class AlertAdmin(admin.ModelAdmin): 7 | list_display = [ 8 | "email", 9 | "title", 10 | "source", 11 | "latest_alert_date", 12 | "date_created", 13 | "validated", 14 | "date_validated", 15 | ] 16 | list_filter = ["validated", "alert_frequency", "source"] 17 | search_fields = ["email"] 18 | 19 | 20 | admin.site.register(Alert, AlertAdmin) 21 | -------------------------------------------------------------------------------- /src/blog/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path, include 2 | 3 | from blog.views import BlogPostList, BlogPostDetail 4 | 5 | urlpatterns = [ 6 | path("", BlogPostList.as_view(), name="blog_post_list_view"), 7 | path("categorie/", BlogPostList.as_view(), name="blog_post_list_view"), 8 | path( 9 | "/", 10 | include( 11 | [ 12 | path("", BlogPostDetail.as_view(), name="blog_post_detail_view"), 13 | ] 14 | ), 15 | ), 16 | ] 17 | -------------------------------------------------------------------------------- /src/geofr/management/commands/populate_communes.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand 2 | from geofr.services.populate import populate_communes 3 | 4 | 5 | class Command(BaseCommand): 6 | """Import the list of all communes.""" 7 | 8 | def handle(self, *args, **options): 9 | result = populate_communes() 10 | self.stdout.write( 11 | self.style.SUCCESS( 12 | f"{result['created']} created, {result['updated']} updated." 13 | ) 14 | ) 15 | -------------------------------------------------------------------------------- /src/organizations/tests/test_models.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from organizations.factories import OrganizationFactory 4 | 5 | pytestmark = pytest.mark.django_db 6 | 7 | 8 | def test_organization_fill_extra_perimeters_on_save(perimeters): 9 | organization = OrganizationFactory() 10 | organization.perimeter = perimeters["montpellier"] 11 | organization.save() 12 | assert organization.perimeter_region == perimeters["occitanie"] 13 | assert organization.perimeter_department == perimeters["herault"] 14 | -------------------------------------------------------------------------------- /src/templates/django/forms/widgets/multiple_input.html: -------------------------------------------------------------------------------- 1 | {% with id=widget.attrs.id %}{% for group, options, index in widget.optgroups %}{% if group %} 2 |
  • {{ group }}{% endif %}{% for option in options %} 3 |
  • {% include option.template_name with widget=option %}
  • {% endfor %}{% if group %} 4 | {% endif %}{% endfor %} 5 | {% endwith %} 6 | -------------------------------------------------------------------------------- /src/categories/api/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | 3 | from categories.models import Theme, Category 4 | 5 | 6 | class CategorySerializer(serializers.ModelSerializer): 7 | class Meta: 8 | model = Category 9 | fields = ("id", "name", "slug") 10 | 11 | 12 | class ThemeSerializer(serializers.ModelSerializer): 13 | 14 | categories = CategorySerializer(many=True) 15 | 16 | class Meta: 17 | model = Theme 18 | fields = ("id", "name", "slug", "categories") 19 | -------------------------------------------------------------------------------- /src/geofr/management/commands/populate_regions.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand 2 | 3 | from geofr.services.populate import populate_regions 4 | 5 | 6 | class Command(BaseCommand): 7 | """Import the list of all regions.""" 8 | 9 | def handle(self, *args, **options): 10 | result = populate_regions() 11 | self.stdout.write( 12 | self.style.SUCCESS( 13 | f"{result['created']} created, {result['updated']} updated." 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /src/search/migrations/0015_auto_20200921_1715.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.16 on 2020-09-21 15:15 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("search", "0014_auto_20200910_1041"), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name="searchpage", 15 | old_name="show_audiance_field", 16 | new_name="show_audience_field", 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/search/tests/test_templatetags.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from search.templatetags.colors import darken 4 | 5 | 6 | def test_darken_only_takes_rgb(): 7 | with pytest.raises(ValueError) as e: 8 | res = darken("blue", 15) == "red" # noqa 9 | assert "Color must be in hexadecimal format" in str(e.value) 10 | 11 | 12 | def test_darken_converts_color(): 13 | assert darken("#99F3E6", 15) == "#63ECD8" 14 | assert darken("#99F3E6", -5) == "#AAF5EA" 15 | assert darken("#99F3E6", 50) == "#14B19A" 16 | -------------------------------------------------------------------------------- /src/stats/migrations/0003_event_meta.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.9 on 2020-03-09 10:50 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("stats", "0002_auto_20200309_1128"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="event", 15 | name="meta", 16 | field=models.CharField(default="", max_length=256, verbose_name="Name"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/stats/migrations/0004_event_source.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.17 on 2020-12-17 19:26 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("stats", "0003_event_meta"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="event", 15 | name="source", 16 | field=models.CharField(default="", max_length=256, verbose_name="Source"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/migrations/0018_auto_20180906_1058.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-09-06 08:58 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0017_aid_perimeter"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name="aid", 15 | name="description", 16 | field=models.TextField(max_length=500, verbose_name="Description"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/tests/test_sitemap.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from django.urls import reverse 3 | 4 | from aids.factories import AidFactory 5 | 6 | pytestmark = pytest.mark.django_db 7 | 8 | 9 | def test_sitemap(client): 10 | AidFactory(name="First aid") 11 | AidFactory(name="Draft aid", status="draft") 12 | 13 | url = reverse("sitemap_xml") 14 | res = client.get(url) 15 | 16 | assert "first-aid" in res.content.decode() 17 | assert "draft-aid" not in res.content.decode() 18 | assert res.status_code == 200 19 | -------------------------------------------------------------------------------- /src/exporting/migrations/0002_reupload_files.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-02-23 14:28 2 | 3 | from django.db import migrations 4 | from django.db.migrations import RunPython 5 | from core.utils import reupload_files 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ("exporting", "0001_initial"), 12 | ] 13 | 14 | operations = [ 15 | RunPython( 16 | reupload_files("exporting.DataExport", "exported_file"), RunPython.noop 17 | ) 18 | ] 19 | -------------------------------------------------------------------------------- /src/geofr/management/commands/populate_countries.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand 2 | 3 | from geofr.services.populate import populate_countries 4 | 5 | 6 | class Command(BaseCommand): 7 | """Import the list of countries.""" 8 | 9 | def handle(self, *args, **options): 10 | result = populate_countries() 11 | self.stdout.write( 12 | self.style.SUCCESS( 13 | f"{result['created']} created, {result['updated']} updated." 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /src/search/factories.py: -------------------------------------------------------------------------------- 1 | import factory 2 | from factory.django import DjangoModelFactory 3 | from django.utils.text import slugify 4 | 5 | from search.models import SearchPage 6 | 7 | 8 | class SearchPageFactory(DjangoModelFactory): 9 | class Meta: 10 | model = SearchPage 11 | 12 | title = factory.Faker("company") 13 | slug = factory.LazyAttribute(lambda o: slugify(o.title)) 14 | content = factory.Faker("text") 15 | more_content = factory.Faker("text") 16 | search_querystring = "text=test" 17 | -------------------------------------------------------------------------------- /src/templates/400.html: -------------------------------------------------------------------------------- 1 | {% extends "_base.html" %} 2 | 3 | {% block content %} 4 |
    5 |

    Demande erronée

    6 | 7 |

    Le serveur ne peut pas comprendre la requête reçue.

    8 | 9 |

    Le mieux que nous puissions faire est de vous 10 | renvoyer vers la page d’accueil.

    11 | 12 |

    Si vous pensez qu’il s’agit d’une erreur de notre part, vous pouvez aussi nous contacter.

    14 |
    15 | {% endblock content %} 16 | -------------------------------------------------------------------------------- /src/templates/admin/admin_lite/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'fieldsets_with_inlines/change_form.html' %} 2 | 3 | {% block nav-global %}{% endblock %} 4 | 5 | {% block object-tools-items %} 6 | {% if has_absolute_url %}
  • Voir sur le site
  • {% endif%} 7 | {% endblock %} 8 | 9 | {% block userlinks %}{% endblock %} 10 | 11 | {% block breadcrumbs %}{% endblock %} 12 | -------------------------------------------------------------------------------- /src/templates/admin/base_site.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/base_site.html" %} 2 | {% load static %} 3 | 4 | {% block extrahead %} 5 | 6 | 15 | {% endblock %} -------------------------------------------------------------------------------- /src/aids/migrations/0026_aid_application_url.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-09-14 11:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0025_auto_20180914_1349"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="aid", 15 | name="application_url", 16 | field=models.URLField(blank=True, verbose_name="Application url"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/migrations/0033_aid_date_updated.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-09-27 10:08 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0032_auto_20180927_0917"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="aid", 15 | name="date_updated", 16 | field=models.DateTimeField(auto_now=True, verbose_name="Date updated"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/migrations/0109_auto_20200921_1707.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.16 on 2020-09-21 15:07 2 | 3 | import core.fields 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ("aids", "0108_auto_20200615_1055"), 11 | ] 12 | 13 | operations = [ 14 | migrations.RenameField( 15 | model_name="aid", 16 | old_name="targeted_audiances", 17 | new_name="targeted_audiences", 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /src/backers/migrations/0002_auto_20180921_1056.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2018-09-21 08:56 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("backers", "0001_initial"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name="backer", 15 | name="name", 16 | field=models.CharField(db_index=True, max_length=256, verbose_name="Name"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/notifications/factories.py: -------------------------------------------------------------------------------- 1 | import factory 2 | from factory.django import DjangoModelFactory 3 | 4 | from accounts.factories import UserFactory 5 | 6 | from notifications.models import Notification 7 | 8 | 9 | class NotificationFactory(DjangoModelFactory): 10 | """Factory for notification.""" 11 | 12 | class Meta: 13 | model = Notification 14 | 15 | recipient = factory.SubFactory(UserFactory) 16 | title = factory.Faker("text", locale="fr_FR") 17 | message = factory.Faker("text", locale="fr_FR") 18 | -------------------------------------------------------------------------------- /src/notifications/migrations/0002_alter_notification_message.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.1.5 on 2023-01-19 09:17 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("notifications", "0001_initial"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name="notification", 15 | name="message", 16 | field=models.TextField(verbose_name="message"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/scripts/start_celery_beat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used by scalingo to start the the application 4 | # It run every time the app container starts, for instance, 5 | # after a deployment or when the container is restarted. 6 | 7 | echo "Entering start celery event script" 8 | echo "Using Django settings module: $DJANGO_SETTINGS_MODULE" 9 | python manage.py compilemessages 10 | celery -A core worker --beat --concurrency=${CELERY_BEAT_CONCURRENCY:=4} --loglevel info 11 | echo "Completed start celery beat script" 12 | -------------------------------------------------------------------------------- /src/templates/emails/contact_form.txt: -------------------------------------------------------------------------------- 1 | Message reçu via le formulaire de contact. 2 | 3 | De : 4 | {% if form_dict.first_name or form_dict.last_name %}- Nom : {{ form_dict.first_name }} {{ form_dict.last_name }}{% endif %} 5 | - E-mail : {{ form_dict.email }} 6 | {% if form_dict.phone %}- Téléphone : {{ form_dict.phone }}{% endif %} 7 | {% if form_dict.organization_and_role %}- Structure et fonction : {{ form_dict.organization_and_role }}{% endif %} 8 | 9 | Sujet : {{ subject_display }} 10 | 11 | Message : 12 | {{ form_dict.message }} -------------------------------------------------------------------------------- /src/templates/robots.txt: -------------------------------------------------------------------------------- 1 | # Allowed 2 | User-agent: Googlebot 3 | Disallow: 4 | 5 | User-agent: Googlebot-Image 6 | Disallow: 7 | 8 | User-agent: bingbot 9 | Disallow: 10 | 11 | User-agent: bingbot/2.0 12 | Disallow: 13 | 14 | User-agent: DuckDuckBot 15 | Disallow: 16 | 17 | # Slow down other bots 18 | User-agent: * 19 | Crawl-delay: 10 20 | 21 | # Disallowed 22 | User-agent: SemrushBot 23 | Disallow: / 24 | 25 | User-agent: YandexBot 26 | Disallow: / 27 | 28 | 29 | Sitemap: https://aides-territoires.beta.gouv.fr/sitemap.xml 30 | -------------------------------------------------------------------------------- /src/accounts/migrations/0011_auto_20210208_1628.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.5 on 2021-02-08 15:28 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("accounts", "0010_auto_20201124_1023"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name="user", 15 | name="last_name", 16 | field=models.CharField(max_length=256, verbose_name="Last name"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/aids/migrations/0130_generic_aid_as_boolean.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.8 on 2021-05-03 14:57 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ("aids", "0129_auto_20210413_1118"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name="aid", 15 | name="is_generic", 16 | field=models.BooleanField(default=False, verbose_name="Is generic aid"), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /src/dataproviders/data/ademe_agir_audiences_mapping.csv: -------------------------------------------------------------------------------- 1 | Code Bénéficiaires Ademe Agir,Libellés Bénéficiaires Ademe Agir,Bénéficiaires AT 1,Bénéficiaires AT 2,Bénéficiaires AT 3,Bénéficiaires AT 4,Bénéficiaires AT 5 2 | SCA3,Entreprise,Entreprises privées,,,, 3 | SCA4,Organisme de recherche,Recherche,,,, 4 | SCA2,Collectivités et secteur public,Communes,Intercommunalités / Pays,Départements,"Entreprises publiques locales (Sem, Spl, SemOp)","Établissements publics (écoles, bibliothèques…) / Services de l'État" 5 | SCA1,Association,Associations,,,, 6 | -------------------------------------------------------------------------------- /src/scripts/start_celery_events.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used by scalingo to start the the application 4 | # It run every time the app container starts, for instance, 5 | # after a deployment or when the container is restarted. 6 | 7 | echo "Entering start celery event script" 8 | echo "Using Django settings module: $DJANGO_SETTINGS_MODULE" 9 | python manage.py compilemessages 10 | celery -A core worker --events --concurrency=${CELERY_EVENTS_CONCURRENCY:=4} --loglevel info 11 | echo "Completed start celery event script" 12 | -------------------------------------------------------------------------------- /src/scripts/start_web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used by scalingo to start the application 4 | # It run every time the app container starts, for instance, 5 | # after a deployment or when the container is restarted. 6 | 7 | echo "Entering start web script" 8 | echo "Using Django settings module: $DJANGO_SETTINGS_MODULE" 9 | python manage.py compilemessages 10 | python manage.py collectstatic --noinput 11 | python manage.py compress --force 12 | gunicorn core.wsgi_scalingo --log-file - 13 | echo "Completed start web script" 14 | -------------------------------------------------------------------------------- /src/static/js/aids/configure_preview_modal.js: -------------------------------------------------------------------------------- 1 | // Load the aid preview page in an iframe in modal 2 | $(document).ready(function () { 3 | "use strict"; 4 | 5 | $('#aid-preview-modal').on('show.bs.modal', function (event) { 6 | var previewBtn = $(event.relatedTarget); 7 | var previewUrl = previewBtn.data('preview-url'); 8 | var content = $(this).find('div.content'); 9 | var iframe = $('