Merge branch 'saas-dev' into saas

This commit is contained in:
Albert Santoni 2015-07-14 15:16:16 -04:00
commit e04a4e3a68
15 changed files with 248 additions and 139 deletions

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

@ -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

@ -1512,4 +1512,13 @@ class Application_Model_Preference
self::setValue("task_manager_lock", $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

@ -155,19 +155,18 @@ class Application_Service_ShowFormService
if ($ccShowDay->isShowStartInPast()) {
//for a non-repeating show, we should never allow user to change the start time.
//for a repeating show, we should allow because the form works as repeating template form
$form->disableStartDateAndTime();
// Removing this - if there is no future instance, this will throw an error.
// If there is a future instance, then we get a WHEN block representing the next instance
// which may be confusing.
/*if (!$ccShowDay->isRepeating()) {
if (!$ccShowDay->isRepeating()) {
$form->disableStartDateAndTime();
} else {
list($showStart, $showEnd) = $this->getNextFutureRepeatShowTime();
$showStartAndEnd = $this->getNextFutureRepeatShowTime();
if (!is_null($showStartAndEnd)) {
$showStart = $showStartAndEnd["starts"];
$showEnd = $showStartAndEnd["ends"];
}
if ($this->hasShowStarted($showStart)) {
$form->disableStartDateAndTime();
}
}*/
}
}
$form->populate(
@ -183,6 +182,29 @@ class Application_Service_ShowFormService
return $showStart;
}
public function getNextFutureRepeatShowTime()
{
$ccShowInstance = CcShowInstancesQuery::create()
->filterByDbShowId($this->ccShow->getDbId())
->filterByDbModifiedInstance(false)
->filterByDbStarts(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN)
->orderByDbStarts()
->findOne();
if (!$ccShowInstance) {
return null;
}
$starts = new DateTime($ccShowInstance->getDbStarts(), new DateTimeZone("UTC"));
$ends = new DateTime($ccShowInstance->getDbEnds(), new DateTimeZone("UTC"));
$showTimezone = $this->ccShow->getFirstCcShowDay()->getDbTimezone();
$starts->setTimezone(new DateTimeZone($showTimezone));
$ends->setTimezone(new DateTimeZone($showTimezone));
return array("starts" => $starts, "ends" => $ends);
}
private function populateInstanceFormWhen($form)
{
$ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId);
@ -437,7 +459,7 @@ class Application_Service_ShowFormService
$ccShowInstance = CcShowInstancesQuery::create()
->filterByDbShowId($this->ccShow->getDbId())
->filterByDbModifiedInstance(false)
->filterByDbStarts(gmdate("Y-m-d"), Criteria::GREATER_EQUAL)
->filterByDbStarts(gmdate("Y-m-d H:i:s"), Criteria::GREATER_EQUAL)
->orderByDbStarts()
->findOne();

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

@ -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

