Improve appearance : error, notice

This commit is contained in:
sparkyx 2025-07-07 10:59:05 +02:00
parent 93edcb0428
commit c43a48fb9e
4 changed files with 44 additions and 6 deletions

View file

@ -79,6 +79,19 @@ input:focus {
opacity:85%;
background-color: wheat;
}
h2.notice {
padding: 0.6ch 2ch;
width: min(90%,90ch);
}
p.notice,span.notice {
display:block;
padding:0.5ch;
width:min(90%,110ch);
margin-left: 5ch;
border:1px solid transparent;
border-radius: 5px;
}
.valid {
color:green;
background-color:transparent;
@ -433,8 +446,18 @@ table.document th{
animation-duration: 4s;
animation-iteration-count: infinite;
}
@media (min-width: 576px) {
p.error,span.error {
padding:0.2ch;
border:1px solid transparent;
border-radius:5px;
display: block;
width: fit-content;
}
@media (min-width: 576px) {
p.error,span.error {
}
}
/* MeDium */
@media (min-width: 768px) {
@ -447,14 +470,25 @@ table.document th{
background-color:#FF0000;
font-weight: bolder;
}
p.error,span.error {
padding:1ch;
border:1px solid transparent;
border-radius:5px;
}
}
/* LarGe */
@media (min-width: 992px) {
p.error,span.error {
padding:3ch;
border:1px solid transparent;
border-radius:5px;
}
}
/* eXtraLarge */
@media (min-width: 1200px) {
}
table.mtitle {
border:0px;
text-align:center;
@ -3992,4 +4026,4 @@ h2.h-section {
margin-bottom: 0.5rem;
border-radius: 5px;
}

View file

@ -2223,10 +2223,12 @@ function filter_table(phrase, _id, colnr, start_row) {
if (tot_found == 0) {
if (document.getElementById('info_' + _id)) {
id$('info_' + _id).innerHTML = content[69];
id$('info_' + _id).style.display = 'block';
}
} else {
if (document.getElementById('info_' + _id)) {
id$('info_' + _id).innerHTML = " ";
id$('info_' + _id).style.display = 'none';
}
}
id$('info_div').style.display = "none";
@ -4124,9 +4126,11 @@ function check_receipt_size(p_max_size, p_info) {
if (f && f.files[0] && f.files[0].size > parseFloat(p_max_size)) {
document.getElementById("receipt_info_id").innerHTML = content[78];
document.getElementById(p_info).style.display = "none";
$('receipt_info_id').addClassName('error');
return false;
}
document.getElementById("receipt_info_id").innerHTML = "";
$('receipt_info_id').removeClassName('error');
document.getElementById("form_file").submit();
return true;
}

View file

@ -216,7 +216,7 @@ switch ($action) {
echo HtmlInput::hidden('div', $div);
echo '<INPUT TYPE="FILE" id="receipt_id" name="pj" onchange="' . $check_receipt . '">';
echo '<p id="receipt_info_id" class="error"></p>';
echo '<p id="receipt_info_id" style="display:inline"></p>';
echo '</FORM>';
} else {
@ -257,7 +257,7 @@ switch ($action) {
}
echo HtmlInput::show_receipt_document($jr_id, h($filename));
echo $x;
echo '<p id="receipt_info_id" class="error"></p>';
echo '<p id="receipt_info_id" style="display:inline" ></p>';
echo '</div>';
echo '</body></html>';
exit();
@ -317,7 +317,7 @@ switch ($action) {
echo HtmlInput::hidden('div', $div);
echo '<INPUT TYPE="FILE" id="receipt_id" name="pj" onchange="' . $check_receipt . '">';
echo '<p id="receipt_info_id" class="error"></p>';
echo '<p id="receipt_info_id" style="display:inline"></p>';
echo '</FORM>';
$ret = $cn->exec_sql("select jr_pj from jrn where jr_id=$1", array($jr_id));
if (Database::num_row($ret) != 0) {

View file

@ -1049,7 +1049,7 @@ class HtmlInput
<input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id."').value='';filter_table($('lk_".$p_table_id."'), '$p_table_id','$p_col',$start_row );\" value=\"X\">
</span>
";
$r.=' <span class="notice" id="info_'.$p_table_id.'"></span>';
$r.=' <span class="notice" style="display:none" id="info_'.$p_table_id.'"></span>';
return $r;
}
/**