Skip to content

Commit

Permalink
Merge branch 'main' of github.com:basxsoftwareassociation/basxconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
saemideluxe committed Sep 27, 2021
2 parents 6bc9fc4 + 988ce23 commit d206f03
Show file tree
Hide file tree
Showing 11 changed files with 554 additions and 464 deletions.
2 changes: 1 addition & 1 deletion basxconnect/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.7"
__version__ = "0.3.9"
37 changes: 27 additions & 10 deletions basxconnect/core/layouts/editlegalperson.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import htmlgenerator as hg
from bread import layout
from bread.layout.components.icon import Icon
from django.utils.translation import gettext_lazy as _

from basxconnect.core import models
from basxconnect.core.layouts import editperson
from basxconnect.core.views.person.person_modals_views import (
LegalPersonEditMailingsView,
LegalPersonEditPersonalDataView,
)

R = layout.grid.Row
C = layout.grid.Col
Expand All @@ -17,17 +15,26 @@ def editlegalperson_form(request):
return editperson.editperson_form(request, base_data_tab, mailings_tab)


def base_data_tab():
def base_data_tab(request):
return layout.tabs.Tab(
_("Base data"),
hg.BaseElement(
editperson.grid_inside_tab(
R(
editperson.tile_col_edit_modal(LegalPersonEditPersonalDataView),
editperson.person_metadata(),
editperson.tile_col_edit_modal(
_("Base Data"),
models.LegalPerson,
"ajax_edit_personal_data",
Icon("building"),
[
"name",
"name_addition",
],
),
editperson.person_metadata(models.LegalPerson),
),
editperson.contact_details(),
R(editperson.categories()),
editperson.contact_details(request),
R(editperson.categories(), editperson.other()),
),
),
)
Expand All @@ -47,7 +54,17 @@ def mailings_tab(request):
_("Mailings"),
editperson.grid_inside_tab(
R(
editperson.tile_col_edit_modal(modal_view=LegalPersonEditMailingsView),
editperson.tile_col_edit_modal(
_("Settings"),
models.LegalPerson,
"ajax_edit_mailings",
Icon("settings--adjust"),
[
"preferred_language",
"type",
"salutation_letter",
],
),
mailer_tile,
),
),
Expand Down
40 changes: 26 additions & 14 deletions basxconnect/core/layouts/editnaturalperson.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import htmlgenerator as hg
from bread import layout
from bread.layout import ObjectFieldValue
from bread.layout.components.icon import Icon
from django.utils.translation import gettext_lazy as _

from basxconnect.core import models
from basxconnect.core.layouts import editperson
from basxconnect.core.layouts.editperson import person_metadata
from basxconnect.core.views.person.person_modals_views import (
NaturalPersonEditMailingsView,
NaturalPersonEditPersonalDataView,
)

R = layout.grid.Row
C = layout.grid.Col
Expand All @@ -19,16 +17,16 @@ def editnaturalperson_form(request):
return editperson.editperson_form(request, base_data_tab, mailings_tab)


def base_data_tab():
def base_data_tab(request):

return layout.tabs.Tab(
_("Base data"),
editperson.grid_inside_tab(
R(
personal_data(),
person_metadata(),
person_metadata(models.NaturalPerson),
),
contact_details_naturalperson(),
contact_details_naturalperson(request),
),
)

Expand All @@ -52,8 +50,12 @@ def personal_data():
editperson.display_field_value("decease_date"),
),
]
return editperson.tile_col_edit_modal_selected_fields(
NaturalPersonEditPersonalDataView, displayed_fields
return editperson.tile_col_edit_modal_displayed_fields(
_("Personal Data"),
models.NaturalPerson,
"ajax_edit_personal_data",
Icon("user--profile"),
displayed_fields,
)


Expand All @@ -72,23 +74,33 @@ def mailings_tab(request):
editperson.grid_inside_tab(
R(
editperson.tile_col_edit_modal(
modal_view=NaturalPersonEditMailingsView
_("Settings"),
models.NaturalPerson,
"ajax_edit_mailings",
Icon("settings--adjust"),
[
"preferred_language",
"type",
"salutation_letter",
"gender",
"form_of_address",
],
),
mailer_tile,
),
),
)


def contact_details_naturalperson():
def contact_details_naturalperson(request):
return hg.BaseElement(
R(
editperson.addresses(),
editperson.numbers(),
editperson.numbers(request),
),
R(
editperson.email(),
editperson.urls(),
editperson.email(request),
editperson.urls(request),
),
R(
editperson.categories(),
Expand Down
Loading

0 comments on commit d206f03

Please sign in to comment.