Skip to content

Commit

Permalink
[UX] servers page : make servers page to be responsive on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Bienvenumoringa authored and josaphatim committed Jun 11, 2024
1 parent de6f4c8 commit d536efa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
11 changes: 6 additions & 5 deletions modules/imap/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,24 +464,25 @@ protected function output() {
$res .= '<form class="imap_connect" method="POST">';
$res .= '<input type="hidden" name="hm_page_key" value="'.$this->html_safe(Hm_Request_Key::generate()).'" />';
$res .= '<input type="hidden" name="imap_server_id" class="imap_server_id" value="'.$this->html_safe($server_id).'" />';
$res .= '<div class="row"><div class="col-sm-2">';
$res .= '<div class="row m-0 p-0"><div class="col-xl-2 col-lg-2 col-md-6">';
$res .= sprintf('
<div class="text-muted"><strong>%s</strong></div>
<div class="server_subtitle">%s/%d %s</div>',
$this->html_safe($vals['name']), $this->html_safe($vals['server']), $this->html_safe($vals['port']),
$vals['tls'] ? 'TLS' : '' );
$res .= '</div><div class="col-sm-2">';

$res .= '</div> <div class="col-xl-7 col-lg-7 col-md-9 p-3 " > <div class="row"> <div class="col-xl-4 col-lg-4 col-md-6 ">';

// IMAP Username
$res .= '<div class="form-floating">';
$res .= '<input '.$disabled.' id="imap_user_'.$server_id.'" class="form-control credentials" type="text" name="imap_user" value="'.$this->html_safe($user_pc).'" placeholder="'.$this->trans('Username').'">';
$res .= '<label for="imap_user_'.$server_id.'">'.$this->trans('IMAP username').'</label></div>';
$res .= '</div><div class="col-sm-2">';
$res .= '</div><div class="col-xl-4 col-lg-4 col-md-6">';
// IMAP Password
$res .= '<div class="form-floating">';
$res .= '<input '.$disabled.' id="imap_pass_'.$server_id.'" class="form-control credentials imap_password" type="password" name="imap_pass" value="'.$pass_value.'" placeholder="'.$pass_pc.'">';
$res .= '<label for="imap_pass_'.$server_id.'">'.$this->trans('IMAP password').'</label></div>';
$res .= '</div><div class="col-sm-2">';
$res .= '</div><div class="col-xl-4 col-lg-4 col-md-6">';

// Sieve Host (Conditional)

Expand All @@ -491,7 +492,7 @@ protected function output() {
$res .= '<input '.$disabled.' id="imap_sieve_host_'.$server_id.'" class="form-control credentials imap_sieve_host_input" type="text" name="imap_sieve_host" value="'.$default_value.'" placeholder="Sieve Host">';
$res .= '<label for="imap_sieve_host_'.$server_id.'">'.$this->trans('Sieve Host').'</label></div>';
}
$res .= '</div><div class="col-sm-4 text-end">';
$res .= '</div></div></div><div class="col-xl-3 col-lg-3 d-flex justify-content-start align-items-center px-2">';

// Buttons
if (!isset($vals['user']) || !$vals['user']) {
Expand Down
1 change: 0 additions & 1 deletion modules/imap/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
.hl { padding-right: 5px; color: #666; }
.dl { color: #888; }
.empty_list { text-align: center; color: #ccc; font-size: 2em; font-style: italic; padding: 30px; padding-bottom: 100px; }
.credentials { width: 205px; margin-bottom: 15px !important; }
.add_server .txt_fld { width: 205px; }
.add_server .port_fld { width: 50px; }
.server_title { font-size: 110%; margin-bottom: 0px; color: #666; }
Expand Down
16 changes: 8 additions & 8 deletions modules/smtp/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1380,29 +1380,29 @@ protected function output() {
}
$res .= '<div class="smtp_server">';

$res .= '<form class="smtp_connect" method="POST">';
$res .= '<form class="smtp_connect col-12" method="POST"><div class="row">';
$res .= '<input type="hidden" name="hm_page_key" value="'.$this->html_safe(Hm_Request_Key::generate()).'" />';
$res .= '<input type="hidden" name="smtp_server_id" value="'.$this->html_safe($index).'" />';
$res .= '<div class="row"><div class="col-sm-2">';
$res .= '<div class="row "><div class="col-xl-9 col-lg-9 p-3" > <div class="row"> <div class="col-xl-3 col-lg-4 col-md-12">';
$res .= sprintf('<div class="text-muted"><strong>%s</strong></div>
<div class="server_subtitle">%s/%d %s</div>',
$this->html_safe($vals['name']), $this->html_safe($vals['server']), $this->html_safe($vals['port']), $vals['tls'] ? 'TLS' : '' );
$res .= '</div><div class="col-sm-2">';
$res .= '</div><div class="col-xl-3 col-lg-4 col-md-4">';

// SMTP Username
$res .= '<div class="form-floating">';
$res .= '<input '.$disabled.' class="form-control credentials" id="smtp_user_'.$index.'" type="text" name="smtp_user" value="'.$this->html_safe($user_pc).'" placeholder="'.$this->trans('Username').'">';
$res .= '<label for="smtp_user_'.$index.'">'.$this->trans('SMTP username').'</label></div>';
$res .= '</div><div class="col-sm-2">';
$res .= '</div><div class="col-xl-3 col-lg-4 col-md-4">';

// SMTP Password
$res .= '<div class="form-floating">';
$res .= '<input '.$disabled.' class="form-control credentials smtp_password" type="password" id="smtp_pass_'.$index.'" name="smtp_pass" value="'.$pass_value.'" placeholder="'.$pass_pc.'">';
$res .= '<label for="smtp_pass_'.$index.'">'.$this->trans('SMTP password').'</label></div>';
$res .= '</div><div class="col-sm-2"></div>';
$res .= '</div><div class="col-xl-3 col-lg-4 col-md-4"></div>';

// Buttons
$res .= '<div class="col-sm-4 text-end">';
$res .= '</div> </div> <div class="col-xl-3 col-lg-3 d-flex justify-content-start align-items-center px-2">';
if (!$no_edit) {
if (!isset($vals['user']) || !$vals['user']) {
$res .= '<input type="submit" value="'.$this->trans('Delete').'" class="delete_smtp_connection btn btn-light border btn-sm me-2" />';
Expand All @@ -1411,11 +1411,11 @@ protected function output() {
else {
$res .= '<input type="submit" value="'.$this->trans('Test').'" class="test_smtp_connect btn btn-primary btn-sm me-2" />';
$res .= '<input type="submit" value="'.$this->trans('Delete').'" class="delete_smtp_connection btn btn-outline-danger btn-sm me-2" />';
$res .= '<input type="submit" value="'.$this->trans('Forget').'" class="forget_smtp_connection btn btn-outline-secondary btn-sm me-2" />';
$res .= '<input type="submit" value="'.$this->trans('Forget').'" class="forget_smtp_connection btn btn-outline-warning btn-sm me-2" />';
}
$res .= '<input type="hidden" value="ajax_smtp_debug" name="hm_ajax_hook" />';
}
$res .= '</div></div></form></div>';
$res .= '</div></div> </div> </form> </div>';
}
return $res;
}
Expand Down

0 comments on commit d536efa

Please sign in to comment.