diff --git a/src/servala/frontend/forms/__init__.py b/src/servala/frontend/forms/__init__.py index fe0ffc1..01447a1 100644 --- a/src/servala/frontend/forms/__init__.py +++ b/src/servala/frontend/forms/__init__.py @@ -1,4 +1,4 @@ -from .organization import OrganizationCreateForm +from .organization import OrganizationForm from .profile import UserProfileForm -__all__ = ["OrganizationCreateForm", "UserProfileForm"] +__all__ = ["OrganizationForm", "UserProfileForm"] diff --git a/src/servala/frontend/forms/organization.py b/src/servala/frontend/forms/organization.py index b6a3391..41cc26c 100644 --- a/src/servala/frontend/forms/organization.py +++ b/src/servala/frontend/forms/organization.py @@ -1,9 +1,10 @@ from django.forms import ModelForm from servala.core.models import Organization +from servala.frontend.forms.mixins import HtmxMixin -class OrganizationCreateForm(ModelForm): +class OrganizationForm(HtmxMixin, ModelForm): class Meta: model = Organization fields = ("name",) diff --git a/src/servala/frontend/templates/frontend/organizations/update.html b/src/servala/frontend/templates/frontend/organizations/update.html new file mode 100644 index 0000000..234622a --- /dev/null +++ b/src/servala/frontend/templates/frontend/organizations/update.html @@ -0,0 +1,50 @@ +{% extends "frontend/base.html" %} +{% load i18n static %} +{% load partials %} +{% block html_title %} + {% block page_title %} + {% translate "Organization Details" %} + {% endblock page_title %} +{% endblock html_title %} +{% partialdef org-name %} + + {{ form.instance.name }} + + +{% endpartialdef org-name %} +{% partialdef org-name-edit %} + +
+
+ {{ form.name.as_field_group }} + + + + +
+
+ +{% endpartialdef org-name-edit %} +{% block card_content %} +
+ + + + + {% partial org-name %} + + +
+ {% translate "Name" %} +
+
+{% endblock card_content %} diff --git a/src/servala/frontend/templates/includes/sidebar.html b/src/servala/frontend/templates/includes/sidebar.html index 1078d4b..a04bc5d 100644 --- a/src/servala/frontend/templates/includes/sidebar.html +++ b/src/servala/frontend/templates/includes/sidebar.html @@ -103,12 +103,18 @@ {% else %} {% if request.organization %} + + {% endif %}