Completed smart block, playlist, and webstream editor form overhauls

* CC-6088: Smart Block form needs to have a form layout
* CC-6089: Editor view name fields must be made <input> fields
* CC-6103: Cannot create webstreams
* Reworked a big chunk of the smart block editor flow to send only the
  playlist contents back rather than the entire HTML fragment for the
  editor.
* Keep more of the playlist/smartblock editor view persistent across
  saves, generates, and shuffles.
This commit is contained in:
Albert Santoni 2015-08-27 19:00:23 -04:00
parent 98ac8fd851
commit b6f33f6083
13 changed files with 229 additions and 106 deletions

View file

@ -20,9 +20,10 @@
<label>Embeddable Code:</label>
<textarea style="width:98%" rows="3" readonly="readonly"><iframe height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo Application_Common_HTTPHelper::getStationUrl()."embed/weekly-program"?>></iframe>
</textarea>
<div>
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site.
Adjust the height and width attributes to your desired size.
<div><p>
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site.
Adjust the height and width attributes to your desired size.
</p>
</div>
</div>
</fieldset>

View file

@ -2,8 +2,10 @@
<div id="current-user-container">
<?php if(Application_Model_User::getCurrentUser()->isSuperAdmin()) : ?>
<div class="user-data" id="user_details_superadmin_message" style="text-align: center;">
<?=sprintf(_("<b>Note:</b> You are a special \"Super Admin\" type of user.<br>Account details for Super Admins can be changed in your <a href=\"%s\">Billing Settings</a> instead."), "/billing/client");?>
<div id="user_details_superadmin_message">
<p class="alert alert-error">
<?=sprintf(_("<b>Note:</b> Since you're the station owner, your account information can be edited in <a href=\"%s\">Billing Settings</a> instead."), "/billing/client");?>
</p>
<br><br>
</div>
<?php endif; ?>

View file

