refinerycms-podcast 0.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/app/controllers/refinery/podcasts/admin/podcasts_controller.rb +24 -0
  3. data/app/controllers/refinery/podcasts/podcasts_controller.rb +39 -0
  4. data/app/models/refinery/podcasts/podcast.rb +41 -0
  5. data/app/views/refinery/podcasts/admin/podcasts/_actions.html.erb +23 -0
  6. data/app/views/refinery/podcasts/admin/podcasts/_form.html.erb +98 -0
  7. data/app/views/refinery/podcasts/admin/podcasts/_podcast.html.erb +22 -0
  8. data/app/views/refinery/podcasts/admin/podcasts/_podcasts.html.erb +2 -0
  9. data/app/views/refinery/podcasts/admin/podcasts/_records.html.erb +18 -0
  10. data/app/views/refinery/podcasts/admin/podcasts/_sortable_list.html.erb +5 -0
  11. data/app/views/refinery/podcasts/admin/podcasts/edit.html.erb +1 -0
  12. data/app/views/refinery/podcasts/admin/podcasts/index.html.erb +7 -0
  13. data/app/views/refinery/podcasts/admin/podcasts/new.html.erb +1 -0
  14. data/app/views/refinery/podcasts/podcasts/index.html.erb +11 -0
  15. data/app/views/refinery/podcasts/podcasts/index.rss.builder +71 -0
  16. data/app/views/refinery/podcasts/podcasts/show.html.erb +59 -0
  17. data/config/locales/cs.yml +34 -0
  18. data/config/locales/en.yml +32 -14
  19. data/config/locales/es.yml +35 -0
  20. data/config/locales/fr.yml +34 -0
  21. data/config/locales/nb.yml +34 -0
  22. data/config/locales/nl.yml +32 -14
  23. data/config/routes.rb +15 -6
  24. data/db/migrate/1_create_refinery_podcasts.rb +33 -0
  25. data/db/migrate/2_add_slug_to_refinery_podcasts.rb +8 -0
  26. data/db/migrate/3_add_image_id_to_refinery_podcasts.rb +8 -0
  27. data/db/seeds.rb +25 -0
  28. data/lib/generators/refinery/podcasts/podcasts_generator.rb +24 -0
  29. data/lib/generators/refinery/podcasts/templates/config/initializers/refinery/podcasts.rb.erb +47 -0
  30. data/lib/refinery/podcasts.rb +22 -0
  31. data/lib/refinery/podcasts/configuration.rb +20 -0
  32. data/lib/refinery/podcasts/engine.rb +22 -0
  33. data/lib/refinerycms-podcast.rb +1 -0
  34. data/lib/tasks/refinery/podcasts.rake +13 -0
  35. data/readme.md +10 -44
  36. metadata +125 -62
  37. data/app/controllers/admin/podcasts_controller.rb +0 -5
  38. data/app/controllers/podcasts_controller.rb +0 -12
  39. data/app/models/podcast.rb +0 -24
  40. data/app/views/admin/podcasts/_form.html.erb +0 -59
  41. data/app/views/admin/podcasts/_podcast.html.erb +0 -16
  42. data/app/views/admin/podcasts/edit.html.erb +0 -1
  43. data/app/views/admin/podcasts/index.html.erb +0 -34
  44. data/app/views/admin/podcasts/new.html.erb +0 -1
  45. data/app/views/podcasts/index.rss.builder +0 -56
  46. data/generators/podcast/podcast_generator.rb +0 -23
  47. data/generators/podcast/templates/migration.rb +0 -32
  48. data/lib/gemspec.rb +0 -30
  49. data/lib/refinery/podcast.rb +0 -15
  50. data/lib/tasks/podcast.rake +0 -35
  51. data/license.md +0 -21
  52. data/rails/init.rb +0 -14
