<commit_before><?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <data>
        <!-- This templates creates the view "Personal information". It receives the following arguments: -->
        <!--     1. partner, the partner that is logged in -->
        <!--     2. coordinates_form, a form to modify the partner coordinates -->
        <!--     3. delivery_form, a form to modify the partner delivery preferences -->
        <template id="my_information_page_template" name="Personal information">
            <t t-set="selected" t-value="'info'"/>
            <t t-set="title">My personal data | <t t-esc="partner.company_id.address_name"/></t>
            <t t-call="website_compassion.my_account_layout">
                <div class="container">
                    <!-- Load modals for forms -->
                    <t t-set="form" t-value="coordinates_form"/>
                    <t t-call="cms_form_compassion.modal_form"/>
                    <t t-set="form" t-value="delivery_form"/>
                    <t t-call="cms_form_compassion.modal_form"/>
                    <div class="row">
                        <!-- Coordinates -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_profile_picture"/>
                        </div>
                        <!-- Communication preferences -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_communication_pref"/>
                        </div>
                    </div>
                    <div class="row">
                        <!-- Coordinates info -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_personal"/>
                        </div>
                        <!-- Privacy data and child protection -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_privacy_data"/>
                        </div>
                    </div>
                    <hr class="my-4"/>
                    <div class="row">
                        <div class="col">
                            <h3 class="mb-4">Useful resources</h3>
                            <div t-field="partner.primary_segment_id.personalized_links" class="oe_structure"/>
                        </div>
                    </div>
                </div>
            </t>
        </template>

        <!-- The template that displays the personal information of the partner -->
        <template id="my_information_personal">
            <h3 class="mt-4">Coordinates</h3>

            <!-- Ref -->
            <t t-set="value" t-value="partner.ref"/>
            <t t-call="website_compassion.fill_key_value">My reference</t>

            <!-- Title -->
            <t t-set="value" t-value="partner.title.name"/>
            <t t-call="website_compassion.fill_key_value">Title</t>

            <!-- Name -->
            <t t-set="value" t-value="partner.name"/>
            <t t-call="website_compassion.fill_key_value">Name</t>

            <!-- Street -->
            <t t-set="value" t-value="partner.street"/>
            <t t-call="website_compassion.fill_key_value">Street</t>

            <!-- City -->
            <t t-set="value" t-value="' '.join(list(filter(None, [partner.zip, partner.city])))"/>
            <t t-call="website_compassion.fill_key_value">City</t>

            <!-- Country -->
            <t t-set="value" t-value="partner.country_id.name"/>
            <t t-call="website_compassion.fill_key_value">Country</t>

            <!-- Phone -->
            <t t-set="value" t-value="partner.phone"/>
            <t t-call="website_compassion.fill_key_value">Phone</t>

            <!-- Mobile -->
            <t t-set="value" t-value="partner.mobile"/>
            <t t-call="website_compassion.fill_key_value">Mobile</t>

            <!-- Email -->
            <t t-set="value" t-value="partner.email"/>
            <t t-call="website_compassion.fill_key_value">Email / login</t>

            <div class="d-flex mt-4">
                <!-- This button opens the form to modify the personal info -->
                <button type="button"
                        class="btn btn-primary mr-4"
                        data-toggle="modal"
                        data-target="#modal_my_coordinates">
                    Change
                </button>

                <form t-attf-action="/web/reset_password" method="POST">
                    <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                    <input type="hidden" name="login" t-att-value="partner.user_ids[:1].login" id="login"/>
                    <input type="hidden" name="redirect" value="/my/information" id="redirect"/>
                    <input type="hidden" name="token"/>

                    <button class="btn btn-primary ml-4">
                        Reset password
                        <a href="#" onclick="this.parentNode.parentNode.submit()"/>
                    </button>
                </form>
            </div>

        </template>

        <!-- Here the partner can modify its profile picture -->
        <template id="my_information_profile_picture">
            <h3 class="mt-4">Profile picture</h3>
            <p>This picture is used when you create or join a project on our crowdfunding platform TOGETHER, or when you join a Muskathlon.</p>
            <form id="form_picture" action="/my/picture" method="POST" enctype="multipart/form-data">
                <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                <input type="file" name="picture" id="upload_picture"  onchange="startStopLoading(true); this.parentNode.submit()" accept="image/*" style="display: none;"/>
            </form>
            <div t-field="partner.image" t-options="{'widget': 'image'}" style="max-width: 200px;"/>
            <button id="picture_normal" onclick="document.getElementById('upload_picture').click()" class="btn btn-primary mt-2" style="width: 200px;">
                Change
            </button>
            <!-- This appears only while loading the new profile picture, via JS -->
            <button id="picture_loading" class="btn btn-primary mt-2" type="button" disabled="true" style="display: none; width: 200px;">
                <span class="spinner-border spinner-border-sm" role="status"/>
                Changing...
            </button>
            <!-- This script makes the buttons clickable or unclickable depending on loading -->
            <script type="text/javascript">
                const startStopLoading = function(start) {
                    $("button").attr('disabled', start);
                    $("#child_charter").attr('disabled', start);
                    $("#privacy_charter").attr('disabled', start);
                    document.getElementById("picture_normal").style.display = start ? "none" : "";
                    document.getElementById("picture_loading").style.display = start ? "" : "none";
                }

                window.onload = function() {
                    startStopLoading(false);
                }
            </script>
        </template>

        <!-- Display the date at which the partner signed some charters, otherwise propose to sign them -->
        <template id="my_information_privacy_data">
            <h3 class="mt-4">Privacy data</h3>
            <p>Compassion knows that children living in extreme poverty are vulnerable. We put their protection as our number one priority.
                <t t-if="not partner.date_agreed_child_protection_charter">We ask our volunteering friends and people that travel to visit their sponsored child to sign a child protection charter. If you want to make a step further, you can sign this document as well and show us that you share our values.
                </t>
                <t t-else="">
                    We thank you that you have signed our child protection charter. You can review the document at any time from here.
                </t>
            </p>
            <p>Compassion is also serious about the protection of your data. All your information is kept private and only used internally. You can sign or review our data protection policy from here.</p>

            <!-- Child protection charter -->
            <div class="row mb-2">
                <div class="col-6 border-right">
                    <label>Child protection charter</label>
                </div>
                <div class="col-6">
                    <t t-if="partner.date_agreed_child_protection_charter">
                        <span>Signing date: </span>
                        <t t-esc="partner.get_date('date_agreed_child_protection_charter', 'date_short')"/>
                        <a t-attf-href="/partner/#{partner.uuid}/child-protection-charter">(view agreement)</a>
                    </t>
                    <t t-else="">
                        <form t-attf-action="/partner/{{partner.uuid}}/child-protection-charter">
                            <input type="hidden" name="redirect" t-att-value="request.httprequest.path" id="redirect"/>
                            <t t-set="input_value">Sign Child Protection Charter</t>
                            <input id="child_charter" class="btn btn-primary w-100" t-att-value="input_value" type="submit"/>
                        </form>
                    </t>
                </div>
            </div>

            <!-- Data protection -->
            <div class="row">
                <div class="col-6 border-right">
                    <label>Data protection</label>
                </div>
                <div class="col-6">
                    <t t-if="partner.privacy_statement_ids">
                        <span>Signing date: </span>
                        <t t-esc="partner.get_date('privacy_statement_ids.agreement_date', 'date_short')"/>
                        <a href="https://compassion.ch/protection-des-donnees/" target="_blank">(view agreement)</a>
                    </t>
                    <t t-else="">
                        <form t-attf-action="/partner/#{partner.uuid}/privacy-statement-agreement">
                            <input type="hidden" name="redirect" t-att-value="request.httprequest.path" id="redirect"/>
                            <t t-set="input_value">Accept Privacy Policy</t>
                            <input id="privacy_charter" class="btn btn-primary w-100" type="submit" t-att-value="input_value"/>
                        </form>
                    </t>
                </div>
            </div>
        </template>

        <!-- Displays the communication preferences of the partner -->
        <template id="my_information_communication_pref">
            <h3 class="mt-4">Communication preferences</h3>
            <p t-if="request.env.lang == 'en_US' and partner.lang == 'en_US'">We serve our sponsors and donors in German, French and Italian. Why not change to your preferred language and expand your journey with Compassion?</p>
            <!-- Language --><commit_msg>FIX data protection URL translation<commit_after><?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <data>
        <!-- This templates creates the view "Personal information". It receives the following arguments: -->
        <!--     1. partner, the partner that is logged in -->
        <!--     2. coordinates_form, a form to modify the partner coordinates -->
        <!--     3. delivery_form, a form to modify the partner delivery preferences -->
        <template id="my_information_page_template" name="Personal information">
            <t t-set="selected" t-value="'info'"/>
            <t t-set="title">My personal data | <t t-esc="partner.company_id.address_name"/></t>
            <t t-call="website_compassion.my_account_layout">
                <div class="container">
                    <!-- Load modals for forms -->
                    <t t-set="form" t-value="coordinates_form"/>
                    <t t-call="cms_form_compassion.modal_form"/>
                    <t t-set="form" t-value="delivery_form"/>
                    <t t-call="cms_form_compassion.modal_form"/>
                    <div class="row">
                        <!-- Coordinates -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_profile_picture"/>
                        </div>
                        <!-- Communication preferences -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_communication_pref"/>
                        </div>
                    </div>
                    <div class="row">
                        <!-- Coordinates info -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_personal"/>
                        </div>
                        <!-- Privacy data and child protection -->
                        <div class="col-md-6">
                            <t t-call="website_compassion.my_information_privacy_data"/>
                        </div>
                    </div>
                    <hr class="my-4"/>
                    <div class="row">
                        <div class="col">
                            <h3 class="mb-4">Useful resources</h3>
                            <div t-field="partner.primary_segment_id.personalized_links" class="oe_structure"/>
                        </div>
                    </div>
                </div>
            </t>
        </template>

        <!-- The template that displays the personal information of the partner -->
        <template id="my_information_personal">
            <h3 class="mt-4">Coordinates</h3>

            <!-- Ref -->
            <t t-set="value" t-value="partner.ref"/>
            <t t-call="website_compassion.fill_key_value">My reference</t>

            <!-- Title -->
            <t t-set="value" t-value="partner.title.name"/>
            <t t-call="website_compassion.fill_key_value">Title</t>

            <!-- Name -->
            <t t-set="value" t-value="partner.name"/>
            <t t-call="website_compassion.fill_key_value">Name</t>

            <!-- Street -->
            <t t-set="value" t-value="partner.street"/>
            <t t-call="website_compassion.fill_key_value">Street</t>

            <!-- City -->
            <t t-set="value" t-value="' '.join(list(filter(None, [partner.zip, partner.city])))"/>
            <t t-call="website_compassion.fill_key_value">City</t>

            <!-- Country -->
            <t t-set="value" t-value="partner.country_id.name"/>
            <t t-call="website_compassion.fill_key_value">Country</t>

            <!-- Phone -->
            <t t-set="value" t-value="partner.phone"/>
            <t t-call="website_compassion.fill_key_value">Phone</t>

            <!-- Mobile -->
            <t t-set="value" t-value="partner.mobile"/>
            <t t-call="website_compassion.fill_key_value">Mobile</t>

            <!-- Email -->
            <t t-set="value" t-value="partner.email"/>
            <t t-call="website_compassion.fill_key_value">Email / login</t>

            <div class="d-flex mt-4">
                <!-- This button opens the form to modify the personal info -->
                <button type="button"
                        class="btn btn-primary mr-4"
                        data-toggle="modal"
                        data-target="#modal_my_coordinates">
                    Change
                </button>

                <form t-attf-action="/web/reset_password" method="POST">
                    <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                    <input type="hidden" name="login" t-att-value="partner.user_ids[:1].login" id="login"/>
                    <input type="hidden" name="redirect" value="/my/information" id="redirect"/>
                    <input type="hidden" name="token"/>

                    <button class="btn btn-primary ml-4">
                        Reset password
                        <a href="#" onclick="this.parentNode.parentNode.submit()"/>
                    </button>
                </form>
            </div>

        </template>

        <!-- Here the partner can modify its profile picture -->
        <template id="my_information_profile_picture">
            <h3 class="mt-4">Profile picture</h3>
            <p>This picture is used when you create or join a project on our crowdfunding platform TOGETHER, or when you join a Muskathlon.</p>
            <form id="form_picture" action="/my/picture" method="POST" enctype="multipart/form-data">
                <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                <input type="file" name="picture" id="upload_picture"  onchange="startStopLoading(true); this.parentNode.submit()" accept="image/*" style="display: none;"/>
            </form>
            <div t-field="partner.image" t-options="{'widget': 'image'}" style="max-width: 200px;"/>
            <button id="picture_normal" onclick="document.getElementById('upload_picture').click()" class="btn btn-primary mt-2" style="width: 200px;">
                Change
            </button>
            <!-- This appears only while loading the new profile picture, via JS -->
            <button id="picture_loading" class="btn btn-primary mt-2" type="button" disabled="true" style="display: none; width: 200px;">
                <span class="spinner-border spinner-border-sm" role="status"/>
                Changing...
            </button>
            <!-- This script makes the buttons clickable or unclickable depending on loading -->
            <script type="text/javascript">
                const startStopLoading = function(start) {
                    $("button").attr('disabled', start);
                    $("#child_charter").attr('disabled', start);
                    $("#privacy_charter").attr('disabled', start);
                    document.getElementById("picture_normal").style.display = start ? "none" : "";
                    document.getElementById("picture_loading").style.display = start ? "" : "none";
                }

                window.onload = function() {
                    startStopLoading(false);
                }
            </script>
        </template>

        <!-- Display the date at which the partner signed some charters, otherwise propose to sign them -->
        <template id="my_information_privacy_data">
            <h3 class="mt-4">Privacy data</h3>
            <p>Compassion knows that children living in extreme poverty are vulnerable. We put their protection as our number one priority.
                <t t-if="not partner.date_agreed_child_protection_charter">We ask our volunteering friends and people that travel to visit their sponsored child to sign a child protection charter. If you want to make a step further, you can sign this document as well and show us that you share our values.
                </t>
                <t t-else="">
                    We thank you that you have signed our child protection charter. You can review the document at any time from here.
                </t>
            </p>
            <p>Compassion is also serious about the protection of your data. All your information is kept private and only used internally. You can sign or review our data protection policy from here.</p>

            <!-- Child protection charter -->
            <div class="row mb-2">
                <div class="col-6 border-right">
                    <label>Child protection charter</label>
                </div>
                <div class="col-6">
                    <t t-if="partner.date_agreed_child_protection_charter">
                        <span>Signing date: </span>
                        <t t-esc="partner.get_date('date_agreed_child_protection_charter', 'date_short')"/>
                        <a t-attf-href="/partner/#{partner.uuid}/child-protection-charter">(view agreement)</a>
                    </t>
                    <t t-else="">
                        <form t-attf-action="/partner/{{partner.uuid}}/child-protection-charter">
                            <input type="hidden" name="redirect" t-att-value="request.httprequest.path" id="redirect"/>
                            <t t-set="input_value">Sign Child Protection Charter</t>
                            <input id="child_charter" class="btn btn-primary w-100" t-att-value="input_value" type="submit"/>
                        </form>
                    </t>
                </div>
            </div>

            <!-- Data protection -->
            <div class="row">
                <div class="col-6 border-right">
                    <label>Data protection</label>
                </div>
                <div class="col-6">
                    <t t-if="partner.privacy_statement_ids">
                        <span>Signing date: </span>
                        <t t-esc="partner.get_date('privacy_statement_ids.agreement_date', 'date_short')"/>
                        <t t-set="data_protection_url">https://compassion.ch/protection-des-donnees/</t>
                        <a t-att-href="data_protection_url" target="_blank">(view agreement)</a>
                    </t>
                    <t t-else="">
                        <form t-attf-action="/partner/#{partner.uuid}/privacy-statement-agreement">
                            <input type="hidden" name="redirect" t-att-value="request.httprequest.path" id="redirect"/>
                            <t t-set="input_value">Accept Privacy Policy</t>
                            <input id="privacy_charter" class="btn btn-primary w-100" type="submit" t-att-value="input_value"/>
                        </form>
                    </t>
                </div>
            </div>
        </template>

        <!-- Displays the communication preferences of the partner -->
        <template id="my_information_communication_pref">
            <h3 class="mt-4">Communication preferences</h3>
            <p t-if="request.env.lang == 'en_US' and partner.lang == 'en_US'">We serve our sponsors and donors in German, French and Italian. Why not change to your preferred language and expand your journey with Compassion?</p>
            <!-- Language -->
{'fraction_non_alphanumeric': 0.13575525812619502, 'fraction_numerical': 0.00462448308061719, 'mean_word_length': 1.608746085140935, 'pattern_counts': {'":': 0, '<': 393, '<?xml version=': 2, '>': 393, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1459317', 'n_tokens_mistral': 6001, 'n_tokens_neox': 5647, 'n_words': 1350}