Closed #18
This commit is contained in:
parent
6e7791e94b
commit
21f4669a98
12 changed files with 176 additions and 186 deletions
|
@ -136,6 +136,8 @@ a:hover i[class*='icon-'] {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
|
max-width: 500px;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-error {
|
.alert-error {
|
||||||
|
|
|
@ -26,6 +26,7 @@ class Bootstrap
|
||||||
$this->config->chibi->baseUrl = 'http://' . rtrim($_SERVER['HTTP_HOST'], '/') . '/';
|
$this->config->chibi->baseUrl = 'http://' . rtrim($_SERVER['HTTP_HOST'], '/') . '/';
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
$this->context->handleExceptions = false;
|
||||||
$this->context->title = $this->config->main->title;
|
$this->context->title = $this->config->main->title;
|
||||||
$this->context->stylesheets =
|
$this->context->stylesheets =
|
||||||
[
|
[
|
||||||
|
@ -63,6 +64,8 @@ class Bootstrap
|
||||||
$this->context->transport->errorMessage = rtrim($e->getMessage(), '.') . '.';
|
$this->context->transport->errorMessage = rtrim($e->getMessage(), '.') . '.';
|
||||||
$this->context->transport->exception = $e;
|
$this->context->transport->exception = $e;
|
||||||
$this->context->transport->success = false;
|
$this->context->transport->success = false;
|
||||||
|
if (!$this->context->handleExceptions)
|
||||||
|
$this->context->viewName = 'error-simple';
|
||||||
(new \Chibi\View())->renderFile($this->context->layoutName);
|
(new \Chibi\View())->renderFile($this->context->layoutName);
|
||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
|
|
|
@ -12,6 +12,7 @@ class AuthController
|
||||||
*/
|
*/
|
||||||
public function loginAction()
|
public function loginAction()
|
||||||
{
|
{
|
||||||
|
$this->context->handleExceptions = true;
|
||||||
$this->context->stylesheets []= 'auth.css';
|
$this->context->stylesheets []= 'auth.css';
|
||||||
$this->context->subTitle = 'authentication form';
|
$this->context->subTitle = 'authentication form';
|
||||||
|
|
||||||
|
@ -62,6 +63,7 @@ class AuthController
|
||||||
*/
|
*/
|
||||||
public function registerAction()
|
public function registerAction()
|
||||||
{
|
{
|
||||||
|
$this->context->handleExceptions = true;
|
||||||
$this->context->stylesheets []= 'auth.css';
|
$this->context->stylesheets []= 'auth.css';
|
||||||
$this->context->subTitle = 'registration form';
|
$this->context->subTitle = 'registration form';
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,6 @@ class CommentController
|
||||||
{
|
{
|
||||||
$this->context->activeSection = 'comments';
|
$this->context->activeSection = 'comments';
|
||||||
$this->context->subTitle = 'comments';
|
$this->context->subTitle = 'comments';
|
||||||
throw new Exception('Not implemented');
|
throw new SimpleException('Not implemented');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ class UserController
|
||||||
public function listAction()
|
public function listAction()
|
||||||
{
|
{
|
||||||
$this->context->subTitle = 'users';
|
$this->context->subTitle = 'users';
|
||||||
throw new Exception('Not implemented');
|
throw new SimpleException('Not implemented');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,6 +17,6 @@ class UserController
|
||||||
public function viewAction($name)
|
public function viewAction($name)
|
||||||
{
|
{
|
||||||
$this->context->subTitle = $name;
|
$this->context->subTitle = $name;
|
||||||
throw new Exception('Not implemented');
|
throw new SimpleException('Not implemented');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,3 @@
|
||||||
<p>However, you still need to be approved by admin.</p>
|
<p>However, you still need to be approved by admin.</p>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (isset($this->context->transport->errorMessage)): ?>
|
|
||||||
<p class="alert alert-error"><?php echo $this->context->transport->errorMessage ?></p>
|
|
||||||
<?php endif ?>
|
|
||||||
|
|
1
src/Views/error-simple.phtml
Normal file
1
src/Views/error-simple.phtml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<p class="alert alert-error">Error: <?php echo $this->context->transport->errorMessage ?><br><a href="javascript:history.go(-1)">Go back</a></p>
|
|
@ -1,6 +1,4 @@
|
||||||
<?php if (!empty($this->context->transport->errorMessage)): ?>
|
<?php if (empty($this->context->transport->posts)): ?>
|
||||||
<p class="alert alert-error"><?php echo $this->context->transport->errorMessage ?></p>
|
|
||||||
<?php elseif (empty($this->context->transport->posts)): ?>
|
|
||||||
<p class="alert alert-warning">No posts to show.</p>
|
<p class="alert alert-warning">No posts to show.</p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="posts paginator-content">
|
<div class="posts paginator-content">
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php if ($this->context->transport->success === true): ?>
|
<?php if ($this->context->transport->success === true): ?>
|
||||||
<p>Post created!</p>
|
<p>Post created!</p>
|
||||||
<?php elseif (isset($this->context->transport->errorMessage)): ?>
|
|
||||||
<p class="alert alert-error"><?php echo $this->context->transport->errorMessage ?></p>
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
|
||||||
<div id="sidebar">
|
<div id="sidebar">
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
<?php if (!empty($this->context->transport->errorMessage)): ?>
|
<div id="sidebar">
|
||||||
<p class="alert alert-error"><?php echo $this->context->transport->errorMessage ?></p>
|
|
||||||
<?php else: ?>
|
|
||||||
|
|
||||||
<div id="sidebar">
|
|
||||||
<nav>
|
<nav>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<?php if ($this->context->transport->nextPostId): ?>
|
<?php if ($this->context->transport->nextPostId): ?>
|
||||||
|
@ -168,9 +164,9 @@
|
||||||
$('.options').hide();
|
$('.options').hide();
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="inner-content">
|
<div id="inner-content">
|
||||||
<div class="post-wrapper">
|
<div class="post-wrapper">
|
||||||
<?php if ($this->context->transport->post->type == PostType::Image): ?>
|
<?php if ($this->context->transport->post->type == PostType::Image): ?>
|
||||||
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>"/>
|
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>"/>
|
||||||
|
@ -178,6 +174,4 @@
|
||||||
<embed width="<?php echo $this->context->transport->post->image_width ?>" height="<?php echo $this->context->transport->post->image_height ?>" type="application/x-shockwave-flash" src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>"/>
|
<embed width="<?php echo $this->context->transport->post->image_width ?>" height="<?php echo $this->context->transport->post->image_height ?>" type="application/x-shockwave-flash" src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>"/>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php endif ?>
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<?php if (isset($this->context->transport->errorMessage)): ?>
|
<ul>
|
||||||
<p class="alert alert-error"><?php echo $this->context->transport->errorMessage ?></p>
|
|
||||||
<?php else: ?>
|
|
||||||
<ul>
|
|
||||||
<?php foreach ($this->context->transport->tagDistribution as $tagName => $count): ?>
|
<?php foreach ($this->context->transport->tagDistribution as $tagName => $count): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tagName]) ?>">
|
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tagName]) ?>">
|
||||||
|
@ -9,5 +6,4 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif ?>
|
|
||||||
|
|
Loading…
Reference in a new issue