<%= javascript_include_tag :defaults %>
<div id="flash" style="clear: both">
</div>
<div style="float: left">
  <p>
    <b>Song Name:</b>
    <%=h@song.audio_file_name%>
  </p>


  <p>
    <b>Song Length:</b>
    <%=h @song.song_length %>
  </p>

  <p>
    <b>Upload Date:</b>
    <%=h @song.created_at.strftime("%m/%d/%Y at %I:%M %p") %>
  </p>

  <p>
    <b>Listen Count:</b>
    <%=h @song.listen_count %>
  </p>

  <p>
    <b>Author:</b>
    <%=h @song.author %>
  </p>

  <p>
    <b>Description:</b>
    <%=h @song.description %>
  </p>
  
  <p>
      <b>Uploaded by:</b>
      <%if not @user_profile.nil?%>
      	<%= link_to( h(@uploader.login), user_profile_path(@user_profile.id)) %>
      <%else%>
        <%= link_to( h(@uploader.login), '/no_profile') %>
      <%end%>
      <% if logged_in? %>
	      <div id="follows">
		<%= render :partial => "follows" %>
	      </div>
      <%end%>
  </p>
  <br />
  <b>Ratings:</b>
  <%=ratings_for @song, @user%>
  
  <br/>
  <div id="tags">
  <b>Tags:</b>
  <% if @song.tags.empty? %>
      <div><br />This song has no tags associated with it. Help us out and add some!</div>
      <br />
  <% end %>
  <%= render :partial => "tags", :collection => @song.tags%>
  </div>
  <div id="new_tag">
  <% if logged_in? %>
  	<%= render :partial => "new_tag", :locals => { :song_id => @song.id, :collection => @song.tags } %>
  <%  end %>
  </div>
  <%= render :partial => "player", :object => @song %>
  <br /><br />

  <% if logged_in? %>
  	<%= link_to 'Back', songs_path %>
  	<% if @song.user_id == @curr_user.id %>
  		| <%= link_to 'Edit', edit_song_path(@song) %> |
  		<%= link_to 'Delete', @song, :confirm => 'Are you sure?', :method => :delete %>
  	<% end %>
  <% else %>
  	<%= link_to 'Back', songs_path %>
  <% end %>
</div>
<div id="comments" style="float: left">
  <%= render :partial => "comments", :collection => @comments %>
</div>
<div id="new_comment">
  <% if logged_in? %>
    <%= render :partial => "new_comment", :locals => { :song_id => @song.id } %>
  <%  end %>
</div>
<div style="clear: both">
</div>
