Translations. Fixing the language bar.
This commit is contained in:
parent
27373f0c61
commit
28fc75dd25
38 changed files with 1006 additions and 150 deletions
77
genres.php
77
genres.php
|
@ -1,16 +1,16 @@
|
|||
<?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);
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'includes/sessions.php';
|
||||
require_once 'includes/lang_loader.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Genres.php';
|
||||
|
||||
$genresFound = false;
|
||||
// if there's a query parameter named 'dj', load the DJ class
|
||||
$db = new Database($config);
|
||||
|
@ -19,44 +19,39 @@ $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"/>
|
||||
<?php require 'includes/header.php'; ?>
|
||||
<style>
|
||||
.card {
|
||||
height: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
<style>
|
||||
.card {
|
||||
height: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.card-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.card-title {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.card-text {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.card-text {
|
||||
flex-grow: 1;
|
||||
}
|
||||
.btn {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body style="background-color: #eee;">
|
||||
<?php require 'navbar.php'; ?>
|
||||
<?php require 'includes/navbar.php'; ?>
|
||||
<section style="background-color: #eee;">
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
|
@ -74,7 +69,7 @@ $genres = new Genres($db);
|
|||
<?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
|
||||
// create a card for each genre, 4 max per row
|
||||
|
||||
$genres = $genres->get_nonzero_genres();
|
||||
$count = 0;
|
||||
|
@ -85,8 +80,8 @@ $genres = new Genres($db);
|
|||
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'] . ' ' ;
|
||||
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 {
|
||||
|
@ -106,6 +101,6 @@ $genres = new Genres($db);
|
|||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php require 'includes/footer.php'; ?>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue