Merge branch 'saas-dev' into soundcloud

This commit is contained in:
Duncan Sommerville 2015-06-15 11:03:37 -04:00
commit 706d7db2b2
20 changed files with 172 additions and 45 deletions

View file

@ -23,6 +23,7 @@ class CORSHelper
return array("http://www.airtime.pro", return array("http://www.airtime.pro",
"https://www.airtime.pro", "https://www.airtime.pro",
"https://account.sourcefabric.com", "https://account.sourcefabric.com",
"https://account.sourcefabric.com:5001",
"http://" . $_SERVER['SERVER_NAME'], "http://" . $_SERVER['SERVER_NAME'],
"https://" . $_SERVER['SERVER_NAME']); "https://" . $_SERVER['SERVER_NAME']);
} }

View file

@ -0,0 +1,11 @@
<?php
/**
* Created by PhpStorm.
* User: asantoni
* Date: 12/06/15
* Time: 12:24 PM
*/
class SecurityHelper {
}

View file

@ -78,7 +78,12 @@ class WidgetHelper
$utcTimezone = new DateTimeZone("UTC"); $utcTimezone = new DateTimeZone("UTC");
$weekStartDateTime->setTimezone($utcTimezone); $weekStartDateTime->setTimezone($utcTimezone);
$utcDayStart = $weekStartDateTime->format("Y-m-d H:i:s");
// When querying for shows we need the start and end date range to have
// a time of "00:00". $utcDayStart is used below when querying for shows.
$utcDayStartDT = clone $weekStartDateTime;
$utcDayStartDT->setTime(0, 0, 0);
$utcDayStart = $utcDayStartDT->format("Y-m-d H:i:s");
$weekCounter = 0; $weekCounter = 0;
while ($weekCounter < $maxNumOFWeeks) { while ($weekCounter < $maxNumOFWeeks) {
for ($dayOfWeekCounter = 0; $dayOfWeekCounter < DAYS_PER_WEEK; $dayOfWeekCounter++) { for ($dayOfWeekCounter = 0; $dayOfWeekCounter < DAYS_PER_WEEK; $dayOfWeekCounter++) {
@ -94,7 +99,11 @@ class WidgetHelper
//convert back to UTC to get the actual timestamp used for search. //convert back to UTC to get the actual timestamp used for search.
$weekStartDateTime->setTimezone($utcTimezone); $weekStartDateTime->setTimezone($utcTimezone);
$utcDayEnd = $weekStartDateTime->format("Y-m-d H:i:s"); // When querying for shows we need the start and end date range to have
// a time of "00:00".
$utcDayEndDT = clone $weekStartDateTime;
$utcDayEndDT->setTime(0, 0, 0);
$utcDayEnd = $utcDayEndDT->format("Y-m-d H:i:s");
$shows = Application_Model_Show::getNextShows($utcDayStart, "ALL", $utcDayEnd); $shows = Application_Model_Show::getNextShows($utcDayStart, "ALL", $utcDayEnd);
$utcDayStart = $utcDayEnd; $utcDayStart = $utcDayEnd;

View file

@ -36,6 +36,13 @@ $pages = array(
'action' => 'index', 'action' => 'index',
'resource' => 'schedule' 'resource' => 'schedule'
), ),
array(
'label' => _('Radio Page'),
'uri' => '/',
'resource' => '',
'pages' => array(
)
),
array( array(
'label' => _('System'), 'label' => _('System'),
'uri' => '#', 'uri' => '#',
@ -81,7 +88,7 @@ $pages = array(
'resource' => 'listenerstat' 'resource' => 'listenerstat'
), ),
array( array(
'label' => _('Widgets'), 'label' => _('Embeddable Widgets'),
'module' => 'default', 'module' => 'default',
'controller' => 'embeddablewidgets', 'controller' => 'embeddablewidgets',
'action' => 'index' 'action' => 'index'

View file

@ -29,8 +29,8 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
} }
if (!$apiEnabled) { if (!$apiEnabled) {
$this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule you must:<br><br> $this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule widget you must:<br><br>
1. Enable the Public Airtime API under System -> Preferences"); Enable the Public Airtime API under System -> Preferences");
} }
} }
} }

View file

@ -337,7 +337,7 @@ class Application_Model_Preference
public static function GetAllow3rdPartyApi() public static function GetAllow3rdPartyApi()
{ {
$val = self::getValue("third_party_api"); $val = self::getValue("third_party_api");
return (strlen($val) == 0 ) ? "0" : $val; return (strlen($val) == 0 ) ? "1" : $val;
} }
public static function SetPhone($phone) public static function SetPhone($phone)

View file

@ -39,12 +39,16 @@
$activeClass = $this->currentDayOfMonth == $data["dayOfMonth"] ? "active" : ""; $activeClass = $this->currentDayOfMonth == $data["dayOfMonth"] ? "active" : "";
echo "<div id='day-".$data["dayOfMonth"]."' class='schedule_item ".$activeClass."'>"; echo "<div id='day-".$data["dayOfMonth"]."' class='schedule_item ".$activeClass."'>";
if (count($data["shows"]) == 0) {
echo "<div class='row empty-schedule'>Looks like there are no shows scheduled on this day.</div>";
} else {
foreach ($data["shows"] as $show => $showData) { foreach ($data["shows"] as $show => $showData) {
echo "<div class='row'>"; echo "<div class='row'>";
echo "<div class='time_grid'>" . $showData["show_start_hour"] . ' - ' . $showData["show_end_hour"] . "</div>"; echo "<div class='time_grid'>" . $showData["show_start_hour"] . ' - ' . $showData["show_end_hour"] . "</div>";
echo "<div class='name_grid'>" . $showData["name"] . "</div>"; echo "<div class='name_grid'>" . $showData["name"] . "</div>";
echo "</div>"; echo "</div>";
} }
}
echo "</div>"; echo "</div>";
}?> }?>
</div> </div>

View file

@ -1,5 +1,5 @@
<div id="widget-menu" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong "> <div id="widget-menu" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
<h2><?php echo _("Widgets:"); ?></h2> <h2><?php echo _("Embeddable Widgets"); ?></h2>
<a href="#player-widget">Player</a> <a href="#player-widget">Player</a>
<a href="#weekly-schedule-widget">Weekly Schedule</a> <a href="#weekly-schedule-widget">Weekly Schedule</a>
</div> </div>
@ -29,17 +29,19 @@
<?php echo $this->weekly_schedule_error_msg; ?> <?php echo $this->weekly_schedule_error_msg; ?>
</div> </div>
<fieldset class="padded">
<div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>> <div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>>
<label>Preview:</label> <label><?php echo _("Preview:") ?></label>
<div class="blah"> <div class="schedule_iframe_wrapper">
<iframe id="schedule_iframe" height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program"?>></iframe> <iframe id="schedule_iframe" height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program"?>></iframe>
</div> </div>
<div style="clear:both"></div> <div style="clear:both"></div>
<label>Embeddable Code:</label> <label>Embeddable Code:</label>
<textarea style="width:100%" rows="3" readonly="readonly"><iframe height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program"?>></iframe> <textarea style="width:100%" 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> </textarea>
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site. 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. Adjust the height and width attributes to your desired size.
</div> </div>
</fieldset>
</div> </div>

View file

@ -9,13 +9,21 @@
echo "<a href='#' class='logo'><img src='data:image/png;base64," . $this->stationLogo . "'></a>"; echo "<a href='#' class='logo'><img src='data:image/png;base64," . $this->stationLogo . "'></a>";
} ?> } ?>
<div class="login-btn">
<a href="/login" target="_parent">
<span>Login</span>
<span class="login-img"></span>
</a>
</div>
<div id="tab-1" class="schedule tab_content current"> <div id="tab-1" class="schedule tab_content current">
<iframe id="schedule_iframe" height="400px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program?style=premium"?>></iframe> <iframe id="schedule_iframe" height="400px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program?style=premium"?>></iframe>
</div> </div>
<div id="tab-2" class="about_us tab_content"> <div id="tab-2" class="about_us tab_content">
<h1><?php echo $this->stationName ?></h1> <h1><?php echo $this->escape($this->stationName) ?></h1>
<p><?php echo $this->stationDescription ?></p> <p><?php echo $this->escape($this->stationDescription) ?></p>
</div> </div>
<div id="tab-3" class="login tab_content"> <div id="tab-3" class="login tab_content">
@ -35,12 +43,11 @@
$(document).ready(function(){ $(document).ready(function(){
$("#player_iframe").load(function () { $("#player_iframe").load(function () {
$("#player_iframe").contents().find('.bottom_bar').append("<a class='login_btn button' target='_parent' href='/login'></a>");
$("#player_iframe").contents().find('.bottom_bar').append("<div class='about_us_btn button' data-tab='tab-2'></div>"); $("#player_iframe").contents().find('.bottom_bar').append("<div class='about_us_btn button' data-tab='tab-2'></div>");
$("#player_iframe").contents().find('.bottom_bar').append("<div class='schedule_btn button current' data-tab='tab-1'></div>"); $("#player_iframe").contents().find('.bottom_bar').append("<div class='schedule_btn button current' data-tab='tab-1'></div>");
$("#player_iframe").contents().find('.bottom_bar .button').not('.login_btn').click(function(){ $("#player_iframe").contents().find('.bottom_bar .button').click(function(){
var tab_id = $(this).attr('data-tab'); var tab_id = $(this).attr('data-tab');
$("#player_iframe").contents().find('.bottom_bar .button').removeClass('current'); $("#player_iframe").contents().find('.bottom_bar .button').removeClass('current');

View file

@ -21,6 +21,7 @@
?> ?>
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable"> <table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
<?php /* Disabling most of the status page for Airtime Pro
<thead> <thead>
<tr class="ui-state-default strong"> <tr class="ui-state-default strong">
<td><?php echo _("Service") ?></td> <td><?php echo _("Service") ?></td>
@ -64,7 +65,7 @@
<td class="solution <?php if ($postgres) {echo 'check';?>"> <td class="solution <?php if ($postgres) {echo 'check';?>">
<?php <?php
} else { } else {
?>"> ?>"
Try running <code>sudo apt-get install php5-pgsql</code> Try running <code>sudo apt-get install php5-pgsql</code>
<?php <?php
} }
@ -81,7 +82,7 @@
<td class="solution <?php if ($database) {echo 'check';?>"> <td class="solution <?php if ($database) {echo 'check';?>">
<?php <?php
} else { } else {
?>"> ?>"
Make sure you aren't missing any of the Postgres dependencies in the table above. Make sure you aren't missing any of the Postgres dependencies in the table above.
If your dependencies check out, make sure your database configuration settings in If your dependencies check out, make sure your database configuration settings in
<code>/etc/airtime.conf</code> are correct and the Airtime database was installed correctly. <code>/etc/airtime.conf</code> are correct and the Airtime database was installed correctly.
@ -100,7 +101,7 @@
<td class="solution <?php if ($rabbitmq) {echo 'check';?>"> <td class="solution <?php if ($rabbitmq) {echo 'check';?>">
<?php <?php
} else { } else {
?>"> ?>"
Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code> are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
@ -121,7 +122,7 @@
<td class="solution <?php if ($mediamonitor) {echo 'check';?>"> <td class="solution <?php if ($mediamonitor) {echo 'check';?>">
<?php <?php
} else { } else {
?>"> ?>"
Check that the airtime-media-monitor service is installed correctly in <code>/etc/init</code>, Check that the airtime-media-monitor service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with and ensure that it's running with
<br/><code>initctl list | grep airtime-media-monitor</code><br/> <br/><code>initctl list | grep airtime-media-monitor</code><br/>
@ -141,7 +142,7 @@
<td class="solution <?php if ($pypo) {echo 'check';?>"> <td class="solution <?php if ($pypo) {echo 'check';?>">
<?php <?php
} else { } else {
?>"> ?>"
Check that the airtime-playout service is installed correctly in <code>/etc/init</code>, Check that the airtime-playout service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with and ensure that it's running with
<br/><code>initctl list | grep airtime-playout</code><br/> <br/><code>initctl list | grep airtime-playout</code><br/>
@ -161,7 +162,7 @@
<td class="solution <?php if ($liquidsoap) {echo 'check';?>"> <td class="solution <?php if ($liquidsoap) {echo 'check';?>">
<?php <?php
} else { } else {
?>"> ?>"
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>, Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with and ensure that it's running with
<br/><code>initctl list | grep airtime-liquidsoap</code><br/> <br/><code>initctl list | grep airtime-liquidsoap</code><br/>
@ -171,6 +172,7 @@
?> ?>
</td> </td>
</tr> </tr>
*/?>
<tr id="partitions" class="even"> <tr id="partitions" class="even">
<th colspan="5"><?php echo _("Disk Space") ?></th> <th colspan="5"><?php echo _("Disk Space") ?></th>
</tr> </tr>

View file

@ -10,7 +10,6 @@ body {
max-width: 750px; max-width: 750px;
/*margin: 0 auto;*/ /*margin: 0 auto;*/
margin-bottom: 140px; margin-bottom: 140px;
padding: 10px;
position: absolute; position: absolute;
/*left: 50%; /*left: 50%;
margin-left: -380px;*/ margin-left: -380px;*/
@ -25,7 +24,18 @@ body {
list-style: none; list-style: none;
padding-left: 0px; padding-left: 0px;
margin: 0px; margin: 0px;
background: rgba(170, 170, 170, 0.9); background: rgba(53, 53, 53, 0.9);
-moz-border-top-left-radius: 4px;
-moz-border-top-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
-webkit-box-shadow: 0 3px 5px rgba(0,0,0,0.1) inset,0 1px 0 rgba(255,255,255,0.1),0 0 1px #000 inset;
-moz-box-shadow: 0 3px 5px rgba(0,0,0,0.1) inset,0 1px 0 rgba(255,255,255,0.1),0 0 1px #000 inset;
box-shadow: 0 3px 5px rgba(0,0,0,0.1) inset,0 1px 0 rgba(255,255,255,0.1),0 0 1px #000 inset;
} }
.schedule .tabs li { .schedule .tabs li {
@ -60,6 +70,7 @@ body {
background: rgba(53, 53, 53, 0.9); background: rgba(53, 53, 53, 0.9);
max-height: 0px; max-height: 0px;
transition: max-height 2s ease; transition: max-height 2s ease;
height: 290px;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
@ -68,7 +79,11 @@ body {
} }
.schedule.current .schedule_content { .schedule.current .schedule_content {
max-height: 300px; max-height: 290px;
}
.tab_content.current ul {
background: rgba(53, 53, 53, 1.0);
} }
/*.schedule_content table { /*.schedule_content table {
@ -86,8 +101,8 @@ body {
display: none; display: none;
font-size: 17px; font-size: 17px;
text-align: left; text-align: left;
text-transform: uppercase;
padding: 10px 30px; padding: 10px 30px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
} }
.schedule_item.active { .schedule_item.active {
@ -99,6 +114,13 @@ body {
padding-bottom: 10px; padding-bottom: 10px;
} }
.empty-schedule {
text-transform: none;
text-align: center;
color: #aaaaaa;
line-height: 240px;
}
.schedule_item div.time_grid { .schedule_item div.time_grid {
/*padding-right: 10px;*/ /*padding-right: 10px;*/
width: 20%; width: 20%;
@ -117,10 +139,19 @@ body {
} }
.weekly-schedule-widget-footer { .weekly-schedule-widget-footer {
border-top: 1px solid #aaaaaa; border-top: 1px solid rgba(255, 255, 255, 0.1);
text-align: right; text-align: right;
padding: 4px 16px; font-size: 11px;
padding: 16px 16px;
background: rgba(53, 53, 53, 0.9); background: rgba(53, 53, 53, 0.9);
-moz-border-bottom-left-radius: 4px;
-moz-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
} }
.weekly-schedule-widget-footer a { .weekly-schedule-widget-footer a {

View file

@ -57,7 +57,7 @@ body {
.schedule_content { .schedule_content {
background: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.3);
max-height: 0px; max-height: 290px;
transition: max-height 2s ease; transition: max-height 2s ease;
overflow-y: auto; overflow-y: auto;
@ -88,6 +88,11 @@ body {
padding-bottom: 10px; padding-bottom: 10px;
} }
.empty-schedule {
text-transform: none;
text-align: center;
}
.schedule_item div.time_grid { .schedule_item div.time_grid {
/*padding-right: 10px;*/ /*padding-right: 10px;*/
width: 20%; width: 20%;

View file

Before

Width:  |  Height:  |  Size: 959 KiB

After

Width:  |  Height:  |  Size: 959 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

View file

@ -1,5 +1,5 @@
html { html {
background: url("img/background.png") no-repeat center center fixed; background: url("img/background-testing-3.jpg") no-repeat center center fixed;
-webkit-background-size: cover; -webkit-background-size: cover;
-moz-background-size: cover; -moz-background-size: cover;
-o-background-size: cover; -o-background-size: cover;
@ -26,6 +26,34 @@ body {
margin: 40px 0px 0px 60px; margin: 40px 0px 0px 60px;
} }
.login-btn {
float: right;
margin-right: 60px;
margin-top: 40px;
display:inline-block;
background-color: #000000;
opacity: 0.5;
padding: 10px;
}
.login-btn a {
color: #fff;
text-decoration: none;
}
.login-btn span {
display: inline-block;
vertical-align: middle;
}
span.login-img {
background: url('img/login-small.png') no-repeat center -25px;
display: inline-block;
vertical-align: middle;
width: 25px;
height: 25px;
}
#schedule_iframe, .tab_content { #schedule_iframe, .tab_content {
color: #fff; color: #fff;
text-align: center; text-align: center;
@ -134,6 +162,19 @@ input[type="submit"]:hover {
margin: 20px 0px; margin: 20px 0px;
} }
.login-btn {
float: right;
margin-right: 0px;
margin-top: 0px;
position: absolute;
top: 15px;
right: 5px;
}
span.login-img {
display:none;
}
.tab_content { .tab_content {
margin-top: 0px; margin-top: 0px;
width: auto; width: auto;

View file

@ -332,7 +332,7 @@ select {
width: 40%; width: 40%;
} }
} }
@media screen and (max-width: 863px) { @media screen and (max-width: 1100px) {
#nav { #nav {
height: inherit; height: inherit;
overflow-y: visible; overflow-y: visible;
@ -3264,11 +3264,13 @@ dd .stream-status {
#weekly-schedule-widget { #weekly-schedule-widget {
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px;
width: 50%; width: 50%;
} }
#widget-menu { #widget-menu {
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px;
width: 40%; width: 40%;
} }
@ -3278,14 +3280,19 @@ dd .stream-status {
font-size: 14px; font-size: 14px;
} }
#player-widget {
margin-bottom: 20px;
}
#weekly-schedule-widget label { #weekly-schedule-widget label {
font-weight: bold; font-weight: bold;
} }
.blah { .schedule_iframe_wrapper {
width: 100%; width: 100%;
float: left; float: left;
text-align: center; text-align: center;
padding: 10px;
} }
#schedule_iframe { #schedule_iframe {