alternative theme improves

This commit is contained in:
Diego Najar 2018-01-27 20:34:26 +01:00
parent 6b827a7c8e
commit 05d916e333
7 changed files with 81 additions and 48 deletions

View File

@ -216,7 +216,7 @@ function buildStaticPages() {
global $dbPages; global $dbPages;
$tmp = array(); $tmp = array();
$staticPages = $dbPages->getStaticDB($onlyKeys=true); $staticPages = $dbPages->getStaticDB();
foreach ($staticPages as $pageKey) { foreach ($staticPages as $pageKey) {
$staticPage = buildPage($pageKey); $staticPage = buildPage($pageKey);
array_push($tmp, $staticPage); array_push($tmp, $staticPage);

View File

@ -30,6 +30,11 @@ class Paginator {
return self::get('amountOfPages'); return self::get('amountOfPages');
} }
public static function currentPage()
{
return self::get('currentPage');
}
public static function nextPage() public static function nextPage()
{ {
return self::get('nextPage'); return self::get('nextPage');

View File

@ -32,6 +32,10 @@ section.page:nth-child(even) {
background: #FAFAFA; background: #FAFAFA;
} }
a.page-title {
color: #333;
}
.page-description { .page-description {
font-size: 1.25rem; font-size: 1.25rem;
font-weight: 300; font-weight: 300;
@ -39,4 +43,9 @@ section.page:nth-child(even) {
.page-cover-image { .page-cover-image {
background-size: cover; background-size: cover;
background-position: center; background-position: center;
}
.nav-link {
font-size: 0.8em;
text-transform: uppercase;
} }

View File

@ -1,32 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<?php include(THEME_DIR_PHP.'head.php') ?> <?php include(THEME_DIR_PHP.'head.php') ?>
</head> </head>
<body id="page-top"> <body id="page-top">
<!-- Navigation --> <!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"> <?php
<div class="container"> include(THEME_DIR_PHP.'navbar.php');
<a class="navbar-brand" href="#"> ?>
<span class="text-white">BLUDIT</span>
<span class="ml-1 text-muted">Surprise</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#">About</a></li>
<li class="nav-item"><a class="nav-link" href="#">Contact</a></li>
<li class="nav-item"><a class="nav-link" href="#">Impressum</a></li>
<li class="nav-item"><a class="nav-link" href="#">BLUDIT PRO</a></li>
</ul>
</div>
</div>
</nav>
<!-- Content --> <!-- Content -->
<?php <?php

View File

@ -18,7 +18,9 @@
<div class="row"> <div class="row">
<div class="col-lg-8 mx-auto"> <div class="col-lg-8 mx-auto">
<!-- Page title --> <!-- Page title -->
<h2 class="page-title"><?php echo $page->title() ?></h2> <a class="page-title" href="<?php echo $page->permalink() ?>">
<h2 class="page-title"><?php echo $page->title() ?></h2>
</a>
<!-- Page content, until the pagebreak --> <!-- Page content, until the pagebreak -->
<div class="page-content"> <div class="page-content">
@ -36,16 +38,27 @@
<?php endforeach ?> <?php endforeach ?>
<!-- Pagination --> <!-- Pagination -->
<nav aria-label="Page navigation example"> <?php if (Paginator::amountOfPages()>1): ?>
<nav class="my-4" aria-label="Page navigation">
<ul class="pagination justify-content-center"> <ul class="pagination justify-content-center">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1">Previous</a> <!-- Previuos button -->
<li class="page-item <?php if (Paginator::showNext()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::prevPageUrl() ?>" tabindex="-1">Previous</a>
</li> </li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li> <!-- List of pages -->
<li class="page-item"><a class="page-link" href="#">3</a></li> <?php for ($i = 1; $i <= Paginator::amountOfPages(); $i++): ?>
<li class="page-item"> <li class="page-item <?php if ($i==Paginator::currentPage()) echo 'active' ?>">
<a class="page-link" href="#">Next</a> <a class="page-link" href="<?php echo Paginator::numberUrl($i) ?>"><?php echo $i ?></a>
</li> </li>
<?php endfor ?>
<!-- Next button -->
<li class="page-item <?php if (Paginator::showPrev()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>">Next</a>
</li>
</ul> </ul>
</nav> </nav>
<?php endif ?>

View File

@ -0,0 +1,20 @@
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
<span class="text-white"><?php echo $site->title() ?></span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<?php foreach ($staticContent as $staticPage): ?>
<li class="nav-item">
<a class="nav-link" href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
</li>
<?php endforeach ?>
</ul>
</div>
</div>
</nav>

View File

@ -1,23 +1,27 @@
<section class="page"> <section class="page">
<div class="container"> <div class="container">
<!-- Page title --> <div class="row">
<h1 class="page-title"><?php echo $page->title() ?></h1> <div class="col-lg-8 mx-auto">
<!-- Page title -->
<h1 class="page-title"><?php echo $page->title() ?></h1>
<!-- Page description --> <!-- Page description -->
<?php if ($page->description()): ?> <?php if ($page->description()): ?>
<p class="page-description"><?php echo $page->description() ?></p> <p class="page-description"><?php echo $page->description() ?></p>
<?php endif ?> <?php endif ?>
<!-- Page cover image --> <!-- Page cover image -->
<?php if ($page->coverImage()): ?> <?php if ($page->coverImage()): ?>
<div class="page-cover-image py-6 mb-4" style="background-image: url('<?php echo $page->coverImage() ?>');"> <div class="page-cover-image py-6 mb-4" style="background-image: url('<?php echo $page->coverImage() ?>');">
<div style="height: 300px;"></div> <div style="height: 300px;"></div>
</div> </div>
<?php endif ?> <?php endif ?>
<!-- Page content --> <!-- Page content -->
<div class="page-content"> <div class="page-content">
<?php echo $page->content() ?> <?php echo $page->content() ?>
</div>
</div>
</div> </div>
</div> </div>
</section> </section>