diff --git a/base/templates/multi_approval_condition/condition_edit_form.html b/base/templates/multi_approval_condition/condition_edit_form.html index 85aaed1e6..48d7da083 100644 --- a/base/templates/multi_approval_condition/condition_edit_form.html +++ b/base/templates/multi_approval_condition/condition_edit_form.html @@ -174,10 +174,3 @@ - diff --git a/dynamic_fields/templates/dynamic_fields/common/form.html b/dynamic_fields/templates/dynamic_fields/common/form.html index 1ff4984f2..dd12dd593 100644 --- a/dynamic_fields/templates/dynamic_fields/common/form.html +++ b/dynamic_fields/templates/dynamic_fields/common/form.html @@ -83,11 +83,3 @@ - diff --git a/horilla_views/templates/generic/form.html b/horilla_views/templates/generic/form.html index b6efea7d2..bb3947304 100644 --- a/horilla_views/templates/generic/form.html +++ b/horilla_views/templates/generic/form.html @@ -1,93 +1,81 @@ {% load widget_tweaks %} {% load i18n %} {% load generic_template_filters %} + {% if form.verbose_name %} -
-

- {{form.verbose_name}} -

- -
-{% endif %} -
- {% if form.instance_ids %} -
- - - -
- {% endif %} -
-
-
-
{{ form.non_field_errors }}
- {% for field in form.visible_fields %} -
-
- - {% if field.help_text != '' %} - - {% endif %} -
- - {% if field.field.widget.input_type == 'checkbox' %} -
- {{ field|add_class:'oh-switch__checkbox' }} -
- {% else %} -
- {{ field|add_class:'form-control' }} - {{ field.errors }} -
- {% endif %} -
- {% endfor %} -
- - {% for field in form.hidden_fields %} {{ field }} {% endfor %} - -
- -
-
+{% endif %} + +
+ {% if form.instance_ids %} +
+ + + +
+ {% endif %} +
+
+
+
{{ form.non_field_errors }}
+ {% for field in form.visible_fields %} +
+
+ + {% if field.help_text != '' %} + + {% endif %} +
+ + {% if field.field.widget.input_type == 'checkbox' %} +
+ {{ field|add_class:'oh-switch__checkbox' }} +
+ {% elif field.name == "country" or field.name == "state" %} +
+ + {{ field.errors }} +
+ {% else %} +
+ {{ field|add_class:'form-control' }} + {{ field.errors }} +
+ {% endif %} +
+ {% endfor %} +
+ + {% for field in form.hidden_fields %} {{ field }} {% endfor %} + +
+ +
+
+
- diff --git a/static/images/ui/company_avatar.jpg b/static/images/ui/company_avatar.jpg new file mode 100644 index 000000000..dcb842229 Binary files /dev/null and b/static/images/ui/company_avatar.jpg differ diff --git a/static/index/country.js b/static/index/country.js index 6ae5fc3de..39933fd2d 100644 --- a/static/index/country.js +++ b/static/index/country.js @@ -687,52 +687,56 @@ s_a[252] = "Bulawayo|Harare|ManicalandMashonaland Central|Mashonaland East|Mashonaland West|Masvingo|Matabeleland North|Matabeleland South|Midlands"; function populateStates(countryElementId, stateElementId) { - var selectedCountryIndex = document.getElementById(countryElementId).selectedIndex; - var stateElement = document.getElementById(stateElementId); - var selectedState = stateElement?.dataset.selected; + var countryEl = document.getElementById(countryElementId); + var stateEl = document.getElementById(stateElementId); - stateElement.length = 0; - stateElement.options[0] = new Option("Select State", ""); - stateElement.selectedIndex = 0; + if (!countryEl || !stateEl) return; // Prevents null access + var selectedCountryIndex = countryEl.selectedIndex; + var selectedState = stateEl.getAttribute('data-selected') || ''; + + stateEl.length = 0; + stateEl.options[0] = new Option("Select State", ""); + stateEl.selectedIndex = 0; if (s_a[selectedCountryIndex]) { - state_arr = s_a[selectedCountryIndex].split("|"); + var state_arr = s_a[selectedCountryIndex].split("|"); for (var i = 0; i < state_arr.length; i++) { let stateValue = state_arr[i].replace(/'/g, '`'); let option = new Option(state_arr[i], stateValue); if (selectedState && selectedState === stateValue) { option.selected = true; } - stateElement.options[stateElement.length] = option; + stateEl.options[stateEl.length] = option; } } } function populateCountries(countryElementId, stateElementId) { - var countryElement = document.getElementById(countryElementId); - var selectedCountry = countryElement?.dataset.selected; - if (countryElement) { - countryElement.length = 0; - countryElement.options[0] = new Option("Select Country", ""); + var countryEl = document.getElementById(countryElementId); + var stateEl = document.getElementById(stateElementId); - for (var i = 0; i < country_arr.length; i++) { - let country = country_arr[i].replace(/'/g, '`'); - let option = new Option(country_arr[i], country); - if (selectedCountry && selectedCountry === country) { - option.selected = true; - } - countryElement.options[countryElement.length] = option; + if (!countryEl) return; + + var selectedCountry = countryEl.getAttribute('data-selected') || ''; + countryEl.length = 0; + countryEl.options[0] = new Option("Select Country", ""); + + for (var i = 0; i < country_arr.length; i++) { + let country = country_arr[i].replace(/'/g, '`'); + let option = new Option(country_arr[i], country); + if (selectedCountry && selectedCountry === country) { + option.selected = true; } + countryEl.options[countryEl.length] = option; + } - // trigger state population if needed - if (stateElementId) { - populateStates(countryElementId, stateElementId); // populate on load + if (stateEl) { + populateStates(countryElementId, stateElementId); - countryElement.onchange = function () { - populateStates(countryElementId, stateElementId); - }; - } + countryEl.onchange = function () { + populateStates(countryElementId, stateElementId); + }; } }