Skip to content

Commit

Permalink
T1537 - my compassion data protection (#29)
Browse files Browse the repository at this point in the history
* feat: add accept privacy data in profile

* fix: add button spacing and translation

---------

Co-authored-by: Clément <[email protected]>
  • Loading branch information
clementcharmillot and Clément authored Aug 8, 2024
1 parent a51715f commit c7a7041
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion my_compassion/controllers/my_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def my_donations(self, invoice_page=1, invoice_per_page=12, **kw):
return request.render("my_compassion.my_donations_page_template", values)

@route("/my/information", type="http", auth="user", website=True)
def my_information(self, form_id=None, **kw):
def my_information(self, form_id=None, privacy_policy=None, **kw):
"""
The route to display the information about the partner
:param form_id: the form that has been filled or None
Expand All @@ -548,6 +548,10 @@ def my_information(self, form_id=None, **kw):
"partner": partner,
}
)

if privacy_policy == "accepted" and not partner.legal_agreement_date:
partner.legal_agreement_date = datetime.now()

return request.render("my_compassion.my_information_page_template", values)

@route("/my/download/<source>", type="http", auth="user", website=True)
Expand Down
5 changes: 5 additions & 0 deletions my_compassion/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ msgstr ""
msgid "(view agreement)"
msgstr "(Vereinbarung anzeigen)"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_information_privacy_data
msgid "Sign the Agreement"
msgstr "Unterschreiben"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_gift_history
#: model_terms:ir.ui.view,arch_db:my_compassion.my_donations_gift_history
Expand Down
5 changes: 5 additions & 0 deletions my_compassion/i18n/fr_CH.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ msgstr ""
msgid "(view agreement)"
msgstr "(voir le contrat)"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_information_privacy_data
msgid "Sign the Agreement"
msgstr "Signer"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_gift_history
#: model_terms:ir.ui.view,arch_db:my_compassion.my_donations_gift_history
Expand Down
23 changes: 23 additions & 0 deletions my_compassion/templates/my_account_personal_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,29 @@
/>
<a href="/legal" target="_blank">(view agreement)</a>
</t>
<form t-else="" enctype="application/x-www-form-urlencoded">
<div class="form-check">
<input
type="checkbox"
value="accepted"
id="privacy_policy"
name="privacy_policy"
class="s_website_form_input form-check-input"
/>
<label
class="form-check-label font-weight-normal"
for="privacy_policy"
>
<t
t-call="website_legal_page.acceptance_full"
/>
</label>
</div>
<button
class="btn btn-primary w-100 mt-2"
type="submit"
>Sign the Agreement</button>
</form>
</div>
</div>
</template>
Expand Down

0 comments on commit c7a7041

Please sign in to comment.