Permalink
Browse files

Move add button from controls to menu.

  • Loading branch information...
1 parent 3f86edc commit 585307f84d3254218a5a381fe6c229850f2ac057 Alexis Bernard committed Dec 23, 2012
Showing with 7 additions and 6 deletions.
  1. +3 −2 app/assets/javascripts/controller.js.coffee
  2. +4 −4 app/views/layouts/application.html.erb
View
5 app/assets/javascripts/controller.js.coffee
@@ -54,8 +54,9 @@ class @Controller
clickOnPreviousButton: () ->
@player.playPreviousTrack()
- clickOnAddButton: ->
- url = prompt("Copy a track URL from official.fm or soundcloud.com.")
+ clickOnAddButton: (event) ->
+ event.preventDefault()
+ url = prompt("Copy a track URL from Official.fm, SoundCloud or YouTube.")
if url
if url.match(/official\.fm/) || url.match(/soundcloud\.com/) || url.match(/youtube\.com/)
@addTrack(url)
View
8 app/views/layouts/application.html.erb
@@ -14,21 +14,21 @@
<span class="iconic first" id="previous-button" title="Previous track (use left arrow as a shortcut)"></span>
<span class="iconic play" id="play-button" title="Play/pause (use space key as a shortcut)"></span>
<span class="iconic last" id="next-button" title="Next track (use right arrow as a shortcut)"></span>
- <% if current_user && current_user == @user %>
- <span class="iconic plus" id="add-button" title="Add a track"></span>
- <% end %>
</section>
<section class="info">
<a id="current-track" href="" title="Go to playing track"></a>
</section>
<section class="settings">
+ <% if current_user %>
+ <%= link_to 'Add', '', id: "add-button" %>
+ <% end %>
<% if @user && current_user != @user %>
<%= link_to "#{@user.name}'s favorites", @user, class: 'active' %>
<% end %>
<%= link_to 'People', users_path, class: request.fullpath == users_path ? 'active' : '' %>
<%= link_to 'Latest tracks', tracks_path, class: request.fullpath == tracks_path ? 'active' : '' %>
<% if current_user %>
- <%= link_to 'Your favorites', current_user, class: request.fullpath == user_path(current_user) ? 'active' : '' %>
+ <%= link_to 'Favorites', current_user, class: request.fullpath == user_path(current_user) ? 'active' : '' %>
<%= link_to 'Logout', session_path, method: 'DELETE' %>
<% else %>
<%= link_to 'Login', session_path %>

0 comments on commit 585307f

Please sign in to comment.