From 1b35c20dd0a93b143d8b9542743a743e0db66386 Mon Sep 17 00:00:00 2001 From: martian Date: Tue, 9 Feb 2010 17:44:44 +0000 Subject: Adding the bandwidth option to the preferences. This changes the complexity of the UI and toggles album art. --- templates/base.css | 4 +- templates/show_album_row.inc.php | 20 +++--- templates/show_albums.inc.php | 6 +- templates/show_artist.inc.php | 4 -- templates/show_index.inc.php | 116 +++++++++++++++++++++++++-------- templates/show_now_playing_row.inc.php | 9 ++- templates/show_random_albums.inc.php | 8 ++- 7 files changed, 119 insertions(+), 48 deletions(-) (limited to 'templates') diff --git a/templates/base.css b/templates/base.css index db4d7408..ca508c35 100644 --- a/templates/base.css +++ b/templates/base.css @@ -25,6 +25,7 @@ * Tag Definitions *****************/ +/* why god why!? .tag_size1 { font-size:.6em; } @@ -37,10 +38,11 @@ .tag_size4 { font-size:1.2em; } +*/ a.tag_size1, a.tag_size2, a.tag_size3, a.tag_size4 { text-decoration: none; } -.hover-add:hover { font-weight:900; } +/* .hover-add:hover { font-weight:900; } */ /* why god why!? */ .hover-remove:hover { text-decoration:line-through;} /***************** diff --git a/templates/show_album_row.inc.php b/templates/show_album_row.inc.php index ff4256fd..71a1afbc 100644 --- a/templates/show_album_row.inc.php +++ b/templates/show_album_row.inc.php @@ -23,13 +23,17 @@ id,'add',_('Add'),'add_album_' . $album->id); ?> id,'random',_('Random'),'random_album_' . $album->id); ?> -f_artist . '] ' . scrub_out($album->full_name); + BANDWIDTH_LOW) { + $name = '[' . $album->f_artist . '] ' . scrub_out($album->full_name); + + // This should not be hard coded, but it will likely break all the themes. + //$image_size = Config::get('bandwidth') == BANDWIDTH_MEDIUM ? 75 : 128; + $image_size = 75; ?> - <?php echo($name) ?> + <?php echo($name) ?> @@ -37,14 +41,12 @@ f_artist_link; ?> song_count; ?> year; ?> -f_tags; ?> +f_tags) > 20) ? substr($album->f_tags, 0, 20) . '&hellip' : $album->f_tags; ?> id,'album'); ?> - - + - - + diff --git a/templates/show_albums.inc.php b/templates/show_albums.inc.php index c394b4d9..82436c40 100644 --- a/templates/show_albums.inc.php +++ b/templates/show_albums.inc.php @@ -25,7 +25,7 @@ $ajax_url = Config::get('ajax_url'); - + BANDWIDTH_LOW) { ?> @@ -38,7 +38,7 @@ $ajax_url = Config::get('ajax_url'); - + BANDWIDTH_LOW) { ?> @@ -69,7 +69,7 @@ $ajax_url = Config::get('ajax_url'); - + BANDWIDTH_LOW) { ?> diff --git a/templates/show_artist.inc.php b/templates/show_artist.inc.php index 4e63835d..24033e8b 100644 --- a/templates/show_artist.inc.php +++ b/templates/show_artist.inc.php @@ -60,10 +60,6 @@ if (Config::get('ratings')) { -
  • - /> - - + - - - - -
    - -
    - -
    - -
    - - -
    - -
    - +// Various settings for the 'bandwidth' option +$feature_sets = array + ( + BANDWIDTH_LOW => array('now', 'played'), + BANDWIDTH_MEDIUM => array('now', 'random', 'played'), + BANDWIDTH_HIGH => array('now', 'random', 'shout', 'played', 'added') + ); + +$feature_limits = array ( + BANDWIDTH_LOW => array + ( + 'shout' => 7, + 'played' => 7, + 'added' => 7 + ), + BANDWIDTH_MEDIUM => array + ( + 'shout' => 10, + 'played' => 10, + 'added' => 10 + ), + BANDWIDTH_HIGH => array + ( + 'shout' => 10, + 'played' => 20, + 'added' => 20 + ) + ); + +$features = $feature_sets[Config::get('bandwidth')]; + +foreach ($features as $feature) { + switch ($feature) { + case 'shout': + ?>
    diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php index bd1f95cc..66b3639d 100644 --- a/templates/show_now_playing_row.inc.php +++ b/templates/show_now_playing_row.inc.php @@ -23,6 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. $title = scrub_out(truncate_with_ellipsis($media->title)); $album = scrub_out(truncate_with_ellipsis($media->f_album_full)); $artist = scrub_out(truncate_with_ellipsis($media->f_artist_full)); + +// This should not be hard coded, but it will likely break all the themes. +//$image_size = Config::get('bandwidth') == BANDWIDTH_MEDIUM ? 75 : 128; +$image_size = 75; + ?>
    @@ -72,11 +77,11 @@ $artist = scrub_out(truncate_with_ellipsis($media->f_artist_full));
    - + BANDWIDTH_LOW) { ?> diff --git a/templates/show_random_albums.inc.php b/templates/show_random_albums.inc.php index a262a4a1..2dee7f85 100644 --- a/templates/show_random_albums.inc.php +++ b/templates/show_random_albums.inc.php @@ -29,11 +29,15 @@ $button = Ajax::button('?page=index&action=random_albums','random',_('Refresh'), $album = new Album($album_id); $album->format(); $name = '[' . $album->f_artist . '] ' . scrub_out($album->full_name); + + // This should not be hard coded, but it will likely break all the themes. + //$image_size = Config::get('bandwidth') == BANDWIDTH_MEDIUM ? 75 : 128; + $image_size = 75; ?>