Various new features.
This commit is contained in:
parent
ad68f515e0
commit
36e6e23a68
14 changed files with 437 additions and 523 deletions
66
genres.php
66
genres.php
|
@ -1,14 +1,6 @@
|
|||
<?php
|
||||
|
||||
// read toml config file
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use Yosymfony\Toml\Toml;
|
||||
|
||||
$config = Toml::ParseFile('includes/config.toml');
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'includes/sessions.php';
|
||||
require_once 'includes/lang_loader.php';
|
||||
require 'includes/globals.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Genres.php';
|
||||
|
||||
|
@ -16,43 +8,8 @@ $genresFound = false;
|
|||
// if there's a query parameter named 'dj', load the DJ class
|
||||
$db = new Database($config);
|
||||
$genres = new Genres($db);
|
||||
require_once 'includes/header.php';
|
||||
?>
|
||||
<!doctype html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<?php require 'includes/header.php'; ?>
|
||||
<style>
|
||||
.card {
|
||||
height: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.card-text {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body style="background-color: #eee;">
|
||||
<?php require 'includes/navbar.php'; ?>
|
||||
<section style="background-color: #eee;">
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
|
@ -75,20 +32,7 @@ $genres = new Genres($db);
|
|||
$genres = $genres->get_nonzero_genres();
|
||||
$count = 0;
|
||||
foreach ($genres as $genre) {
|
||||
if ($count % 4 == 0) {
|
||||
echo '<div class="row">';
|
||||
}
|
||||
echo '<div class="col-md-3">';
|
||||
echo '<div class="card mb-4">';
|
||||
echo '<div class="card-body">';
|
||||
echo '<h5 class="card-title" title="' . $genre['name'] . '">' . $genre['name'] . '</h5>';
|
||||
echo '<p class="card-text">' . $genre['count'] . ' ';
|
||||
if ($genre['count'] == 1) {
|
||||
echo $locale['mix'];
|
||||
} else {
|
||||
echo $locale['mixes'];
|
||||
}
|
||||
echo '</p>';
|
||||
card_output($count, $genre, $locale);
|
||||
echo '<a href="/genre.php?genre=' . $genre['slug'] . '" class="btn btn-primary">' . $locale['view'] . '</a>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -102,6 +46,4 @@ $genres = new Genres($db);
|
|||
|
||||
</div>
|
||||
</section>
|
||||
<?php require 'includes/footer.php'; ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php require 'includes/footer.php'; ?>
|
Loading…
Add table
Add a link
Reference in a new issue