refinerycms-music 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- en:
1
+ fr:
2
2
  plugins:
3
3
  music:
4
4
  title: Musique
@@ -0,0 +1,47 @@
1
+ class CreateMusic < ActiveRecord::Migration
2
+
3
+ def self.up
4
+
5
+ create_table :songs do |t|
6
+ t.string :title
7
+ t.string :artist
8
+ t.text :description
9
+ t.boolean :published, :default => true
10
+ t.boolean :show_download_link, :default => true
11
+ t.integer :resource_id
12
+ t.integer :position
13
+
14
+ t.timestamps
15
+ end
16
+
17
+ add_index :songs, :id
18
+ add_index :songs, [:id, :published]
19
+
20
+ create_table :music_settings do |t|
21
+ t.string :name
22
+ t.boolean :value
23
+ t.string :color
24
+ t.integer :size
25
+ t.string :description
26
+ t.datetime :created_at
27
+ t.datetime :updated_at
28
+
29
+ t.timestamps
30
+ end
31
+
32
+ add_index :music_settings, :id
33
+ add_index :music_settings, :name
34
+
35
+ load(Rails.root.join('db', 'seeds', 'music.rb'))
36
+ end
37
+
38
+ def self.down
39
+ UserPlugin.destroy_all({:name => "music"})
40
+
41
+ Page.delete_all({:link_url => "/music"})
42
+
43
+ drop_table :songs
44
+ drop_table :music_settings
45
+ end
46
+
47
+ end
data/db/seeds/music.rb ADDED
@@ -0,0 +1,44 @@
1
+ # colors
2
+ MusicSetting.create(:name => "bg", :color => "E5E5E5", :description => "Background")
3
+ MusicSetting.create(:name => "leftbg", :color => "CCCCCC", :description => "Speaker icon/Volume control background")
4
+ MusicSetting.create(:name => "lefticon", :color => "333333", :description => "Speaker icon")
5
+ MusicSetting.create(:name => "voltrack", :color => "F2F2F2", :description => "Volume track")
6
+ MusicSetting.create(:name => "volslider", :color => "666666", :description => "Volume slider")
7
+ MusicSetting.create(:name => "rightbg", :color => "B4B4B4", :description => "Play/Pause button background")
8
+ MusicSetting.create(:name => "rightbghover", :color => "999999", :description => "Play/Pause button background (hover state)")
9
+ MusicSetting.create(:name => "righticon", :color => "333333", :description => "Play/Pause icon")
10
+ MusicSetting.create(:name => "righticonhover", :color => "FFFFFF", :description => "Play/Pause icon (hover state)")
11
+ MusicSetting.create(:name => "loader", :color => "009900", :description => "Loading bar")
12
+ MusicSetting.create(:name => "track", :color => "FFFFFF", :description => "Loading/Progress bar track backgrounds")
13
+ MusicSetting.create(:name => "tracker", :color => "DDDDDD", :description => "Progress track")
14
+ MusicSetting.create(:name => "border", :color => "CCCCCC", :description => "Progress bar border")
15
+ MusicSetting.create(:name => "skip", :color => "666666", :description => "Previous/Next skip buttons, only if you modify the plugin to build a playlist.")
16
+ MusicSetting.create(:name => "text", :color => "333333", :description => "Text")
17
+
18
+ # size
19
+ width = MusicSetting.create(:name => "width", :size => 290, :description => "Width of the player")
20
+
21
+ # Boolean
22
+ MusicSetting.create(:name => "autostart", :value => true, :description => "if true, player starts automatically")
23
+ MusicSetting.create(:name => "loop_track", :value => false, :description => "if true, player loops")
24
+ MusicSetting.create(:name => "animation", :value => false, :description => "if false, player is always open")
25
+ MusicSetting.create(:name => "remaining", :value => false, :description => "if true, shows remaining track time rather than ellapsed time")
26
+ MusicSetting.create(:name => "noinfo", :value => false, :description => "if true, disables the track information display")
27
+
28
+ User.find(:all).each do |user|
29
+ if user.plugins.find_by_name('music').nil?
30
+ user.plugins.create(:name => 'music',
31
+ :position => (user.plugins.maximum(:position) || -1) +1)
32
+ end
33
+ end
34
+
35
+ page = Page.create(
36
+ :title => 'Music',
37
+ :link_url => '/music',
38
+ :deletable => false,
39
+ :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
40
+ :menu_match => '^/music(\/|\/.+?|)$'
41
+ )
42
+ Page.default_parts.each do |default_page_part|
43
+ page.parts.create(:title => default_page_part, :body => nil)
44
+ end
@@ -1,4 +1,6 @@
1
- class RefinerycmsMusic < Refinery::Generators::EngineInstaller
1
+ require 'refinery/generators'
2
+
3
+ class RefinerycmsMusicGenerator < Refinery::Generators::EngineInstaller
2
4
 
3
5
  source_root File.expand_path('../../../', __FILE__)
4
6
  engine_name "music"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-music
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors: []
13
13
 
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-17 00:00:00 -07:00
18
+ date: 2011-05-22 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -55,6 +55,8 @@ files:
55
55
  - app/views/admin/songs/new.html.erb
56
56
  - app/views/songs/index.html.erb
57
57
  - app/views/songs/show.html.erb
58
+ - db/migrate/1_create_music.rb
59
+ - db/seeds/music.rb
58
60
  has_rdoc: true
59
61
  homepage: http://github.com/unixcharles/refinerycms-music
60
62
  licenses: