Upload
This commit is contained in:
parent
db1d26e122
commit
c79cde1afd
4 changed files with 598 additions and 598 deletions
220
genres.php
220
genres.php
|
@ -1,111 +1,111 @@
|
|||
<?php
|
||||
|
||||
// read toml config file
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Genres.php';
|
||||
|
||||
use Yosymfony\Toml\Toml;
|
||||
|
||||
$config = Toml::ParseFile('includes/config.toml');
|
||||
$lang = $_SESSION['lang'] ?? $config['app']['locale'];
|
||||
$locale = loadLocale($lang);
|
||||
$genresFound = false;
|
||||
// if there's a query parameter named 'dj', load the DJ class
|
||||
$db = new Database($config);
|
||||
$genres = new Genres($db);
|
||||
?>
|
||||
<!doctype html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo $config['app']['name']; ?></title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="fontawesome/css/all.css" rel="stylesheet"/>
|
||||
|
||||
<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 'navbar.php'; ?>
|
||||
<section style="background-color: #eee;">
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item active"><a href="/genres.php"><?php echo $locale['genres']; ?></a>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// we have a list of genres; we need to create them as cards
|
||||
// loop through $genres->get_all_genres
|
||||
// create a card for each genre, 4 max per row
|
||||
|
||||
$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>';
|
||||
echo '<a href="/genre.php?genre=' . $genre['slug'] . '" class="btn btn-primary">' . $locale['view'] . '</a>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
if ($count % 4 == 3) {
|
||||
echo '</div>';
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
<?php
|
||||
|
||||
// read toml config file
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Genres.php';
|
||||
|
||||
use Yosymfony\Toml\Toml;
|
||||
|
||||
$config = Toml::ParseFile('includes/config.toml');
|
||||
$lang = $_SESSION['lang'] ?? $config['app']['locale'];
|
||||
$locale = loadLocale($lang);
|
||||
$genresFound = false;
|
||||
// if there's a query parameter named 'dj', load the DJ class
|
||||
$db = new Database($config);
|
||||
$genres = new Genres($db);
|
||||
?>
|
||||
<!doctype html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo $config['app']['name']; ?></title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="fontawesome/css/all.css" rel="stylesheet"/>
|
||||
|
||||
<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 'navbar.php'; ?>
|
||||
<section style="background-color: #eee;">
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item active"><a href="/genres.php"><?php echo $locale['genres']; ?></a>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// we have a list of genres; we need to create them as cards
|
||||
// loop through $genres->get_all_genres
|
||||
// create a card for each genre, 4 max per row
|
||||
|
||||
$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>';
|
||||
echo '<a href="/genre.php?genre=' . $genre['slug'] . '" class="btn btn-primary">' . $locale['view'] . '</a>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
if ($count % 4 == 3) {
|
||||
echo '</div>';
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue