Skip to content
Permalink
Browse files

Ericg/57 simplify playlist creation and updating (#60)

simplify edit & new playlist format

   * single page for playlist edit, delete & restorePlaylist
   * separate GET & POST operations for code clarity
   * normalize form element layout & styling
   * use single quote when possible
   * remove new DJ air name
   * round new show start time to now mod 1/4 hour
   * replace tab in playlist picker with a select element for active & deleted
   * remove tables check code
  • Loading branch information...
eric-gilbertson authored and RocketMan committed Sep 14, 2019
1 parent eddbe02 commit 83ace2378df8842022770c2258278d105956d8ca
Showing with 406 additions and 283 deletions.
  1. +8 −1 config/ui_config.php
  2. +12 −6 css/zoostyle.css
  3. +5 −1 engine/impl/Playlist.php
  4. +22 −1 ui/Main.php
  5. +359 −274 ui/Playlists.php
@@ -29,6 +29,8 @@
*
* The first item in the list is the default if no action is specified.
*/
//NOTE: server must be restarted for changes to take effect.
$menu = [
// access, action, menu label, implementation class
[ 'a', 'home', 0, ZK\UI\Home::class ],
@@ -39,7 +41,12 @@
[ 'a', 'searchReview%', 0, ZK\UI\Reviews::class ],
[ 'a', 'addmgr', 'A-File', ZK\UI\AddManager::class ],
[ 'u', 'newList%', 'New Playlist', ZK\UI\Playlists::class ],
[ 'u', 'editList%', 'Edit Playlist', ZK\UI\Playlists::class ],
[ 'u', 'addAirname%', '0', ZK\UI\Playlists::class ],
[ 'u', 'addAirnamePost%','0', ZK\UI\Playlists::class ],
[ 'u', 'editList%', '0', ZK\UI\Playlists::class ],
[ 'u', 'deleteList%', '0', ZK\UI\Playlists::class ],
[ 'u', 'restoreList%', '0', ZK\UI\Playlists::class ],
[ 'u', 'editListSel%', 'Edit Playlist', ZK\UI\Playlists::class ],
[ 'u', 'showLink', 'Link to Playlist', ZK\UI\Playlists::class ],
[ 'u', 'importExport', 'Import/Export', ZK\UI\Playlists::class ],
[ 'a', 'viewDJ%', 'DJ Zone!', ZK\UI\Playlists::class ],
@@ -412,36 +412,42 @@ TH.sec {
.zk-hidden {
display: none;
}

.track-info {
color: gray;
}
.track-error {
color: red;
}

.track-editor {
.pl-form {
margin-top: 8px;
margin-left: 4px;
}
.pl-form-entry {
padding-top: 4px;
}

.track-editor input, .track-editor select {
.pl-form-entry input, .pl-form-entry select {
width: 300px;
box-sizing: border-box;
height: 24px;
margin-bottom: 4px;
}

.track-editor button {
.pl-form-entry button {
width: 140px;
box-sizing: border-box;
}

.track-editor label {
width: 44px;
.form-entry label, .pl-form-entry label {
display:inline-block;
font-weight: bold;
}

.pl-form-entry label {
width: 84px;
}

INPUT[type="radio"],
INPUT[type="checkbox"] {
height: 15px;
@@ -61,7 +61,7 @@ public function getPlaylist($playlist, $withAirname=0) {
}
public function getPlaylists($onlyPublished=0, $withAirname=0,
$showDate="", $airname="", $user="", $desc=1) {
$showDate="", $airname="", $user="", $desc=1, $limit=null) {
if($withAirname)
$query = "SELECT l.id, l.showdate, l.showtime, l.description, " .
"a.id airid, a.airname FROM lists l LEFT JOIN airnames a " .
@@ -78,6 +78,10 @@ public function getPlaylists($onlyPublished=0, $withAirname=0,
$query .= "AND l.airname IS NOT NULL ";
$desc = $desc?"DESC":"";
$query .= "ORDER BY l.showdate $desc, l.showtime $desc, l.id $desc";
if ($limit)
$query .= " limit $limit ";
$stmt = $this->prepare($query);
$p = 1;
@@ -37,13 +37,20 @@ class Main implements IController {
protected $dn;
protected $session;
private function getRequestHeader($headerName)
{
$headers = getallheaders();
return isset($headerName) ? $headers[$headerName] : null;
}
public function processRequest($dispatcher) {
$this->session = Engine::session();
$contentType = $_REQUEST["Content-Type"];
$action = $_REQUEST["action"];
$subAction = $_REQUEST["subaction"];
$isJson = substr($_SERVER["HTTP_ACCEPT"], 0, 16) === 'application/json';
$acceptHdr = $this->getRequestHeader("Accept");
$isJson = substr($acceptHdr, 0, 16) === 'application/json';
$this->preProcessRequest($dispatcher);
if ($isJson == 1) {
@@ -97,6 +104,20 @@ protected function emitResponseHeader() {
<?php UI::emitCSS('css/about.css'); ?>
<?php UI::emitJS('js/jquery.min.js'); ?>
<?php UI::emitJS('js/jquery.tablesorter.min.js'); ?>

<!-- pull down date & time pickers if browser is stupid -->
<script type="text/javascript">
var datefield=document.createElement("input");
datefield.setAttribute("type", "date");
if (datefield.type!="date") {
document.write('<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />');
document.write('<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"><\/script>')
document.write('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css" />');
document.write('<script src="https://cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js"><\/script>');
}
</script>

<LINK REL="alternate" TYPE="application/rss+xml" TITLE="<?php echo $station; ?> Radio Music Reviews" HREF="zkrss.php?feed=reviews">
<LINK REL="alternate" TYPE="application/rss+xml" TITLE="<?php echo $station; ?> Radio Airplay Charts" HREF="zkrss.php?feed=charts">
<LINK REL="alternate" TYPE="application/rss+xml" TITLE="<?php echo $station; ?> Radio A-File Adds" HREF="zkrss.php?feed=adds">

0 comments on commit 83ace23

Please sign in to comment.
You can’t perform that action at this time.