Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-08-31 12:18:48 -04:00
commit 0ceb0167fe
8 changed files with 48 additions and 57 deletions

View File

@ -24,9 +24,16 @@ class UserController extends Zend_Controller_Action
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/user/user.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$js_files = array(
'/js/datatables/js/jquery.dataTables.js?',
'/js/datatables/plugin/dataTables.pluginAPI.js?',
'/js/airtime/user/user.js?'
);
foreach ($js_files as $js) {
$this->view->headScript()->appendFile(
$baseUrl.$js.$CC_CONFIG['airtime_version'],'text/javascript');
}
$this->view->headLink()->appendStylesheet($baseUrl.'/css/users.css?'.$CC_CONFIG['airtime_version']);
@ -97,14 +104,39 @@ class UserController extends Zend_Controller_Action
// action body
$delId = $this->_getParam('id');
$valid_actions = array("delete_cascade", "reassign_to");
$files_action = $this->_getParam('deleted_files');
# TODO : remove this. we only use default for now not to break the UI.
if (!$files_action) { # set default action
$files_action = "delete_cascade";
}
# only delete when valid action is selected for the owned files
if (! in_array($files_action, $valid_actions) ) {
return;
}
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$userId = $userInfo->id;
if ($delId != $userId) {
$user = new Application_Model_User($delId);
$this->view->entries = $user->delete();
# Don't let users delete themselves
if ($delId == $userId) {
return;
}
}
$user = new Application_Model_User($delId);
# Take care of the user's files by either assigning them to somebody
# or deleting them all
if ($files_action == "delete_cascade") {
$user->deleteAllFiles();
} elseif ($files_action == "reassign_to") {
$new_owner = $this->_getParam("new_owner");
$user->reassignTo( $new_owner );
}
# Finally delete the user
$this->view->entries = $user->delete();
}
}

View File

@ -249,6 +249,9 @@ class Application_Model_User
public function deleteAllFiles()
{
$my_files = $this->getOwnedFiles();
foreach ($files as $file) {
$file->delete();
}
}
private function createUser()

View File

@ -1,4 +1,5 @@
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong user-management">
<h2>Manage Users</h2>
<div class="user-list-wrapper">
<div id="users_wrapper" class="dataTables_wrapper">

View File

@ -179,36 +179,6 @@ function getFileExt(filename){
return filename.split('.').pop();
}
function audioStream(){
if ($("#jquery_jplayer_1").data("jPlayer") && $("#jquery_jplayer_1").data("jPlayer").status.paused != true){
$('#jquery_jplayer_1').jPlayer('clearMedia');
$('#jquery_jplayer_1').jPlayer('destroy');
return;
}
var uri = "http://localhost:8000/airtime_128.ogg";
var ext = getFileExt(uri);
var media;
var supplied;
if (ext == "ogg"){
media = {oga:uri};
supplied = "oga";
} else {
media = {mp3:uri};
supplied = "mp3";
}
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", media).jPlayer("play");
},
swfPath: "/js/jplayer",
supplied: supplied
});
}
function resizeImg(ele, targetWidth, targetHeight){
var img = $(ele);

View File

@ -9,7 +9,7 @@ $(document).ready(function() {
unique_names: 'true',
multiple_queues : 'true',
filters : [
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,aac,bwf"}
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,aac,wav"}
]
});

View File

@ -37,21 +37,6 @@ rm airtime/airtime_mvc/library/soundcloud-api/README.md
# Remove Liquidsoap binaries
rm -r airtime/python_apps/pypo/liquidsoap_bin/
# Disable installation of Liquidsoap symlink
sed -i '84s:print:#print:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '86s:p = Popen:#p = Popen:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '87s:liq_path:#liq_path:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '88s:symlink_path:#symlink_path:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '90s:if p.returncode:#if p.returncode:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '91s:tr:#tr:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '92s:os.unlink:#os.unlink:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '93s:except:#except:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '95s:pass:#pass:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '98s:os.symlink:#os.symlink:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '99s:else:#else:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '100s:print:#print:g' airtime/python_apps/pypo/install/pypo-initialize.py
sed -i '101s:sys.exit:#sys.exit:g' airtime/python_apps/pypo/install/pypo-initialize.py
#Remove phing library
rm -r airtime/airtime_mvc/library/phing/
@ -71,7 +56,7 @@ echo "running the build..."
debuild -b -uc -us $@ || exit
# copy the new package to the public server
scp /tmp/airtime_${VERSION}_all.deb apt.sourcefabric.org:/var/www/apt/snapshots/
# scp /tmp/airtime_${VERSION}_all.deb apt.sourcefabric.org:/var/www/apt/snapshots/
# copy the build log too
scp /tmp/airtime_${VERSION}_amd64.build apt.sourcefabric.org:/var/www/apt/snapshots/
# scp /tmp/airtime_${VERSION}_amd64.build apt.sourcefabric.org:/var/www/apt/snapshots/

View File

@ -15,7 +15,7 @@ from configobj import ConfigObj
from media.monitor.exceptions import FailedToSetLocale, FailedToCreateDir
#supported_extensions = [u"mp3", u"ogg", u"oga"]
supported_extensions = [u"mp3", u"ogg", u"oga", u"flac", u"aac", u"bwf"]
supported_extensions = [u"mp3", u"ogg", u"oga", u"flac", u"aac", u"wav"]
unicode_unknown = u'unknown'
path_md = ['MDATA_KEY_TITLE', 'MDATA_KEY_CREATOR', 'MDATA_KEY_SOURCE',

View File

@ -81,7 +81,7 @@ try:
(codename, fullname) = get_os_codename()
print " Found %s (%s) on %s architecture" % (fullname, codename, arch)
print " * Installing Liquidsoap binary"
print " * Creating symlink to Liquidsoap binary"
p = Popen("which liquidsoap", shell=True, stdout=PIPE)
liq_path = p.communicate()[0].strip()