lot tag -> lot groups
includes rephrase of some expressions and minor visual adjustments
This commit is contained in:
parent
9b183062ad
commit
8a1dc1945a
|
@ -18,7 +18,7 @@
|
|||
<table class="table table-hover table-bordered align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">{% trans "Tag" %}
|
||||
<th scope="col">{% trans "Lot Group Name" %}
|
||||
</th>
|
||||
<th scope="col" width="15%" class="text-center">{% trans "Actions" %}
|
||||
</th>
|
||||
|
@ -58,7 +58,7 @@
|
|||
|
||||
{% else %}
|
||||
<div class="alert alert-primary text-center mt-5" role="alert">
|
||||
{% trans "No Lot Tags found on current organization" %}
|
||||
{% trans "No Lot Groups found on current organization" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -69,7 +69,7 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="addLotTagModalLabel">{% trans "Add Lot Tag" %}</h5>
|
||||
<h5 class="modal-title" id="addLotTagModalLabel">{% trans "Add Lot Group" %}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
@ -92,7 +92,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Edit Lot Tag Modals -->
|
||||
<!-- Edit Lot Group Modals -->
|
||||
{% for tag in lot_tags_edit %}
|
||||
<div class="modal fade" id="editLotTagModal{{ tag.id }}" tabindex="-1" aria-labelledby="editLotTagModalLabel{{ tag.id }}" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
|
@ -101,7 +101,7 @@
|
|||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="editLotTagModalLabel{{ tag.id }}">
|
||||
{% trans "Edit Lot Tag" %}
|
||||
{% trans "Edit Lot Group" %}
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans 'Close' %}"></button>
|
||||
</div>
|
||||
|
@ -131,14 +131,14 @@
|
|||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title fw-bold" id="deleteLotTagModalLabel{{ tag.id }}">
|
||||
{% trans "Delete Lot Tag" %}
|
||||
{% trans "Delete Lot Group" %}
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans 'Close' %}"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{% if tag.lot_set.first %}
|
||||
<div class="alert alert-warning text-center" role="alert">
|
||||
{% trans "There are lots with this tag. Change the tag for this lots" %}
|
||||
{% trans "Failed to remove Lot Group, it is not empty" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-flex align-items-center border rounded p-3 mt-3">
|
||||
|
|
|
@ -15,8 +15,8 @@ urlpatterns = [
|
|||
path("states/delete/<int:pk>", views.DeleteStateDefinitionView.as_view(), name='delete_state_definition'),
|
||||
path("states/update_order/", views.UpdateStateOrderView.as_view(), name='update_state_order'),
|
||||
path("states/edit/<int:pk>/", views.UpdateStateDefinitionView.as_view(), name='edit_state_definition'),
|
||||
path("lot_tag/", views.LotTagPanelView.as_view(), name="tag_panel"),
|
||||
path("lot_tag/add", views.AddLotTagView.as_view(), name="add_lot_tag"),
|
||||
path("lot_tag/delete/<int:pk>", views.DeleteLotTagView.as_view(), name='delete_lot_tag'),
|
||||
path("lot_tag/edit/<int:pk>/", views.UpdateLotTagView.as_view(), name='edit_lot_tag'),
|
||||
path("lot/", views.LotTagPanelView.as_view(), name="tag_panel"),
|
||||
path("lot/add", views.AddLotTagView.as_view(), name="add_lot_tag"),
|
||||
path("lot/delete/<int:pk>", views.DeleteLotTagView.as_view(), name='delete_lot_tag'),
|
||||
path("lot/edit/<int:pk>/", views.UpdateLotTagView.as_view(), name='edit_lot_tag'),
|
||||
]
|
||||
|
|
|
@ -115,8 +115,8 @@ class EditUserView(AdminView, UpdateView):
|
|||
|
||||
class LotTagPanelView(AdminView, TemplateView):
|
||||
template_name = "lot_tag_panel.html"
|
||||
title = _("Lot Tag Panel")
|
||||
breadcrumb = _("admin / Lot Tag Panel")
|
||||
title = _("Lot Groups Panel")
|
||||
breadcrumb = _("admin / Lot Groups Panel")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
@ -129,7 +129,7 @@ class LotTagPanelView(AdminView, TemplateView):
|
|||
|
||||
class AddLotTagView(AdminView, CreateView):
|
||||
template_name = "lot_tag_panel.html"
|
||||
title = _("New lot tag Definition")
|
||||
title = _("New lot group Definition")
|
||||
breadcrumb = "Admin / New lot tag"
|
||||
success_url = reverse_lazy('admin:tag_panel')
|
||||
model = LotTag
|
||||
|
@ -145,7 +145,7 @@ class AddLotTagView(AdminView, CreateView):
|
|||
return redirect(self.success_url)
|
||||
|
||||
response = super().form_valid(form)
|
||||
messages.success(self.request, _("Lot Tag successfully added."))
|
||||
messages.success(self.request, _("Lot Group successfully added."))
|
||||
return response
|
||||
|
||||
|
||||
|
@ -162,18 +162,18 @@ class DeleteLotTagView(AdminView, DeleteView):
|
|||
)
|
||||
|
||||
if self.object.lot_set.first():
|
||||
msg = _('This tag have lots. Impossible deleted.')
|
||||
msg = _('This group have lots. Impossible to delete.')
|
||||
messages.warning(self.request, msg)
|
||||
return redirect(reverse_lazy('admin:tag_panel'))
|
||||
|
||||
if self.object.inbox:
|
||||
msg = f"The tag '{self.object.name}'"
|
||||
msg += " is a inbox, you can redefine but not delete."
|
||||
msg = f"The lot group '{self.object.name}'"
|
||||
msg += " is INBOX, so it cannot be deleted, only renamed."
|
||||
messages.error(self.request, msg)
|
||||
return redirect(self.success_url)
|
||||
|
||||
response = super().delete(request, *args, **kwargs)
|
||||
msg = _('Lot Tag has been deleted.')
|
||||
msg = _('Lot Group has been deleted.')
|
||||
messages.success(self.request, msg)
|
||||
return response
|
||||
|
||||
|
@ -201,7 +201,7 @@ class UpdateLotTagView(AdminView, UpdateView):
|
|||
return redirect(self.success_url)
|
||||
|
||||
response = super().form_valid(form)
|
||||
msg = _("Lot Tag updated successfully.")
|
||||
msg = _("Lot Group updated successfully.")
|
||||
messages.success(self.request, msg)
|
||||
return response
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link{% if path == 'tag_panel' %} active2{% endif %}" href="{% url 'admin:tag_panel' %}">
|
||||
{% trans 'Lot Tags' %}
|
||||
{% trans 'Lot Groups' %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -112,7 +112,7 @@
|
|||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<a class="admin {% if path in 'all_device' %}active {% endif %}nav-link fw-bold" data-bs-toggle="collapse" data-bs-target="#ul_device" aria-expanded="false" aria-controls="ul_lots" href="javascript:void()">
|
||||
<i class="bi bi-database icon_sidebar"></i>
|
||||
<i class="bi bi-laptop icon_sidebar"></i>
|
||||
{% trans 'Device' %}
|
||||
</a>
|
||||
<ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if path in 'all_device' %}expanded{% else %}collapse{% endif %}" id="ul_device" data-bs-parent="#sidebarMenu">
|
||||
|
|
|
@ -9,7 +9,7 @@ urlpatterns = [
|
|||
path("edit/<int:pk>/", views.EditLotView.as_view(), name="edit"),
|
||||
path("add/devices/", views.AddToLotView.as_view(), name="add_devices"),
|
||||
path("del/devices/", views.DelToLotView.as_view(), name="del_devices"),
|
||||
path("tag/<int:pk>/", views.LotsTagsView.as_view(), name="tags"),
|
||||
path("group/<int:pk>/", views.LotsTagsView.as_view(), name="tags"),
|
||||
path("<int:pk>/property", views.LotPropertiesView.as_view(), name="properties"),
|
||||
path("<int:pk>/property/add", views.AddLotPropertyView.as_view(), name="add_property"),
|
||||
path("<int:pk>/property/update", views.UpdateLotPropertyView.as_view(), name="update_property"),
|
||||
|
|
Loading…
Reference in a new issue