- Added trans() / _() translations to models, forms and templates. - Updated Spanish locale (django.po). - Fixed missing verbose_name translations. Known issues: - "Leave Type" label in horilla/leave/forms.py not translating. - "Performance" and "Mails automations" still pending.
25 lines
655 B
Python
25 lines
655 B
Python
from django import forms
|
|
from django.template.loader import render_to_string
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from base.forms import ModelForm
|
|
|
|
from .models import GeoFencing
|
|
|
|
|
|
class GeoFencingSetupForm(ModelForm):
|
|
verbose_name = _("Geofence Configuration")
|
|
|
|
class Meta:
|
|
model = GeoFencing
|
|
fields = "__all__"
|
|
widgets = {"company_id": forms.HiddenInput()}
|
|
|
|
def as_p(self):
|
|
"""
|
|
Render the form fields as HTML table rows with Bootstrap styling.
|
|
"""
|
|
context = {"form": self}
|
|
table_html = render_to_string("common_form.html", context)
|
|
return table_html
|