Started work on the site design

This commit is contained in:
Gregory Ballantine 2023-04-08 16:44:28 -04:00
parent 0a4b41c547
commit cb341524c4
12 changed files with 1303 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Copyright (c) <year> <owner> Copyright (c) 2023 Metaunix.net
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

17
app/bootstrap.php Normal file
View File

@ -0,0 +1,17 @@
<?php
use Slim\Factory\AppFactory;
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;
require __DIR__ . '/../vendor/autoload.php';
$app = AppFactory::create();
// Create Twig
$twig = Twig::create(__DIR__ . '/../views', ['cache' => false]);
// Add Twig-View Middleware
$app->add(TwigMiddleware::create($app, $twig));
// Register routes
require_once __DIR__ . '/routes.php';

10
app/routes.php Normal file
View File

@ -0,0 +1,10 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Views\Twig;
$app->get('/', function (Request $request, Response $response, array $args) {
$view = Twig::fromRequest($request);
return $view->render($response, 'index.twig');
});

23
composer.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "metaunix/salt-hub",
"description": "Website to share and browse SaltStack formulas",
"type": "project",
"license": "BSD-2-Clause",
"autoload": {
"psr-4": {
"Metaunix\\SaltHub\\": "src/"
}
},
"authors": [
{
"name": "Gregory Ballantine",
"email": "gballantine@metaunix.net"
}
],
"minimum-stability": "stable",
"require": {
"slim/slim": "^4.11",
"slim/psr7": "^1.6",
"slim/twig-view": "^3.3"
}
}

1159
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

5
public/.htaccess Normal file
View File

@ -0,0 +1,5 @@
# rewrite rules
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

18
public/css/duradel.css Normal file
View File

@ -0,0 +1,18 @@
#top-bar{
margin-bottom: 15px;
}
#top-bar,
#top-bar ul{
background: #6200ee;
color: white;
font-size: 18px;
}
#top-bar a{
color: white;
}
#top-bar a:hover{
color: #eee;
}

23
public/index.php Normal file
View File

@ -0,0 +1,23 @@
<?php
// if we're looking for static files in dev, return false so they can be served.
if (PHP_SAPI == 'cli-server') {
$url = parse_url($_SERVER['REQUEST_URI']);
$file = __DIR__ . $url['path'];
// check the file types, only serve standard files
if (preg_match('/\.(?:png|js|jpg|jpeg|gif|css)$/', $file)) {
// does the file exist? If so, return it
if (is_file($file))
return false;
// file does not exist. return a 404
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
printf('"%s" does not exist', $_SERVER['REQUEST_URI']);
return false;
}
}
require_once __DIR__ . '/../app/bootstrap.php';
$app->run();

5
public/js/konar.js Normal file
View File

@ -0,0 +1,5 @@
$(document).ready(function() {
$(document).foundation();
});

11
views/index.twig Normal file
View File

@ -0,0 +1,11 @@
{% extends 'layout/layout.twig' %}
{% block title %}Dashboard{% endblock %}
{% block content %}
<div class="grid-x">
<div class="cell small-12">
<p>This is a test.</p>
</div>
</div>
{% endblock %}

21
views/layout/layout.twig Normal file
View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{% block title %}{% endblock %} | Salt Hub</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/css/foundation.min.css">
<link rel="stylesheet" href="/css/duradel.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/js/foundation.min.js" charset="utf-8"></script>
<script src="/js/konar.js" charset="utf-8"></script>
</head>
<body>
{% include 'layout/top-bar.twig' %}
<div class="grid-container">
{% block content %}{% endblock %}
</div>
</body>
</html>

10
views/layout/top-bar.twig Normal file
View File

@ -0,0 +1,10 @@
<nav id="top-bar" class="top-bar">
<div class="top-bar-left">
<ul class="menu" data-dropdown-menu>
<li class="menu-text">Salt Hub</li>
<li><a href="/">Dashboard</a></li>
<li><a href="/formulas">Formulas</a></li>
<li><a href="/organizations">Organizations</a></li>
</ul>
</div>
</nav>