refinerycms-music 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/music_settings_controller.rb +14 -0
- data/app/controllers/admin/songs_controller.rb +6 -0
- data/app/controllers/songs_controller.rb +19 -0
- data/app/helpers/songs_helper.rb +63 -0
- data/app/models/music_setting.rb +70 -0
- data/app/models/song.rb +11 -0
- data/app/views/admin/music_settings/_form.html.erb +51 -0
- data/app/views/admin/music_settings/_music_setting.html.erb +30 -0
- data/app/views/admin/music_settings/edit.html.erb +1 -0
- data/app/views/admin/music_settings/index.html.erb +16 -0
- data/app/views/admin/songs/_form.html.erb +67 -0
- data/app/views/admin/songs/_song.html.erb +18 -0
- data/app/views/admin/songs/_songs.html.erb +2 -0
- data/app/views/admin/songs/_sortable_list.html.erb +7 -0
- data/app/views/admin/songs/edit.html.erb +1 -0
- data/app/views/admin/songs/index.html.erb +57 -0
- data/app/views/admin/songs/new.html.erb +1 -0
- data/app/views/songs/index.html.erb +11 -0
- data/app/views/songs/show.html.erb +40 -0
- data/config/locales/en.yml +24 -0
- data/config/locales/lolcat.yml +21 -0
- data/config/locales/nb.yml +21 -0
- data/config/locales/nl.yml +21 -0
- data/config/routes.rb +16 -0
- data/lib/generators/refinerycms_music_generator.rb +6 -0
- data/lib/refinerycms-music.rb +23 -0
- metadata +91 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
module Admin
|
2
|
+
class MusicSettingsController < Admin::BaseController
|
3
|
+
crudify :music_setting, :title_attribute => :name, :order => "id ASC", :searchable => false
|
4
|
+
|
5
|
+
def toggle
|
6
|
+
@music_setting = MusicSetting.find(params[:id])
|
7
|
+
@music_setting.toggle!(:value)
|
8
|
+
|
9
|
+
flash[:notice] = "Comment from '#{@music_setting.name}' has been set to '#{@music_setting.value ? 'true' : 'false'}'"
|
10
|
+
|
11
|
+
redirect_to :action => 'index'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class SongsController < ApplicationController
|
2
|
+
before_filter :find_page
|
3
|
+
|
4
|
+
def index
|
5
|
+
@songs = Song.published
|
6
|
+
end
|
7
|
+
|
8
|
+
def show
|
9
|
+
@songs = Song.published # for body_content_right
|
10
|
+
@song = Song.find(params[:id], :conditions => {:published => true})
|
11
|
+
end
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
def find_page
|
16
|
+
@page = Page.find_by_link_url("/music")
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module SongsHelper
|
2
|
+
def player(music)
|
3
|
+
flashvar = []
|
4
|
+
|
5
|
+
# colors
|
6
|
+
flashvar << "bg=#{MusicSetting.bg}" unless MusicSetting.bg == 'E5E5E5'
|
7
|
+
flashvar << "leftbg=#{MusicSetting.bg}" unless MusicSetting.leftbg == 'CCCCCC'
|
8
|
+
flashvar << "lefticon=#{MusicSetting.lefticon}" unless MusicSetting.lefticon == '333333'
|
9
|
+
flashvar << "voltrack=#{MusicSetting.voltrack}" unless MusicSetting.voltrack == 'F2F2F2'
|
10
|
+
flashvar << "volslider=#{MusicSetting.volslider}" unless MusicSetting.volslider == '666666'
|
11
|
+
flashvar << "rightbg=#{MusicSetting.rightbg}" unless MusicSetting.rightbg == 'B4B4B4'
|
12
|
+
flashvar << "rightbghover=#{MusicSetting.rightbghover}" unless MusicSetting.rightbghover == '999999'
|
13
|
+
flashvar << "righticon=#{MusicSetting.righticon}" unless MusicSetting.righticon == '333333'
|
14
|
+
flashvar << "righticonhover=#{MusicSetting.righticonhover}" unless MusicSetting.righticonhover == 'FFFFFF'
|
15
|
+
flashvar << "righticonhover=#{MusicSetting.righticonhover}" unless MusicSetting.righticonhover == 'FFFFFF'
|
16
|
+
flashvar << "loader=#{MusicSetting.loader}" unless MusicSetting.loader == '009900'
|
17
|
+
flashvar << "track=#{MusicSetting.track}" unless MusicSetting.track == 'FFFFFF'
|
18
|
+
flashvar << "tracker=#{MusicSetting.tracker}" unless MusicSetting.tracker == 'DDDDDD'
|
19
|
+
flashvar << "border=#{MusicSetting.border}" unless MusicSetting.border == 'CCCCCC'
|
20
|
+
flashvar << "skip=#{MusicSetting.skip}" unless MusicSetting.skip == '666666'
|
21
|
+
flashvar << "text=#{MusicSetting.text}" unless MusicSetting.text == '333333'
|
22
|
+
# Boolean
|
23
|
+
flashvar << "autostart=yes" if MusicSetting.autostart == true
|
24
|
+
flashvar << "loop=yes" if MusicSetting.loop_track == true
|
25
|
+
flashvar << "animation=no" if MusicSetting.animation == false
|
26
|
+
flashvar << "remaining=yes" if MusicSetting.remaining == true
|
27
|
+
flashvar << "noinfo=yes" if MusicSetting.noinfo == true
|
28
|
+
# size
|
29
|
+
flashvar << "width=#{MusicSetting.width}"
|
30
|
+
|
31
|
+
if music.respond_to? :each
|
32
|
+
artists = []
|
33
|
+
titles = []
|
34
|
+
files = []
|
35
|
+
music.each do |song|
|
36
|
+
if song.resource
|
37
|
+
artists << song.title
|
38
|
+
titles << song.artist
|
39
|
+
files << song.resource.url
|
40
|
+
end
|
41
|
+
end
|
42
|
+
flashvar << "titles=#{CGI::escape titles.join(',')}"
|
43
|
+
flashvar << "artists=#{CGI::escape artists.join(',')}"
|
44
|
+
flashvar << "soundFile=#{CGI::escape files.join(',')}"
|
45
|
+
else
|
46
|
+
# file info
|
47
|
+
flashvar << "titles=#{CGI::escape(music.title)}"
|
48
|
+
flashvar << "artists=#{CGI::escape(music.artist)}"
|
49
|
+
flashvar << "soundFile=#{CGI::escape(music.resource.url)}"
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
raw <<-EOF
|
54
|
+
<object type="application/x-shockwave-flash" data="/player.swf" height="84px" width="#{MusicSetting.width}">
|
55
|
+
<param name="movie" value="/player.swf" />
|
56
|
+
<param name="FlashVars" value="#{flashvar.join('&')}" />
|
57
|
+
<param name="quality" value="high" />
|
58
|
+
<param name="menu" value="true" />
|
59
|
+
<param name="wmode" value="transparent" />
|
60
|
+
</object>
|
61
|
+
EOF
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
class MusicSetting < ActiveRecord::Base
|
2
|
+
|
3
|
+
# colors
|
4
|
+
def self.bg
|
5
|
+
find_or_create_by_name("bg").color
|
6
|
+
end
|
7
|
+
def self.leftbg
|
8
|
+
find_or_create_by_name("leftbg").color
|
9
|
+
end
|
10
|
+
def self.lefticon
|
11
|
+
find_or_create_by_name("lefticon").color
|
12
|
+
end
|
13
|
+
def self.voltrack
|
14
|
+
find_or_create_by_name("voltrack").color
|
15
|
+
end
|
16
|
+
def self.volslider
|
17
|
+
find_or_create_by_name("volslider").color
|
18
|
+
end
|
19
|
+
def self.rightbg
|
20
|
+
find_or_create_by_name("rightbg").color
|
21
|
+
end
|
22
|
+
def self.rightbghover
|
23
|
+
find_or_create_by_name("rightbghover").color
|
24
|
+
end
|
25
|
+
def self.righticon
|
26
|
+
find_or_create_by_name("righticon").color
|
27
|
+
end
|
28
|
+
def self.righticonhover
|
29
|
+
find_or_create_by_name("righticonhover").color
|
30
|
+
end
|
31
|
+
def self.loader
|
32
|
+
find_or_create_by_name("loader").color
|
33
|
+
end
|
34
|
+
def self.track
|
35
|
+
find_or_create_by_name("track").color
|
36
|
+
end
|
37
|
+
def self.tracker
|
38
|
+
find_or_create_by_name("tracker").color
|
39
|
+
end
|
40
|
+
def self.border
|
41
|
+
find_or_create_by_name("border").color
|
42
|
+
end
|
43
|
+
def self.skip
|
44
|
+
find_or_create_by_name("skip").color
|
45
|
+
end
|
46
|
+
def self.text
|
47
|
+
find_or_create_by_name("text").color
|
48
|
+
end
|
49
|
+
# size
|
50
|
+
def self.width
|
51
|
+
find_or_create_by_name("width").size.to_s
|
52
|
+
end
|
53
|
+
# Boolean
|
54
|
+
def self.autostart
|
55
|
+
find_or_create_by_name("autostart").value
|
56
|
+
end
|
57
|
+
def self.loop_track
|
58
|
+
find_or_create_by_name("loop_track").value
|
59
|
+
end
|
60
|
+
def self.animation
|
61
|
+
find_or_create_by_name("animation").value
|
62
|
+
end
|
63
|
+
def self.remaining
|
64
|
+
find_or_create_by_name("remaining").value
|
65
|
+
end
|
66
|
+
def self.noinfo
|
67
|
+
find_or_create_by_name("noinfo").value
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
data/app/models/song.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
class Song < ActiveRecord::Base
|
2
|
+
acts_as_indexed :fields => [:title, :description],
|
3
|
+
:index_file => [Rails.root.to_s, "tmp", "index"]
|
4
|
+
|
5
|
+
named_scope :published, :conditions => {:published => true}, :order => :position
|
6
|
+
|
7
|
+
belongs_to :resource
|
8
|
+
|
9
|
+
validates_presence_of :title
|
10
|
+
validates_uniqueness_of :title
|
11
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<% form_for [:admin,@music_setting] do |f| -%>
|
2
|
+
<%= render :partial => "/shared/admin/error_messages", :locals => {
|
3
|
+
:object => @music_setting,
|
4
|
+
:include_object_name => true
|
5
|
+
} %>
|
6
|
+
<p>
|
7
|
+
<strong>
|
8
|
+
<%= @music_setting.description -%>
|
9
|
+
</strong>
|
10
|
+
</p>
|
11
|
+
<% if @music_setting.value.nil? && @music_setting.size.nil? %>
|
12
|
+
<div class='field'>
|
13
|
+
<%= f.label :color -%>
|
14
|
+
<div id="colorSelector"><div style="background-color: #<%= @music_setting.color %>"></div></div>
|
15
|
+
<%= f.text_field :color -%>
|
16
|
+
</div>
|
17
|
+
<% elsif @music_setting.value.nil? && @music_setting.color.nil? %>
|
18
|
+
<div class='field'>
|
19
|
+
<%= f.label :size -%>
|
20
|
+
<%= f.text_field :size -%>
|
21
|
+
</div>
|
22
|
+
<% else %>
|
23
|
+
<div class='field'>
|
24
|
+
<%= f.label :value -%>
|
25
|
+
<%= f.check_box :value -%>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<%= render :partial => "/shared/admin/form_actions", :locals => {:f => f, :continue_editing => false} %>
|
30
|
+
<% end -%>
|
31
|
+
|
32
|
+
<% content_for :head do %>
|
33
|
+
<%= stylesheet_link_tag 'colorpicker' %>
|
34
|
+
<%= javascript_include_tag 'colorpicker' %>
|
35
|
+
<style>
|
36
|
+
#colorSelector {
|
37
|
+
position: relative;
|
38
|
+
width: 36px;
|
39
|
+
height: 36px;
|
40
|
+
background: url(../images/select.png);
|
41
|
+
}
|
42
|
+
#colorSelector div {
|
43
|
+
position: absolute;
|
44
|
+
top: 3px;
|
45
|
+
left: 3px;
|
46
|
+
width: 30px;
|
47
|
+
height: 30px;
|
48
|
+
background: url(../images/select.png) center;
|
49
|
+
}
|
50
|
+
</style>
|
51
|
+
<% end %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(music_setting) -%>">
|
2
|
+
<span class='title'>
|
3
|
+
<span class='actions'>
|
4
|
+
<% if music_setting.value != nil %>
|
5
|
+
<%= link_to refinery_icon_tag("#{music_setting.value ? 'cross' : 'tick'}.png"),
|
6
|
+
toggle_admin_music_setting_path(music_setting.id),
|
7
|
+
{:title => "Set this setting to #{music_setting.value ? 'false' : 'true'}"} %>
|
8
|
+
<% end %>
|
9
|
+
<% if music_setting.color %>
|
10
|
+
<%= link_to refinery_icon_tag("application_edit.png"), edit_admin_music_setting_path(music_setting),
|
11
|
+
:title => 'Edit this color setting' if music_setting.value.nil? %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<% if music_setting.size %>
|
15
|
+
<%= link_to refinery_icon_tag("application_edit.png"), edit_admin_music_setting_path(music_setting),
|
16
|
+
:title => 'Edit this color setting' if music_setting.value.nil? %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
</span>
|
20
|
+
<strong><%=h music_setting.name %></strong>
|
21
|
+
is set to <strong>
|
22
|
+
<%= music_setting.value ? 'true' : 'false' unless music_setting.value.nil? %>
|
23
|
+
<%= content_tag('span', "##{music_setting.color}",
|
24
|
+
:style => "background-color:##{music_setting.color};padding:4px" ) unless music_setting.color.nil? %>
|
25
|
+
<%= music_setting.size.to_s + 'px' unless music_setting.size.nil? -%>
|
26
|
+
</strong>
|
27
|
+
<%= link_to '?', edit_admin_music_setting_path(music_setting), :title => music_setting.description %>
|
28
|
+
<span class="preview"> </span>
|
29
|
+
</span>
|
30
|
+
</li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => "form" %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id='actions'>
|
2
|
+
<ul>
|
3
|
+
<li>
|
4
|
+
<%= link_to "Manage Music", admin_songs_url, :class => "back_icon" %>
|
5
|
+
</li>
|
6
|
+
</ul>
|
7
|
+
</div>
|
8
|
+
<div id='records'>
|
9
|
+
<% if @music_settings.present? and @music_settings.any? %>
|
10
|
+
<%= will_paginate @music_settings, :previous_label => '«', :next_label => '»' %>
|
11
|
+
<ul id='sortable_list'>
|
12
|
+
<%= render :partial => 'music_setting', :collection => @music_settings %>
|
13
|
+
</ul>
|
14
|
+
<%= will_paginate @music_settings, :previous_label => '«', :next_label => '»' %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<% form_for [:admin, @song] do |f| -%>
|
2
|
+
<%= render :partial => "/shared/admin/error_messages", :locals => {
|
3
|
+
:object => @song,
|
4
|
+
:include_object_name => true
|
5
|
+
} %>
|
6
|
+
|
7
|
+
<div class='field'>
|
8
|
+
<%= f.label :artist -%>
|
9
|
+
<%= f.text_field :artist, :class => 'larger widest' -%>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class='field'>
|
13
|
+
<%= f.label :title -%>
|
14
|
+
<%= f.text_field :title, :class => 'larger widest' -%>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class='field images_field'>
|
18
|
+
<%= f.label :resource, 'Audio resource' %>
|
19
|
+
<%= render :partial => "/shared/admin/resource_picker", :locals => {
|
20
|
+
:f => f,
|
21
|
+
:field => :resource_id,
|
22
|
+
:resource => @song.resource,
|
23
|
+
:description => "audio resource"
|
24
|
+
} %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class='field'>
|
28
|
+
<%= f.label :show_download_link -%>
|
29
|
+
<%= f.check_box :show_download_link -%>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class='field'>
|
33
|
+
<div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
|
34
|
+
<ul id='page_parts'>
|
35
|
+
<% [:description].each_with_index do |part, part_index| %>
|
36
|
+
<li class='ui-state-default<%= ' ui-state-active' if part_index == 0 %>'>
|
37
|
+
<%= link_to part.to_s.titleize, "##{part}" %>
|
38
|
+
</li>
|
39
|
+
<% end %>
|
40
|
+
</ul>
|
41
|
+
|
42
|
+
<div id='page_part_editors'>
|
43
|
+
<% [:description].each do |part| %>
|
44
|
+
<div class='page_part' id='<%= part %>'>
|
45
|
+
<%= f.text_area part, :rows => 20, :class => 'wymeditor widest' -%>
|
46
|
+
</div>
|
47
|
+
<% end %>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
<%= render :partial => "/shared/admin/form_actions",
|
53
|
+
:locals => {
|
54
|
+
:f => f,
|
55
|
+
:continue_editing => false,
|
56
|
+
:delete_title => t('delete', :scope => 'admin.songs.song'),
|
57
|
+
:delete_confirmation => t('message', :scope => 'shared.admin.delete', :title => @song.title)
|
58
|
+
} %>
|
59
|
+
<% end -%>
|
60
|
+
|
61
|
+
<% content_for :javascripts do %>
|
62
|
+
<script>
|
63
|
+
$(document).ready(function(){
|
64
|
+
page_options.init(false, '', '');
|
65
|
+
});
|
66
|
+
</script>
|
67
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(song) -%>">
|
2
|
+
<span class='title'>
|
3
|
+
<%= song.title %>
|
4
|
+
<span class="preview"> </span>
|
5
|
+
</span>
|
6
|
+
<span class='actions'>
|
7
|
+
<%= link_to refinery_icon_tag("application_go.png"), song_url(song),
|
8
|
+
:title => t('.view_live_html'),
|
9
|
+
:target => "_blank" %>
|
10
|
+
<%= link_to refinery_icon_tag("application_edit.png"), edit_admin_song_path(song),
|
11
|
+
:title => t('.edit') %>
|
12
|
+
<%= link_to refinery_icon_tag("delete.png"), admin_song_path(song),
|
13
|
+
:class => "cancel confirm-delete",
|
14
|
+
:title => t('.delete'),
|
15
|
+
:confirm => t('message', :scope => 'shared.admin.delete', :title => song.title),
|
16
|
+
:method => :delete %>
|
17
|
+
</span>
|
18
|
+
</li>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<ul id='sortable_list'>
|
2
|
+
<%= render :partial => 'song', :collection => @songs %>
|
3
|
+
</ul>
|
4
|
+
<%= render :partial => "/shared/admin/sortable_list",
|
5
|
+
:locals => {
|
6
|
+
:continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true
|
7
|
+
} %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => "form" %>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<div id='records'>
|
2
|
+
<% if searching? %>
|
3
|
+
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
|
4
|
+
<% end %>
|
5
|
+
<% if @songs.any? %>
|
6
|
+
<div class='pagination_container'>
|
7
|
+
<%= render :partial => 'songs' %>
|
8
|
+
</div>
|
9
|
+
<% else %>
|
10
|
+
<p>
|
11
|
+
<% unless searching? %>
|
12
|
+
<strong>
|
13
|
+
<%= t('.no_items_yet') %>
|
14
|
+
</strong>
|
15
|
+
<% else %>
|
16
|
+
<%= t('no_results', :scope => 'shared.admin.search') %>
|
17
|
+
<% end %>
|
18
|
+
</p>
|
19
|
+
<% end %>
|
20
|
+
</div>
|
21
|
+
<div id='actions'>
|
22
|
+
<ul>
|
23
|
+
<% if Admin::SongsController.searchable? %>
|
24
|
+
<li>
|
25
|
+
<%= render :partial => "/shared/admin/search",
|
26
|
+
:locals => {
|
27
|
+
:url => admin_songs_url
|
28
|
+
} %>
|
29
|
+
</li>
|
30
|
+
<% end %>
|
31
|
+
<li>
|
32
|
+
<%= link_to t('.create_new'), new_admin_song_url,
|
33
|
+
:class => "add_icon" %>
|
34
|
+
</li>
|
35
|
+
<li>
|
36
|
+
<%=link_to t('.settings'), admin_music_settings_url, :class => "edit_icon" %>
|
37
|
+
</li>
|
38
|
+
<% if !searching? and Admin::SongsController.sortable? and Song.count > 1 %>
|
39
|
+
<li>
|
40
|
+
<%= link_to t('.reorder', :what => "Songs"),
|
41
|
+
admin_songs_url,
|
42
|
+
:id => "reorder_action",
|
43
|
+
:class => "reorder_icon" %>
|
44
|
+
|
45
|
+
<%= link_to t('.reorder_done', :what => "Songs"),
|
46
|
+
admin_songs_url,
|
47
|
+
:id => "reorder_action_done",
|
48
|
+
:style => "display: none;",
|
49
|
+
:class => "reorder_icon" %>
|
50
|
+
</li>
|
51
|
+
<% end %>
|
52
|
+
</ul>
|
53
|
+
</div>
|
54
|
+
<%= render :partial => "/shared/admin/make_sortable",
|
55
|
+
:locals => {
|
56
|
+
:tree => false
|
57
|
+
} if !searching? and Admin::SongsController.sortable? and Song.count > 1 %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => "form" %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<% content_for :body_content_title do %>
|
2
|
+
<%= @song.artist %> - <%= @song.title %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :body_content_left do %>
|
6
|
+
<section>
|
7
|
+
<% if @song.resource %>
|
8
|
+
<%= player(@song) %>
|
9
|
+
<% else %>
|
10
|
+
<%= t('.nofile') %>
|
11
|
+
<% end %>
|
12
|
+
<div class="music-description">
|
13
|
+
<%= @song.description.html_safe %>
|
14
|
+
</div>
|
15
|
+
<% if @song.show_download_link && @song.resource -%>
|
16
|
+
<div class="music-download">
|
17
|
+
<%= link_to t('.download'), @song.resource.url %><br/>
|
18
|
+
<%= t('.download-advice') %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</section>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<% content_for :body_content_right do %>
|
25
|
+
<aside>
|
26
|
+
<h2><%= t('.other') %></h2>
|
27
|
+
<ul id="track">
|
28
|
+
<% @songs.each do |song| -%>
|
29
|
+
<li id="track">
|
30
|
+
<% if @song == song %>
|
31
|
+
<b><%= link_to song.title, song_url(song) %></b>
|
32
|
+
<% else %>
|
33
|
+
<%= link_to song.title, song_url(song) %>
|
34
|
+
<% end %>
|
35
|
+
</li>
|
36
|
+
<% end %>
|
37
|
+
</ul>
|
38
|
+
</aside>
|
39
|
+
<% end %>
|
40
|
+
<%= render :partial => "/shared/content_page" %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
en:
|
2
|
+
plugins:
|
3
|
+
music:
|
4
|
+
title: Music
|
5
|
+
admin:
|
6
|
+
songs:
|
7
|
+
index:
|
8
|
+
title: Songs
|
9
|
+
create_new: Add New Song
|
10
|
+
reorder: Reorder Songs
|
11
|
+
reorder_done: Done Reordering Songs
|
12
|
+
settings: Edit music settings
|
13
|
+
sorry_no_results: Sorry! There are no results found.
|
14
|
+
no_items_yet: There are no songs yet. Click "Add New Music" to add your first music.
|
15
|
+
song:
|
16
|
+
view_live_html: View this song live <br/><em>(opens in a new window)</em>
|
17
|
+
edit: Edit this song
|
18
|
+
delete: Remove this song forever
|
19
|
+
songs:
|
20
|
+
show:
|
21
|
+
other: Other Songs
|
22
|
+
download-advice: (you might need to right click and save as...)
|
23
|
+
download: Download this track!
|
24
|
+
nofile: Oops! the song exist, but we don't have the file yet!
|
@@ -0,0 +1,21 @@
|
|
1
|
+
lolcat:
|
2
|
+
plugins:
|
3
|
+
music:
|
4
|
+
title: Music
|
5
|
+
admin:
|
6
|
+
music:
|
7
|
+
index:
|
8
|
+
title: Songs
|
9
|
+
create_new: CREATE NEW Song
|
10
|
+
reorder: REORDR Songs
|
11
|
+
reorder_done: DUN REORDERIN Songs
|
12
|
+
settings: Edit music settings
|
13
|
+
sorry_no_results: SRY! THAR R NO RESULTS FINDZ.
|
14
|
+
no_items_yet: THAR R NO Songs YET. CLICK "CREATE NEW Song" 2 ADD UR FURST song.
|
15
|
+
song:
|
16
|
+
view_live_html: VIEW DIS song LIV <BR/><EM>(OPENS IN NEW WINDOW)</EM>
|
17
|
+
edit: EDIT DIS song
|
18
|
+
delete: REMOOV DIS song FOREVR
|
19
|
+
songs:
|
20
|
+
show:
|
21
|
+
other: OTHR Songs
|
@@ -0,0 +1,21 @@
|
|
1
|
+
nb:
|
2
|
+
plugins:
|
3
|
+
music:
|
4
|
+
title: Music
|
5
|
+
admin:
|
6
|
+
songs:
|
7
|
+
index:
|
8
|
+
title: Songs
|
9
|
+
create_new: Lag en ny Song
|
10
|
+
reorder: Endre rekkefølgen på Songs
|
11
|
+
reorder_done: Ferdig å endre rekkefølgen Songs
|
12
|
+
settings: Edit music settings
|
13
|
+
sorry_no_results: Beklager! Vi fant ikke noen resultater.
|
14
|
+
no_items_yet: Det er ingen Songs enda. Klikk på "Lag en ny Song" for å legge til din første song.
|
15
|
+
song:
|
16
|
+
view_live_html: Vis hvordan denne song ser ut offentlig <br/><em>(åpner i et nytt vindu)</em>
|
17
|
+
edit: Rediger denne song
|
18
|
+
delete: Fjern denne song permanent
|
19
|
+
songs:
|
20
|
+
show:
|
21
|
+
other: Andre Songs
|
@@ -0,0 +1,21 @@
|
|
1
|
+
nl:
|
2
|
+
plugins:
|
3
|
+
music:
|
4
|
+
title: Music
|
5
|
+
admin:
|
6
|
+
music:
|
7
|
+
index:
|
8
|
+
title: Songs
|
9
|
+
create_new: Maak een nieuwe Song
|
10
|
+
reorder: Wijzig de volgorde van de Songs
|
11
|
+
reorder_done: Klaar met het wijzingen van de volgorde van de Songs
|
12
|
+
settings: Edit music settings
|
13
|
+
sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
|
14
|
+
no_items_yet: Er zijn nog geen Songs. Druk op 'Maak een nieuwe Song' om de eerste aan te maken.
|
15
|
+
song:
|
16
|
+
view_live_html: Bekijk deze song op de website <br/><em>(opent een nieuw venster)</em>
|
17
|
+
edit: Bewerk deze song
|
18
|
+
delete: Verwijder deze song voor eeuwig
|
19
|
+
songs:
|
20
|
+
show:
|
21
|
+
other: Andere Songs
|
data/config/routes.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Refinery::Application.routes.draw do
|
2
|
+
resources :music, :as => :songs, :controller => :songs
|
3
|
+
#resources :songs, :as => :music
|
4
|
+
scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
|
5
|
+
resources :music_settings do
|
6
|
+
member do
|
7
|
+
match :toggle
|
8
|
+
end
|
9
|
+
end
|
10
|
+
resources :music, :as => :songs, :controller => :songs, :except => :show do
|
11
|
+
collection do
|
12
|
+
post :update_positions
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'refinery'
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module Music
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
initializer "static assets" do |app|
|
7
|
+
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
8
|
+
end
|
9
|
+
|
10
|
+
config.after_initialize do
|
11
|
+
Refinery::Plugin.register do |plugin|
|
12
|
+
plugin.name = "music"
|
13
|
+
plugin.menu_match = /(admin|refinery)\/(music|songs|music_settings)?$/
|
14
|
+
plugin.url = {:controller => '/admin/songs', :action => 'index'}
|
15
|
+
plugin.activity = {
|
16
|
+
:class => Song,
|
17
|
+
:title => 'title'
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: refinerycms-music
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: "0.2"
|
10
|
+
platform: ruby
|
11
|
+
authors: []
|
12
|
+
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-04-17 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description:
|
22
|
+
email: unixcharles@gmail.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- lib/generators/refinerycms_music_generator.rb
|
31
|
+
- lib/refinerycms-music.rb
|
32
|
+
- config/locales/en.yml
|
33
|
+
- config/locales/lolcat.yml
|
34
|
+
- config/locales/nb.yml
|
35
|
+
- config/locales/nl.yml
|
36
|
+
- config/routes.rb
|
37
|
+
- app/controllers/admin/music_settings_controller.rb
|
38
|
+
- app/controllers/admin/songs_controller.rb
|
39
|
+
- app/controllers/songs_controller.rb
|
40
|
+
- app/helpers/songs_helper.rb
|
41
|
+
- app/models/music_setting.rb
|
42
|
+
- app/models/song.rb
|
43
|
+
- app/views/admin/music_settings/_form.html.erb
|
44
|
+
- app/views/admin/music_settings/_music_setting.html.erb
|
45
|
+
- app/views/admin/music_settings/edit.html.erb
|
46
|
+
- app/views/admin/music_settings/index.html.erb
|
47
|
+
- app/views/admin/songs/_form.html.erb
|
48
|
+
- app/views/admin/songs/_song.html.erb
|
49
|
+
- app/views/admin/songs/_songs.html.erb
|
50
|
+
- app/views/admin/songs/_sortable_list.html.erb
|
51
|
+
- app/views/admin/songs/edit.html.erb
|
52
|
+
- app/views/admin/songs/index.html.erb
|
53
|
+
- app/views/admin/songs/new.html.erb
|
54
|
+
- app/views/songs/index.html.erb
|
55
|
+
- app/views/songs/show.html.erb
|
56
|
+
has_rdoc: true
|
57
|
+
homepage: http://github.com/unixcharles/refinerycms-music
|
58
|
+
licenses:
|
59
|
+
- MIT
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 3
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
version: "0"
|
83
|
+
requirements: []
|
84
|
+
|
85
|
+
rubyforge_project:
|
86
|
+
rubygems_version: 1.6.2
|
87
|
+
signing_key:
|
88
|
+
specification_version: 3
|
89
|
+
summary: Music engine for Refinery CMS
|
90
|
+
test_files: []
|
91
|
+
|