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.
Files changed (107) hide show
  1. data/Gemfile +1 -4
  2. data/MIX_RAILS_VERSION +1 -1
  3. data/README.md +15 -8
  4. data/admix/app/assets/javascripts/admix/application.js.coffee +13 -4
  5. data/admix/app/assets/javascripts/admix/tipsy_init.js.coffee +3 -0
  6. data/admix/app/assets/stylesheets/admix/admix_bootstrap.scss +1 -0
  7. data/admix/app/assets/stylesheets/admix/application.css +3 -1
  8. data/admix/lib/admix/version.rb +1 -1
  9. data/mix-rails-albums/app/assets/javascripts/backbone/models/photo.js.coffee +33 -1
  10. data/mix-rails-albums/app/assets/javascripts/backbone/routers/photos_router.js.coffee +3 -3
  11. data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/thumbnail.hamlc.erb +5 -3
  12. data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/thumbnail_view.js.coffee +18 -10
  13. data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/upload_index_view.js.coffee +1 -0
  14. data/mix-rails-albums/app/assets/javascripts/photos/upload.js.coffee.erb +19 -16
  15. data/mix-rails-albums/app/assets/javascripts/views/fileview.js +0 -1
  16. data/mix-rails-albums/app/controllers/admix/photos_controller.rb +6 -3
  17. data/mix-rails-albums/app/models/album.rb +1 -3
  18. data/mix-rails-albums/app/uploaders/albums/image_uploader.rb +1 -1
  19. data/mix-rails-albums/lib/mix-rails-albums/version.rb +1 -1
  20. data/mix-rails-auth/lib/mix-rails-auth/version.rb +1 -1
  21. data/mix-rails-core/app/controllers/mix_controller.rb +2 -0
  22. data/mix-rails-core/app/views/{application → mix}/_title.html.haml +0 -0
  23. data/mix-rails-core/lib/mix-rails-core/version.rb +1 -1
  24. data/mix-rails-core/lib/mix-rails-core.rb +3 -0
  25. data/mix-rails-core/mix-rails-core.gemspec +43 -41
  26. data/mix-rails-message-board/lib/mix-rails-message-board/version.rb +1 -1
  27. data/mix-rails-settings/lib/mix-rails-settings/version.rb +1 -1
  28. data/mix-rails-songs/app/controllers/songs_controller.rb +14 -1
  29. data/mix-rails-songs/app/views/songs/player.haml +1 -1
  30. data/mix-rails-songs/config/routes.rb +2 -1
  31. data/mix-rails-songs/lib/mix-rails-songs/version.rb +1 -1
  32. data/mix-rails-videos/lib/mix-rails-videos/version.rb +1 -1
  33. data/mix-rails-vouchers/lib/mix-rails-vouchers/version.rb +1 -1
  34. data/mix-rails-wireframe/.gitignore +7 -0
  35. data/mix-rails-wireframe/Gemfile +17 -0
  36. data/mix-rails-wireframe/MIT-LICENSE +20 -0
  37. data/mix-rails-wireframe/README.rdoc +3 -0
  38. data/mix-rails-wireframe/Rakefile +27 -0
  39. data/mix-rails-wireframe/app/assets/images/mix-rails-wireframe/.gitkeep +0 -0
  40. data/mix-rails-wireframe/app/assets/javascripts/mix-rails-wireframe/.gitkeep +0 -0
  41. data/mix-rails-wireframe/app/assets/javascripts/mix-rails-wireframe.js.coffee +0 -0
  42. data/mix-rails-wireframe/app/assets/stylesheets/mix-rails-wireframe/.gitkeep +0 -0
  43. data/mix-rails-wireframe/app/assets/stylesheets/mix-rails-wireframe.sass +1 -0
  44. data/mix-rails-wireframe/app/controllers/.gitkeep +0 -0
  45. data/mix-rails-wireframe/app/controllers/wireframe_controller.rb +11 -0
  46. data/mix-rails-wireframe/app/helpers/.gitkeep +0 -0
  47. data/mix-rails-wireframe/app/helpers/wireframe_helper.rb +12 -0
  48. data/mix-rails-wireframe/app/mailers/.gitkeep +0 -0
  49. data/mix-rails-wireframe/app/models/.gitkeep +0 -0
  50. data/mix-rails-wireframe/app/views/.gitkeep +0 -0
  51. data/mix-rails-wireframe/app/views/layouts/wireframe.haml +14 -0
  52. data/mix-rails-wireframe/app/views/wireframe/home.haml +2 -0
  53. data/mix-rails-wireframe/config/routes.rb +7 -0
  54. data/mix-rails-wireframe/lib/mix-rails-wireframe/engine.rb +4 -0
  55. data/mix-rails-wireframe/lib/mix-rails-wireframe/version.rb +10 -0
  56. data/mix-rails-wireframe/lib/mix-rails-wireframe.rb +4 -0
  57. data/mix-rails-wireframe/lib/tasks/mix-rails-wireframe_tasks.rake +4 -0
  58. data/mix-rails-wireframe/mix-rails-wireframe.gemspec +19 -0
  59. data/mix-rails-wireframe/script/rails +8 -0
  60. data/mix-rails-wireframe/spec/dummy/README.rdoc +261 -0
  61. data/mix-rails-wireframe/spec/dummy/Rakefile +7 -0
  62. data/mix-rails-wireframe/spec/dummy/app/assets/javascripts/application.js +15 -0
  63. data/mix-rails-wireframe/spec/dummy/app/assets/stylesheets/application.css +13 -0
  64. data/mix-rails-wireframe/spec/dummy/app/controllers/application_controller.rb +3 -0
  65. data/mix-rails-wireframe/spec/dummy/app/helpers/application_helper.rb +2 -0
  66. data/mix-rails-wireframe/spec/dummy/app/mailers/.gitkeep +0 -0
  67. data/mix-rails-wireframe/spec/dummy/app/models/.gitkeep +0 -0
  68. data/mix-rails-wireframe/spec/dummy/app/views/layouts/application.html.erb +14 -0
  69. data/mix-rails-wireframe/spec/dummy/config/application.rb +65 -0
  70. data/mix-rails-wireframe/spec/dummy/config/boot.rb +10 -0
  71. data/mix-rails-wireframe/spec/dummy/config/environment.rb +5 -0
  72. data/mix-rails-wireframe/spec/dummy/config/environments/development.rb +31 -0
  73. data/mix-rails-wireframe/spec/dummy/config/environments/production.rb +64 -0
  74. data/mix-rails-wireframe/spec/dummy/config/environments/test.rb +35 -0
  75. data/mix-rails-wireframe/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  76. data/mix-rails-wireframe/spec/dummy/config/initializers/inflections.rb +15 -0
  77. data/mix-rails-wireframe/spec/dummy/config/initializers/mime_types.rb +5 -0
  78. data/mix-rails-wireframe/spec/dummy/config/initializers/secret_token.rb +7 -0
  79. data/mix-rails-wireframe/spec/dummy/config/initializers/session_store.rb +8 -0
  80. data/mix-rails-wireframe/spec/dummy/config/initializers/wrap_parameters.rb +10 -0
  81. data/mix-rails-wireframe/spec/dummy/config/locales/en.yml +5 -0
  82. data/mix-rails-wireframe/spec/dummy/config/routes.rb +58 -0
  83. data/mix-rails-wireframe/spec/dummy/config.ru +4 -0
  84. data/mix-rails-wireframe/spec/dummy/lib/assets/.gitkeep +0 -0
  85. data/mix-rails-wireframe/spec/dummy/log/.gitkeep +0 -0
  86. data/mix-rails-wireframe/spec/dummy/public/404.html +26 -0
  87. data/mix-rails-wireframe/spec/dummy/public/422.html +26 -0
  88. data/mix-rails-wireframe/spec/dummy/public/500.html +25 -0
  89. data/mix-rails-wireframe/spec/dummy/public/favicon.ico +0 -0
  90. data/mix-rails-wireframe/spec/dummy/script/rails +6 -0
  91. data/mix-rails-writer/lib/mix-rails-writer/version.rb +1 -1
  92. data/mix-rails.gemspec +19 -14
  93. data/version.rb +1 -1
  94. metadata +132 -38
  95. data/admix/app/assets/javascripts/admix/tipsy_init.js +0 -5
  96. data/admix/app/assets/stylesheets/admix/bootstrap.min.css +0 -868
  97. data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/edit.jst.ejs +0 -20
  98. data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/index.jst.ejs +0 -15
  99. data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/modal.hamlc.erb +0 -14
  100. data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/new.jst.ejs +0 -20
  101. data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/photo.jst.ejs +0 -6
  102. data/mix-rails-albums/app/assets/javascripts/backbone/templates/photos/show.jst.ejs +0 -12
  103. data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/edit_view.js.coffee +0 -24
  104. data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/index_view.js.coffee +0 -20
  105. data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/new_view.js.coffee +0 -37
  106. data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/photo_view.js.coffee +0 -19
  107. data/mix-rails-albums/app/assets/javascripts/backbone/views/photos/show_view.js.coffee +0 -8
data/Gemfile CHANGED
@@ -2,7 +2,4 @@ source 'https://rubygems.org'
2
2
  Encoding.default_external = Encoding::UTF_8
3
3
 
4
4
  # Specify your gem's dependencies in mix-rails.gemspec
5
- gemspec
6
-
7
-
8
- gem 'fancybox-rails'
5
+ gemspec
data/MIX_RAILS_VERSION CHANGED
@@ -1 +1 @@
1
- 0.15.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
- ## Installation
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
- Create a new rails project.
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 ../../bootstrap/js/bootstrap.min
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
- #= require ./tipsy_init
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,3 @@
1
+ $ ->
2
+ $("a[title]").livequery ->
3
+ $(this).tipsy gravity: "s"
@@ -0,0 +1 @@
1
+ @import "bootstrap";
@@ -12,7 +12,9 @@
12
12
  *= require jquery.ui.all
13
13
  *= require ../../tipsy/src/stylesheets/tipsy
14
14
  *= require fancybox
15
- *= require_tree .
15
+ *= require ./admix_bootstrap
16
+ *= require ./style
17
+ *= require jquery.qtip.css
16
18
  *= require_self
17
19
  */
18
20
 
@@ -1,7 +1,7 @@
1
1
  module Admix
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -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
- @view = new Application.Views.Photos.EditView(model: photo)
37
- $("#upload-container").html(@view.render().el)
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.thumb.url}
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 "albums/delete.png" %>
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 .photo-link": "photo_link",
8
+ "click .edit": "edit",
9
9
 
10
10
  tagName: "li"
11
- className: 'span2'
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
- @model.destroy()
22
- this.remove()
23
-
24
- return false
25
-
26
- photo_link: () ->
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
@@ -7,6 +7,7 @@ class Application.Views.Photos.UploadIndexView extends Backbone.View
7
7
 
8
8
  initialize: () ->
9
9
  @options.photos.bind('reset', @addAll)
10
+ @options.photos.bind('add', @addOne)
10
11
 
11
12
  addAll: () =>
12
13
  @options.photos.each(@addOne)
@@ -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").change (el) ->
11
- files = el.currentTarget.files
12
- i = 0
13
- while i < files.length
14
- photo = new Application.Models.Photo(
15
- image: files[i]
16
- name: files[i].name
17
- )
18
- photo.url = fileList.url
19
- fileList.add photo
20
- setTimeout (->
21
- fileList.add photo
22
- ), 1000
23
- i++
24
- fileListView.render()
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++
@@ -34,6 +34,5 @@ var FileView = Backbone.View.extend({
34
34
  },
35
35
  photo_link: function(e) {
36
36
  e.preventDefault();
37
- Backbone.history.navigate(":photo_id/ajax_edit".replace(':photo_id', this.model.get('id')), {trigger: true});
38
37
  }
39
38
  });
@@ -1,5 +1,10 @@
1
- class Admix::PhotosController < Admix::InheritedController
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
@@ -44,7 +44,7 @@ class Albums::ImageUploader < CarrierWave::Uploader::Base
44
44
  # version :thumb do
45
45
  # process :resize_to_fit => [80, 80]
46
46
  # end
47
-
47
+
48
48
  version :medium do
49
49
  process :resize_to_fill => [640,420]
50
50
  end
@@ -1,7 +1,7 @@
1
1
  module MixRailsAlbums
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -1,7 +1,7 @@
1
1
  module MixRailsAuth
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -7,4 +7,6 @@ class MixController < ActionController::Base
7
7
 
8
8
  helper :all
9
9
 
10
+ before_filter -> { breadcrumbs.add 'Home', index_path }
11
+
10
12
  end
@@ -1,7 +1,7 @@
1
1
  module MixRailsCore
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -38,5 +38,8 @@ require 'simple_form'
38
38
 
39
39
  require 'rails-backbone'
40
40
 
41
+ require 'bootstrap-sass'
42
+ require 'jquery-qtip2-rails'
43
+
41
44
  module MixRailsCore
42
45
  end
@@ -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('../../MIX_RAILS_VERSION', __FILE__)).strip
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 |s|
7
- s.name = "mix-rails-core"
8
- s.version = version
9
- s.authors = ["Sadjow Leão"]
10
- s.email = ["sadjow@gmail.com"]
11
- s.homepage = "https://github.com/mixinternet/mix-rails"
12
- s.summary = "This is the core of the mix-rails"
13
- s.description = "This is the core of the mix-rails"
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
- s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
15
+ gem.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
16
16
 
17
- s.add_dependency "rails", "~> 3.2.9"
17
+ gem.add_dependency "rails", "~> 3.2.9"
18
18
 
19
- s.add_dependency 'mail_form', '~> 1.4.0'
20
- s.add_dependency 'simple_form', '~> 2.0.0'
19
+ gem.add_dependency "mail_form", "~> 1.4.0"
20
+ gem.add_dependency "simple_form", "~> 2.0.0"
21
21
 
22
- s.add_dependency 'enumerize'
22
+ gem.add_dependency "enumerize"
23
23
 
24
- s.add_dependency "activevalidators"
24
+ gem.add_dependency "activevalidators"
25
25
 
26
- s.add_dependency "i18n_routing"
26
+ gem.add_dependency "i18n_routing"
27
27
 
28
- s.add_dependency "rails-i18n"
28
+ gem.add_dependency "rails-i18n"
29
29
 
30
- s.add_dependency 'mongoid'
30
+ gem.add_dependency "mongoid"
31
31
  # mongoid should be loaded before cancan
32
- s.add_dependency "cancan"
32
+ gem.add_dependency "cancan"
33
33
 
34
- s.add_dependency 'mongoid_slug'
35
- s.add_dependency 'bson_ext'
36
- s.add_dependency 'mongo'
37
- s.add_dependency 'carrierwave-mongoid'
38
- s.add_dependency 'mini_magick'
39
- s.add_dependency 'haml_coffee_assets'
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
- s.add_dependency 'rspec-rails'
42
- s.add_dependency 'database_cleaner'
43
-
44
- s.add_dependency 'breadcrumbs'
45
- s.add_dependency 'simple-navigation'
46
- s.add_dependency 'simple-navigation-bootstrap'
47
- s.add_dependency 'datagrid', '~> 0.7.0'
48
- s.add_dependency 'will_paginate_mongoid'
49
-
50
- s.add_dependency "jquery-rails"
51
- s.add_dependency "jquery-ui-rails"
52
-
53
- s.add_dependency "coffee-script"
54
- s.add_dependency "coffee-filter"
55
- s.add_dependency "rails-backbone"
56
- #s.add_dependency "sass-rails"
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,7 +1,7 @@
1
1
  module MixRailsMessageBoard
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -1,7 +1,7 @@
1
1
  module MixRailsSettings
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -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 "#{songs_path(:json)}", (songs) =>
31
+ $.getJSON "#{@songs_api}", (songs) =>
32
32
  new jPlayerPlaylist(
33
33
  jPlayer: "#jquery_jplayer_1"
34
34
  cssSelectorAncestor: "#jp_container_1"
@@ -1,9 +1,10 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
3
  localized do
4
- resources :songs do
4
+ resources :songs do
5
5
  collection do
6
6
  get :player
7
+ get :shuffled
7
8
  end
8
9
  end
9
10
  end
@@ -1,7 +1,7 @@
1
1
  module MixRailsSongs
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -1,7 +1,7 @@
1
1
  module MixRailsVideos
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -1,7 +1,7 @@
1
1
  module MixRailsVouchers
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
@@ -0,0 +1,7 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ spec/dummy/db/*.sqlite3
5
+ spec/dummy/log/*.log
6
+ spec/dummy/tmp/
7
+ spec/dummy/.sass-cache
@@ -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'