Skip to content

Commit

Permalink
Pending changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Jan 17, 2024
1 parent 293fbdf commit 94d1822
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 70 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ ARG uid
RUN a2enmod rewrite
ENV PHP_MEMORY_LIMIT=-1

RUN apt-get -y update \
&& apt-get install -y libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl

ENV APACHE_DOCUMENT_ROOT=/var/www/html/pub
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
Expand Down
4 changes: 3 additions & 1 deletion app.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
require_once __DIR__ . '/lib/functions.php';

define('__ROOT__', __DIR__);
Registry::getInstance()->setContentDirectory(__ROOT__ . '/content');
Registry::getInstance()->setContentDirectory(__ROOT__ . '/content');

error_reporting(E_ALL);
3 changes: 2 additions & 1 deletion content/data/nl.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
"Read more","Lees meer"
"Become member","Lid worden"
"Your email","Jouw emailadres"
"Pay now","Nu betalen"
"Pay now","Nu betalen"
"Directory of Magento in Nederland","Directory van Magento in Nederland"
26 changes: 19 additions & 7 deletions content/pages/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@

$blogs = (new BlogProvider())->getBlogs();
?>
<h1>Nieuws</h1>
<section>
<div class="mx-auto md:max-w-6xl px-4 xl:px-0 py-16">
<h1 class="text-4xl text-center p-8"><?= __('Blog') ?></h1>

<?php foreach ($blogs as $blog): ?>
<h2><?= $blog->getTitle() ?></h2>
<p><em><?= $blog->getDate() ?></em></p>
<?= $blog->getIntro() ?>
<a class="p-2 text-white bg-orange-600" href="/blog/<?= $blog->getId() ?>"><?= __('Read more') ?></a>
<?php endforeach; ?>
<?php foreach ($blogs as $blog): ?>
<div>
<h2 class="text-2xl py-4"><?= $blog->getTitle() ?></h2>
<p class="italic text-zinc-500"><?= $blog->getDate() ?></p>
<div class="mb-4">
<?= $blog->getIntro() ?>
</div>
<div class="mb-4">
<a class="p-2 text-white bg-orange-600" href="/blog/<?= $blog->getId() ?>">
<?= __('Read more') ?>
</a>
</div>
</div>
<?php endforeach; ?>
</div>
</section>
8 changes: 4 additions & 4 deletions content/pages/directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
$items = (new DirectoryProvider())->getDirectoryItems();
$currentSort = (isset($_GET['sort']) && $_GET['sort'] === 'name_desc') ? 'name_desc' : 'name_asc';
?>
<section class="bg-gray-200">
<section class="bg-gray-100">
<div class="mx-auto md:max-w-6xl px-4 xl:px-0 py-16">
<h1 class="text-4xl text-center p-8">Directory van Magento in Nederland (<?= count($items) ?>)</h1>
<h1 class="text-4xl text-center p-8"><?= __('Directory of Magento in Nederland') ?> (<?= count($items) ?>)</h1>


<form method="get" class="py-4">
Expand All @@ -25,7 +25,7 @@
value="<?= $form->getSearch() ?>" placeholder="<?= __('Search') ?>" onChange="form.submit()">
</form>

<div class="grid grid-cols-5 gap-4">
<div class="grid grid-cols-1 md:grid-cols-5 gap-4">
<?php foreach ($items as $item): ?>
<div class="bg-white shadow-lg ring-1 ring-black/5 p-6 text-center">
<a class="no-underline " href="<?= $item->getUrl() ?>">
Expand All @@ -40,7 +40,7 @@
<?php endforeach; ?>
</div>

<div class="prose">
<div class="pt-16">
<?= markdownFile('directory') ?>
</div>
</div>
Expand Down
68 changes: 36 additions & 32 deletions content/pages/lid-worden.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
<?php declare(strict_types=1);

?>
<?= markdownFile('become-member/intro') ?>
<section>
<div class="mx-auto md:max-w-6xl px-4 xl:px-0 py-16">
<?= markdownFile('become-member/intro') ?>

<div class="w-full bg-gray-50 rounded shadow-md p-8">
<div>
<label class="block text-gray-700 text-sm font-bold mb-2" for="email">
<?= __('Your email') ?>
</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
name="email" id="email" type="email" placeholder="[email protected]" required>
</div>
<div class="mt-4">
<form class="" id="bank-form" method="get">
<button class="bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
onClick="bankFormSubmit()">
<?= __('Pay now') ?>
</button>
</form>
</div>
</div>
<div class="w-full bg-gray-50 rounded shadow-md p-8">
<div>
<label class="block text-gray-700 text-sm font-bold mb-2" for="email">
<?= __('Your email') ?>
</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
name="email" id="email" type="email" placeholder="[email protected]" required>
</div>
<div class="mt-4">
<form class="" id="bank-form" method="get">
<button class="bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
onClick="bankFormSubmit()">
<?= __('Pay now') ?>
</button>
</form>
</div>
</div>

<script>
function bankFormSubmit() {
const url = 'https://bunq.me/MageOSNederland/10/';
const email = document.getElementById('email').value;
if (!email) {
alert('Not a valid email address');
return;
}
<script>
function bankFormSubmit() {
const url = 'https://bunq.me/MageOSNederland/10/';
const email = document.getElementById('email').value;
if (!email) {
alert('Not a valid email address');
return;
}

let form = document.getElementById('bank-form');
form.action = url + email;
form.submit();
}
</script>
let form = document.getElementById('bank-form');
form.action = url + email;
form.submit();
}
</script>

