Skip to content

fix: Revise HTML Structure for Login Page#53

Open
sergioceron wants to merge 1 commit intomasterfrom
coderops/fix-swarm-bd-task-ece
Open

fix: Revise HTML Structure for Login Page#53
sergioceron wants to merge 1 commit intomasterfrom
coderops/fix-swarm-bd-task-ece

Conversation

@sergioceron
Copy link
Copy Markdown
Member

Automated fix by CoderOps.

Swarm: s2
Task: Revise HTML Structure for Login Page

Copilot AI review requested due to automatic review settings April 14, 2026 20:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the login.php view markup to modernize/clean up the login page’s HTML structure (moving away from table-based layout) while keeping the existing login flow and i18n strings.

Changes:

  • Replaced the table-based login form layout with div-based containers and added labels/ids for inputs.
  • Introduced new CSS class hooks (login-container, login-form, form-group, etc.) for the new structure.
  • Kept the existing inline style block and message rendering behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread login.php
Comment on lines +107 to +108
var focusControl = document.forms["login"].elements["userName"];
if (focusControl.type != "hidden" && !focusControl.disabled) {
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The focus script references document.forms["login"], but the only form on this page is name="settings". In browsers this makes focusControl undefined and the subsequent .type access can throw, breaking the page JS and preventing autofocus. Update the script to reference the actual form (or target the input by id) and null-check before accessing properties.

Suggested change
var focusControl = document.forms["login"].elements["userName"];
if (focusControl.type != "hidden" && !focusControl.disabled) {
var focusControl = document.getElementById("userName");
if (focusControl && focusControl.type != "hidden" && !focusControl.disabled) {

Copilot uses AI. Check for mistakes.
Comment thread login.php
Comment on lines +89 to +96
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div class="form-group">
<label for="userPassword" class="form-label"><?=$_i18n[ "pass" ]?> :</label>
<input id="userPassword" name="userPassword" type="password" class="input-text rounded">
<?php if( strpos( $fields, 'userPassword' ) ){?>
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both validation error <span> elements use the same id="errormsg_0". IDs must be unique in the DOM; this can break CSS/JS targeting and assistive tech relationships. Use distinct IDs per field (or drop the id attribute if it isn't used).

Suggested change
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div class="form-group">
<label for="userPassword" class="form-label"><?=$_i18n[ "pass" ]?> :</label>
<input id="userPassword" name="userPassword" type="password" class="input-text rounded">
<?php if( strpos( $fields, 'userPassword' ) ){?>
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
<span class="errormsg" id="errormsg_userName"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div class="form-group">
<label for="userPassword" class="form-label"><?=$_i18n[ "pass" ]?> :</label>
<input id="userPassword" name="userPassword" type="password" class="input-text rounded">
<?php if( strpos( $fields, 'userPassword' ) ){?>
<span class="errormsg" id="errormsg_userPassword"> <?=$_i18n[ "error.required" ]?></span>

Copilot uses AI. Check for mistakes.
Comment thread login.php

<div class="login-container">
<form action="action_login.php" method="post" name="settings" class="login-form">
<h2 class="section-header">&nbsp;Entrar al sistema</h2>
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<h2 class="section-header"> replaces the prior div.section header, but there is no .section-header style in the repo and the existing styling targets div.section in styles/global.css. This likely regresses the login heading styling. Consider keeping div class="section", or update/add CSS so the new heading class gets the intended styles.

Suggested change
<h2 class="section-header">&nbsp;Entrar al sistema</h2>
<div class="section">&nbsp;Entrar al sistema</div>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants