summaryrefslogtreecommitdiff
path: root/_frame/library.internal/main.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-03-27 21:29:24 +0200
committerMinteck <contact@minteck.org>2022-03-27 21:29:24 +0200
commit226516aca48e97d3dc4e4df213bc2023e64b1afd (patch)
tree60fb4f24b75b120e7e5b0e149069b16367c48aa0 /_frame/library.internal/main.php
downloadargon-226516aca48e97d3dc4e4df213bc2023e64b1afd.tar.gz
argon-226516aca48e97d3dc4e4df213bc2023e64b1afd.tar.bz2
argon-226516aca48e97d3dc4e4df213bc2023e64b1afd.zip
Initial commit
Diffstat (limited to '_frame/library.internal/main.php')
-rw-r--r--_frame/library.internal/main.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/_frame/library.internal/main.php b/_frame/library.internal/main.php
new file mode 100644
index 0000000..7ce781e
--- /dev/null
+++ b/_frame/library.internal/main.php
@@ -0,0 +1,60 @@
+<?php if (str_ends_with($_SERVER['HTTP_HOST'], ".familine.minteck.org")) { $_FAMILINE = true; } else { $_FAMILINE = false; } function l($en, $fr) { global $_FAMILINE; if ($_FAMILINE) { return $fr; } else { return $en; } } $root = $_SERVER['DOCUMENT_ROOT']; $root = $_SERVER['DOCUMENT_ROOT']; if ($_FAMILINE) { require_once "/mnt/familine/app/session.php"; } ?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Argon</title>
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
+ <link rel="stylesheet" href="/css/fonts.css">
+ <link rel="stylesheet" href="/css/general.css">
+ <link rel="stylesheet" href="/css/header.css">
+ <link rel="stylesheet" href="/css/frame-library.css?_=a">
+ <link rel="stylesheet" href="/css/frame.css">
+ <link rel="stylesheet" href="/dark.css">
+ <meta name="HandheldFriendly" content="true" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+</head>
+<body>
+<div id="argon-frame">
+ <div id="frame-header">
+ <?= l("Library", "Bibliothèque") ?>
+ </div>
+ <div id="frame-contents">
+ <?php $data = json_decode(file_get_contents("https://argon.minteck.org/api/get_list.php"), true); ?>
+ <div id="frame-library-listing">
+ <?php foreach ($data["listing"] as $item): ?>
+ <div onclick="if (!event.target.classList.contains('frame-library-item-part-song')) location.href='/_frame/library/<?= $item["_id"] ?>';" class="frame-library-item" id="frame-library-item--<?= $item["_type"] . "-" . $item["_id"] ?>">
+ <div class="frame-library-item-inner">
+ <div class="frame-library-item-cover">
+ <img alt="<?= l("Album art", "Couv. album") ?>" class="frame-library-item-cover-inner" src="/api/get_image.php?_=<?= $item["_id"] ?>">
+ </div>
+ <div class="frame-library-item-text">
+ <div class="frame-library-item-text-inner">
+ <div class="frame-library-item-text-title"><?= $item["name"] ?><?php if ($item["wip"]): ?> <span class="frame-library-wipBadge"><?= l("WIP", "En travail") ?></span><?php endif; ?></div>
+ <div class="frame-library-item-text-info"><?= $item["author"] ?> · <?= substr($item["release"], 0, 4); ?></div>
+ <?php if ($item["_type"] === "song"): ?>
+ <div class="frame-library-item-text-original"><?= $item["original"] === null ? l("Original Content", "Contenu original") : l("original by ", "original par ") . $item["original"] ?></div>
+ <?php else: ?>
+ <div class="frame-library-item-text-original"><?= count($item["songs"]) ?> <?= l("tracks", "morceaux") ?></div>
+ <?php endif; ?>
+ </div>
+ </div>
+ </div>
+ <?php if ($item["_type"] === "set"): ?>
+ <div class="frame-library-item-set">
+ <?php foreach ($item["songs"] as $index => $song): ?>
+ <div <?php if ($song["_released"]): ?>onclick="location.href='/_frame/library/<?= $song["_id"] ?>';"<?php endif; ?> class="frame-library-item-set-song frame-library-item-part-song <?php if (!$song["_released"]): ?>frame-library-item-set-song-wip<?php endif; ?>" id="frame-library-item-set-song--<?= $item["_id"] ?>--<?= $song["_id"] ?>">
+ <div class="frame-library-item-set-song-cover frame-library-item-part-song">
+ <img alt="<?= l("Album art", "Couv. album") ?>" class="frame-library-item-set-song-cover-inner frame-library-item-part-song" src="/api/get_image.php?_=<?= $song["_id"] ?>"></div>
+ <div class="frame-library-item-set-song-title frame-library-item-part-song"><?= $song["name"] ?><?php if ($song["wip"]): ?> <span class="frame-library-wipBadge"><?= l("WIP", "En travail") ?></span><?php endif; ?></div>
+ </div>
+ <?php endforeach; ?>
+ </div>
+ <?php endif; ?>
+ </div>
+ <?php endforeach; ?>
+ </div>
+ </div>
+</div>
+</body>
+</html> \ No newline at end of file