@@ -0,0 +1,34 @@
1
+ cs:
2
+ refinery:
3
+ plugins:
4
+ podcasts:
5
+ title: Podcasts
6
+ podcasts:
7
+ admin:
8
+ podcasts:
9
+ actions:
10
+ create_new: Přidat Podcast
11
+ reorder: Řadit Podcasts
12
+ reorder_done: Konec řazení Podcasts
13
+ records:
14
+ title: Podcasts
15
+ sorry_no_results: Litujeme, ale nebyly nalezny žádné výsledky.
16
+ no_items_yet: Zatím nebyly vytvořeny žádné Podcasts. Zvolte "Přidat Podcast" pro přidání prvního podcast.
17
+ podcast:
18
+ view_live_html: Zobrazit náhled podcast<br/><em>(otevře se v novém okně)</em>
19
+ edit: Upravit podcast
20
+ delete: Smazat podcast
21
+ podcasts:
22
+ show:
23
+ other: Další Podcasts
24
+ activerecord:
25
+ attributes:
26
+ 'refinery/podcasts/podcast':
27
+ title: Title
28
+ author: Author
29
+ subtitle: Subtitle
30
+ file_id: File
31
+ published_at: Published At
32
+ duration: Duration
33
+ keywords: Keywords
34
+ summary: Summary
@@ -1,16 +1,34 @@
1
1
  en:
2
- admin:
2
+ refinery:
3
+ plugins:
4
+ podcasts:
5
+ title: Podcast Episodes
3
6
  podcasts:
4
- index:
5
- create_new: Create a new Podcast
6
- reorder: Reorder Podcasts
7
- reorder_done: Done Reordering Podcasts
8
- sorry_no_results: Sorry! There are no results found.
9
- no_items_yet: There are no podcasts yet. Click "Create a new Podcast" to add your first podcast.
10
- podcast:
11
- view_live: View this podcast live <br/><em>(opens in a new window)</em>
12
- edit: Edit this podcast
13
- delete: Remove this podcast forever
14
- podcasts:
15
- show:
16
- other: Other Podcasts
7
+ admin:
8
+ podcasts:
9
+ actions:
10
+ create_new: Add New Episode
11
+ reorder: Reorder Episodes
12
+ reorder_done: Done Reordering Episodes
13
+ records:
14
+ title: Podcasts
15
+ sorry_no_results: Sorry! There are no results found.
16
+ no_items_yet: There are no episodes yet. Click "Add New Episode" to add your first podcast episode.
17
+ podcast:
18
+ view_live_html: View this episode live <br/><em>(opens in a new window)</em>
19
+ edit: Edit this episode
20
+ delete: Remove this episode forever
21
+ podcasts:
22
+ show:
23
+ other: Other Episodes
24
+ activerecord:
25
+ attributes:
26
+ 'refinery/podcasts/podcast':
27
+ title: Title
28
+ author: Author
29
+ subtitle: Subtitle
30
+ file_id: File
31
+ published_at: Published At
32
+ duration: Duration
33
+ keywords: Keywords
34
+ summary: Summary
@@ -0,0 +1,35 @@
1
+ es:
2
+ refinery:
3
+ plugins:
4
+ podcasts:
5
+ title: Podcasts
6
+ # article: masculino/femenino
7
+ podcasts:
8
+ admin:
9
+ podcasts:
10
+ actions:
11
+ create_new: Crear nuevo podcast
12
+ reorder: Reordenar podcasts
13
+ reorder_done: Reordenación de podcasts completada
14
+ records:
15
+ title: Podcasts
16
+ sorry_no_results: Lo siento, no hay resultados
17
+ no_items_yet: No hay podcasts todavía. Pulsa en "Crear nuevo Podcast" para crear tu primer podcast.
18
+ podcast:
19
+ view_live_html: Ver este podcast como abierto al público <br/><em>(abre en ventana nueva)</em>
20
+ edit: Editar este podcast
21
+ delete: Borrar este podcast para siempre
22
+ podcasts:
23
+ show:
24
+ other: Otros podcasts
25
+ activerecord:
26
+ attributes:
27
+ 'refinery/podcasts/podcast':
28
+ title: Title
29
+ author: Author
30
+ subtitle: Subtitle
31
+ file_id: File
32
+ published_at: Published At
33
+ duration: Duration
34
+ keywords: Keywords
35
+ summary: Summary
@@ -0,0 +1,34 @@
1
+ fr:
2
+ refinery:
3
+ plugins:
4
+ podcasts:
5
+ title: Podcasts
6
+ podcasts:
7
+ admin:
8
+ podcasts:
9
+ actions:
10
+ create_new: Créer un(e) nouve(au/l/lle) Podcast
11
+ reorder: Réordonner les Podcasts
12
+ reorder_done: Fin de réordonnancement des Podcasts
13
+ records:
14
+ title: Podcasts
15
+ sorry_no_results: "Désolé ! Aucun résultat."
16
+ no_items_yet: 'Il n''y a actuellement aucun(e) Podcast. Cliquer sur "Créer un(e) nouve(au/l/lle) Podcast" pour créer votre premi(er/ère) podcast.'
17
+ podcast:
18
+ view_live_html: Voir ce(t/tte) podcast <br/><em>(Ouvre une nouvelle fenêtre)</em>
19
+ edit: Modifier ce(t/tte) podcast
20
+ delete: Supprimer définitivement ce(t/tte) podcast
21
+ podcasts:
22
+ show:
23
+ other: Autres Podcasts
24
+ activerecord:
25
+ attributes:
26
+ 'refinery/podcasts/podcast':
27
+ title: Title
28
+ author: Author
29
+ subtitle: Subtitle
30
+ file_id: File
31
+ published_at: Published At
32
+ duration: Duration
33
+ keywords: Keywords
34
+ summary: Summary
@@ -0,0 +1,34 @@
1
+ nb:
2
+ refinery:
3
+ plugins:
4
+ podcasts:
5
+ title: Podcasts
6
+ podcasts:
7
+ admin:
8
+ podcasts:
9
+ actions:
10
+ create_new: Lag en ny Podcast
11
+ reorder: Endre rekkefølgen på Podcasts
12
+ reorder_done: Ferdig å endre rekkefølgen Podcasts
13
+ records:
14
+ title: Podcasts
15
+ sorry_no_results: Beklager! Vi fant ikke noen resultater.
16
+ no_items_yet: Det er ingen Podcasts enda. Klikk på "Lag en ny Podcast" for å legge til din første podcast.
17
+ podcast:
18
+ view_live_html: Vis hvordan denne podcast ser ut offentlig <br/><em>(åpner i et nytt vindu)</em>
19
+ edit: Rediger denne podcast
20
+ delete: Fjern denne podcast permanent
21
+ podcasts:
22
+ show:
23
+ other: Andre Podcasts
24
+ activerecord:
25
+ attributes:
26
+ 'refinery/podcasts/podcast':
27
+ title: Title
28
+ author: Author
29
+ subtitle: Subtitle
30
+ file_id: File
31
+ published_at: Published At
32
+ duration: Duration
33
+ keywords: Keywords
34
+ summary: Summary
@@ -1,16 +1,34 @@
1
1
  nl:
2
- admin:
2
+ refinery:
3
+ plugins:
4
+ podcasts:
5
+ title: Podcasts
3
6
  podcasts:
