mix-rails 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -4
- data/MIX_RAILS_VERSION +1 -1
- data/README.md +15 -8
- data/admix/app/assets/javascripts/admix/application.js.coffee +13 -4
- data/admix/app/assets/javascripts/admix/tipsy_init.js.coffee +3 -0
- data/admix/app/assets/stylesheets/admix/admix_bootstrap.scss +1 -0
- data/admix/app/assets/stylesheets/admix/application.css +3 -1
- data/admix/lib/admix/version.rb +1 -1
- data/mix-rails-albums/app/assets/javascripts/backbone/models/photo.js.coffee +33 -1
- data/mix-rails-albums/app/assets/javascripts/backbone/routers/photos_router.js.coffee +3 -3
- data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/thumbnail.hamlc.erb +5 -3
- data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/thumbnail_view.js.coffee +18 -10
- data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/upload_index_view.js.coffee +1 -0
- data/mix-rails-albums/app/assets/javascripts/photos/upload.js.coffee.erb +19 -16
- data/mix-rails-albums/app/assets/javascripts/views/fileview.js +0 -1
- data/mix-rails-albums/app/controllers/admix/photos_controller.rb +6 -3
- data/mix-rails-albums/app/models/album.rb +1 -3
- data/mix-rails-albums/app/uploaders/albums/image_uploader.rb +1 -1
- data/mix-rails-albums/lib/mix-rails-albums/version.rb +1 -1
- data/mix-rails-auth/lib/mix-rails-auth/version.rb +1 -1
- data/mix-rails-core/app/controllers/mix_controller.rb +2 -0
- data/mix-rails-core/app/views/{application → mix}/_title.html.haml +0 -0
- data/mix-rails-core/lib/mix-rails-core/version.rb +1 -1
- data/mix-rails-core/lib/mix-rails-core.rb +3 -0
- data/mix-rails-core/mix-rails-core.gemspec +43 -41
- data/mix-rails-message-board/lib/mix-rails-message-board/version.rb +1 -1
- data/mix-rails-settings/lib/mix-rails-settings/version.rb +1 -1
- data/mix-rails-songs/app/controllers/songs_controller.rb +14 -1
- data/mix-rails-songs/app/views/songs/player.haml +1 -1
- data/mix-rails-songs/config/routes.rb +2 -1
- data/mix-rails-songs/lib/mix-rails-songs/version.rb +1 -1
- data/mix-rails-videos/lib/mix-rails-videos/version.rb +1 -1
- data/mix-rails-vouchers/lib/mix-rails-vouchers/version.rb +1 -1
- data/mix-rails-wireframe/.gitignore +7 -0
- data/mix-rails-wireframe/Gemfile +17 -0
- data/mix-rails-wireframe/MIT-LICENSE +20 -0
- data/mix-rails-wireframe/README.rdoc +3 -0
- data/mix-rails-wireframe/Rakefile +27 -0
- data/mix-rails-wireframe/app/assets/images/mix-rails-wireframe/.gitkeep +0 -0
- data/mix-rails-wireframe/app/assets/javascripts/mix-rails-wireframe/.gitkeep +0 -0
- data/mix-rails-wireframe/app/assets/javascripts/mix-rails-wireframe.js.coffee +0 -0
- data/mix-rails-wireframe/app/assets/stylesheets/mix-rails-wireframe/.gitkeep +0 -0
- data/mix-rails-wireframe/app/assets/stylesheets/mix-rails-wireframe.sass +1 -0
- data/mix-rails-wireframe/app/controllers/.gitkeep +0 -0
- data/mix-rails-wireframe/app/controllers/wireframe_controller.rb +11 -0
- data/mix-rails-wireframe/app/helpers/.gitkeep +0 -0
- data/mix-rails-wireframe/app/helpers/wireframe_helper.rb +12 -0
- data/mix-rails-wireframe/app/mailers/.gitkeep +0 -0
- data/mix-rails-wireframe/app/models/.gitkeep +0 -0
- data/mix-rails-wireframe/app/views/.gitkeep +0 -0
- data/mix-rails-wireframe/app/views/layouts/wireframe.haml +14 -0
- data/mix-rails-wireframe/app/views/wireframe/home.haml +2 -0
- data/mix-rails-wireframe/config/routes.rb +7 -0
- data/mix-rails-wireframe/lib/mix-rails-wireframe/engine.rb +4 -0
- data/mix-rails-wireframe/lib/mix-rails-wireframe/version.rb +10 -0
- data/mix-rails-wireframe/lib/mix-rails-wireframe.rb +4 -0
- data/mix-rails-wireframe/lib/tasks/mix-rails-wireframe_tasks.rake +4 -0
- data/mix-rails-wireframe/mix-rails-wireframe.gemspec +19 -0
- data/mix-rails-wireframe/script/rails +8 -0
- data/mix-rails-wireframe/spec/dummy/README.rdoc +261 -0
- data/mix-rails-wireframe/spec/dummy/Rakefile +7 -0
- data/mix-rails-wireframe/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/mix-rails-wireframe/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/mix-rails-wireframe/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/mix-rails-wireframe/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/mix-rails-wireframe/spec/dummy/app/mailers/.gitkeep +0 -0
- data/mix-rails-wireframe/spec/dummy/app/models/.gitkeep +0 -0
- data/mix-rails-wireframe/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/mix-rails-wireframe/spec/dummy/config/application.rb +65 -0
- data/mix-rails-wireframe/spec/dummy/config/boot.rb +10 -0
- data/mix-rails-wireframe/spec/dummy/config/environment.rb +5 -0
- data/mix-rails-wireframe/spec/dummy/config/environments/development.rb +31 -0
- data/mix-rails-wireframe/spec/dummy/config/environments/production.rb +64 -0
- data/mix-rails-wireframe/spec/dummy/config/environments/test.rb +35 -0
- data/mix-rails-wireframe/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/mix-rails-wireframe/spec/dummy/config/initializers/inflections.rb +15 -0
- data/mix-rails-wireframe/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/mix-rails-wireframe/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/mix-rails-wireframe/spec/dummy/config/initializers/session_store.rb +8 -0
- data/mix-rails-wireframe/spec/dummy/config/initializers/wrap_parameters.rb +10 -0
- data/mix-rails-wireframe/spec/dummy/config/locales/en.yml +5 -0
- data/mix-rails-wireframe/spec/dummy/config/routes.rb +58 -0
- data/mix-rails-wireframe/spec/dummy/config.ru +4 -0
- data/mix-rails-wireframe/spec/dummy/lib/assets/.gitkeep +0 -0
- data/mix-rails-wireframe/spec/dummy/log/.gitkeep +0 -0
- data/mix-rails-wireframe/spec/dummy/public/404.html +26 -0
- data/mix-rails-wireframe/spec/dummy/public/422.html +26 -0
- data/mix-rails-wireframe/spec/dummy/public/500.html +25 -0
- data/mix-rails-wireframe/spec/dummy/public/favicon.ico +0 -0
- data/mix-rails-wireframe/spec/dummy/script/rails +6 -0
- data/mix-rails-writer/lib/mix-rails-writer/version.rb +1 -1
- data/mix-rails.gemspec +19 -14
- data/version.rb +1 -1
- metadata +132 -38
- data/admix/app/assets/javascripts/admix/tipsy_init.js +0 -5
- data/admix/app/assets/stylesheets/admix/bootstrap.min.css +0 -868
- data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/edit.jst.ejs +0 -20
- data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/index.jst.ejs +0 -15
- data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/modal.hamlc.erb +0 -14
- data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/new.jst.ejs +0 -20
- data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/photo.jst.ejs +0 -6
- data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/show.jst.ejs +0 -12
- data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/edit_view.js.coffee +0 -24
- data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/index_view.js.coffee +0 -20
- data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/new_view.js.coffee +0 -37
- data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/photo_view.js.coffee +0 -19
- data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/show_view.js.coffee +0 -8
data/Gemfile
CHANGED
data/MIX_RAILS_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.16.0
|
data/README.md
CHANGED
@@ -5,23 +5,24 @@
|
|
5
5
|
|
6
6
|
MixRails is a CMS based on Ruby on Rails and uses Mongoid as ORM(MongoDB).
|
7
7
|
|
8
|
-
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Create a new rails project.
|
12
|
+
|
13
|
+
$ rails new myproject -T --skip-active-record --skip-bundle --dummy-path=spec/dummy
|
9
14
|
|
10
15
|
Add this line to your application's Gemfile:
|
11
16
|
|
12
17
|
gem 'mix-rails'
|
13
18
|
|
14
19
|
And then execute:
|
15
|
-
|
20
|
+
|
21
|
+
$ cd myproject
|
16
22
|
$ bundle
|
17
23
|
|
18
|
-
## Usage
|
19
24
|
|
20
|
-
|
21
|
-
|
22
|
-
$ rails new myproject -T --skip-active-record --skip-bundle --dummy-path=spec/dummy
|
23
|
-
|
24
|
-
In your config/application.rb add these after rails's requires.
|
25
|
+
In your config/application.rb add require 'mix-rails/all'.
|
25
26
|
|
26
27
|
```ruby
|
27
28
|
require "action_controller/railtie"
|
@@ -78,3 +79,9 @@ Admix::namespace_path = "myadminpath"
|
|
78
79
|
TODO: Add some docs for admix
|
79
80
|
|
80
81
|
[![Admix](http://img233.imageshack.us/img233/6731/screenshotfrom201301221.png)]
|
82
|
+
|
83
|
+
# Plugins (Extensions)
|
84
|
+
|
85
|
+
## Creatig a extensions
|
86
|
+
|
87
|
+
$ rails plugin new mix-rails-pluginame -T --skip-active-record --skip-bundle --dummy-path=spec/dummy --full
|
@@ -2,19 +2,28 @@
|
|
2
2
|
#= require jquery_ujs
|
3
3
|
#= require underscore
|
4
4
|
#= require backbone
|
5
|
-
#= require backbone_rails_sync
|
6
|
-
#= require backbone_datalink
|
7
5
|
#= require jquery/jquery.livequery
|
8
6
|
#= require fancybox
|
9
7
|
#= require jquery.ui.datepicker
|
10
|
-
#= require
|
8
|
+
#= require bootstrap
|
11
9
|
#= require ./dates
|
12
10
|
#= require ../../nicedit/nicEdit
|
13
11
|
#= require ./nicedit_applier
|
14
12
|
#= require ../../tipsy/src/javascripts/jquery.tipsy
|
15
|
-
|
13
|
+
# ./tipsy_init
|
14
|
+
#= require jquery.qtip.js
|
15
|
+
|
16
|
+
|
17
|
+
Backbone.emulateHTTP = true
|
16
18
|
|
17
19
|
$ ->
|
20
|
+
|
21
|
+
$(".actions [title]").livequery ->
|
22
|
+
$(this).qtip
|
23
|
+
content: $(this).attr("title") # Use the tooltip attribute of the element for the content
|
24
|
+
#style: "dark" # Give it a crea mstyle to make it stand out
|
25
|
+
style:
|
26
|
+
classes: 'qtip-bootstrap'
|
18
27
|
|
19
28
|
$('.fancybox').livequery ->
|
20
29
|
$(@).fancybox();
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "bootstrap";
|
data/admix/lib/admix/version.rb
CHANGED
@@ -11,7 +11,7 @@ class Application.Models.Photo extends Backbone.Model
|
|
11
11
|
|
12
12
|
onAdd: ->
|
13
13
|
xhr = new XMLHttpRequest()
|
14
|
-
xhr.open "POST", @url
|
14
|
+
xhr.open "POST", @url()
|
15
15
|
datas = new FormData()
|
16
16
|
datas.append "image", @get("image")
|
17
17
|
xhr.upload.addEventListener "progress", (e) =>
|
@@ -25,6 +25,7 @@ class Application.Models.Photo extends Backbone.Model
|
|
25
25
|
@trigger "uploadCompleted"
|
26
26
|
if xhr.responseText
|
27
27
|
responseObject = JSON.parse(xhr.responseText)
|
28
|
+
console.log responseObject
|
28
29
|
@set responseObject
|
29
30
|
else
|
30
31
|
console.log "Não foi possível enviar o arquivo"
|
@@ -37,3 +38,34 @@ class Application.Collections.PhotosCollection extends Backbone.Collection
|
|
37
38
|
model: Application.Models.Photo
|
38
39
|
url: '/photos'
|
39
40
|
|
41
|
+
setFromFiles: (files) ->
|
42
|
+
@reset()
|
43
|
+
i = 0
|
44
|
+
while f = files[i]
|
45
|
+
reader = new FileReader()
|
46
|
+
reader.onload = ((theFile, theId) =>
|
47
|
+
(e) ->
|
48
|
+
photo = new Application.Models.Photo()
|
49
|
+
photo.set id: theId
|
50
|
+
photo.set filename: theFile.name
|
51
|
+
photo.set image: e.target.result
|
52
|
+
@add photo
|
53
|
+
)(f)
|
54
|
+
reader.readAsDataURL f, i
|
55
|
+
i++
|
56
|
+
|
57
|
+
addFromFiles: (files) ->
|
58
|
+
i = 0
|
59
|
+
while f = files[i]
|
60
|
+
reader = new FileReader()
|
61
|
+
reader.onload = ((theFile, theId) =>
|
62
|
+
(e) ->
|
63
|
+
photo = new Application.Models.Photo()
|
64
|
+
photo.set id: theId
|
65
|
+
photo.set filename: theFile.name
|
66
|
+
photo.set image: e.target.result
|
67
|
+
@add photo
|
68
|
+
)(f)
|
69
|
+
reader.readAsDataURL f, i
|
70
|
+
i++
|
71
|
+
|
@@ -32,6 +32,6 @@ class Application.Routers.PhotosRouter extends Backbone.Router
|
|
32
32
|
|
33
33
|
edit: (id) ->
|
34
34
|
photo = @photos.get(id)
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
console.log 'Editando a foto!' + photo
|
36
|
+
#@view = new Application.Views.Photos.EditView(model: photo)
|
37
|
+
#$("#upload-container").html(@view.render().el)
|
@@ -5,12 +5,14 @@
|
|
5
5
|
.loading-file
|
6
6
|
- if @image.url
|
7
7
|
%a.photo-link{href: "#"}
|
8
|
-
%img{src: ROOT_PATH + @image.
|
8
|
+
%img{src: ROOT_PATH + @image.medium.url}
|
9
9
|
- else
|
10
10
|
%img{src: "http://placehold.it/130x90&text=Carregando"}
|
11
11
|
-if (@progress != null && @progress < 100)
|
12
12
|
%div{class: (@progress < 100) ? 'progress progress-striped active' : 'progress'}
|
13
13
|
.bar{style: "width:#{@progress}%;"}
|
14
14
|
.caption
|
15
|
-
%a.file-action.destroy{href: "#"}
|
16
|
-
<%= image_tag "
|
15
|
+
%a.file-action.btn.destroy{href: "#", tooltip: 'Excluir'}
|
16
|
+
<%= image_tag "admix/icons/delete.png" %>
|
17
|
+
%a.file-action.btn.edit{href: "#", tooltip: 'Editar'}
|
18
|
+
<%= image_tag "admix/icons/picture_edit.png" %>
|
@@ -5,26 +5,34 @@ class Application.Views.Photos.PhotoView extends Backbone.View
|
|
5
5
|
|
6
6
|
events:
|
7
7
|
"click .destroy" : "destroy"
|
8
|
-
"click .
|
8
|
+
"click .edit": "edit",
|
9
9
|
|
10
10
|
tagName: "li"
|
11
|
-
className: '
|
11
|
+
className: 'span4'
|
12
12
|
|
13
13
|
initialize: ->
|
14
14
|
@model.on "change", @render, this
|
15
15
|
@model.on "uploadCompleted", @removeProgressBar, this
|
16
|
+
self = @
|
17
|
+
$(@el).find('a[tooltip]').livequery ->
|
18
|
+
$(this).qtip
|
19
|
+
content: $(this).attr("tooltip") # Use the tooltip attribute of the element for the content
|
20
|
+
#style: "dark" # Give it a crea mstyle to make it stand out
|
21
|
+
style:
|
22
|
+
classes: "qtip-bootstrap qtip-#{self.model.get('id')}"
|
16
23
|
|
17
24
|
removeProgressBar: ->
|
18
25
|
@$el.find(".progress").fadeOut() unless @$el is undefined
|
19
26
|
|
20
|
-
destroy:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
destroy: ->
|
28
|
+
if confirm('Tem certeza que deseja deletar?')
|
29
|
+
@model.destroy()
|
30
|
+
this.remove()
|
31
|
+
$(".qtip-#{@model.get('id')}").remove()
|
32
|
+
false
|
33
|
+
edit: () ->
|
34
|
+
Backbone.history.navigate("#/#{@model.id}/edit")
|
35
|
+
false
|
28
36
|
render: ->
|
29
37
|
@$el.html(@template(@model.toJSON() ))
|
30
38
|
return this
|
@@ -4,21 +4,24 @@
|
|
4
4
|
<% url = Rails.application.routes.url_helpers %>
|
5
5
|
$ ->
|
6
6
|
$.getJSON RESOURCE_PATH,(json) ->
|
7
|
-
new Application.Routers.PhotosRouter(collectionUrl: RESOURCE_PATH, photos: json)
|
7
|
+
window.photos_router = new Application.Routers.PhotosRouter(collectionUrl: RESOURCE_PATH, photos: json)
|
8
8
|
Backbone.history.start()
|
9
9
|
|
10
|
-
$("#uploader").
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
10
|
+
$("#uploader").livequery ->
|
11
|
+
$(@).change (el) ->
|
12
|
+
#photos_router.addFromFiles(el.currentTarget.files)
|
13
|
+
files = el.currentTarget.files
|
14
|
+
console.log "Files count: #{files.length}"
|
15
|
+
i = 0
|
16
|
+
while i < files.length
|
17
|
+
|
18
|
+
photo = new Application.Models.Photo(
|
19
|
+
image: files[i]
|
20
|
+
name: files[i].name
|
21
|
+
)
|
22
|
+
((photo) ->
|
23
|
+
setTimeout ->
|
24
|
+
photos_router.photos.add photo
|
25
|
+
, 1000
|
26
|
+
)(photo)
|
27
|
+
i++
|
@@ -1,5 +1,10 @@
|
|
1
|
-
class Admix::PhotosController < Admix::
|
1
|
+
class Admix::PhotosController < Admix::AdmixController
|
2
2
|
|
3
|
+
respond_to :json
|
4
|
+
respond_to :html, :only => [:upload, :index, :destroy]
|
5
|
+
|
6
|
+
inherit_resources
|
7
|
+
|
3
8
|
before_filter :image_param
|
4
9
|
|
5
10
|
polymorphic_belongs_to :album, param: :album_id
|
@@ -8,8 +13,6 @@ class Admix::PhotosController < Admix::InheritedController
|
|
8
13
|
# load_and_authorize_resource :photo, :through => :album_id
|
9
14
|
skip_load_and_authorize_resource
|
10
15
|
|
11
|
-
respond_to :json
|
12
|
-
|
13
16
|
def upload
|
14
17
|
render inline: params.to_s
|
15
18
|
end
|
@@ -2,7 +2,6 @@ class Album
|
|
2
2
|
|
3
3
|
include Mongoid::Document
|
4
4
|
include Mongoid::Timestamps
|
5
|
-
include Mongoid::Paranoia
|
6
5
|
include Mongoid::Slug
|
7
6
|
|
8
7
|
field :name, type: String
|
@@ -22,8 +21,7 @@ class Album
|
|
22
21
|
|
23
22
|
embeds_many :photos, cascade_callbacks: true
|
24
23
|
|
25
|
-
|
26
|
-
scope :published, where(published: true)
|
24
|
+
scope :published, where(published: true, :photos.ne => nil, :photos.exists => true)
|
27
25
|
|
28
26
|
|
29
27
|
end
|
File without changes
|
@@ -1,58 +1,60 @@
|
|
1
1
|
$:.push File.expand_path("../lib", __FILE__)
|
2
2
|
# Maintain your gem's version:
|
3
|
-
version = File.read(File.expand_path(
|
3
|
+
version = File.read(File.expand_path("../../MIX_RAILS_VERSION", __FILE__)).strip
|
4
4
|
|
5
5
|
# Describe your gem and declare its dependencies:
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "mix-rails-core"
|
8
|
+
gem.version = version
|
9
|
+
gem.authors = ["Sadjow Leão"]
|
10
|
+
gem.email = ["sadjow@gmail.com"]
|
11
|
+
gem.homepage = "https://github.com/mixinternet/mix-rails"
|
12
|
+
gem.summary = "This is the core of the mix-rails"
|
13
|
+
gem.description = "This is the core of the mix-rails"
|
14
14
|
|
15
|
-
|
15
|
+
gem.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
|
16
16
|
|
17
|
-
|
17
|
+
gem.add_dependency "rails", "~> 3.2.9"
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
gem.add_dependency "mail_form", "~> 1.4.0"
|
20
|
+
gem.add_dependency "simple_form", "~> 2.0.0"
|
21
21
|
|
22
|
-
|
22
|
+
gem.add_dependency "enumerize"
|
23
23
|
|
24
|
-
|
24
|
+
gem.add_dependency "activevalidators"
|
25
25
|
|
26
|
-
|
26
|
+
gem.add_dependency "i18n_routing"
|
27
27
|
|
28
|
-
|
28
|
+
gem.add_dependency "rails-i18n"
|
29
29
|
|
30
|
-
|
30
|
+
gem.add_dependency "mongoid"
|
31
31
|
# mongoid should be loaded before cancan
|
32
|
-
|
32
|
+
gem.add_dependency "cancan"
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
gem.add_dependency "mongoid_slug"
|
35
|
+
gem.add_dependency "bson_ext"
|
36
|
+
gem.add_dependency "mongo"
|
37
|
+
gem.add_dependency "carrierwave-mongoid"
|
38
|
+
gem.add_dependency "mini_magick"
|
39
|
+
gem.add_dependency "haml_coffee_assets"
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
#
|
41
|
+
gem.add_dependency "rspec-rails"
|
42
|
+
gem.add_dependency "database_cleaner"
|
43
|
+
|
44
|
+
gem.add_dependency "breadcrumbs"
|
45
|
+
gem.add_dependency "simple-navigation"
|
46
|
+
gem.add_dependency "simple-navigation-bootstrap"
|
47
|
+
gem.add_dependency "datagrid", "~> 0.7.0"
|
48
|
+
gem.add_dependency "will_paginate_mongoid"
|
49
|
+
|
50
|
+
gem.add_dependency "jquery-rails"
|
51
|
+
gem.add_dependency "jquery-ui-rails"
|
52
|
+
|
53
|
+
gem.add_dependency "coffee-script"
|
54
|
+
gem.add_dependency "coffee-filter"
|
55
|
+
gem.add_dependency "rails-backbone"
|
56
|
+
#gem.add_dependency "sass-rails"
|
57
|
+
|
58
|
+
gem.add_dependency "jquery-qtip2-rails", "~> 0.4.0"
|
57
59
|
|
58
60
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class SongsController < ApplicationController
|
2
|
-
|
2
|
+
|
3
3
|
def index
|
4
4
|
|
5
5
|
@songs = Song.published.all
|
@@ -7,9 +7,22 @@ class SongsController < ApplicationController
|
|
7
7
|
respond_to do |format|
|
8
8
|
format.json { render json: @songs }
|
9
9
|
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
def shuffled
|
14
|
+
|
15
|
+
@songs = Song.published.all.shuffle
|
16
|
+
|
17
|
+
respond_to do |format|
|
18
|
+
format.json { render json: @songs }
|
19
|
+
end
|
20
|
+
|
10
21
|
end
|
11
22
|
|
12
23
|
def player
|
24
|
+
@shuffled = params[:shuffled] || false
|
25
|
+
@songs_api = @shuffled ? shuffled_songs_path(:json) : songs_path(:json)
|
13
26
|
render layout: false
|
14
27
|
end
|
15
28
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
$("#jquery_jplayer_1").bind $.jPlayer.event.pause, (event, par2) ->
|
30
30
|
|
31
|
-
$.getJSON "#{
|
31
|
+
$.getJSON "#{@songs_api}", (songs) =>
|
32
32
|
new jPlayerPlaylist(
|
33
33
|
jPlayer: "#jquery_jplayer_1"
|
34
34
|
cssSelectorAncestor: "#jp_container_1"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
# Declare your gem's dependencies in mix-rails-wireframe.gemspec.
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
+
# development dependencies will be added by default to the :development group.
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
# jquery-rails is used by the dummy application
|
9
|
+
gem "jquery-rails"
|
10
|
+
|
11
|
+
# Declare any dependencies that are still in development here instead of in
|
12
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
13
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
14
|
+
# your gem to rubygems.org.
|
15
|
+
|
16
|
+
# To use debugger
|
17
|
+
# gem 'debugger'
|