diff options
author | spocky <spocky@ampache> | 2007-11-13 20:57:07 +0000 |
---|---|---|
committer | spocky <spocky@ampache> | 2007-11-13 20:57:07 +0000 |
commit | 1379769b18e6146e5a7c97c6a879fac4e41ff6b6 (patch) | |
tree | 1e9dc112e69d460c9e73da8daae19c16a864e3c7 /templates | |
parent | ab6ecea9dbc4b53a7442db6f3695d68f9ba36f99 (diff) | |
download | ampache-1379769b18e6146e5a7c97c6a879fac4e41ff6b6.tar.gz ampache-1379769b18e6146e5a7c97c6a879fac4e41ff6b6.tar.bz2 ampache-1379769b18e6146e5a7c97c6a879fac4e41ff6b6.zip |
- Updated Now Playing html/css
- Fixed Star-rating css
- Updated Pager (5 elements around selected page# should be enough)
- Updated Album class so that disk# is part of the link
- Some more cleanup/updates to html/themes (hopefully it should be almost done in a week, so that themers can start theming on 3.4)
Diffstat (limited to 'templates')
-rw-r--r-- | templates/list_header.inc.php | 7 | ||||
-rw-r--r-- | templates/show_index.inc.php | 2 | ||||
-rw-r--r-- | templates/show_now_playing.inc.php | 6 | ||||
-rw-r--r-- | templates/show_now_playing_row.inc.php | 74 | ||||
-rw-r--r-- | templates/show_object_rating.inc.php | 63 | ||||
-rw-r--r-- | templates/show_object_rating_static.inc.php | 57 | ||||
-rw-r--r-- | templates/show_objects.inc.php | 4 |
7 files changed, 107 insertions, 106 deletions
diff --git a/templates/list_header.inc.php b/templates/list_header.inc.php index 9469cd85..c465a6b0 100644 --- a/templates/list_header.inc.php +++ b/templates/list_header.inc.php @@ -30,7 +30,8 @@ $limit = $GLOBALS['user']->prefs['offset_limit'] ? $GLOBALS['user']->prefs['offset_limit'] : '25'; $start = Browse::$start; $total = Browse::$total_objects; -$uid = Config::get('list_header_uid'); +$uid = Config::get('list_header_uid'); +$sides = 5; // ++ the uid Config::set('list_header_uid',$uid+1); @@ -63,7 +64,7 @@ $page = $current_page; $i = 0; /* While we have pages left */ while ($page > 0) { - if ($i == '10') { $page_data['down'][1] = '...'; $page_data['down'][0] = '0'; break; } + if ($i == $sides) { $page_data['down'][1] = '...'; $page_data['down'][0] = '0'; break; } $i++; $page = $page - 1; $page_data['down'][$page] = $page * $limit; @@ -75,7 +76,7 @@ $i = 0; /* While we have pages left */ while ($page <= $pages) { if ($page * $limit > $total) { break; } - if ($i == '10') { + if ($i == $sides) { $key = $pages - 1; if (!$page_data['up'][$key]) { $page_data['up'][$key] = '...'; } $page_data['up'][$pages] = ($pages-1) * $limit; diff --git a/templates/show_index.inc.php b/templates/show_index.inc.php index 39a95c5b..4ff0055f 100644 --- a/templates/show_index.inc.php +++ b/templates/show_index.inc.php @@ -25,7 +25,7 @@ if (isset($_REQUEST['xspf']) && isset ($_REQUEST['play_info'])){ } ?> -<div id="np_data"> +<div id="now_playing"> <?php show_now_playing(); ?> </div> <!-- Close Now Playing Div --> <!-- Recently Played --> diff --git a/templates/show_now_playing.inc.php b/templates/show_now_playing.inc.php index 3e5b259f..267bb9c4 100644 --- a/templates/show_now_playing.inc.php +++ b/templates/show_now_playing.inc.php @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. if (count($results)) { ?> <?php show_box_top(_('Now Playing')); ?> -<table class="tabledata"> +<div class="np_row"> <?php foreach ($results as $item) { $song = $item['song']; @@ -41,12 +41,10 @@ foreach ($results as $item) { if (!is_object($song)) { continue; } if (!$np_user->fullname) { $np_user->fullname = "Ampache User"; } - echo '<tr class="np_row">'; require Config::get('prefix') . '/templates/show_now_playing_row.inc.php'; - echo '</tr>'; } // end foreach ?> -</table> +</div> <?php show_box_bottom(); ?> <?php } // end if count results ?> diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php index 6faabb99..4c80e462 100644 --- a/templates/show_now_playing_row.inc.php +++ b/templates/show_now_playing_row.inc.php @@ -24,31 +24,51 @@ $title = scrub_out(truncate_with_ellipsis($song->title,'25')); $album = scrub_out(truncate_with_ellipsis($song->f_album_full,'25')); $artist = scrub_out(truncate_with_ellipsis($song->f_artist_full,'25')); ?> -<td class="np_cell_left"><b><?php echo _('Username'); ?></b>:<br /> - <a title="<?php echo scrub_out($agent); ?>" href="<?php echo $web_path; ?>/stats.php?action=show_user&user_id=<?php echo $np_user->id; ?>"><?php echo scrub_out($np_user->fullname); ?></a><br /><br /> - <!-- ## modified ##--> - <strong><?php echo _('Song'); ?></strong><br /> - <a title="<?php echo scrub_out($song->title); ?>" href="<?php echo $web_path; ?>/stream.php?action=single_song&song_id=<?php echo $song->id; ?>"> - <?php echo $title; ?> - </a> - <div id="rating_<?php echo $song->id; ?>_song"> - <?php Rating::show($song->id,'song'); ?> - </div> -</td> -<td class="np_cell_m"> - <strong><?php echo _('Artist'); ?></strong><br /> - <a title="<?php echo scrub_out($song->f_artist_full); ?>" href="<?php echo $web_path; ?>/artists.php?action=show&artist=<?php echo $song->artist; ?>"> - <?php echo $artist; ?> - </a> - <br /><br /> - <strong><?php echo _('Album'); ?></strong><br /> - <a title="<?php echo scrub_out($song->f_album_full); ?>" href="<?php echo $web_path; ?>/albums.php?action=show&album=<?php echo $song->album; ?>"> - <?php echo $album; ?> - </a> -</td> - <?php if (Config::get('show_album_art')) { ?> -<td class="np_cell_right"> - <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>'); return false;"> - <img align="middle" src="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&thumb=1&sid=<?php echo session_id(); ?>" alt="<?php echo scrub_out($song->f_album_full); ?>" title="<?php echo scrub_out($song->f_album_full); ?>" height="75" width="75" /></a> -</td> +<div class="np_group"> + <div class="np_cell cel_username"> + <label><?php echo _('Username'); ?></label> + <a title="<?php echo scrub_out($agent); ?>" href="<?php echo $web_path; ?>/stats.php?action=show_user&user_id=<?php echo $np_user->id; ?>"> + <?php echo scrub_out($np_user->fullname); ?> + </a> + </div> + + <div class="np_cell cel_rating"> + <label><?php echo _('Rating'); ?></label> + <div id="rating_<?php echo $song->id; ?>_song"> + <?php Rating::show($song->id,'song'); ?> + </div> + </div> +</div> + +<div class="np_group"> + <div class="np_cell cel_song"> + <label><?php echo _('Song'); ?></label> + <a title="<?php echo scrub_out($song->title); ?>" href="<?php echo $web_path; ?>/stream.php?action=single_song&song_id=<?php echo $song->id; ?>"> + <?php echo $title; ?> + </a> + </div> + + <div class="np_cell cel_album"> + <label><?php echo _('Album'); ?></label> + <a title="<?php echo scrub_out($song->f_album_full); ?>" href="<?php echo $web_path; ?>/albums.php?action=show&album=<?php echo $song->album; ?>"> + <?php echo $album; ?> + </a> + </div> + + <div class="np_cell cel_artist"> + <label><?php echo _('Artist'); ?></label> + <a title="<?php echo scrub_out($song->f_artist_full); ?>" href="<?php echo $web_path; ?>/artists.php?action=show&artist=<?php echo $song->artist; ?>"> + <?php echo $artist; ?> + </a> + </div> +</div> + +<?php if (Config::get('show_album_art')) { ?> +<div class="np_group"> + <div class="np_cell cel_albumart"> + <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>'); return false;"> + <img align="middle" src="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&thumb=1&sid=<?php echo session_id(); ?>" alt="<?php echo scrub_out($song->f_album_full); ?>" title="<?php echo scrub_out($song->f_album_full); ?>" height="75" width="75" /> + </a> + </div> +</div> <?php } // end play album art ?> diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php index ad512c0d..ea3a22ba 100644 --- a/templates/show_object_rating.inc.php +++ b/templates/show_object_rating.inc.php @@ -21,42 +21,31 @@ /* Create some variables we are going to need */ $web_path = Config::get('web_path'); $base_url = '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id; - -echo "<div class=\"star-rating dynamic-star-rating\">\n"; -echo "<ul>\n"; - -// decide width of rating (5 stars -> 20% per star) -$width = $rating->rating*20; -if ($width < 0) $width = 0; - -//set the current rating background -echo "<li class=\"current-rating\" style=\"width:${width}%\" >Current rating: "; -if ($rating->rating <= 0) { - echo "not rated yet </li>\n"; -} -else echo "$rating->rating of 5</li>\n"; - -//it did not like my "1-star", "2-star" ... css styles, and I changed it to this after I realized star1... would have worked :\ ?> -<li> - <?php echo Ajax::text($base_url . '&rating=1','','rating1_' . $rating->id,'','one-stars'); ?> -</li> -<li> - <?php echo Ajax::text($base_url . '&rating=2','','rating2_' . $rating->id,'','two-stars'); ?> -</li> -<li> - <?php echo Ajax::text($base_url . '&rating=3','','rating3_' . $rating->id,'','three-stars'); ?> -</li> -<li> - <?php echo Ajax::text($base_url . '&rating=4','','rating4_' . $rating->id,'','four-stars'); ?> -</li> -<li> - <?php echo Ajax::text($base_url . '&rating=5','','rating5_' . $rating->id,'','five-stars'); ?> -</li> -</ul> -<?php - // Add in the 0 / Remove rating level - echo "<div class=\"zero-stars\">" . Ajax::text($base_url . '&rating=-1','','rating0_' . $rating->id,'','zero-stars') . "</div>\n"; - echo "</div>\n"; -?> +<div class="star-rating dynamic-star-rating"> + <ul> + <?php + // decide width of rating (5 stars -> 20% per star) + $width = $rating->rating*20; + if ($width < 0) $width = 0; + + //set the current rating background + echo "<li class=\"current-rating\" style=\"width:${width}%\" >Current rating: "; + if ($rating->rating <= 0) { + echo "not rated yet </li>\n"; + } + else echo "$rating->rating of 5</li>\n"; + + for ($i=1; $i<6; $i++) + { + ?> + <li> + <?php echo Ajax::text($base_url . '&rating='.$i,'','rating'.$i.'_' . $rating->id,'','star'.$i); ?> + </li> + <?php + } + ?> + </ul> + <?php echo Ajax::text($base_url . '&rating=-1','','rating0_' . $rating->id,'','star0'); ?> +</div> diff --git a/templates/show_object_rating_static.inc.php b/templates/show_object_rating_static.inc.php index 763c115a..5fcd4f18 100644 --- a/templates/show_object_rating_static.inc.php +++ b/templates/show_object_rating_static.inc.php @@ -21,37 +21,30 @@ /* Create some variables we are going to need */ $web_path = Config::get('web_path'); $base_url = Config::get('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id; - -echo "<div class=\"star-rating\">\n"; -echo "<ul>\n"; - -// decide width of rating (5 stars -> 20% per star) -$width = $rating->rating*20; -if ($width < 0) $width = 0; - -//set the current rating background -echo "<li class=\"current-rating\" style=\"width:${width}%\" >Current rating: "; -if ($rating->rating <= 0) { - echo "not rated yet </li>\n"; -} -else echo "$rating->rating of 5</li>\n"; - -//it did not like my "1-star", "2-star" ... css styles, and I changed it to this after I realized star1... would have worked :\ ?> -<li> - <span class="one-stars" title="1 <?php echo _('out of'); ?> 5">1</span> -</li> -<li> - <span class="two-stars" title="2 <?php echo _('out of'); ?> 5">2</span> -</li> -<li> - <span class="three-stars" title="3 <?php echo _('out of'); ?> 5">3</span> -</li> -<li> - <span class="four-stars" title="4 <?php echo _('out of'); ?> 5">4</span> -</li> -<li> - <span class="five-stars" title="5 <?php echo _('out of'); ?> 5">5</span> -</li> -</ul> + +<div class="star-rating"> + <ul> + <?php + // decide width of rating (5 stars -> 20% per star) + $width = $rating->rating*20; + if ($width < 0) $width = 0; + + //set the current rating background + echo "<li class=\"current-rating\" style=\"width:${width}%\" >Current rating: "; + if ($rating->rating <= 0) { + echo "not rated yet </li>\n"; + } + else echo "$rating->rating of 5</li>\n"; + + for ($i=1; $i<6; $i++) + { + ?> + <li> + <span class="star<?php echo $i; ?>" title="<?php echo $i.' '._('out of'); ?> 5"><?php echo $i; ?></span> + </li> + <?php + } + ?> + </ul> </div> diff --git a/templates/show_objects.inc.php b/templates/show_objects.inc.php index 72e79f89..4ebaa1f2 100644 --- a/templates/show_objects.inc.php +++ b/templates/show_objects.inc.php @@ -23,10 +23,10 @@ * Variable/Non-DB object display takes headers & objects */ ?> -<table class="table-data" cellspacing="0"> +<table class="tabledata" cellspacing="0"> <tr> <?php foreach ($headers as $header) { ?> - <th><?php echo scrub_out($header); ?></th> + <th class="th-top"><?php echo scrub_out($header); ?></th> <?php } ?> </tr> <?php |