@ -65,7 +65,9 @@
<dt><label><?php echo(_("Search Criteria:"));?></label></dt>
<dd id='sp_criteria-element' class='criteria-element'>
<?php for ($i = 0; $i < $this->criteriasLength; $i++) {
<a class='btn btn-small' id='criteria_add'><i class='icon-white icon-plus'></i><?php echo(_("New Criteria")); ?></a>
<?php for ($i = 0; $i < $this->criteriasLength; $i++) {
// modRowMap holds the number of modifier rows for each criteria element
// i.e. if we have 'Album contains 1' and 'Album contains 2' the modRowMap
// for Album is 2
@ -93,16 +95,17 @@
<?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?>
<?php echo $this->element->getElement("sp_criteria_modifier_".$i."_".$j) ?>
<?php echo $this->element->getElement("sp_criteria_value_".$i."_".$j) ?>
<a class='btn btn-small' id='modifier_add_<?php echo $i ?>'>
<i class='icon-white icon-plus'></i><?php echo(_("New Modifier")); ?>
</a>
<span class='sp_text_font' id="extra_criteria" <?php echo $this->element->getElement("sp_criteria_extra_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo _(" to "); ?><?php echo $this->element->getElement('sp_criteria_extra_'.$i."_".$j) ?></span>
<a style='margin-right:3px' class='btn btn-small btn-danger' id='criteria_remove_<?php echo $i ?>'>
<i class='icon-white icon-remove'></i>
<i class='icon-white icon-remove spl-no-r-margin'></i>
</a>
<span class='db-logic-label' <?php if ($nextDisabled) echo "style='display:none'"?>>
<?php echo $logicLabel;?>
</span>
<a class='btn btn-small' id='modifier_add_<?php echo $i ?>'>
<i class='icon-white icon-plus'></i>
</a>
<?php if($this->element->getElement("sp_criteria_field_".$i."_".$j)->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_criteria_field_".$i."_".$j)->getMessages() as $error): ?>

View file

@ -6,6 +6,10 @@ if (isset($this->obj)) {
?>
<?php if (isset($this->obj)) : ?>
<div class="inner_editor_title">
<H2><?php echo(_("Editing "));?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName;
else echo $this->escape($this->obj->getName());?></span>"</H2>
</div>
<div class="inner_editor_wrapper">
<input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/>
<input class="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"/>
@ -33,6 +37,11 @@ if (isset($this->obj)) {
<div class="ui-widget-header fg-toolbar btn-toolbar clearfix">
<h4 class="obj_length"><?php echo($this->length); ?></h4>
<h4 class="obj_length_label"><?php echo(_("Duration:"));?></h4>
<div class='btn-group'>
<button class="btn toggle-editor-form" title='<?php echo _("Toggle Details") ?>' type="button"><span class="icon-white spl-no-r-margin icon-chevron-up"></span></button>
</div>
<div class='btn-group'>
<button class="btn" title='<?php echo _("Shuffle playlist") ?>' type="button" id="playlist_shuffle_button"><?php echo _("Shuffle") ?></button>
</div>

View file

@ -6,6 +6,10 @@ if (isset($this->obj)) {
?>
<?php if (isset($this->obj)) : ?>
<div class="inner_editor_title">
<H2><?php echo(_("Editing "));?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName;
else echo $this->escape($this->obj->getName());?></span>"</H2>
</div>
<div class="inner_editor_wrapper">
<input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/>
<input class="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"/>
@ -40,6 +44,9 @@ if (isset($this->obj)) {
<h4 class="obj_length"><?php echo($this->length); ?></h4>
<h4 class="obj_length_label"><?php echo(_("Duration:"));?></h4>
<div class='btn-group'>
<button class="btn toggle-editor-form" title='<?php echo _("Toggle Details") ?>' type="button"><span class="icon-white spl-no-r-margin icon-chevron-up"></span></button>
</div>
<div class='btn-group'>
<?php echo $this->form->getElement('generate_button');?>
</div>

View file

@ -1,6 +1,6 @@
<?php
$items = $this->contents;
if (count($items)) : ?>
if (count($items) && ($this->obj instanceof Application_Model_Block && $this->obj->isStatic())) : ?>
<?php $i = 0; ?>
<?php foreach($items as $item) :
$staticBlock = null;
@ -131,8 +131,15 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) {
<?php else : ?>
<div class="spl_empty">
<?php
echo _("Drag tracks here from your library to add them to the "
. ($this->obj instanceof Application_Model_Block ? "smart block" : "playlist"));
if ($this->obj instanceof Application_Model_Block) {
if ($this->obj->isStatic()) {
echo _("Choose some search criteria above and click Generate to create this playlist.");
} else {
echo _("A track list will be generated when you schedule this smart block into a show.");
}
} else {
echo _("Drag tracks here from your library to add them to the playlist");
}
?>
</div>
<?php endif; ?>

View file

@ -4,27 +4,32 @@
<input class="obj_type" type="hidden" value="webstream"/>
<div class="status" style="display:none;"></div>
<div class="playlist_title">
<div id="name-error" class="errors" style="display:none;"></div>
<h3 class="ws_name">
<a class="playlist_name_display" contenteditable="true"><?php echo $this->escape($this->obj->getName()); ?></a>
</h3>
<h4 class="ws_length"><?php echo $this->obj->getDefaultLength(); ?></h4>
<div class="inner_editor_title">
<H2><?php echo(_("Editing "));?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName;
else echo $this->escape($this->obj->getName());?></span>"</H2>
</div>
<dl class="zend_form">
<div class="inner_editor_wrapper">
<dl class="zend_form side_playlist playlist_editor">
<dt>
<label><?php echo(_("Name:")); ?></label>
</dt>
<dd>
<div id="name-error" class="errors" style="display:none;"></div>
<input class="playlist_name_display" type="text" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>">
</dd>
<dt id="description-label"><label for="description"><?php echo _("Description") ?></label></dt>
<dd id="description-element">
<textarea cols="80" rows="24" id="description" name="description"><?php echo $this->obj->getDescription(); ?></textarea>
</dd>
</dl>
<dl class="zend_form">
<dt id="submit-label" style="display: none;">&nbsp;</dt>
<div id="url-error" class="errors" style="display:none;"></div>
<dt id="streamurl-label"><label for="streamurl"><?php echo _("Stream URL:"); ?></label></dt>
<dd id="streamurl-element">
<input type="text" value="<?php echo $this->obj->getUrl(); ?>" size="40"/>
<input type="url" value="<?php echo $this->obj->getUrl(); ?>" size="40"/>
</dd>
<div id="length-error" class="errors" style="display:none;"></div>
<dt id="streamlength-label"><label for="streamlength"><?php echo _("Default Length:"); ?></label></dt>
@ -32,8 +37,10 @@
<input type="text" value="<?php echo $this->obj->getDefaultLength() ?>"/>
</dd>
</dl>
</div>
<div class="btn-toolbar spl-no-margin clearfix">
<div class="btn-toolbar clearfix">
<div class="btn-group pull-right">
<button class="btn" type="button" id="webstream_cancel" name="submit"><?php echo _("Cancel") ?></button>
</div>