Skip to content

Commit

Permalink
Added bootstrap to passwords section in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
josaphatim committed May 16, 2024
1 parent b5b4bd2 commit b53221f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 27 deletions.
17 changes: 9 additions & 8 deletions modules/core/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1775,18 +1775,19 @@ class Hm_Output_home_password_dialogs extends Hm_Output_Module {
protected function output() {
$missing = $this->get('missing_pw_servers', array());
if (count($missing) > 0) {
$res = '<div class="home_password_dialogs">';
$res .= '<div class="nux_title">Passwords</div>'.$this->trans('You have elected to not store passwords between logins.').
' '.$this->trans('Enter your passwords below to gain access to these services during this session.').'<br /><br />';
$res = '<div class="home_password_dialogs mt-3 col-lg-6 col-md-5 col-sm-12">';
$res .= '<div class="card"><div class="card-body">';
$res .= '<div class="card_title"><h4>Passwords</h4></div><p>'.$this->trans('You have elected to not store passwords between logins.').
' '.$this->trans('Enter your passwords below to gain access to these services during this session.').'</p>';

foreach ($missing as $vals) {
$id = $this->html_safe(sprintf('%s_%s', strtolower($vals['type']), $vals['id']));
$res .= '<div class="div_'.$id.'" >'.$this->html_safe($vals['type']).' '.$this->html_safe($vals['name']).
' '.$this->html_safe($vals['user']).' '.$this->html_safe($vals['server']).' <input placeholder="'.$this->trans('Password').
'" type="password" class="pw_input" id="update_pw_'.$id.'" /> <input type="button" class="pw_update" data-id="'.$id.
'" value="'.$this->trans('Update').'" /></div>';
$res .= '<div class="div_'.$id.' mt-3">'.$this->html_safe($vals['type']).' '.$this->html_safe($vals['name']).
' '.$this->html_safe($vals['user']).' '.$this->html_safe($vals['server']).' <div class="input-group mt-2"><input placeholder="'.$this->trans('Password').
'" type="password" class="form-control pw_input" id="update_pw_'.$id.'" /> <input type="button" class="pw_update btn btn-primary" data-id="'.$id.
'" value="'.$this->trans('Update').'" /></div></div>';
}
$res .= '</div>';
$res .= '</div></div></div>';
return $res;
}
}
Expand Down
16 changes: 0 additions & 16 deletions modules/core/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -772,22 +772,6 @@ div.unseen,
rgba(0, 0, 0, 0.3) 70%
);
}
.home_password_dialogs {
min-height: 400px;
max-width: 480px;
padding: 20px;
margin: 20px;
margin-right: 0px;
float: left;
border: solid 1px #eee;
}
.home_password_dialogs .pw_input {
width: 120px;
}
.nux_title {
font-size: 120%;
margin-bottom: 20px;
}
.total_unread_count,
.unread_count {
background-color: #ccc;
Expand Down
4 changes: 2 additions & 2 deletions modules/nux/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ protected function output() {
*/
class Hm_Output_nux_dev_news extends Hm_Output_Module {
protected function output() {
$res = '<div class="nux_dev_news mt-3 col-12"><div class="card"><div class="card-body"><div class="nux_title">'.$this->trans('Development Updates').'</div><table>';
$res = '<div class="nux_dev_news mt-3 col-12"><div class="card"><div class="card-body"><div class="card_title"><h4>'.$this->trans('Development Updates').'</h4></div><table>';
foreach ($this->get('nux_dev_news', array()) as $vals) {
$res .= sprintf('<tr><td><a href="https:/cypht-org/cypht/commit/%s" target="_blank" rel="noopener">%s</a>'.
'</td><td class="msg_date">%s</td><td>%s</td><td>%s</td></tr>',
Expand All @@ -351,7 +351,7 @@ protected function output() {
*/
class Hm_Output_nux_help extends Hm_Output_Module {
protected function output() {
return '<div class="nux_help mt-3 col-lg-6 col-md-12 col-sm-12"><div class="card"><div class="card-body"><div class="nux_title">'.$this->trans('Help').'</div>'.
return '<div class="nux_help mt-3 col-lg-6 col-md-12 col-sm-12"><div class="card"><div class="card-body"><div class="card_title"><h4>'.$this->trans('Help').'</h4></div>'.
$this->trans('Cypht is a webmail program. You can use it to access your E-mail accounts from any service that offers IMAP, or SMTP access - which most do.').' '.
'</div></div></div>';
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/modules/core/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ public function test_home_password_dialogs() {
$this->assertEquals(array(), $res->output_response);
$test->handler_response = array('missing_pw_servers' => array(array('server' => 'host', 'user' => 'test', 'type' => 'foo', 'id' => 1, 'name' => 'bar')));
$res = $test->run();
$this->assertEquals(array('<div class="home_password_dialogs"><div class="nux_title">Passwords</div>You have elected to not store passwords between logins. Enter your passwords below to gain access to these services during this session.<br /><br /><div class="div_foo_1" >foo bar test host <input placeholder="Password" type="password" class="pw_input" id="update_pw_foo_1" /> <input type="button" class="pw_update" data-id="foo_1" value="Update" /></div></div>'), $res->output_response);
$this->assertEquals(array('<div class="home_password_dialogs mt-3 col-lg-6 col-md-5 col-sm-12"><div class="card"><div class="card-body"><div class="card_title"><h4>Passwords</h4></div><p>You have elected to not store passwords between logins. Enter your passwords below to gain access to these services during this session.</p><div class="div_foo_1 mt-3">foo bar test host <div class="input-group mt-2"><input placeholder="Password" type="password" class="form-control pw_input" id="update_pw_foo_1" /> <input type="button" class="pw_update btn btn-primary" data-id="foo_1" value="Update" /></div></div></div></div></div>'), $res->output_response);
}
/**
* @preserveGlobalState disabled
Expand Down

0 comments on commit b53221f

Please sign in to comment.