mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 10:49:37 +02:00
Add artist information tabs (fix #126)
This commit is contained in:
parent
a45a1479ad
commit
24895f24f7
6 changed files with 90 additions and 13 deletions
|
@ -1131,7 +1131,6 @@ class User extends database_object
|
||||||
$avatar['url_mini'] = $avatar['url'];
|
$avatar['url_mini'] = $avatar['url'];
|
||||||
$avatar['url'] .= '&thumb=3';
|
$avatar['url'] .= '&thumb=3';
|
||||||
$avatar['url_mini'] .= '&thumb=5';
|
$avatar['url_mini'] .= '&thumb=5';
|
||||||
$avatar['data'] = $this->avatar;
|
|
||||||
} else {
|
} else {
|
||||||
foreach (Plugin::get_plugins('get_avatar_url') as $plugin_name) {
|
foreach (Plugin::get_plugins('get_avatar_url') as $plugin_name) {
|
||||||
$plugin = new Plugin($plugin_name);
|
$plugin = new Plugin($plugin_name);
|
||||||
|
|
|
@ -19,6 +19,16 @@
|
||||||
//
|
//
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.default_hidden').hide();
|
$('.default_hidden').hide();
|
||||||
|
|
||||||
|
$("#tabs li").click(function() {
|
||||||
|
$("#tabs li").removeClass('tab_active');
|
||||||
|
$(this).addClass("tab_active");
|
||||||
|
$(".tab_content").hide();
|
||||||
|
var selected_tab = $(this).find("a").attr("href");
|
||||||
|
$(selected_tab).fadeIn();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
|
@ -47,15 +47,15 @@ switch ($_REQUEST['action']) {
|
||||||
break;
|
break;
|
||||||
case 'append_item':
|
case 'append_item':
|
||||||
// Only song item are supported with playlists
|
// Only song item are supported with playlists
|
||||||
|
|
||||||
debug_event('playlist', 'Appending items to playlist {'.$_REQUEST['playlist_id'].'}...', '5');
|
debug_event('playlist', 'Appending items to playlist {'.$_REQUEST['playlist_id'].'}...', '5');
|
||||||
|
|
||||||
if (!isset($_REQUEST['playlist_id']) || empty($_REQUEST['playlist_id'])) {
|
if (!isset($_REQUEST['playlist_id']) || empty($_REQUEST['playlist_id'])) {
|
||||||
if (!Access::check('interface','25')) {
|
if (!Access::check('interface','25')) {
|
||||||
debug_event('DENIED','Error:' . $GLOBALS['user']->username . ' does not have user access, unable to create playlist','1');
|
debug_event('DENIED','Error:' . $GLOBALS['user']->username . ' does not have user access, unable to create playlist','1');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = $GLOBALS['user']->username . ' - ' . date("Y-m-d H:i:s",time());
|
$name = $GLOBALS['user']->username . ' - ' . date("Y-m-d H:i:s",time());
|
||||||
$playlist_id = Playlist::create($name,'public');
|
$playlist_id = Playlist::create($name,'public');
|
||||||
if (!$playlist_id) {
|
if (!$playlist_id) {
|
||||||
|
@ -72,7 +72,7 @@ switch ($_REQUEST['action']) {
|
||||||
|
|
||||||
$songs = array();
|
$songs = array();
|
||||||
$item_id = $_REQUEST['item_id'];
|
$item_id = $_REQUEST['item_id'];
|
||||||
|
|
||||||
switch ($_REQUEST['item_type']) {
|
switch ($_REQUEST['item_type']) {
|
||||||
case 'smartplaylist':
|
case 'smartplaylist':
|
||||||
$smartplaylist = new Search('song', $item_id);
|
$smartplaylist = new Search('song', $item_id);
|
||||||
|
@ -121,11 +121,11 @@ switch ($_REQUEST['action']) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($songs) > 0) {
|
if (count($songs) > 0) {
|
||||||
Ajax::set_include_override(true);
|
Ajax::set_include_override(true);
|
||||||
$playlist->add_songs($songs, 'ORDERED');
|
$playlist->add_songs($songs, 'ORDERED');
|
||||||
|
|
||||||
/*$playlist->format();
|
/*$playlist->format();
|
||||||
$object_ids = $playlist->get_items();
|
$object_ids = $playlist->get_items();
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
|
@ -53,3 +53,52 @@ a.tag_size1, a.tag_size2, a.tag_size3, a.tag_size4 { text-decoration: none; }
|
||||||
.item_off {
|
.item_off {
|
||||||
color: #FF0000;
|
color: #FF0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tabs_wrapper {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
#tabs_container {
|
||||||
|
border-bottom: 1px solid #3C3C3C;
|
||||||
|
}
|
||||||
|
#tabs {
|
||||||
|
list-style: none;
|
||||||
|
padding: 5px 0 4px 0;
|
||||||
|
margin: 0 0 0 10px;
|
||||||
|
font: 0.75em arial;
|
||||||
|
}
|
||||||
|
#tabs li {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
#tabs li a {
|
||||||
|
padding: 4px 6px;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: #5D5C5C;
|
||||||
|
border-bottom: none;
|
||||||
|
outline: none;
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
-moz-border-radius: 5px 5px 0 0;
|
||||||
|
-webkit-border-top-left-radius: 5px;
|
||||||
|
-webkit-border-top-right-radius: 5px;
|
||||||
|
}
|
||||||
|
#tabs li a:hover {
|
||||||
|
background-color: #3C3C3C;
|
||||||
|
padding: 4px 6px;
|
||||||
|
}
|
||||||
|
#tabs li.tab_active a {
|
||||||
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
|
padding: 4px 6px 5px 6px;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
#tabs li.tab_active a:hover {
|
||||||
|
background-color: #5D5C5C;
|
||||||
|
padding: 4px 6px 5px 6px;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tabs_content {
|
||||||
|
padding: 10px;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
.tab_content {
|
||||||
|
display: none;
|
||||||
|
}
|
|
@ -114,21 +114,40 @@ if (AmpConfig::get('show_played_times')) {
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php UI::show_box_bottom(); ?>
|
<?php UI::show_box_bottom(); ?>
|
||||||
|
<div class="tabs_wrapper">
|
||||||
|
<div id="tabs_container">
|
||||||
|
<ul id="tabs">
|
||||||
|
<li class="tab_active"><a href="#albums"><?php echo T_('Albums'); ?></a></li>
|
||||||
|
<?php if (AmpConfig::get('wanted')) { ?>
|
||||||
|
<li><a id="missing_albums_link" href="#missing_albums"><?php echo T_('Missing Albums'); ?></a></li>
|
||||||
|
<?php if (AmpConfig::get('show_similar')) { ?>
|
||||||
|
<?php } ?>
|
||||||
|
<li><a id="similar_artist_link" href="#similar_artist"><?php echo T_('Similar Artists'); ?></a></li>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="tabs_content">
|
||||||
|
<div id="albums" class="tab_content" style="display: block;">
|
||||||
<?php
|
<?php
|
||||||
$browse->show_objects($object_ids);
|
$browse->show_objects($object_ids);
|
||||||
$browse->store();
|
$browse->store();
|
||||||
?>
|
?>
|
||||||
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if (AmpConfig::get('wanted')) {
|
if (AmpConfig::get('wanted')) {
|
||||||
echo Ajax::observe('window','load', Ajax::action('?page=index&action=wanted_missing_albums&artist='.$artist->id, 'missing_albums'));
|
echo Ajax::observe('missing_albums_link','click', Ajax::action('?page=index&action=wanted_missing_albums&artist='.$artist->id, 'missing_albums'));
|
||||||
?>
|
?>
|
||||||
<div id="missing_albums"></div>
|
<div id="missing_albums" class="tab_content">
|
||||||
|
<?php UI::show_box_top(T_('Missing Albums'), 'info-box'); echo T_('Loading...'); UI::show_box_bottom(); ?>
|
||||||
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php
|
<?php
|
||||||
if (AmpConfig::get('show_similar')) {
|
if (AmpConfig::get('show_similar')) {
|
||||||
echo Ajax::observe('window','load', Ajax::action('?page=index&action=similar_artist&artist='.$artist->id, 'similar_artist'));
|
echo Ajax::observe('similar_artist_link','click', Ajax::action('?page=index&action=similar_artist&artist='.$artist->id, 'similar_artist'));
|
||||||
?>
|
?>
|
||||||
<div id="similar_artist">
|
<div id="similar_artist" class="tab_content">
|
||||||
<?php UI::show_box_top(T_('Similar Artists'), 'info-box'); echo T_('Loading...'); UI::show_box_bottom(); ?>
|
<?php UI::show_box_top(T_('Similar Artists'), 'info-box'); echo T_('Loading...'); UI::show_box_bottom(); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue