Source

soundbush / soundbush / templates / artist.mako

Full commit
<%inherit file="base.mako"/>

<%def name="renderHead()">
<title>${c.htmlify(c.title)}</title>
<link rel="alternate" title="soundbush.com feed for ${c.artist.displayname}"
    type="application/rss+xml" href="${c.urlbase}/_artist/rss/${c.artist.id}"/>
<script>
    SB.playerURL = '${c.static}/xspf_player_slim.swf';
    SB.tracks = [];
    %for track in c.tracks:
        SB.tracks.push({songURL: '${c.static}/${c.artist.id}/${track.filename}',
                        songTitle: '${track.title.replace("'", r"\'")}',
                        id: '${track.id}'});
    %endfor
</script>
</%def>

<%def name="renderPlayer()">
<div class="headerplayer" id="headerplayer">
%if c.tracks:
 <div class="player" id="player-div">
 <a href="#" id="play-button"></a>
 <h2 class="nowplaying">Now playing: <span>${c.tracks[0].title}</span></h2>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer" align="">
  <param name=movie value="${c.static}/niftyplayer.swf?file=${c.static}/${c.artist.id}/${c.tracks[0].filename}">
  <param name=quality value=high>
  <param name=bgcolor value=#FFFFFF>
  <embed src="${c.static}/niftyplayer.swf?file=${c.static}/${c.artist.id}/${c.tracks[0].filename}" quality=high bgcolor=#FFFFFF width="165" height="38" name="niftyPlayer" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
  </embed>
</object>
</div>
%else:
<h2>This artist has not uploaded any tracks yet</h2>
%endif
</div>
</%def>


<%def name="renderCol1()">

<div style="display: none;" id="contact-dialog">
    <form action="${c.urlbase}/_artist/contact/${c.artist.id}" method="post">
        <table>
        <tr><td style="padding-right: 3em;">Name:</td>
            <td><input name="name" class="form" width="30" type="text"/></td></tr>
        <tr><td>Email:</td>
            <td><input name="email" class="form" width="30" type="text"/></td></tr>
        <tr><td valign="top">Message:</td>
            <td><textarea name="comments" rows="10"></textarea></td></tr>
        <tr><td></td><td style="text-align: right" align="right">
            <input id="contact-submit" class="submit" type="submit" value="Submit"/></td></tr>
        </table>
    </form>
</div>

<div id="dialog" class="dialog"></div>

    <table>
    <tr>
    <td>

    <h3>${c.htmlify(c.artist.displayname)}
        <a class="rsslink" href="${c.urlbase}/_artist/rss/${c.artist.id}"><img
        class="rsslink" src="${c.static}/img/feed-icon-14x14.png"/></a></h3>

    </td>

    <td align="center">

    <button id="contact-artist">Contact</button>

    </td></tr>
    </table>

    <div id="artist-description"><p>${c.htmlify(c.artist.description)}</p></div>

    <a href="#" id="read-more">Show More</a>

%for i, track in enumerate(c.tracks):
        <%owner = c.user and c.user.id == track.author.id%>
        <div class="track-box">
        <table width="100%">
            <tr>
                <td style="padding: 0">
                    <h2>${c.htmlify(track.title)}</h2>
                </td>
                %if owner:
                <td style="padding: 0">
                    <button class="edit-track-button">Edit</button>
                    <button class="delete-track-button">Delete</button>
                </td>
                %endif
            </tr>
        </table>

        <table class="play-links">
        <tr>
            <td>
                <h2>
                <a class="redlink" id="play-${i}" href="#">
                    <div class="play-button-track"></div>
                </a>
                </h2>
            </td>

            <td>
                <h2>
                |<a class="redlink" href="${c.urlbase}/_artist/download/${track.id}">Download
                </a>
                </h2>
            </td>

            <td>
                <h2>
                 |<span style="color: #999">Share</span>
                <a href="${c.url.facebook(track)}">
                    <img title="Facebook" src="${c.static}/img/icons/facebook.png"/></a>
                <a href="${c.url.twitter(track)}">
                    <img title="Twitter" src="${c.static}/img/icons/twitter.png"/></a>
                </h2>
            </td>
        </tr>
        </table>

        <h3 class="count">Plays <i>${track.listens}</i>
        Downloads <i>${track.downloads}</i></h3>
        <h3 class="date">${track.tstamp.strftime('%c')}</h3>
        <p>${c.htmlify(track.description)}</p>
        <div class="commentlinks">
            <div class="commentlinkcontainer">
            <a href="${c.urlbase}/${track.id}">Permalink</a> |
            <a class="comment-link" id="comment-${track.id}" href="#">Comment</a> |
            <a class="comment-view"
                id="comment-view-${track.id}"
                href="#">View Comments (${len(track.comments)})</a>
            </div>
        </div>
        <div class="comments" id="comments-${track.id}"></div>
    </div>
%endfor

</%def>

<%def name="renderFooter()">
</%def>