Merge branch 'saas-dev' into saas-stream-settings

Conflicts:
	airtime_mvc/application/models/Preference.php
This commit is contained in:
Duncan Sommerville 2015-07-10 10:29:38 -04:00
commit 37ed35f5b2
16 changed files with 94 additions and 17 deletions

View File

@ -69,6 +69,8 @@ class WidgetHelper
* We don't do any timezone conversion in this function on purpose. All timezone conversion
* and show time ordering should be done on the frontend.
*
* *** This function does no HTML encoding. It is up to the caller to escape or encode the data appropriately.
*
* @return array
*/
public static function getWeekInfoV2()
@ -139,9 +141,6 @@ class WidgetHelper
}
$result["shows"] = $shows;
// XSS exploit prevention
SecurityHelper::htmlescape_recursive($result);
// convert image paths to point to api endpoints
//TODO: do we need this here?
self::findAndConvertPaths($result);

View File

@ -27,6 +27,12 @@ class IndexController extends Zend_Controller_Action
$this->view->stationUrl = Application_Common_HTTPHelper::getStationUrl();
$displayRadioPageLoginButtonValue = Application_Model_Preference::getRadioPageDisplayLoginButton();
if ($displayRadioPageLoginButtonValue == "") {
$displayRadioPageLoginButtonValue = true;
}
$this->view->displayLoginButton = $displayRadioPageLoginButtonValue;
}
public function mainAction()

View File

@ -47,6 +47,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetDefaultLocale($values["locale"]);
Application_Model_Preference::SetDefaultTimezone($values["timezone"]);
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
Application_Model_Preference::setRadioPageDisplayLoginButton($values["radioPageLoginButton"]);
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
$logoUploadElement->receive();

View File

@ -1,4 +1,3 @@
ALTER TABLE cc_pref ALTER COLUMN subjid SET NULL;
ALTER TABLE cc_pref ALTER COLUMN subjid SET DEFAULT NULL;
CREATE UNIQUE INDEX cc_pref_key_idx ON cc_pref (keystr) WHERE subjid IS NULL;
ANALYZE cc_pref;

View File

@ -8,6 +8,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
{
$cb_airtime_auth = new Zend_Form_Element_Checkbox("cb_airtime_auth");
$cb_airtime_auth->setLabel(sprintf(_("Use %s Authentication:"), PRODUCT_NAME))
->setChecked(true)
->setRequired(false);
$this->addElement($cb_airtime_auth);
@ -57,7 +58,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
$showSourceMount = new Zend_Form_Element_Text('show_source_mount');
$showSourceMount->setAttrib('readonly', true)
->setLabel(_('Mount:'))
->setValue(isset($showSourceParams["mount"])?$showSourceParams["mount"]:"");
->setValue(isset($showSourceParams["path"])?$showSourceParams["path"]:"");
$this->addElement($showSourceMount);
$this->setDecorators(

View File

@ -136,6 +136,21 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$week_start_day->setMultiOptions($this->getWeekStartDays());
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
$this->addElement($week_start_day);
$radioPageLoginButton = new Zend_Form_Element_Checkbox("radioPageLoginButton");
$radioPageLoginButton->setDecorators(array(
'ViewHelper',
'Errors',
'Label'
));
$displayRadioPageLoginButtonValue = Application_Model_Preference::getRadioPageDisplayLoginButton();
if ($displayRadioPageLoginButtonValue == "") {
$displayRadioPageLoginButtonValue = true;
}
$radioPageLoginButton->addDecorator('Label', array("class" => "enable-tunein"));
$radioPageLoginButton->setLabel(_("Display login button on your Radio Page?"));
$radioPageLoginButton->setValue($displayRadioPageLoginButtonValue);
$this->addElement($radioPageLoginButton);
}
private function getWeekStartDays()

View File

@ -1522,4 +1522,13 @@ class Application_Model_Preference
self::setValue("using_custom_stream_settings", $value);
}
public static function getRadioPageDisplayLoginButton()
{
return self::getValue("radio_page_display_login_button");
}
public static function setRadioPageDisplayLoginButton($value)
{
self::setValue("radio_page_display_login_button", $value);
}
}

View File

@ -9,7 +9,7 @@
<fieldset>
<legend><?php echo _("Show Source") ?></legend>
<p class="input-settings-inline-p">
<?php echo _("DJs can use these settings to connect and broadcast live during this show (with compatible software)") ?>
<?php echo _("DJs can use these settings to connect with compatible software and broadcast live during this show. Assign a DJ below.") ?>
</p>
<?php echo $this->element->getElement("show_source_host")->render() ?>
<?php echo $this->element->getElement("show_source_port")->render() ?>

View File

@ -37,5 +37,8 @@
<?php echo $this->element->getElement('thirdPartyApi')->render() ?>
<?php echo $this->element->getElement('radioPageLoginButton')->renderViewHelper() ?>
<?php echo $this->element->getElement('radioPageLoginButton')->renderLabel() ?>
</dl>
</fieldset>

View File

@ -10,7 +10,7 @@
<fieldset class="padded stream-setting-global" style="margin-top: 15px">
<legend><?php echo _("Master Source") ?></legend>
<p class="input-settings-inline-p">
<?php echo _("Use these settings in your broadcasting software to connect to Master Source") ?>
<?php echo _("Use these settings in your broadcasting software to stream live at any time.") ?>
</p>
<?php echo $this->element->getElement('master_username')->render() ?>
<span class="master_username_help_icon"></span>
@ -24,7 +24,7 @@
<fieldset class="padded stream-setting-global" style="margin-top: 15px">
<legend><?php echo _("Show Source") ?></legend>
<p class="input-settings-inline-p">
<?php echo _("These settings allow DJs to connect to individual shows through Show Source") ?>
<?php echo _("DJs can use these settings in their broadcasting software to broadcast live only during shows assigned to them.") ?>
</p>
<?php echo $this->element->getElement("show_source_host")->render() ?>
<?php echo $this->element->getElement("show_source_port")->render() ?>

View File

@ -24,12 +24,14 @@ document.getElementById(id).width= (newwidth) + "px";
echo "<a href='#' class='logo'><img src='data:image/png;base64," . $this->stationLogo . "'></a>";
} ?>
<div class="login-btn">
<a href="/login" target="_parent">
<?php if ($this->displayLoginButton) {
echo "<div class='login-btn'>
<a href='/login' target='_parent'>
<span>Login</span>
<span class="login-img"></span>
<span class='login-img'></span>
</a>
</div>
</div>";
}?>
<div id="tab-1" class="schedule tab_content current">
<iframe onLoad="autoResize('schedule_iframe');" id="schedule_iframe" height="300px" scrolling="yes" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program?style=premium"?>></iframe>

View File

@ -217,11 +217,11 @@ background: rgba(53, 53, 53, 1.0);
@media (max-width: 400px) {
.schedule_item div.time_grid {
width: 90%;
width: 95%;
}
.schedule_item div.name_grid {
width: 90%;
width: 95%;
}
}

View File

@ -167,11 +167,11 @@ body {
@media (max-width: 400px) {
.schedule_item div.time_grid {
width: 90%;
width: 95%;
}
.schedule_item div.name_grid {
width: 90%;
width: 95%;
}
}

View File

@ -39,6 +39,7 @@ body {
.on_air {
display: inline-block;
margin-left: 40px;
width: 65%
}
.bottom_bar p.now_playing {
@ -47,11 +48,19 @@ body {
font-weight: 300;
float: left;
margin: 28px 0px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bottom_bar p.now_playing span {
display: block;
font-weight: 100;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bottom_bar .button {
@ -88,6 +97,30 @@ body {
float: right;
}
@media (max-width: 1230px) {
.on_air {
width: 60%;
}
}
@media (max-width: 1075px) {
.on_air {
width: 55%;
}
}
@media (max-width: 960px) {
.on_air {
width: 50%;
}
}
@media (max-width: 850px) {
.on_air {
width: 45%;
}
}
@media (max-width: 780px) {
.bottom_bar {
height: 80px;
@ -122,6 +155,7 @@ body {
left: 0px;
right: 0px;
padding-top: 40px;
width: 100%;
background: rgba(0,0,0,0);
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 69%, rgba(0,0,0,1) 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(0,0,0,0)), color-stop(69%, rgba(0,0,0,1)), color-stop(100%, rgba(0,0,0,1)));

View File

@ -47,6 +47,11 @@ select {
border:1px solid #9d9d9d;
}
/* Fix for Firefox */
fieldset {
clear: both;
}
.logo {
background: transparent url(images/airtime_logo.png) no-repeat 0 0;
height: 35px;

View File

@ -9,7 +9,10 @@ import pickle
import threading
from urlparse import urlparse
requests.packages.urllib3.disable_warnings()
# Disable urllib3 warnings because these can cause a rare deadlock due to Python 2's crappy internal non-reentrant locking
# around POSIX stuff. See SAAS-714. The hasattr() is for compatibility with older versions of requests.
if hasattr(requests, 'packages'):
requests.packages.urllib3.disable_warnings()
class PicklableHttpRequest:
def __init__(self, method, url, data, api_key):