4
- index:
5
- create_new: Maak een nieuwe Podcast
6
- reorder: Wijzig de volgorde van de Podcasts
7
- reorder_done: Klaar met het wijzingen van de volgorde van de Podcasts
8
- sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
9
- no_items_yet: Er zijn nog geen podcasts. Druk op 'Maak een nieuwe Podcast' om de eerste aan te maken.
10
- podcast:
11
- view_live: Bekijk deze podcast op de website <br/><em>(opent een nieuw venster)</em>
12
- edit: Bewerk deze podcast
13
- delete: Verwijder deze podcast voor eeuwig
14
- podcasts:
15
- show:
16
- other: Andere Podcasts
7
+ admin:
8
+ podcasts:
9
+ actions:
10
+ create_new: Nieuwe Podcast toevoegen
11
+ reorder: De volgorde van de Podcasts wijzigen
12
+ reorder_done: Klaar met het wijzingen van de van de Podcast-volgorde
13
+ records:
14
+ title: Podcasts
15
+ sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
16
+ no_items_yet: Er zijn nog geen Podcasts. Druk op 'Nieuwe Podcast toevoegen' om de eerste toe te voegen.
17
+ podcast:
18
+ view_live_html: Deze podcast op de website bekijken <br/><em>(opent in een nieuw venster)</em>
19
+ edit: Bewerk deze podcast
20
+ delete: Deze podcast definitief verwijderen
21
+ podcasts:
22
+ show:
23
+ other: Andere Podcasts
24
+ activerecord:
25
+ attributes:
26
+ 'refinery/podcasts/podcast':
27
+ title: Title
28
+ author: Author
29
+ subtitle: Subtitle
30
+ file_id: File
31
+ published_at: Published At
32
+ duration: Duration
33
+ keywords: Keywords
34
+ summary: Summary
data/config/routes.rb CHANGED
@@ -1,10 +1,19 @@
1
- ActionController::Routing::Routes.draw do |map|
2
- map.resources :podcasts
1
+ Refinery::Core::Engine.routes.append do
3
2
 
4
- map.namespace(:admin, :path_prefix => 'refinery') do |admin|
5
- admin.resources :podcasts, :collection => {:update_positions => :post, :settings => :get}
3
+ # Frontend routes
4
+ namespace :podcasts do
5
+ resources :podcasts, :path => '', :only => [:index, :show]
6
+ end
7
+
8
+ # Admin routes
9
+ namespace :podcasts, :path => '' do
10
+ namespace :admin, :path => 'refinery' do
11
+ resources :podcasts, :except => :show do
12
+ collection do
13
+ post :update_positions
14
+ end
15
+ end
16
+ end
6
17
  end
7
-
8
- map.podcast '/podcast.rss', :controller => "podcasts", :action => "index", :format => "rss"
9
18
 
10
19
  end
