Skip to content
Snippets Groups Projects
Commit 161923d0 authored by daniquilez's avatar daniquilez
Browse files

apply linter corrections

parent c57dba75
No related branches found
No related tags found
2 merge requests!277[REL] Release Sprint 27/11/23,!244Feature/company data public form
Pipeline #67537 passed
...@@ -356,6 +356,8 @@ class WebsiteCommunityData(http.Controller): ...@@ -356,6 +356,8 @@ class WebsiteCommunityData(http.Controller):
): ):
values["ce_state"] = False values["ce_state"] = False
# energy_services selection # energy_services selection
if "ce_services" not in values.keys() or values["ce_services"] == "":
values["ce_services"] = []
values["energy_service_options"] = self._get_energy_service_tags() values["energy_service_options"] = self._get_energy_service_tags()
# community_status selection # community_status selection
values["yes_no_options"] = _YES_NO_OPTIONS values["yes_no_options"] = _YES_NO_OPTIONS
...@@ -375,6 +377,12 @@ class WebsiteCommunityData(http.Controller): ...@@ -375,6 +377,12 @@ class WebsiteCommunityData(http.Controller):
] = _COMMUNITY_CONSTITUTION_STATUS_OPTIONS ] = _COMMUNITY_CONSTITUTION_STATUS_OPTIONS
# community_legal_form selection # community_legal_form selection
values["community_legal_form_options"] = self._get_legal_forms() values["community_legal_form_options"] = self._get_legal_forms()
# image preselection from db (if necessary)
for image_field_key in _COMMUNITY_DATA__IMAGE_FIELDS.keys():
if image_field_key not in values.keys():
lead_values = self._get_lead_values(values["lead_id"])
if image_field_key in lead_values:
values[image_field_key] = lead_values[image_field_key]
# form/messages visibility # form/messages visibility
values["display_success"] = display_success values["display_success"] = display_success
values["display_form"] = display_form values["display_form"] = display_form
...@@ -438,6 +446,13 @@ class WebsiteCommunityData(http.Controller): ...@@ -438,6 +446,13 @@ class WebsiteCommunityData(http.Controller):
if "error_msgs" in values.keys(): if "error_msgs" in values.keys():
return request.render("energy_communities.community_data_page", values) return request.render("energy_communities.community_data_page", values)
# ce_services validation
if "ce_services" not in values.keys():
error.append("ce_services")
error_msgs.append(
"Please select at least one Energy service in order to submit the form"
)
# image validation # image validation
for image_field_key in _COMMUNITY_DATA__IMAGE_FIELDS.keys(): for image_field_key in _COMMUNITY_DATA__IMAGE_FIELDS.keys():
if image_field_key in values.keys(): if image_field_key in values.keys():
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<t t-set="value" t-value="ce_name" /> <t t-set="value" t-value="ce_name" />
<t t-set="key" t-value="ce_name_key" /> <t t-set="key" t-value="ce_name_key" />
<t t-set="label" t-value="ce_name_label" /> <t t-set="label" t-value="ce_name_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<t t-set="value" t-value="ce_fiscal_name" /> <t t-set="value" t-value="ce_fiscal_name" />
<t t-set="key" t-value="ce_fiscal_name_key" /> <t t-set="key" t-value="ce_fiscal_name_key" />
<t t-set="label" t-value="ce_fiscal_name_label" /> <t t-set="label" t-value="ce_fiscal_name_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_1 or pack_2"> <div class="col-md-12" t-if="pack_1 or pack_2">
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
<t t-set="key" t-value="ce_description_key" /> <t t-set="key" t-value="ce_description_key" />
<t t-set="label" t-value="ce_description_label" /> <t t-set="label" t-value="ce_description_label" />
<t t-set="rows" t-value="5" /> <t t-set="rows" t-value="5" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_1 or pack_2"> <div class="col-md-12" t-if="pack_1 or pack_2">
...@@ -47,6 +50,7 @@ ...@@ -47,6 +50,7 @@
<t t-set="key" t-value="ce_long_description_key" /> <t t-set="key" t-value="ce_long_description_key" />
<t t-set="label" t-value="ce_long_description_label" /> <t t-set="label" t-value="ce_long_description_label" />
<t t-set="rows" t-value="10" /> <t t-set="rows" t-value="10" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_1 or pack_2"> <div class="col-md-6" t-if="pack_1 or pack_2">
...@@ -54,6 +58,7 @@ ...@@ -54,6 +58,7 @@
<t t-set="value" t-value="ce_address" /> <t t-set="value" t-value="ce_address" />
<t t-set="key" t-value="ce_address_key" /> <t t-set="key" t-value="ce_address_key" />
<t t-set="label" t-value="ce_address_label" /> <t t-set="label" t-value="ce_address_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_1 or pack_2"> <div class="col-md-6" t-if="pack_1 or pack_2">
...@@ -61,6 +66,7 @@ ...@@ -61,6 +66,7 @@
<t t-set="value" t-value="ce_zip" /> <t t-set="value" t-value="ce_zip" />
<t t-set="key" t-value="ce_zip_key" /> <t t-set="key" t-value="ce_zip_key" />
<t t-set="label" t-value="ce_zip_label" /> <t t-set="label" t-value="ce_zip_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_1 or pack_2"> <div class="col-md-6" t-if="pack_1 or pack_2">
...@@ -68,6 +74,7 @@ ...@@ -68,6 +74,7 @@
<t t-set="value" t-value="ce_city" /> <t t-set="value" t-value="ce_city" />
<t t-set="key" t-value="ce_city_key" /> <t t-set="key" t-value="ce_city_key" />
<t t-set="label" t-value="ce_city_label" /> <t t-set="label" t-value="ce_city_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_1 or pack_2"> <div class="col-md-6" t-if="pack_1 or pack_2">
...@@ -76,6 +83,7 @@ ...@@ -76,6 +83,7 @@
<t t-set="key" t-value="ce_state_key" /> <t t-set="key" t-value="ce_state_key" />
<t t-set="label" t-value="ce_state_label" /> <t t-set="label" t-value="ce_state_label" />
<t t-set="options" t-value="state_options" /> <t t-set="options" t-value="state_options" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_1 or pack_2"> <div class="col-md-6" t-if="pack_1 or pack_2">
...@@ -83,6 +91,7 @@ ...@@ -83,6 +91,7 @@
<t t-set="value" t-value="email_from" /> <t t-set="value" t-value="email_from" />
<t t-set="key" t-value="email_from_key" /> <t t-set="key" t-value="email_from_key" />
<t t-set="label" t-value="email_from_label" /> <t t-set="label" t-value="email_from_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_1 or pack_2"> <div class="col-md-6" t-if="pack_1 or pack_2">
...@@ -90,6 +99,7 @@ ...@@ -90,6 +99,7 @@
<t t-set="value" t-value="contact_phone" /> <t t-set="value" t-value="contact_phone" />
<t t-set="key" t-value="contact_phone_key" /> <t t-set="key" t-value="contact_phone_key" />
<t t-set="label" t-value="contact_phone_label" /> <t t-set="label" t-value="contact_phone_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_1 or pack_2"> <div class="col-md-12" t-if="pack_1 or pack_2">
...@@ -98,6 +108,7 @@ ...@@ -98,6 +108,7 @@
<t t-set="key" t-value="current_lang_key" /> <t t-set="key" t-value="current_lang_key" />
<t t-set="label" t-value="current_lang_label" /> <t t-set="label" t-value="current_lang_label" />
<t t-set="options" t-value="lang_options" /> <t t-set="options" t-value="lang_options" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_1 or pack_2"> <div class="col-md-12" t-if="pack_1 or pack_2">
...@@ -106,6 +117,7 @@ ...@@ -106,6 +117,7 @@
<t t-set="key" t-value="ce_services_key" /> <t t-set="key" t-value="ce_services_key" />
<t t-set="label" t-value="ce_services_label" /> <t t-set="label" t-value="ce_services_label" />
<t t-set="options" t-value="energy_service_options" /> <t t-set="options" t-value="energy_service_options" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_1 or pack_2"> <div class="col-md-12" t-if="pack_1 or pack_2">
...@@ -113,6 +125,7 @@ ...@@ -113,6 +125,7 @@
<t t-set="value" t-value="ce_number_of_members" /> <t t-set="value" t-value="ce_number_of_members" />
<t t-set="key" t-value="ce_number_of_members_key" /> <t t-set="key" t-value="ce_number_of_members_key" />
<t t-set="label" t-value="ce_number_of_members_label" /> <t t-set="label" t-value="ce_number_of_members_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_1 or pack_2"> <div class="col-md-12" t-if="pack_1 or pack_2">
...@@ -121,6 +134,7 @@ ...@@ -121,6 +134,7 @@
<t t-set="key" t-value="ce_status_key" /> <t t-set="key" t-value="ce_status_key" />
<t t-set="label" t-value="ce_status_label" /> <t t-set="label" t-value="ce_status_label" />
<t t-set="options" t-value="community_status_options" /> <t t-set="options" t-value="community_status_options" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_1 or pack_2"> <div class="col-md-12" t-if="pack_1 or pack_2">
...@@ -131,7 +145,7 @@ ...@@ -131,7 +145,7 @@
<t t-set="rows" t-value="5" /> <t t-set="rows" t-value="5" />
<t t-set="maxlength" t-value="100" /> <t t-set="maxlength" t-value="100" />
<t <t
t-set="field_description" t-set="description"
>In this section you can briefly explain the advantages of joining the community</t> >In this section you can briefly explain the advantages of joining the community</t>
</t> </t>
</div> </div>
...@@ -143,7 +157,7 @@ ...@@ -143,7 +157,7 @@
<t t-set="rows" t-value="5" /> <t t-set="rows" t-value="5" />
<t t-set="maxlength" t-value="100" /> <t t-set="maxlength" t-value="100" />
<t <t
t-set="field_description" t-set="description"
>Explain the process to become cooperator. Include payment information.</t> >Explain the process to become cooperator. Include payment information.</t>
</t> </t>
</div> </div>
...@@ -153,7 +167,8 @@ ...@@ -153,7 +167,8 @@
<t t-set="value" t-value="ce_primary_image_file" /> <t t-set="value" t-value="ce_primary_image_file" />
<t t-set="key" t-value="ce_primary_image_file_key" /> <t t-set="key" t-value="ce_primary_image_file_key" />
<t t-set="label" t-value="ce_primary_image_file_label" /> <t t-set="label" t-value="ce_primary_image_file_label" />
<t t-set="field_description">If possible upload a group image</t> <t t-set="description">If possible upload a group image</t>
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
</div> </div>
...@@ -163,6 +178,7 @@ ...@@ -163,6 +178,7 @@
<t t-set="value" t-value="ce_secondary_image_file" /> <t t-set="value" t-value="ce_secondary_image_file" />
<t t-set="key" t-value="ce_secondary_image_file_key" /> <t t-set="key" t-value="ce_secondary_image_file_key" />
<t t-set="label" t-value="ce_secondary_image_file_label" /> <t t-set="label" t-value="ce_secondary_image_file_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
</div> </div>
...@@ -181,6 +197,7 @@ ...@@ -181,6 +197,7 @@
<t t-set="key" t-value="ce_type_key" /> <t t-set="key" t-value="ce_type_key" />
<t t-set="label" t-value="ce_type_label" /> <t t-set="label" t-value="ce_type_label" />
<t t-set="options" t-value="community_type_options" /> <t t-set="options" t-value="community_type_options" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -189,6 +206,7 @@ ...@@ -189,6 +206,7 @@
<t t-set="key" t-value="ce_constitution_status_key" /> <t t-set="key" t-value="ce_constitution_status_key" />
<t t-set="label" t-value="ce_constitution_status_label" /> <t t-set="label" t-value="ce_constitution_status_label" />
<t t-set="options" t-value="community_constitution_status_options" /> <t t-set="options" t-value="community_constitution_status_options" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -196,6 +214,7 @@ ...@@ -196,6 +214,7 @@
<t t-set="value" t-value="ce_constitution_status_other" /> <t t-set="value" t-value="ce_constitution_status_other" />
<t t-set="key" t-value="ce_constitution_status_other_key" /> <t t-set="key" t-value="ce_constitution_status_other_key" />
<t t-set="label" t-value="ce_constitution_status_other_label" /> <t t-set="label" t-value="ce_constitution_status_other_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_2"> <div class="col-md-6" t-if="pack_2">
...@@ -204,6 +223,7 @@ ...@@ -204,6 +223,7 @@
<t t-set="key" t-value="ce_legal_form_key" /> <t t-set="key" t-value="ce_legal_form_key" />
<t t-set="label" t-value="ce_legal_form_label" /> <t t-set="label" t-value="ce_legal_form_label" />
<t t-set="options" t-value="community_legal_form_options" /> <t t-set="options" t-value="community_legal_form_options" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -211,6 +231,7 @@ ...@@ -211,6 +231,7 @@
<t t-set="value" t-value="ce_creation_date" /> <t t-set="value" t-value="ce_creation_date" />
<t t-set="key" t-value="ce_creation_date_key" /> <t t-set="key" t-value="ce_creation_date_key" />
<t t-set="label" t-value="ce_creation_date_label" /> <t t-set="label" t-value="ce_creation_date_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -218,6 +239,7 @@ ...@@ -218,6 +239,7 @@
<t t-set="value" t-value="ce_vat" /> <t t-set="value" t-value="ce_vat" />
<t t-set="key" t-value="ce_vat_key" /> <t t-set="key" t-value="ce_vat_key" />
<t t-set="label" t-value="ce_vat_label" /> <t t-set="label" t-value="ce_vat_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -225,6 +247,7 @@ ...@@ -225,6 +247,7 @@
<t t-set="value" t-value="ce_member_mandatory_contribution" /> <t t-set="value" t-value="ce_member_mandatory_contribution" />
<t t-set="key" t-value="ce_member_mandatory_contribution_key" /> <t t-set="key" t-value="ce_member_mandatory_contribution_key" />
<t t-set="label" t-value="ce_member_mandatory_contribution_label" /> <t t-set="label" t-value="ce_member_mandatory_contribution_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -233,9 +256,9 @@ ...@@ -233,9 +256,9 @@
<t t-set="key" t-value="ce_registration_tool_key" /> <t t-set="key" t-value="ce_registration_tool_key" />
<t t-set="label" t-value="ce_registration_tool_label" /> <t t-set="label" t-value="ce_registration_tool_label" />
<t t-set="rows" t-value="5" /> <t t-set="rows" t-value="5" />
<!--<t t-set="maxlength" t-value="100" />--> <t t-set="required" t-value="pack_2" />
<t <t
t-set="field_description" t-set="description"
>Non-computer support, Excels, computer program (which one?)</t> >Non-computer support, Excels, computer program (which one?)</t>
</t> </t>
</div> </div>
...@@ -245,6 +268,7 @@ ...@@ -245,6 +268,7 @@
<t t-set="key" t-value="ce_account_management_key" /> <t t-set="key" t-value="ce_account_management_key" />
<t t-set="label" t-value="ce_account_management_label" /> <t t-set="label" t-value="ce_account_management_label" />
<t t-set="options" t-value="community_management_options" /> <t t-set="options" t-value="community_management_options" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -253,6 +277,7 @@ ...@@ -253,6 +277,7 @@
<t t-set="key" t-value="ce_tax_management_key" /> <t t-set="key" t-value="ce_tax_management_key" />
<t t-set="label" t-value="ce_tax_management_label" /> <t t-set="label" t-value="ce_tax_management_label" />
<t t-set="options" t-value="community_management_options" /> <t t-set="options" t-value="community_management_options" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -261,6 +286,7 @@ ...@@ -261,6 +286,7 @@
<t t-set="key" t-value="ce_management_can_enter_platform_key" /> <t t-set="key" t-value="ce_management_can_enter_platform_key" />
<t t-set="label" t-value="ce_management_can_enter_platform_label" /> <t t-set="label" t-value="ce_management_can_enter_platform_label" />
<t t-set="options" t-value="yes_no_options" /> <t t-set="options" t-value="yes_no_options" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -269,6 +295,7 @@ ...@@ -269,6 +295,7 @@
<t t-set="key" t-value="ce_manager_key" /> <t t-set="key" t-value="ce_manager_key" />
<t t-set="label" t-value="ce_manager_label" /> <t t-set="label" t-value="ce_manager_label" />
<t t-set="options" t-value="community_manager_options" /> <t t-set="options" t-value="community_manager_options" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -280,6 +307,7 @@ ...@@ -280,6 +307,7 @@
<t t-set="value" t-value="ce_manager_firstname" /> <t t-set="value" t-value="ce_manager_firstname" />
<t t-set="key" t-value="ce_manager_firstname_key" /> <t t-set="key" t-value="ce_manager_firstname_key" />
<t t-set="label" t-value="ce_manager_firstname_label" /> <t t-set="label" t-value="ce_manager_firstname_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_2"> <div class="col-md-6" t-if="pack_2">
...@@ -287,6 +315,7 @@ ...@@ -287,6 +315,7 @@
<t t-set="value" t-value="ce_manager_surname" /> <t t-set="value" t-value="ce_manager_surname" />
<t t-set="key" t-value="ce_manager_surname_key" /> <t t-set="key" t-value="ce_manager_surname_key" />
<t t-set="label" t-value="ce_manager_surname_label" /> <t t-set="label" t-value="ce_manager_surname_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_2"> <div class="col-md-6" t-if="pack_2">
...@@ -294,6 +323,7 @@ ...@@ -294,6 +323,7 @@
<t t-set="value" t-value="ce_manager_email" /> <t t-set="value" t-value="ce_manager_email" />
<t t-set="key" t-value="ce_manager_email_key" /> <t t-set="key" t-value="ce_manager_email_key" />
<t t-set="label" t-value="ce_manager_email_label" /> <t t-set="label" t-value="ce_manager_email_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-6" t-if="pack_2"> <div class="col-md-6" t-if="pack_2">
...@@ -301,6 +331,7 @@ ...@@ -301,6 +331,7 @@
<t t-set="value" t-value="ce_manager_phone" /> <t t-set="value" t-value="ce_manager_phone" />
<t t-set="key" t-value="ce_manager_phone_key" /> <t t-set="key" t-value="ce_manager_phone_key" />
<t t-set="label" t-value="ce_manager_phone_label" /> <t t-set="label" t-value="ce_manager_phone_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -309,6 +340,7 @@ ...@@ -309,6 +340,7 @@
<t t-set="key" t-value="ce_payment_method_key" /> <t t-set="key" t-value="ce_payment_method_key" />
<t t-set="label" t-value="ce_payment_method_label" /> <t t-set="label" t-value="ce_payment_method_label" />
<t t-set="options" t-value="community_payment_method_options" /> <t t-set="options" t-value="community_payment_method_options" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -316,6 +348,7 @@ ...@@ -316,6 +348,7 @@
<t t-set="value" t-value="ce_iban_1" /> <t t-set="value" t-value="ce_iban_1" />
<t t-set="key" t-value="ce_iban_1_key" /> <t t-set="key" t-value="ce_iban_1_key" />
<t t-set="label" t-value="ce_iban_1_label" /> <t t-set="label" t-value="ce_iban_1_label" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -331,6 +364,7 @@ ...@@ -331,6 +364,7 @@
<t t-set="key" t-value="ce_extra_charges_key" /> <t t-set="key" t-value="ce_extra_charges_key" />
<t t-set="label" t-value="ce_extra_charges_label" /> <t t-set="label" t-value="ce_extra_charges_label" />
<t t-set="rows" t-value="5" /> <t t-set="rows" t-value="5" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -339,6 +373,7 @@ ...@@ -339,6 +373,7 @@
<t t-set="key" t-value="ce_voluntary_contributions_key" /> <t t-set="key" t-value="ce_voluntary_contributions_key" />
<t t-set="label" t-value="ce_voluntary_contributions_label" /> <t t-set="label" t-value="ce_voluntary_contributions_label" />
<t t-set="rows" t-value="5" /> <t t-set="rows" t-value="5" />
<t t-set="required" t-value="pack_2" />
</t> </t>
</div> </div>
<div class="col-md-12" t-if="pack_2"> <div class="col-md-12" t-if="pack_2">
...@@ -389,6 +424,7 @@ ...@@ -389,6 +424,7 @@
<t t-set="value" t-value="ce_privacy_policy" /> <t t-set="value" t-value="ce_privacy_policy" />
<t t-set="key" t-value="ce_privacy_policy_key" /> <t t-set="key" t-value="ce_privacy_policy_key" />
<t t-set="label" t-value="ce_privacy_policy_label" /> <t t-set="label" t-value="ce_privacy_policy_label" />
<t t-set="required" t-value="True" />
</t> </t>
</div> </div>
<!-- TODO: Make this description dynamic and db translatable --> <!-- TODO: Make this description dynamic and db translatable -->
......
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<template id="form_field_part_description" name="form_field_part_description"> <template id="form_field_part_description" name="form_field_part_description">
<label <span
style="font-size:13px;font-family:'Roboto',sans-serif;font-weight:300;" style="display:block;font-size:13px;font-family:'Roboto',sans-serif;font-weight:300;"
t-if="description" t-if="field_description"
><t t-esc="description" /></label> ><t t-esc="field_description" /></span>
</template>
<template id="form_field_part_label" name="form_field_part_label">
<label t-att="{'for': field_key}"><t t-esc="field_label" /><span
t-if="field_required"
> *</span></label>
</template> </template>
<template id="form_field_text" name="form_field_text"> <template id="form_field_text" name="form_field_text">
<div <div
t-attf-name="#{key}_container" t-attf-name="#{key}_container"
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<input <input
class="form-control form-control-sm" class="form-control form-control-sm"
...@@ -21,6 +30,7 @@ ...@@ -21,6 +30,7 @@
type="text" type="text"
t-attf-name="#{key}" t-attf-name="#{key}"
t-attf-value="#{value or ''}" t-attf-value="#{value or ''}"
t-att-required="required"
/> />
</div> </div>
</template> </template>
...@@ -29,9 +39,13 @@ ...@@ -29,9 +39,13 @@
t-attf-name="#{key}_container" t-attf-name="#{key}_container"
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<input <input
class="form-control form-control-sm" class="form-control form-control-sm"
...@@ -40,6 +54,7 @@ ...@@ -40,6 +54,7 @@
t-attf-name="#{key}" t-attf-name="#{key}"
min="1" min="1"
t-attf-value="#{value or ''}" t-attf-value="#{value or ''}"
t-att-required="required"
/> />
</div> </div>
</template> </template>
...@@ -48,9 +63,13 @@ ...@@ -48,9 +63,13 @@
t-attf-name="#{key}_container" t-attf-name="#{key}_container"
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<input <input
class="form-control form-control-sm" class="form-control form-control-sm"
...@@ -59,6 +78,7 @@ ...@@ -59,6 +78,7 @@
type="email" type="email"
t-attf-name="#{key}" t-attf-name="#{key}"
t-attf-value="#{value or ''}" t-attf-value="#{value or ''}"
t-att-required="required"
/> />
</div> </div>
</template> </template>
...@@ -67,9 +87,13 @@ ...@@ -67,9 +87,13 @@
t-attf-name="#{key}_container" t-attf-name="#{key}_container"
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<textarea <textarea
class="form-control form-control-sm" class="form-control form-control-sm"
...@@ -77,6 +101,7 @@ ...@@ -77,6 +101,7 @@
t-attf-name="#{key}" t-attf-name="#{key}"
t-attf-rows="#{rows}" t-attf-rows="#{rows}"
t-attf-maxlength="#{maxlength}" t-attf-maxlength="#{maxlength}"
t-att-required="required"
><t t-esc="value or ''" /></textarea> ><t t-esc="value or ''" /></textarea>
</div> </div>
</template> </template>
...@@ -85,14 +110,19 @@ ...@@ -85,14 +110,19 @@
t-attf-name="#{key}_container" t-attf-name="#{key}_container"
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<select <select
class="form-control form-control-sm" class="form-control form-control-sm"
t-attf-id="#{key}" t-attf-id="#{key}"
t-attf-name="#{key}" t-attf-name="#{key}"
t-att-required="required"
> >
<option value="">Please choose an option</option> <option value="">Please choose an option</option>
<t t-foreach="options or []" t-as="option"> <t t-foreach="options or []" t-as="option">
...@@ -111,10 +141,15 @@ ...@@ -111,10 +141,15 @@
t-attf-name="#{key}_container" t-attf-name="#{key}_container"
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<fieldset> <!-- TODO: Required validation trough javascript -->
<label t-att="{'for': key}"><t t-esc="label" /></label> <fieldset t-att-required="required">
<t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<t t-foreach="options or []" t-as="option"> <t t-foreach="options or []" t-as="option">
<div> <div>
...@@ -122,14 +157,7 @@ ...@@ -122,14 +157,7 @@
type="checkbox" type="checkbox"
t-att-id="option['id']" t-att-id="option['id']"
t-att-name="option['id']" t-att-name="option['id']"
t-if="option['id'] in value" t-att-checked="option['id'] in value"
checked="0"
/>
<input
type="checkbox"
t-att-id="option['id']"
t-att-name="option['id']"
t-if="option['id'] not in value"
/> />
<span><t t-esc="option['name']" /></span> <span><t t-esc="option['name']" /></span>
</div> </div>
...@@ -147,14 +175,17 @@ ...@@ -147,14 +175,17 @@
type="checkbox" type="checkbox"
t-att-id="key" t-att-id="key"
t-att-name="key" t-att-name="key"
t-if="value=='on'" t-att-checked="value=='on'"
checked="0" t-att-required="required"
/> />
<input type="checkbox" t-att-id="key" t-att-name="key" t-if="value=='off'" /> <t t-call="energy_communities.form_field_part_label">
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
</div> </div>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
</div> </div>
</template> </template>
...@@ -164,9 +195,13 @@ ...@@ -164,9 +195,13 @@
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<fieldset> <fieldset>
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<t t-foreach="options or []" t-as="option"> <t t-foreach="options or []" t-as="option">
<div> <div>
...@@ -175,15 +210,8 @@ ...@@ -175,15 +210,8 @@
t-att-id="option['id']" t-att-id="option['id']"
t-att-value="option['id']" t-att-value="option['id']"
t-att-name="key" t-att-name="key"
t-if="option['id'] == value" t-att-checked="option['id'] == value"
checked="0" t-att-required="required"
/>
<input
type="radio"
t-att-id="option['id']"
t-att-value="option['id']"
t-att-name="key"
t-if="option['id'] != value"
/> />
<span><t t-esc="option['name']" /></span> <span><t t-esc="option['name']" /></span>
</div> </div>
...@@ -197,12 +225,16 @@ ...@@ -197,12 +225,16 @@
t-attf-name="#{key}_container" t-attf-name="#{key}_container"
t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}" t-attf-class="form-group #{error and key in error and 'has-error' or ''} field-#{key}"
> >
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description" t-value="field_description" /> <t t-set="field_description" t-value="description" />
</t> </t>
<t t-call="energy_communities.form_field_part_description"> <t t-call="energy_communities.form_field_part_description">
<t t-set="description"> <t t-set="field_description">
Upload a new one to change Upload a new one to change
</t> </t>
</t> </t>
...@@ -211,6 +243,7 @@ ...@@ -211,6 +243,7 @@
accept="image/*" accept="image/*"
class="form-control form-control-sm #{key}" class="form-control form-control-sm #{key}"
t-attf-name="#{key}" t-attf-name="#{key}"
t-att-required="required and not value"
/> />
</div> </div>
</div> </div>
...@@ -226,7 +259,11 @@ ...@@ -226,7 +259,11 @@
<t t-set="date_placeholder" t-if="lang=='ca_ES'">dd/mm/aaaa</t> <t t-set="date_placeholder" t-if="lang=='ca_ES'">dd/mm/aaaa</t>
<t t-set="date_placeholder" t-if="lang=='es_ES'">dd/mm/aaaa</t> <t t-set="date_placeholder" t-if="lang=='es_ES'">dd/mm/aaaa</t>
<t t-set="date_placeholder" t-if="lang=='en_US'">dd/mm/yyyy</t> <t t-set="date_placeholder" t-if="lang=='en_US'">dd/mm/yyyy</t>
<label t-att="{'for': key}"><t t-esc="label" /></label> <t t-call="energy_communities.form_field_part_label">
<t t-set="field_key" t-value="key" />
<t t-set="field_label" t-value="label" />
<t t-set="field_required" t-value="required" />
</t>
<input <input
class="form-control form-control-sm o_website_form_date_past" class="form-control form-control-sm o_website_form_date_past"
type="text" type="text"
...@@ -235,6 +272,7 @@ ...@@ -235,6 +272,7 @@
t-attf-value="#{value or ''}" t-attf-value="#{value or ''}"
t-attf-data-locale="#{lang}" t-attf-data-locale="#{lang}"
t-attf-placeholder="#{date_placeholder}" t-attf-placeholder="#{date_placeholder}"
t-att-required="required"
/> />
</div> </div>
</template> </template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment