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",
"https://www.airtime.pro",
"https://account.sourcefabric.com",
"https://account.sourcefabric.com:5001",
"http://" . $_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");
$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;
while ($weekCounter < $maxNumOFWeeks) {
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.
$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);
$utcDayStart = $utcDayEnd;

View file

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

View file

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

View file

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

View file

@ -39,12 +39,16 @@
$activeClass = $this->currentDayOfMonth == $data["dayOfMonth"] ? "active" : "";
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) {
echo "<div class='row'>";
echo "<div class='time_grid'>" . $showData["show_start_hour"] . ' - ' . $showData["show_end_hour"] . "</div>";
echo "<div class='name_grid'>" . $showData["name"] . "</div>";
echo "</div>";
}
}
echo "</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 ">
<h2><?php echo _("Widgets:"); ?></h2>
<h2><?php echo _("Embeddable Widgets"); ?></h2>
<a href="#player-widget">Player</a>
<a href="#weekly-schedule-widget">Weekly Schedule</a>
</div>
@ -29,17 +29,19 @@
<?php echo $this->weekly_schedule_error_msg; ?>
</div>
<fieldset class="padded">
<div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>>
<label>Preview:</label>
<div class="blah">
<label><?php echo _("Preview:") ?></label>
<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>
</div>
<div style="clear:both"></div>
<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>
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>
</fieldset>
</div>

View file

@ -9,13 +9,21 @@
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">
<iframe id="schedule_iframe" height="400px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program?style=premium"?>></iframe>
</div>
<div id="tab-2" class="about_us tab_content">
<h1><?php echo $this->stationName ?></h1>
<p><?php echo $this->stationDescription ?></p>
<h1><?php echo $this->escape($this->stationName) ?></h1>
<p><?php echo $this->escape($this->stationDescription) ?></p>
</div>
<div id="tab-3" class="login tab_content">
@ -35,12 +43,11 @@
$(document).ready(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='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');
$("#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">
<?php /* Disabling most of the status page for Airtime Pro
<thead>
<tr class="ui-state-default strong">
<td><?php echo _("Service") ?></td>
@ -64,7 +65,7 @@
<td class="solution <?php if ($postgres) {echo 'check';?>">
<?php
} else {
?>">
?>"
Try running <code>sudo apt-get install php5-pgsql</code>
<?php
}
@ -81,7 +82,7 @@
<td class="solution <?php if ($database) {echo 'check';?>">
<?php
} else {
?>">
?>"
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
<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';?>">
<?php
} else {
?>">
?>"
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>
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';?>">
<?php
} else {
?>">
?>"
Check that the airtime-media-monitor service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-media-monitor</code><br/>
@ -141,7 +142,7 @@
<td class="solution <?php if ($pypo) {echo 'check';?>">
<?php
} else {
?>">
?>"
Check that the airtime-playout service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-playout</code><br/>
@ -161,7 +162,7 @@
<td class="solution <?php if ($liquidsoap) {echo 'check';?>">
<?php
} else {
?>">
?>"
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-liquidsoap</code><br/>
@ -171,6 +172,7 @@
?>
</td>
</tr>
*/?>
<tr id="partitions" class="even">
<th colspan="5"><?php echo _("Disk Space") ?></th>
</tr>

View file

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

View file

@ -57,7 +57,7 @@ body {
.schedule_content {
background: rgba(0, 0, 0, 0.3);
max-height: 0px;
max-height: 290px;
transition: max-height 2s ease;
overflow-y: auto;
@ -88,6 +88,11 @@ body {
padding-bottom: 10px;
}
.empty-schedule {
text-transform: none;
text-align: center;
}
.schedule_item div.time_grid {
/*padding-right: 10px;*/
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 {
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;
-moz-background-size: cover;
-o-background-size: cover;
@ -26,6 +26,34 @@ body {
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 {
color: #fff;
text-align: center;
@ -134,6 +162,19 @@ input[type="submit"]:hover {
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 {
margin-top: 0px;
width: auto;

View file

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