@@ -0,0 +1,33 @@
1
+ class CreateRefineryPodcasts < ActiveRecord::Migration
2
+
3
+ def up
4
+ create_table :refinery_podcasts do |t|
5
+ t.string :title
6
+ t.string :author
7
+ t.string :subtitle
8
+ t.integer :file_id
9
+ t.date :published_at
10
+ t.string :duration
11
+ t.string :keywords
12
+ t.text :summary
13
+ t.integer :position
14
+
15
+ t.timestamps
16
+ end
17
+
18
+ end
19
+
20
+ def down
21
+ if defined?(::Refinery::UserPlugin)
22
+ ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-podcasts"})
23
+ end
24
+
25
+ if defined?(::Refinery::Page)
26
+ ::Refinery::Page.delete_all({:link_url => "/podcasts/podcasts"})
27
+ end
28
+
29
+ drop_table :refinery_podcasts
30
+
31
+ end
32
+
33
+ end
@@ -0,0 +1,8 @@
1
+ class AddSlugToRefineryPodcasts < ActiveRecord::Migration
2
+
3
+ def change
4
+ add_column :refinery_podcasts, :slug, :string
5
+ add_index :refinery_podcasts, :slug
6
+ end
7
+
8
+ end
@@ -0,0 +1,8 @@
1
+ class AddImageIdToRefineryPodcasts < ActiveRecord::Migration
2
+
3
+ def change
4
+ add_column :refinery_podcasts, :image_id, :integer
5
+ add_index :refinery_podcasts, :image_id
6
+ end
7
+
8
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,25 @@
1
+ Refinery::I18n.frontend_locales.each do |lang|
2
+ I18n.locale = lang
3
+
4
+ if defined?(Refinery::User)
5
+ Refinery::User.find_each do |user|
6
+ if user.plugins.where(:name => 'podcasts').blank?
7
+ user.plugins.create(:name => 'podcasts',
8
+ :position => (user.plugins.maximum(:position) || -1) +1)
9
+ end
10
+ end
11
+ end
12
+
13
+ url = "/podcasts"
14
+ if defined?(Refinery::Page) && Refinery::Page.where(:link_url => url).empty?
15
+ page = Refinery::Page.create(
16
+ :title => 'Podcasts',
17
+ :link_url => url,
18
+ :deletable => false,
19
+ :menu_match => "^#{url}(\/|\/.+?|)$"
20
+ )
21
+ Refinery::Pages.default_parts.each_with_index do |default_page_part, index|
22
+ page.parts.create(:title => default_page_part, :body => nil, :position => index)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ module Refinery
2
+ class PodcastsGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("../templates", __FILE__)
4
+
5
+ def generate_podcasts_initializer
6
+ template "config/initializers/refinery/podcasts.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "podcasts.rb")
7
+ end
8
+
9
+ def rake_db
10
+ rake("refinery_podcasts:install:migrations")
11
+ end
12
+
13
+ def append_load_seed_data
14
+ create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
15
+ append_file 'db/seeds.rb', :verbose => true do
16
+ <<-EOH
17
+
18
+ # Added by Refinery CMS Podcasts extension
19
+ Refinery::Podcasts::Engine.load_seed
20
+ EOH
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,47 @@
1
+ Refinery::Podcasts.configure do |config|
2
+ # What your podcast show is called.
3
+ #
4
+ # config.title = <%= Refinery::Podcasts.title.inspect %>
5
+
6
+ # A subtitle/byline for your podcast show
7
+ # config.subtitle = <%= Refinery::Podcasts.subtitle.inspect %>
8
+
9
+ # The contents of this tag are shown in a separate window that appears when the
10
+ # "circled i" in the Description column is clicked. It also appears on the iTunes
11
+ # page for your podcast. This field can be up to 4000 characters.
12
+ #
13
+ # config.description = <%= Refinery::Podcasts.description.inspect %>
14
+
15
+ # The content of this tag is shown in the Artist column in iTunes.
16
+ #
17
+ # config.author = <%= Refinery::Podcasts.author.inspect %>
18
+
19
+ # This tag should be used to indicate whether or not your podcast contains
20
+ # explicit material. The three values for this tag are "yes", "no", and "clean".
21
+ #
22
+ # config.explicit_content = <%= Refinery::Podcasts.explicit_content.inspect %>
23
+
24
+ # Accepted values are those in the ISO 639-1 Alpha-2 list
25
+ # (two-letter language codes, some with possible modifiers, such as 'en-us').
26
+ #
27
+ # config.language = <%= Refinery::Podcasts.language.inspect %>
28
+
29
+ # iTunes prefers square .jpg or .png images that are between
30
+ # 1400 x 1400 pixels and 3000 x 3000 pixels
31
+ # You could upload an image to your resources tab and link it in here.
32
+ #
33
+ # config.image_url = <%= Refinery::Podcasts.image_url.inspect %>
34
+
35
+ # select from the list of categories here:
36
+ # https://help.apple.com/itc/podcasts_connect/?lang=en#/itc9267a2f12
37
+ #
38
+ # config.category = <%= Refinery::Podcasts.category.inspect %>
39
+ # config.subcategory = <%= Refinery::Podcasts.subcategory.inspect %>
40
+
41
+ # The owner name and email tags contain information that will be used to
42
+ # contact the owner of the podcast for communication specifically about their
43
+ # podcast. It should not be publicly displayed.
44
+ #
45
+ # config.owner_name = <%= Refinery::Podcasts.owner_name.inspect %>
46
+ # config.owner_email = <%= Refinery::Podcasts.owner_email.inspect %>
47
+ end
@@ -0,0 +1,22 @@
1
+ require 'refinerycms-core'
2
+
3
+ module Refinery
4
+ autoload :PodcastsGenerator, 'generators/refinery/podcasts/podcasts_generator'
5
+
6
+ module Podcasts
7
+ require 'refinery/podcasts/engine'
8
+ require 'refinery/podcasts/configuration'
9
+
10
+ class << self
11
+ attr_writer :root
12
+
13
+ def root
14
+ @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
15
+ end
16
+
17
+ def factory_paths
18
+ @factory_paths ||= [ root.join('spec', 'factories').to_s ]
19
+ end
20
+ end
21
+ end
22
+ end