Merge branch '2.3.x' into 2.3.x-saas

This commit is contained in:
Martin Konecny 2013-01-25 12:12:21 -05:00
commit 7c327e4c75
6 changed files with 18 additions and 11 deletions
airtime_mvc
application
public/js/airtime
login
preferences
python_apps/pypo

View File

@ -4,10 +4,6 @@ class LocaleController extends Zend_Controller_Action
{
public function init()
{
$ajaxContext = $this->_helper->getHelper("AjaxContext");
$ajaxContext->addActionContext("general-translation-table", "json")
->addActionContext("datatables-translation-table", "json")
->initContext();
}
public function datatablesTranslationTableAction()
@ -26,7 +22,7 @@ class LocaleController extends Zend_Controller_Action
$locale.".txt")
);
}
public function generalTranslationTableAction()
{
$translations = array (

View File

@ -110,7 +110,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
{
$controller = strtolower($request->getControllerName());
if (in_array($controller, array("api", "auth"))) {
if (in_array($controller, array("api", "auth", "locale"))) {
$this->setRoleName("G");
} elseif (!Zend_Auth::getInstance()->hasIdentity()) {

View File

@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
public function init()
{
$this->setAction(Application_Common_OsPath::getBaseDir().'/Showbuilder');
$this->setAction(Application_Common_OsPath::getBaseDir().'Showbuilder');
$this->setMethod('post');
$country_list = Application_Model_Preference::GetCountryList();

View File

@ -1,6 +1,6 @@
$(window).load(function(){
$("#username").focus();
$("#locale").val($.cookie("airtime_locale")!== null?$.cookie("airtime_locale"):'en_CA');
$("#locale").val($.cookie("airtime_locale")!== null?$.cookie("airtime_locale"):$.cookie("default_airtime_locale"));
});
$(document).ready(function() {

View File

@ -154,6 +154,7 @@ $(document).ready(function() {
$.post(url, {format: "json", data: data}, function(data){
var json = $.parseJSON(data);
$('#content').empty().append(json.html);
$.cookie("default_airtime_locale", $('#locale').val(), {path: '/'});
setTimeout(removeSuccessMsg, 5000);
showErrorSections();
});

View File

@ -217,7 +217,7 @@ class PypoFetch(Thread):
self.set_bootstrap_variables()
#get the most up to date schedule, which will #initiate the process
#of making sure Liquidsoap is playing the schedule
self.manual_schedule_fetch()
self.persistent_manual_schedule_fetch(max_attempts=5)
except Exception, e:
self.logger.error(str(e))
@ -488,10 +488,20 @@ class PypoFetch(Thread):
self.process_schedule(self.schedule_data)
return success
def persistent_manual_schedule_fetch(self, max_attempts=1):
success = False
num_attempts = 0
while not success and num_attempts < max_attempts:
success = self.manual_schedule_fetch()
num_attempts += 1
return success
def main(self):
# Bootstrap: since we are just starting up, we need to grab the
# most recent schedule. After that we can just wait for updates.
success = self.manual_schedule_fetch()
success = self.persistent_manual_schedule_fetch(max_attempts=5)
if success:
self.logger.info("Bootstrap schedule received: %s", self.schedule_data)
self.set_bootstrap_variables()
@ -519,7 +529,7 @@ class PypoFetch(Thread):
self.handle_message(message)
except Empty, e:
self.logger.info("Queue timeout. Fetching schedule manually")
self.manual_schedule_fetch()
self.persistent_manual_schedule_fetch(max_attempts=5)
except Exception, e:
import traceback
top = traceback.format_exc()