Verified Commit 0b6b74c6 authored by Štěpán Henek's avatar Štěpán Henek 🌩

subordinates: set titles from "Subordinates" to "Managed devices"

parent 051bf977
......@@ -437,7 +437,7 @@ class SubordinatesConfigPage(ConfigPageMixin, subordinates.SubordinatesConfigHan
menu_order = 12
template = "config/subordinates"
userfriendly_title = gettext("Subordinates")
userfriendly_title = gettext("Managed devices")
template_type = "jinja2"
def render(self, **kwargs):
......@@ -580,7 +580,7 @@ class SubordinatesConfigPage(ConfigPageMixin, subordinates.SubordinatesConfigHan
if results["result"]:
message = {
"classes": ['success'],
"text": _("Subordinate '%(controller_id)s' was sucessfully updated.")
"text": _("Device '%(controller_id)s' was sucessfully updated.")
% dict(controller_id=data["controller_id"])
}
......
......@@ -22,7 +22,6 @@ from foris import fapi
from foris.form import File, Hidden, Textbox
from foris.state import current_state
from foris.utils.translators import (
gettext_dummy as gettext,
gettext as _,
)
......@@ -30,7 +29,6 @@ from .base import BaseConfigHandler
class SubordinatesConfigHandler(BaseConfigHandler):
userfriendly_title = gettext("Subordinates")
def get_form(self):
form = fapi.ForisForm("suboridinates", self.data)
......@@ -69,7 +67,7 @@ class SubordinatesEditForm(fapi.ForisAjaxForm):
def __init__(self, data, controller_id=None):
self.subordinate_controller_id = data["controller_id"]
super().__init__(data, controller_id)
self.title = _("Edit subordinate '%(controller_id)s'") % dict(
self.title = _("Edit device '%(controller_id)s'") % dict(
controller_id=data["controller_id"])
def convert_data_from_backend_to_form(self, backend_data):
......@@ -101,7 +99,7 @@ class SubordinatesEditForm(fapi.ForisAjaxForm):
sub_form = fapi.ForisForm("update_sub", form_data)
sub_section = sub_form.add_section(
"subordinate_section", title="", description=_(
"You can edit you subordinate here. Subordinates are directly connected to this "
"You can edit managed devices here. These managed devices are directly connected to this "
"device."
)
)
......@@ -129,7 +127,7 @@ class SubsubordinatesEditForm(fapi.ForisAjaxForm):
def __init__(self, data, controller_id=None):
self.subsubordinate_controller_id = data["controller_id"]
super().__init__(data, controller_id)
self.title = _("Edit subsubordinate '%(controller_id)s'") % dict(
self.title = _("Edit managed device '%(controller_id)s'") % dict(
controller_id=data["controller_id"])
def convert_data_from_backend_to_form(self, backend_data):
......@@ -165,9 +163,9 @@ class SubsubordinatesEditForm(fapi.ForisAjaxForm):
sub_form = fapi.ForisForm("update_subsub", form_data)
sub_section = sub_form.add_section(
"subsubordinate_section", title="", description=_(
"You can edit you subsubordinate here. Subsubordinates are "
"devices which are not directly connected to this device but "
"they are connected with a subordinated."
"You can edit managed devices here. These devices are not "
"not directly connected to this device but "
"they are connected through another managed device."
)
)
sub_section.add_field(
......
......@@ -11,7 +11,7 @@
you wan't to control. And insert the token here.
{%- endtrans %}
</p>
<h3>{% trans %}Add subordinate device{% endtrans %}</h3>
<h3>{% trans %}Add device{% endtrans %}</h3>
<form id="main-form" class="config-form" action="{{ request.fullpath }}" method="post" enctype="multipart/form-data" autocomplete="off" novalidate>
{% include '_messages.html.j2' %}
<input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}">
......@@ -23,14 +23,14 @@
</div>
</form>
{% if is_xhr is not defined %}
<h3>{% trans %}Subordinate devices{% endtrans %}</h3>
<h3>{% trans %}Device list{% endtrans %}</h3>
{% set subpage = request.params.get("view", "subordinates") %}
<a href="{{ request.fullpath }}?view=subordinates" class="button{% if subpage == "subordinates" %} disabled{% endif %}">{% trans %}Subordinates{% endtrans %}</a>
<a href="{{ request.fullpath }}?view=subordinates" class="button{% if subpage == "subordinates" %} disabled{% endif %}">{% trans %}Devices{% endtrans %}</a>
<a href="{{ request.fullpath }}?view=wifi" class="button{% if subpage == "wifi" %} disabled{% endif %}">{% trans %}Wifi{% endtrans %}</a>
<hr>
<div id="subordinates-message"></div>
<div id="subordinates-table">
{% trans %}Loading subordinates...{% endtrans %}
{% trans %}Loading manged devices...{% endtrans %}
</div>
<br />
<div id="subordinates-edit">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment