Skip to content

Commit

Permalink
Next pass at bootstrap conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbennett committed Jul 5, 2021
1 parent c4eb190 commit 5a5b211
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/templates/Server/View.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
$server_name = filter_var($server->getName(), FILTER_SANITIZE_FULL_SPECIAL_CHARS);

$title = $server_name;
$description = sprintf('Server Status for %s', $server_name);
$description = sprintf('The server details and status for %s', $server_name);
$url = $server->getURI();
$url_json = sprintf('%s.json', $url);
$url_txt = sprintf('%s.txt', $url);
Expand Down
73 changes: 31 additions & 42 deletions src/templates/User/Logout.phtml
Original file line number Diff line number Diff line change
@@ -1,45 +1,34 @@
<?php

<?php /* vim: set colorcolumn= expandtab shiftwidth=2 softtabstop=2 tabstop=4 smarttab: */
namespace BNETDocs\Templates\User;

use \CarlBennett\MVC\Libraries\Pair;

$title = "Logout";
$description = "Log out of the BNETDocs website";
$this->opengraph->attach(new Pair("url", "/user/logout"));

switch ($this->getContext()->error) {
case "NOT_LOGGED_IN":
$message = "You were not logged in to begin with.";
break;
default:
$message = $this->getContext()->error;
$title = 'Logout';
$description = 'Log out of the BNETDocs website';
$this->opengraph->attach(new Pair('url', '/user/logout'));
$error = $this->getContext()->error;
switch ($error)
{
case 'NOT_LOGGED_IN': $message = 'You were not logged in to begin with.'; break;
default: $message = $error;
}

require("./header.inc.phtml");
?>
<article>
<?php if (is_null($this->getContext()->error)) { ?>
<header>Account Logout</header>
<form method="POST" action="?">
<section>
<p>If you are sure you wish to log out, press the button below.</p>
<p><input type="submit" value="Log Out"/></p>
</section>
</form>
<?php } else if ($this->getContext()->error === false) { ?>
<header class="green">Logged Out</header>
<section class="green">
<p>You have been successfully logged out!</p>
<p>Use the navigation to the left to move to another page.</p>
</section>
<?php } else { ?>
<header class="red">Log out failure</header>
<section class="red">
<p>An error occurred while attempting to log out.</p>
<p><?php echo $message; ?></p>
<p>Use the navigation to the left to move to another page.</p>
</section>
<?php } ?>
</article>
<?php require("./footer.inc.phtml"); ?>
require('./header.inc.phtml'); ?>
<div class="container">
<? if (is_null($error)) { ?>
<h1 class="text-danger"><?=$title?></h1>
<p class="text-danger">If you are sure you wish to log out, press the button below.</p>
<form method="POST" action="?">
<input class="btn btn-danger" type="submit" value="Log Out"/>
</form>
<? } else if ($this->getContext()->error === false) { ?>
<h1 class="text-success">Logged Out</h1>
<div class="alert alert-success">
<p class="mb-0">You have been successfully logged out!</p>
</div>
<? } else { ?>
<h1 class="text-danger">Log out failure</h1>
<div class="alert alert-danger">
<p>An error occurred while attempting to log out.</p>
<p class="mb-0"><?=$message?></p>
</secton>
<? } ?>
</div>
<? require('./footer.inc.phtml'); ?>

0 comments on commit 5a5b211

Please sign in to comment.