Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: lukeledet/deej
base: 768ea6abb7
...
head fork: lukeledet/deej
compare: bc84182abe
  • 9 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
3  Gemfile
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
-gem 'rails', '3.2.3'
+gem 'rails', '3.2.11'
gem 'sqlite3'
gem 'jquery-rails'
@@ -11,7 +11,6 @@ gem 'ruby-shout', require: 'shout'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
- gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'twitter-bootstrap-rails'
end
View
122 Gemfile.lock
@@ -1,122 +1,113 @@
GEM
remote: https://rubygems.org/
specs:
- actionmailer (3.2.3)
- actionpack (= 3.2.3)
+ actionmailer (3.2.11)
+ actionpack (= 3.2.11)
mail (~> 2.4.4)
- actionpack (3.2.3)
- activemodel (= 3.2.3)
- activesupport (= 3.2.3)
+ actionpack (3.2.11)
+ activemodel (= 3.2.11)
+ activesupport (= 3.2.11)
builder (~> 3.0.0)
erubis (~> 2.7.0)
- journey (~> 1.0.1)
+ journey (~> 1.0.4)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.1.2)
- activemodel (3.2.3)
- activesupport (= 3.2.3)
+ sprockets (~> 2.2.1)
+ activemodel (3.2.11)
+ activesupport (= 3.2.11)
builder (~> 3.0.0)
- activerecord (3.2.3)
- activemodel (= 3.2.3)
- activesupport (= 3.2.3)
+ activerecord (3.2.11)
+ activemodel (= 3.2.11)
+ activesupport (= 3.2.11)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
- activeresource (3.2.3)
- activemodel (= 3.2.3)
- activesupport (= 3.2.3)
- activesupport (3.2.3)
+ activeresource (3.2.11)
+ activemodel (= 3.2.11)
+ activesupport (= 3.2.11)
+ activesupport (3.2.11)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
- builder (3.0.0)
+ builder (3.0.4)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.3.1)
- commonjs (0.2.6)
+ coffee-script-source (1.4.0)
erubis (2.7.0)
- execjs (1.3.1)
+ execjs (1.4.0)
multi_json (~> 1.0)
hike (1.2.1)
- i18n (0.6.0)
- journey (1.0.3)
- jquery-rails (2.0.2)
- railties (>= 3.2.0, < 5.0)
- thor (~> 0.14)
- json (1.7.0)
- kaminari (0.13.0)
+ i18n (0.6.1)
+ journey (1.0.4)
+ jquery-rails (2.1.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.7.6)
+ kaminari (0.14.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
- railties (>= 3.0.0)
- less (2.2.1)
- commonjs (~> 0.2.6)
- less-rails (2.2.2)
- actionpack (>= 3.1)
- less (~> 2.2.0)
- libv8 (3.3.10.4)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.18)
- multi_json (1.3.4)
+ mime-types (1.19)
+ multi_json (1.5.0)
polyglot (0.3.3)
- rack (1.4.1)
+ rack (1.4.3)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
- rack-test (0.6.1)
+ rack-test (0.6.2)
rack (>= 1.0)
- rails (3.2.3)
- actionmailer (= 3.2.3)
- actionpack (= 3.2.3)
- activerecord (= 3.2.3)
- activeresource (= 3.2.3)
- activesupport (= 3.2.3)
+ rails (3.2.11)
+ actionmailer (= 3.2.11)
+ actionpack (= 3.2.11)
+ activerecord (= 3.2.11)
+ activeresource (= 3.2.11)
+ activesupport (= 3.2.11)
bundler (~> 1.0)
- railties (= 3.2.3)
- railties (3.2.3)
- actionpack (= 3.2.3)
- activesupport (= 3.2.3)
+ railties (= 3.2.11)
+ railties (3.2.11)
+ actionpack (= 3.2.11)
+ activesupport (= 3.2.11)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
- thor (~> 0.14.6)
- rake (0.9.2.2)
+ thor (>= 0.14.6, < 2.0)
+ rake (10.0.3)
rdoc (3.12)
json (~> 1.4)
- ruby-shout (2.2.0)
- sass (3.1.16)
+ ruby-shout (2.2.1)
+ sass (3.2.5)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
- sprockets (2.1.3)
+ sprockets (2.2.2)
hike (~> 1.2)
+ multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- sqlite3 (1.3.6)
- taglib-ruby (0.5.0)
- therubyracer (0.10.1)
- libv8 (~> 3.3.10)
- thor (0.14.6)
+ sqlite3 (1.3.7)
+ taglib-ruby (0.5.2)
+ thor (0.16.0)
tilt (1.3.3)
- treetop (1.4.10)
+ treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
- twitter-bootstrap-rails (2.0.6)
+ twitter-bootstrap-rails (2.2.0)
actionpack (>= 3.1)
- less-rails (~> 2.2.0)
+ execjs
railties (>= 3.1)
- tzinfo (0.3.33)
- uglifier (1.2.4)
+ tzinfo (0.3.35)
+ uglifier (1.3.0)
execjs (>= 0.3.0)
- multi_json (>= 1.0.2)
+ multi_json (~> 1.0, >= 1.0.2)
PLATFORMS
ruby
@@ -125,11 +116,10 @@ DEPENDENCIES
coffee-rails (~> 3.2.1)
jquery-rails
kaminari
- rails (= 3.2.3)
+ rails (= 3.2.11)
ruby-shout
sass-rails (~> 3.2.3)
sqlite3
taglib-ruby
- therubyracer
twitter-bootstrap-rails
uglifier (>= 1.0.3)
View
18 app/assets/javascripts/keys.js.coffee
@@ -3,7 +3,7 @@ window.selected_song = null
key.filter = (e) -> true
key '/,s', ->
- return if $('.navbar-search input').is(':focus')
+ return if $('.navbar-search input').is(':focus')
$('.navbar-search input').focus()
return false
@@ -16,31 +16,31 @@ key 'down', ->
window.selected_song = if selected_song != null then selected_song + 1 else 1
window.selected_song = $('#song_list tr').length - 1 if selected_song >= $('#song_list tr').length
- $('#song_list tr').removeClass('selected')
- $('#song_list tr:eq('+selected_song+')').addClass('selected')
+ highlight_selected_song()
+
return false
key 'up', ->
- return if $('.navbar-search input').is(':focus')
+ return if $('.navbar-search input').is(':focus')
$('.navbar-search input').blur()
window.selected_song = if selected_song != null then selected_song - 1 else 1
if selected_song < 1
- $('.navbar-search input').focus()
+ $('.navbar-search input').focus()
window.selected_song = null
- $('#song_list tr').removeClass('selected')
- $('#song_list tr:eq('+selected_song+')').addClass('selected')
+ highlight_selected_song()
+
return false
key 'left', ->
- return if $('.navbar-search input').is(':focus')
+ return if $('.navbar-search input').is(':focus')
$('.pagination .prev a').click()
return false
key 'right', ->
- return if $('.navbar-search input').is(':focus')
+ return if $('.navbar-search input').is(':focus')
$('.pagination .next_page a').click()
return false
View
7 app/assets/javascripts/songs.js.coffee
@@ -15,6 +15,10 @@ window.cancel_search = ->
$('.navbar-search input').val('').keyup().blur()
$('#cancel-search').hide()
+window.highlight_selected_song = ->
+ $('#song_list tr').removeClass('selected')
+ $('#song_list tr:eq('+selected_song+')').addClass('selected')
+
jQuery ($) ->
$('.search-query')
.on 'keyup', (e) ->
@@ -30,6 +34,9 @@ jQuery ($) ->
$('#cancel-search').on 'click', ->
cancel_search()
+ $(document).on 'click', '.pagination a', ->
+ window.selected_song = null
+
setInterval ->
return if elapsed == null
View
11 app/assets/stylesheets/bootstrap_and_overrides.css
@@ -0,0 +1,11 @@
+/*
+ =require twitter-bootstrap-static/bootstrap
+
+ Use Font Awesome icons (default)
+ To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites"
+ =require twitter-bootstrap-static/fontawesome
+ */
+
+body > .container {
+ margin-top: 20px;
+}
View
29 app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -1,29 +0,0 @@
-@import "twitter/bootstrap/bootstrap";
-body { padding-top: 60px; }
-
-@import "twitter/bootstrap/responsive";
-
-// Set the correct sprite paths
-@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
-@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
-
-// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
-@fontAwesomeEotPath: asset-path('fontawesome-webfont.eot');
-@fontAwesomeWoffPath: asset-path('fontawesome-webfont.woff');
-@fontAwesomeTtfPath: asset-path('fontawesome-webfont.ttf');
-@fontAwesomeSvgzPath: asset-path('fontawesome-webfont.svgz');
-@fontAwesomeSvgPath: asset-path('fontawesome-webfont.svg');
-
-// Font Awesome
-@import "fontawesome";
-
-// Your custom LESS stylesheets goes here
-//
-// Since bootstrap was imported above you have access to its mixins which
-// you may use and inherit here
-//
-// If you'd like to override bootstrap's own variables, you can do so here as well
-// See http://twitter.github.com/bootstrap/less.html for their names and documentation
-//
-// Example:
-// @linkColor: #ff0000;
View
9 app/controllers/votes_controller.rb
@@ -6,4 +6,13 @@ def new
@vote.status = params[:status] if params[:status]
@vote.save
end
+
+ def destroy
+ @song = Song.find params[:song_id]
+
+ @vote = Vote.find params[:id]
+ @vote.destroy
+
+ render action: :new
+ end
end
View
53 app/views/layouts/application.html.erb
@@ -6,7 +6,6 @@
<title><%= content_for?(:title) ? yield(:title) : "Deej" %></title>
<%= csrf_meta_tags %>
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
@@ -20,21 +19,13 @@
</head>
<body>
- <div class="navbar navbar-fixed-top">
+ <div class="navbar navbar-inverse navbar-static-top">
<div class="navbar-inner">
- <div class="container">
- <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
+ <div class="container">
<a class="brand" href="/">Deej</a>
- <div class="container nav-collapse">
- <!-- <ul class="nav">
- <li><%= link_to "Home", "/" %></li>
- </ul> -->
- <form class="navbar-search pull-left">
+ <div class="container nav-collapse">
+ <form class="navbar-search pull-right">
<input type="text" class="search-query" placeholder="Search">
<i id="cancel-search" class="icon-remove"></i>
</form>
@@ -46,31 +37,23 @@
<div class="container">
<div class="content">
<div class="row">
- <div class="span9">
- <%= yield %>
- </div>
- <div class="span3">
- <div class="well" style="text-align: center">
- <a href="<%= CONFIG['icecast']['full_url'] %>" class="btn btn-success btn-large">
- Click here to listen!
- </a>
- </div>
- <div id="queue" class="well">
- <%= render 'songs/queue' %>
- </div><!--/.well -->
- </div><!--/span-->
+ <div class="span9">
+ <%= yield %>
+ </div>
+ <div class="span3">
+ <div class="well" style="text-align: center">
+ <a href="<%= CONFIG['icecast']['full_url'] %>" class="btn btn-success btn-large">
+ Click here to listen!
+ </a>
+ </div>
+ <div id="queue" class="well">
+ <%= render 'songs/queue' %>
+ </div><!--/.well -->
+ </div><!--/span-->
</div><!--/row-->
</div><!--/content-->
+ </div><!-- /container -->
- <footer>
- <p>&copy; Company 2012</p>
- </footer>
-
- </div> <!-- /container -->
-
- <!-- Javascripts
- ================================================== -->
- <!-- Placed at the end of the document so the pages load faster -->
<%= javascript_include_tag "application" %>
</body>
</html>
View
4 app/views/songs/_song.html.erb
@@ -3,8 +3,8 @@
<td><%= link_to song.title, download_song_path(song) %></td>
<td><%= format_time song.length %></td>
<td>
- <% if song.votes.active.where(ip: request.remote_ip).count > 0 %>
- <span class="label label-info">You voted for this song!</span>
+ <% if vote = song.votes.active.where(ip: request.remote_ip).first %>
+ <%= link_to 'Remove your vote', song_vote_path(song, vote), method: :delete, remote: true, class: 'btn btn-mini btn-danger vote' %>
<% elsif song.votes.skips.where(ip: request.remote_ip).count > 0 %>
<span class="label label-warning">You voted to skip this song!</span>
<% elsif song.playing? %>
View
3  app/views/votes/new.js.erb
@@ -1,6 +1,5 @@
<% if @vote %>
$('#queue').html('<%= escape_javascript(render 'songs/queue') %>');
$('#song_'+<%= @song.id %>).replaceWith('<%= escape_javascript(render partial: 'songs/song', object: @song) %>');
-<% else %>
-
+ highlight_selected_song();
<% end %>

No commit comments for this range

Something went wrong with that request. Please try again.