Localization and several UI changes #51

Open
rskthomas wants to merge 55 commits from ux-changes_rebase into main
5 changed files with 36 additions and 27 deletions
Showing only changes of commit d8ce10b972 - Show all commits

View file

@ -31,7 +31,7 @@ class AdminView(DashboardView):
class PanelView(AdminView, TemplateView):
template_name = "admin_panel.html"
title = _("Admin")
breadcrumb = _("admin") + " /"
breadcrumb = _("Admin") + " / " + _("Panel") + " /"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@ -41,7 +41,7 @@ class PanelView(AdminView, TemplateView):
class UsersView(AdminView, TemplateView):
template_name = "admin_users.html"
title = _("Users")
breadcrumb = _("admin / Users") + " /"
breadcrumb = _("Admin") + " / " + _("Panel") + " / " + _("Users")
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@ -54,7 +54,7 @@ class UsersView(AdminView, TemplateView):
class CreateUserView(AdminView, NotifyActivateUserByEmail, CreateView):
template_name = "user.html"
title = _("User")
breadcrumb = _("admin / User") + " /"
breadcrumb = _("Admin") + " / " + _("Users") + " / " +_("New")
success_url = reverse_lazy('admin:users')
model = User
fields = (
@ -79,7 +79,7 @@ class CreateUserView(AdminView, NotifyActivateUserByEmail, CreateView):
class DeleteUserView(AdminView, DeleteView):
template_name = "delete_user.html"
title = _("Delete user")
breadcrumb = "admin / Delete user"
breadcrumb = _("Admin") + " / " + _("Users") + " / " +_("Delete")
success_url = reverse_lazy('admin:users')
model = User
fields = (
@ -96,7 +96,7 @@ class DeleteUserView(AdminView, DeleteView):
class EditUserView(AdminView, UpdateView):
template_name = "user.html"
title = _("Edit user")
breadcrumb = "admin / Edit user"
breadcrumb = _("Admin") + " / " + _("Users") + " / " +_("Edit")
success_url = reverse_lazy('admin:users')
model = User
fields = (
@ -116,6 +116,7 @@ class InstitutionView(AdminView, UpdateView):
template_name = "institution.html"
title = _("Edit institution")
section = "admin"
breadcrumb = _("Admin") + " / " + _("Institution") + " / "
subtitle = _('Edit institution')
model = Institution
success_url = reverse_lazy('admin:panel')
@ -156,7 +157,7 @@ class StateDefinitionContextMixin(ContextMixin):
class StatesPanelView(AdminView, StateDefinitionContextMixin, TemplateView):
template_name = "states_panel.html"
title = _("States Panel")
breadcrumb = _("admin / States Panel") + " /"
breadcrumb = _("Admin") + " / " + _("States") + " / "
class AddStateDefinitionView(AdminView, StateDefinitionContextMixin, CreateView):

View file

@ -16,7 +16,7 @@ class UnassignedDevicesView(InventaryMixin):
template_name = "unassigned_devices.html"
section = "Unassigned"
title = _("Unassigned Devices")
breadcrumb = "Devices / Unassigned Devices"
breadcrumb = _("Devices") + " / " + _("Unassigned") + " / "
def get_devices(self, user, offset, limit):
return Device.get_unassigned(self.request.user.institution, offset, limit)
@ -26,7 +26,7 @@ class LotDashboardView(InventaryMixin, DetailsMixin):
template_name = "unassigned_devices.html"
section = "dashboard_lot"
title = _("Lot Devices")
breadcrumb = "Lot / Devices"
breadcrumb = _("Lot") + " / " + _("Devices") + " / "
model = Lot
def get_context_data(self, **kwargs):
@ -50,7 +50,7 @@ class SearchView(InventaryMixin):
template_name = "unassigned_devices.html"
section = "Search"
title = _("Search Devices")
breadcrumb = "Devices / Search Devices"
breadcrumb = _("Devices") + " / " + _("Search") + " / "
def get_devices(self, user, offset, limit):
post = dict(self.request.POST)

View file

@ -40,7 +40,7 @@ class DeviceLogMixin(DashboardView):
class NewDeviceView(DashboardView, FormView):
template_name = "new_device.html"
title = _("New Device")
breadcrumb = "Device / New Device"
breadcrumb = _("Device") + " / " + _("New") + " / "
success_url = reverse_lazy('dashboard:unassigned_devices')
form_class = DeviceFormSet
@ -57,7 +57,7 @@ class NewDeviceView(DashboardView, FormView):
class EditDeviceView(DashboardView, UpdateView):
template_name = "new_device.html"
title = _("Update Device")
breadcrumb = "Device / Update Device"
breadcrumb = _("Device") + " / " + _("Update") + " / "
success_url = reverse_lazy('dashboard:unassigned_devices')
model = SystemProperty
@ -76,7 +76,7 @@ class EditDeviceView(DashboardView, UpdateView):
class DetailsView(DashboardView, TemplateView):
template_name = "details.html"
title = _("Device")
breadcrumb = "Device / Details"
breadcrumb = _("Device") + " / " + _("Details") + " / "
model = SystemProperty
def get(self, request, *args, **kwargs):
@ -192,7 +192,7 @@ class PublicDeviceWebView(TemplateView):
class AddUserPropertyView(DeviceLogMixin, CreateView):
template_name = "new_user_property.html"
title = _("New User Property")
breadcrumb = "Device / New Property"
breadcrumb = _("Device") + " / " + _("Property") + " / " + _("New")
model = UserProperty
fields = ("key", "value")
@ -239,7 +239,7 @@ class AddUserPropertyView(DeviceLogMixin, CreateView):
class UpdateUserPropertyView(DeviceLogMixin, UpdateView):
template_name = "new_user_property.html"
title = _("Update User Property")
breadcrumb = "Device / Update Property"
breadcrumb = _("Device") + " / " + _("Property") + " / " + _("Update")
model = UserProperty
fields = ("key", "value")

View file

@ -27,7 +27,7 @@ class ListEvidencesView(DashboardView, TemplateView):
template_name = "evidences.html"
section = "evidences"
title = _("Evidences")
breadcrumb = "Evidences"
breadcrumb = _("Evidence") + " / " + _("All") + " / "
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@ -43,10 +43,18 @@ class UploadView(DashboardView, FormView):
template_name = "upload.html"
section = "evidences"
title = _("Upload Evidence")
breadcrumb = "Evidences / Upload"
breadcrumb = _("Evidence") + " / " + _("Upload") + " / "
success_url = reverse_lazy('evidence:list')
form_class = UploadForm
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({
"help_text": _('Upload the snapshots generated by Workbench.'),
})
return context
def form_valid(self, form):
form.save(self.request.user)
messages.success(self.request, _("Evidence uploaded successfully."))
@ -62,7 +70,7 @@ class ImportView(DashboardView, FormView):
template_name = "upload.html"
section = "evidences"
title = _("Import Evidence")
breadcrumb = "Evidences / Import"
breadcrumb = _("Evidence") + " / " + _("Import") + " / "
success_url = reverse_lazy('evidence:list')
form_class = ImportForm
@ -86,7 +94,7 @@ class EvidenceView(DashboardView, FormView):
template_name = "ev_details.html"
section = "evidences"
title = _("Evidences")
breadcrumb = "Evidences / Details"
breadcrumb = _("Evidence") + " / " + _("Details") + " / "
success_url = reverse_lazy('evidence:list')
form_class = UserTagForm

View file

@ -17,7 +17,7 @@ from lot.forms import LotsForm
class NewLotView(DashboardView, CreateView):
template_name = "new_lot.html"
title = _("New lot")
breadcrumb = "lot / New lot"
breadcrumb = _("Lot") + " / " + _("New") + " / "
success_url = reverse_lazy('dashboard:unassigned_devices')
model = Lot
fields = (
@ -38,7 +38,7 @@ class NewLotView(DashboardView, CreateView):
class DeleteLotView(DashboardView, DeleteView):
template_name = "delete_lot.html"
title = _("Delete lot")
breadcrumb = "lot / Delete lot"
breadcrumb = _("Lot") + " / " + _("Delete") + " / "
success_url = reverse_lazy('dashboard:unassigned_devices')
model = Lot
fields = (
@ -57,7 +57,7 @@ class DeleteLotView(DashboardView, DeleteView):
class EditLotView(DashboardView, UpdateView):
template_name = "new_lot.html"
title = _("Edit lot")
breadcrumb = "Lot / Edit lot"
breadcrumb = _("Lot") + " / " + _("Edit") + " / "
success_url = reverse_lazy('dashboard:unassigned_devices')
model = Lot
fields = (
@ -83,7 +83,7 @@ class EditLotView(DashboardView, UpdateView):
class AddToLotView(DashboardView, FormView):
template_name = "list_lots.html"
title = _("Add to lots")
breadcrumb = "lot / add to lots"
breadcrumb = _("Lot") + " / " + _("Assign Device") + " / "
success_url = reverse_lazy('dashboard:unassigned_devices')
form_class = LotsForm
@ -112,7 +112,7 @@ class AddToLotView(DashboardView, FormView):
class DelToLotView(AddToLotView):
title = _("Remove from lots")
breadcrumb = "lot / remove from lots"
breadcrumb = _("Lot") + " / " + _("Unassign Device") + " / "
def form_valid(self, form):
form.devices = self.get_session_devices()
@ -124,7 +124,7 @@ class DelToLotView(AddToLotView):
class LotsTagsView(DashboardView, TemplateView):
template_name = "lots.html"
title = _("lots")
breadcrumb = _("lots") + " /"
breadcrumb = _("Lot") + " / "
success_url = reverse_lazy('dashboard:unassigned_devices')
def get_context_data(self, **kwargs):
@ -149,7 +149,7 @@ class LotsTagsView(DashboardView, TemplateView):
class LotPropertiesView(DashboardView, TemplateView):
template_name = "properties.html"
title = _("New Lot Property")
breadcrumb = "Lot / New property"
breadcrumb = _("Lot") + " / " + _("Property") + " / "
def get_context_data(self, **kwargs):
self.pk = kwargs.get('pk')
@ -172,7 +172,7 @@ class LotPropertiesView(DashboardView, TemplateView):
class AddLotPropertyView(DashboardView, CreateView):
template_name = "new_property.html"
title = _("New Lot Property")
breadcrumb = "Device / New property"
breadcrumb = _("Lot") + " / " + _("Property") + " / " +_("New")
success_url = reverse_lazy('dashboard:unassigned_devices')
model = LotProperty
fields = ("key", "value")
@ -206,7 +206,7 @@ class AddLotPropertyView(DashboardView, CreateView):
class UpdateLotPropertyView(DashboardView, UpdateView):
template_name = "properties.html"
title = _("Update lot Property")
breadcrumb = "Lot / Update Property"
breadcrumb = _("Lot") + " / " + _("Property") + " / " +_("Update")
model = LotProperty
fields = ("key", "value")