@ -1,21 +1,21 @@
#schedule-add-show,
#fullcalendar_show_display {
float: left;
float: left;
}
#schedule-add-show {
font-size: 12px;
/*width: 25%;*/
width:310px;
font-size: 12px;
/*width: 25%;*/
width: 310px;
}
#schedule-add-show textarea {
width: 99%;
height: 80px;
width: 99%;
height: 80px;
}
#fullcalendar_show_display {
width: 60%;
width: 60%;
}
#schedule-add-show .ui-tabs-panel {
@ -23,16 +23,16 @@
}
#schedule-add-show fieldset {
padding:8px;
margin-bottom:8px;
padding: 8px;
margin-bottom: 8px;
}
#schedule-add-show dl {
padding:8px;
margin-bottom:8px;
margin:0;
padding:0;
width:100%;
padding: 8px;
margin-bottom: 8px;
margin: 0;
padding: 0;
width: 100%;
}
#schedule-add-show dd {
@ -52,67 +52,67 @@
margin: 0;
padding: 4px 0;
text-align: left;
min-width:103px;
clear:left;
min-width: 103px;
clear: left;
}
#schedule-add-show dt.big {
min-width:130px;
min-width: 130px;
}
#schedule-add-show dt.block-display, #schedule-add-show dd.block-display {
display:block;
float:none;
margin-left:0;
padding-left:0;
display: block;
float: none;
margin-left: 0;
padding-left: 0;
}
#schedule-add-show dt label {
padding-right:0;
padding-right: 0;
}
.wrapp-label {
padding:0;
height:16px;
display:block;
line-height:18px;
padding: 0;
height: 16px;
display: block;
line-height: 18px;
}
label.wrapp-label input[type="checkbox"] {
float:left;
margin:-1px 2px 0 0;
float: left;
margin: -1px 2px 0 0;
}
#schedule-add-show fieldset:last-child {
margin-bottom:0;
margin-bottom: 0;
}
#schedule-add-show fieldset dd input[type="checkbox"] {
margin-top:2px;
margin-top: 2px;
}
#add_show_day_check-element.block-display {
margin-bottom:15px;
margin-top:7px;
#add_show_day_check-element.block-display {
margin-bottom: 15px;
margin-top: 7px;
}
#add_show_day_check-element.block-display label.wrapp-label {
font-size:12px;
float:left;
margin-right:10px;
font-size: 12px;
float: left;
margin-right: 10px;
}
#add_show_name-element .input_text {
/*width:99%;*/
/*width:99%;*/
}
#schedule-add-show-overlap {
border: 1px solid #c83f3f;
background: #c6b4b4;
margin-top:8px;
padding:8px;
color:#902d2d;
display:none;
border: 1px solid #c83f3f;
background: #c6b4b4;
margin-top: 8px;
padding: 8px;
color: #902d2d;
display: none;
}
#add_show_hosts-element {
@ -121,38 +121,90 @@ label.wrapp-label input[type="checkbox"] {
overflow: auto;
}
#add_show_start_time, #add_show_end_time {
width: 54px;
margin-left:10px;
#add_show_start_time, #add_show_end_time {
width: 54px;
margin-left: 10px;
}
#add_show_end_date_no_repeat, #add_show_start_date {
width: 89px;
#add_show_end_date_no_repeat, #add_show_start_date {
width: 89px;
}
#add_show_duration {
background: #AAAAAA;
cursor: default;
width: 65px;
#add_show_duration {
background: #AAAAAA;
cursor: default;
width: 65px;
}
[id^=add_show_instance_description] {
display: none;
display: none;
}
#add_show_logo_current,
#add_show_logo_current,
#add_show_logo_preview {
border: 1px solid #5b5b5b;
-webkit-box-shadow: 0px 0px 2px 1px rgba(48,48,48,1);
-moz-box-shadow: 0px 0px 2px 1px rgba(48,48,48,1);
box-shadow: 0px 0px 2px 1px rgba(48,48,48,1);
width: 200px;
height: 200px;
display: none;
cursor: default;
-webkit-box-shadow: 0px 0px 2px 1px rgba(48, 48, 48, 1);
-moz-box-shadow: 0px 0px 2px 1px rgba(48, 48, 48, 1);
box-shadow: 0px 0px 2px 1px rgba(48, 48, 48, 1);
width: 200px;
height: 200px;
display: none;
cursor: default;
}
#add_show_logo_current_remove {
display: none;
height: 28px;
height: 28px;
}
.add-button {
cursor: pointer;
}
.add-button {
border: 1px solid #5b5b5b;
background-color: #767676;
background: -moz-linear-gradient(top, #868686 0, #6e6e6e 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #868686), color-stop(100%, #6e6e6e));
color: #ffffff;
margin:0;
font-size:12px;
font-weight:bold;
padding:4px 12px 4px 22px;
text-decoration:none;
/*text-shadow: #000 0px -1px;*/
display:block;
float:left;
position:relative;
}
.add-button:hover {
border: 1px solid #000000;
background-color: #353535;
background: -moz-linear-gradient(top, #353535 0, #000000 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #353535), color-stop(100%, #000000));
color: #ffffff;
}
.add-button span {
position:absolute;
top:3px;
left:3px;
height:16px;
width:16px;
display:block;
background:url(redmond/images/ui-icons_ffffff_256x240.png) no-repeat;
}
/*.add-button:hover span {*/
/*background:url(redmond/images/ui-icons_ff5d1a_256x240.png) no-repeat;*/
/*}*/
.add-button span.add-icon {
background-position: -32px -129px;
}
.add-button[disabled] {
cursor: auto;
color: #e7e7e7;
border: 1px solid #a1a1a1;
background-color: #b1b1b1;
background: -moz-linear-gradient(top, #c7c7c7 0, #c7c7c7 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #c7c7c7), color-stop(100%, #c7c7c7));
}

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

@ -1901,44 +1901,6 @@ span.errors.sp-errors{
height:38px;
}
.add-button, .ui-widget-content a.add-button {
border: 1px solid #242424;
background-color: #353535;
background: -moz-linear-gradient(top, #494949 0, #353535 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #494949), color-stop(100%, #353535));
color: #ffffff;
margin:0;
font-size:12px;
font-weight:bold;
padding:4px 12px 4px 22px;
text-decoration:none;
text-shadow: #000 0px -1px;
display:block;
float:left;
position:relative;
}
.add-button:hover, .ui-widget-content a.add-button:hover {
border: 1px solid #000000;
background-color: #353535;
background: -moz-linear-gradient(top, #353535 0, #000000 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #353535), color-stop(100%, #000000));
color: #ffffff;
}
.add-button span {
position:absolute;
top:3px;
left:3px;
height:16px;
width:16px;
display:block;
background:url(redmond/images/ui-icons_ffffff_256x240.png) no-repeat;
}
.add-button:hover span {
background:url(redmond/images/ui-icons_ff5d1a_256x240.png) no-repeat;
}
.add-button span.add-icon {
background-position: -32px -128px;
}
/*---//////////////////// NOW PLAYING COLORS ////////////////////---*/
.playing-song, .datatable tr.playing-song:hover td {
@ -1958,7 +1920,6 @@ span.errors.sp-errors{
color:#FFF;
}
/*---//////////////////// END NOW PLAYING COLORS ////////////////////---*/
.icon-link, .ui-widget-content a.icon-link {
color: #646464;

View File

@ -31,24 +31,26 @@ function openAddShowForm() {
}
}
function makeAddShowButton(){
$('.fc-header-left')
.append('<span class="fc-header-space"></span>')
.append('<span class="fc-button"><a href="#" class="add-button"><span class="add-icon"></span>'+$.i18n._("Show")+'</a></span>')
.find('span.fc-button:last > a')
.click(function(){
openAddShowForm();
removeAddShowButton();
});
function makeAddShowButton() {
if($('.add-button').length === 0) {
$('.fc-header-left')
.append('<span class="fc-header-space"></span>')
.append('<span class="fc-button">' +
'<button onclick="showForm()" class="add-button">' +
'<span class="add-icon"></span>' + $.i18n._("Create New Show") +
'</button>' +
'</span>');
}
}
function removeAddShowButton(){
var aTag = $('.fc-header-left')
.find("span.fc-button:last > a");
function showForm() {
openAddShowForm();
toggleAddShowButton();
}
var span = aTag.parent();
span.prev().remove();
span.remove();
function toggleAddShowButton(){
var aTag = $('.add-button');
aTag.prop('disabled', function(i, v) { return !v; });
}
//$el is DOM element #add-show-form
@ -79,11 +81,11 @@ function closeAddShowForm(event) {
windowResize();
$.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json) {
redrawAddShowForm($el, json.form);
});
makeAddShowButton();
toggleAddShowButton();
}
//dateText mm-dd-yy
@ -162,7 +164,7 @@ function beginEditShow(data){
}
redrawAddShowForm($("#add-show-form"), data.newForm);
removeAddShowButton();
toggleAddShowButton();
openAddShowForm();
}
@ -777,20 +779,20 @@ function setAddShowEvents(form) {
.fullCalendar('render');
$addShowForm.hide();
toggleAddShowButton();
$.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json){
redrawAddShowForm($addShowForm, json.form);
});
makeAddShowButton();
} else {
redrawAddShowForm($addShowForm, json.newForm);
scheduleRefetchEvents(json);
$addShowForm.hide();
toggleAddShowButton();
}
/* CC-6062: Resize the window to avoid stretching the last column */
windowResize();
makeAddShowButton();
}
});
});

View File

@ -110,6 +110,8 @@ function dayClick(date, allDay, jsEvent, view){
$("#schedule-show-when").show();
openAddShowForm();
makeAddShowButton();
toggleAddShowButton();
}
}
}

View File

@ -20,7 +20,7 @@ def generate_liquidsoap_config(ss):
str_buffer = "%s = %s\n" % (key, int(value))
except ValueError:
try: # Is it a boolean?
if "true" in value or "false" in value:
if value=="true" or value=="false":
str_buffer = "%s = %s\n" % (key, value.lower())
else:
raise ValueError() # Just drop into the except below