Skip to content

Commit e1cd028

Browse files
committed
fix(admin-modal): streamline admin creation and modification modals by consolidating sudo status switch into a single horizontal layout
1 parent 3f7be3a commit e1cd028

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tui/admin.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ def compose(self) -> ComposeResult:
188188
with Container(classes="modal-box-form"):
189189
yield Static("Create a new admin", classes="title")
190190
yield Vertical(
191+
Horizontal(
192+
Static("Is sudo: ", classes="label"),
193+
Switch(animate=False, id="is_sudo", value=True),
194+
classes="switch-container",
195+
),
191196
Input(placeholder="Username", id="username"),
192197
Input(placeholder="Password", password=True, id="password"),
193198
Input(placeholder="Confirm Password", password=True, id="confirm_password"),
@@ -199,11 +204,6 @@ def compose(self) -> ComposeResult:
199204
Input(placeholder="Profile Title", id="profile_title"),
200205
Input(placeholder="Support URL", id="support_url"),
201206
TextArea(placeholder="Note", id="note"),
202-
Horizontal(
203-
Static("Is sudo: ", classes="label"),
204-
Switch(animate=False, id="is_sudo"),
205-
classes="switch-container",
206-
),
207207
Horizontal(
208208
Static("Enable Notifications: ", classes="label"),
209209
Switch(animate=False, id="notif_master", value=False),
@@ -389,6 +389,13 @@ def compose(self) -> ComposeResult:
389389
with Container(classes="modal-box-form"):
390390
yield Static("Modify admin", classes="title")
391391
yield Vertical(
392+
Horizontal(
393+
Static("Is sudo: ", classes="label"),
394+
Switch(animate=False, id="is_sudo"),
395+
Static("Is disabled: ", classes="label"),
396+
Switch(animate=False, id="is_disabled"),
397+
classes="switch-container",
398+
),
392399
Input(placeholder="Username", id="username", disabled=True),
393400
Input(placeholder="Password", password=True, id="password"),
394401
Input(placeholder="Confirm Password", password=True, id="confirm_password"),
@@ -400,13 +407,6 @@ def compose(self) -> ComposeResult:
400407
Input(placeholder="Profile Title", id="profile_title"),
401408
Input(placeholder="Support URL", id="support_url"),
402409
TextArea(placeholder="Note", id="note"),
403-
Horizontal(
404-
Static("Is sudo: ", classes="label"),
405-
Switch(animate=False, id="is_sudo"),
406-
Static("Is disabled: ", classes="label"),
407-
Switch(animate=False, id="is_disabled"),
408-
classes="switch-container",
409-
),
410410
Static("", id="legacy_notif_warning", classes="label"),
411411
Horizontal(
412412
Static("Enable Notifications: ", classes="label"),

0 commit comments

Comments
 (0)