<?= markdownFile('become-member/bottom') ?>
<?= markdownFile('become-member/bottom') ?>
</div>
</section>
2 changes: 1 addition & 1 deletion lib/Website/Blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getContent(): string
*/
public function getTimestamp(): int
{
return $this->timestamp;
return $this->timestamp ?? 0;
}

public function getDate(): string
Expand Down
5 changes: 5 additions & 0 deletions lib/Website/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public function getHtml(): string
$markdown = $this->getMarkdownContent();
$markdown = str_replace('---', '', $markdown);
$html = MarkdownExtra::defaultTransform($markdown);
ob_start();
include __ROOT__ .'/templates/section-html.php';
$html = ob_get_contents();
ob_end_clean();

} catch (InvalidArgumentException $e) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ function markdownFile(string $fileId): string

$text = file_get_contents($file);

return MarkdownExtra::defaultTransform($text);
return markdown($text);
}
72 changes: 53 additions & 19 deletions pub/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,10 @@ video {
right:0px;
}

.top-2 {
top:0.5rem;
}

.bottom-0 {
bottom:0px;
}
Expand Down Expand Up @@ -1147,6 +1151,10 @@ video {
margin:auto;
}

.m-2 {
margin:0.5rem;
}

.mx-auto {
margin-left:auto;
margin-right:auto;
Expand All @@ -1157,6 +1165,11 @@ video {
margin-right:0px;
}

.my-4 {
margin-top:1rem;
margin-bottom:1rem;
}

.mb-2 {
margin-bottom:0.5rem;
}
Expand All @@ -1165,6 +1178,14 @@ video {
margin-top:1rem;
}

.mt-8 {
margin-top:2rem;
}

.mb-4 {
margin-bottom:1rem;
}

.block {
display:block;
}
Expand Down Expand Up @@ -1231,8 +1252,8 @@ video {
appearance:none;
}

.grid-cols-5 {
grid-template-columns:repeat(5, minmax(0, 1fr));
.grid-cols-1 {
grid-template-columns:repeat(1, minmax(0, 1fr));
}

.flex-row {
Expand Down Expand Up @@ -1293,9 +1314,9 @@ video {
background-color:rgb(234 88 12 / var(--tw-bg-opacity));
}

.bg-gray-200 {
.bg-gray-100 {
--tw-bg-opacity:1;
background-color:rgb(229 231 235 / var(--tw-bg-opacity));
background-color:rgb(243 244 246 / var(--tw-bg-opacity));
}

.bg-white {
Expand Down Expand Up @@ -1332,12 +1353,16 @@ video {
object-fit:cover;
}

.p-8 {
padding:2rem;
}

.p-2 {
padding:0.5rem;
}

.p-8 {
padding:2rem;
.p-1 {
padding:0.25rem;
}

.p-6 {
Expand All @@ -1348,10 +1373,6 @@ video {
padding:1rem;
}

.p-1 {
padding:0.25rem;
}

.px-4 {
padding-left:1rem;
padding-right:1rem;
Expand Down Expand Up @@ -1387,6 +1408,10 @@ video {
padding-bottom:2rem;
}

.pt-16 {
padding-top:4rem;
}

.pt-4 {
padding-top:1rem;
}
Expand All @@ -1411,10 +1436,6 @@ video {
padding-right:0.5rem;
}

.pb-16 {
padding-bottom:4rem;
}

.pb-8 {
padding-bottom:2rem;
}
Expand Down Expand Up @@ -1452,6 +1473,11 @@ video {
line-height:2.5rem;
}

.text-2xl {
font-size:1.5rem;
line-height:2rem;
}

.text-sm {
font-size:0.875rem;
line-height:1.25rem;
Expand All @@ -1462,11 +1488,6 @@ video {
line-height:2.25rem;
}

.text-2xl {
font-size:1.5rem;
line-height:2rem;
}

.text-lg {
font-size:1.125rem;
line-height:1.75rem;
Expand Down Expand Up @@ -1494,6 +1515,10 @@ video {
text-transform:uppercase;
}

.italic {
font-style:italic;
}

.leading-tight {
line-height:1.25;
}
Expand Down Expand Up @@ -1537,6 +1562,11 @@ video {
color:rgb(251 146 60 / var(--tw-text-opacity));
}

.text-zinc-500 {
--tw-text-opacity:1;
color:rgb(113 113 122 / var(--tw-text-opacity));
}

.no-underline {
text-decoration-line:none;
}
Expand Down Expand Up @@ -1661,6 +1691,10 @@ video {
flex:none;
}

.md\:grid-cols-5 {
grid-template-columns:repeat(5, minmax(0, 1fr));
}

.md\:py-32 {
padding-top:8rem;
padding-bottom:8rem;
Expand Down
6 changes: 4 additions & 2 deletions templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
$menuItems = include Registry::getInstance()->getContentDirectory().'/data/topmenu.php';
?>
<div class="text-sm">
<div class="mx-auto md:max-w-6xl px-4 xl:px-0">
<div class="mx-auto md:max-w-6xl px-4 xl:px-0 relative">
<div class="absolute right-0 top-2">
<?php include __ROOT__ .'/templates/header/social-media.php' ?>
</div>
<header class="relative flex flex-wrap items-center" x-data="{open:false}">
<?= include './header/social-media.php' ?>
<div class=" flex pt-4 xs:w-1/3 max-width-xs mx-0">
<a href="/" class="block pb-2 max-w-[90px] md:max-w-[180px]">
<?php include __ROOT__.'/resources/svg/mage-os-nl.svg' ?>
Expand Down
Loading

0 comments on commit 94d1822

Please sign in to comment.