refinerycms-sl-videos 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/Gemfile +71 -0
  2. data/Gemfile.lock +289 -0
  3. data/Guardfile +27 -0
  4. data/Rakefile +22 -0
  5. data/app/controllers/refinery/videos/admin/videos_controller.rb +12 -0
  6. data/app/controllers/refinery/videos/videos_controller.rb +34 -0
  7. data/app/models/refinery/videos/video.rb +64 -0
  8. data/app/views/refinery/videos/admin/shared/_locale_picker.html.erb +11 -0
  9. data/app/views/refinery/videos/admin/videos/_actions.html.erb +25 -0
  10. data/app/views/refinery/videos/admin/videos/_form.html.erb +44 -0
  11. data/app/views/refinery/videos/admin/videos/_records.html.erb +18 -0
  12. data/app/views/refinery/videos/admin/videos/_sortable_list.html.erb +5 -0
  13. data/app/views/refinery/videos/admin/videos/_video.html.erb +33 -0
  14. data/app/views/refinery/videos/admin/videos/_videos.html.erb +2 -0
  15. data/app/views/refinery/videos/admin/videos/edit.html.erb +1 -0
  16. data/app/views/refinery/videos/admin/videos/index.html.erb +7 -0
  17. data/app/views/refinery/videos/admin/videos/new.html.erb +1 -0
  18. data/app/views/refinery/videos/videos/index.html.erb +11 -0
  19. data/app/views/refinery/videos/videos/show.html.erb +25 -0
  20. data/config/locales/en.yml +34 -0
  21. data/config/locales/es.yml +35 -0
  22. data/config/routes.rb +19 -0
  23. data/db/migrate/1_create_videos_videos.rb +31 -0
  24. data/db/migrate/2_create_videos_translations.rb +17 -0
  25. data/db/migrate/3_add_dimensions_to_videos.rb +13 -0
  26. data/db/seeds.rb +25 -0
  27. data/lib/generators/refinery/videos_generator.rb +19 -0
  28. data/lib/refinery/videos/engine.rb +26 -0
  29. data/lib/refinery/videos/version.rb +18 -0
  30. data/lib/refinery/videos.rb +22 -0
  31. data/lib/refinerycms-sl-videos.rb +1 -0
  32. data/lib/tasks/refinery/videos.rake +13 -0
  33. data/readme.md +43 -0
  34. data/refinerycms-sl-videos.gemspec +23 -0
  35. data/script/rails +10 -0
  36. data/spec/models/refinery/videos/video_spec.rb +18 -0
  37. data/spec/requests/refinery/videos/admin/videos_spec.rb +101 -0
  38. data/spec/spec_helper.rb +61 -0
  39. data/spec/support/factories/refinery/videos.rb +7 -0
  40. data/tasks/rspec.rake +6 -0
  41. data/tasks/testing.rake +8 -0
  42. metadata +112 -0
data/Gemfile ADDED
@@ -0,0 +1,71 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'refinerycms', '~> 2.0.3'
6
+
7
+ # Database Configuration
8
+ platforms :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter'
10
+ gem 'activerecord-jdbcmysql-adapter'
11
+ gem 'activerecord-jdbcpostgresql-adapter'
12
+ gem 'jruby-openssl'
13
+ end
14
+
15
+ platforms :ruby do
16
+ gem 'sqlite3'
17
+ gem 'mysql2'
18
+ gem 'pg'
19
+ end
20
+
21
+ group :development, :test do
22
+ gem 'refinerycms-testing', '~> 2.0.3'
23
+ gem 'guard-rspec', '~> 0.7.0'
24
+
25
+ platforms :mswin, :mingw do
26
+ gem 'win32console', '~> 1.3.0'
27
+ gem 'rb-fchange', '~> 0.0.5'
28
+ gem 'rb-notifu', '~> 0.0.4'
29
+ end
30
+
31
+ platforms :ruby do
32
+ gem 'spork', '~> 0.9.0'
33
+ gem 'guard-spork', '~> 0.5.2'
34
+
35
+ unless ENV['TRAVIS']
36
+ require 'rbconfig'
37
+ if RbConfig::CONFIG['target_os'] =~ /darwin/i
38
+ gem 'rb-fsevent', '~> 0.9.0'
39
+ gem 'ruby_gntp', '~> 0.3.4'
40
+ end
41
+ if RbConfig::CONFIG['target_os'] =~ /linux/i
42
+ gem 'rb-inotify', '~> 0.8.8'
43
+ gem 'libnotify', '~> 0.7.2'
44
+ gem 'therubyracer', '~> 0.10.0'
45
+ end
46
+ end
47
+ end
48
+
49
+ platforms :jruby do
50
+ unless ENV['TRAVIS']
51
+ require 'rbconfig'
52
+ if RbConfig::CONFIG['target_os'] =~ /darwin/i
53
+ gem 'ruby_gntp', '~> 0.3.4'
54
+ end
55
+ if RbConfig::CONFIG['target_os'] =~ /linux/i
56
+ gem 'rb-inotify', '~> 0.8.8'
57
+ gem 'libnotify', '~> 0.7.2'
58
+ end
59
+ end
60
+ end
61
+ end
62
+
63
+ # Gems used only for assets and not required
64
+ # in production environments by default.
65
+ group :assets do
66
+ gem 'sass-rails'
67
+ gem 'coffee-rails'
68
+ gem 'uglifier'
69
+ end
70
+
71
+ gem 'jquery-rails', '~> 2.0.0'
data/Gemfile.lock ADDED
@@ -0,0 +1,289 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ refinerycms-sl-videos (2.0.0)
5
+ acts_as_unvlogable (~> 1.0.0)
6
+ refinerycms-core (~> 2.0.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.8)
12
+ actionpack (= 3.2.8)
13
+ mail (~> 2.4.4)
14
+ actionpack (3.2.8)
15
+ activemodel (= 3.2.8)
16
+ activesupport (= 3.2.8)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.4)
20
+ rack (~> 1.4.0)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.1.3)
24
+ activemodel (3.2.8)
25
+ activesupport (= 3.2.8)
26
+ builder (~> 3.0.0)
27
+ activerecord (3.2.8)
28
+ activemodel (= 3.2.8)
29
+ activesupport (= 3.2.8)
30
+ arel (~> 3.0.2)
31
+ tzinfo (~> 0.3.29)
32
+ activeresource (3.2.8)
33
+ activemodel (= 3.2.8)
34
+ activesupport (= 3.2.8)
35
+ activesupport (3.2.8)
36
+ i18n (~> 0.6)
37
+ multi_json (~> 1.0)
38
+ acts_as_indexed (0.7.8)
39
+ acts_as_unvlogable (1.0.0)
40
+ hpricot
41
+ xml-simple
42
+ youtube_it
43
+ addressable (2.3.2)
44
+ arel (3.0.2)
45
+ awesome_nested_set (2.1.4)
46
+ activerecord (>= 3.0.0)
47
+ babosa (0.3.8)
48
+ bcrypt-ruby (3.0.1)
49
+ builder (3.0.3)
50
+ capybara (1.1.2)
51
+ mime-types (>= 1.16)
52
+ nokogiri (>= 1.3.3)
53
+ rack (>= 1.0.0)
54
+ rack-test (>= 0.5.4)
55
+ selenium-webdriver (~> 2.0)
56
+ xpath (~> 0.1.4)
57
+ childprocess (0.3.5)
58
+ ffi (~> 1.0, >= 1.0.6)
59
+ coffee-rails (3.2.2)
60
+ coffee-script (>= 2.2.0)
61
+ railties (~> 3.2.0)
62
+ coffee-script (2.2.0)
63
+ coffee-script-source
64
+ execjs
65
+ coffee-script-source (1.3.3)
66
+ database_cleaner (0.7.2)
67
+ devise (2.0.4)
68
+ bcrypt-ruby (~> 3.0)
69
+ orm_adapter (~> 0.0.3)
70
+ railties (~> 3.1)
71
+ warden (~> 1.1.1)
72
+ diff-lcs (1.1.3)
73
+ dragonfly (0.9.12)
74
+ rack
75
+ erubis (2.7.0)
76
+ execjs (1.4.0)
77
+ multi_json (~> 1.0)
78
+ factory_girl (2.6.4)
79
+ activesupport (>= 2.3.9)
80
+ factory_girl_rails (1.7.0)
81
+ factory_girl (~> 2.6.0)
82
+ railties (>= 3.0.0)
83
+ faraday (0.8.4)
84
+ multipart-post (~> 1.1)
85
+ ffi (1.1.5)
86
+ friendly_id (4.0.8)
87
+ globalize3 (0.2.0)
88
+ activemodel (>= 3.0.0)
89
+ activerecord (>= 3.0.0)
90
+ paper_trail (~> 2)
91
+ guard (1.4.0)
92
+ listen (>= 0.4.2)
93
+ thor (>= 0.14.6)
94
+ guard-rspec (0.7.3)
95
+ guard (>= 0.10.0)
96
+ guard-spork (0.5.2)
97
+ guard (>= 0.10.0)
98
+ spork (>= 0.8.4)
99
+ hike (1.2.1)
100
+ hpricot (0.8.6)
101
+ httpauth (0.2.0)
102
+ i18n (0.6.1)
103
+ journey (1.0.4)
104
+ jquery-rails (2.0.3)
105
+ railties (>= 3.1.0, < 5.0)
106
+ thor (~> 0.14)
107
+ json (1.7.5)
108
+ jwt (0.1.5)
109
+ multi_json (>= 1.0)
110
+ libwebsocket (0.1.5)
111
+ addressable
112
+ listen (0.5.2)
113
+ mail (2.4.4)
114
+ i18n (>= 0.4.0)
115
+ mime-types (~> 1.16)
116
+ treetop (~> 1.4.8)
117
+ mime-types (1.19)
118
+ multi_json (1.3.6)
119
+ multipart-post (1.1.5)
120
+ mysql2 (0.3.11)
121
+ nokogiri (1.5.5)
122
+ oauth (0.4.7)
123
+ oauth2 (0.8.0)
124
+ faraday (~> 0.8)
125
+ httpauth (~> 0.1)
126
+ jwt (~> 0.1.4)
127
+ multi_json (~> 1.0)
128
+ rack (~> 1.2)
129
+ orm_adapter (0.0.7)
130
+ paper_trail (2.6.3)
131
+ activerecord (~> 3.0)
132
+ railties (~> 3.0)
133
+ pg (0.14.1)
134
+ polyglot (0.3.3)
135
+ rack (1.4.1)
136
+ rack-cache (1.2)
137
+ rack (>= 0.4)
138
+ rack-ssl (1.3.2)
139
+ rack
140
+ rack-test (0.6.1)
141
+ rack (>= 1.0)
142
+ rails (3.2.8)
143
+ actionmailer (= 3.2.8)
144
+ actionpack (= 3.2.8)
145
+ activerecord (= 3.2.8)
146
+ activeresource (= 3.2.8)
147
+ activesupport (= 3.2.8)
148
+ bundler (~> 1.0)
149
+ railties (= 3.2.8)
150
+ railties (3.2.8)
151
+ actionpack (= 3.2.8)
152
+ activesupport (= 3.2.8)
153
+ rack-ssl (~> 1.3.2)
154
+ rake (>= 0.8.7)
155
+ rdoc (~> 3.4)
156
+ thor (>= 0.14.6, < 2.0)
157
+ rake (0.9.2.2)
158
+ rb-fsevent (0.9.2)
159
+ rdoc (3.12)
160
+ json (~> 1.4)
161
+ refinerycms (2.0.8)
162
+ bundler (~> 1.0)
163
+ refinerycms-authentication (= 2.0.8)
164
+ refinerycms-core (= 2.0.8)
165
+ refinerycms-dashboard (= 2.0.8)
166
+ refinerycms-images (= 2.0.8)
167
+ refinerycms-pages (= 2.0.8)
168
+ refinerycms-resources (= 2.0.8)
169
+ refinerycms-authentication (2.0.8)
170
+ devise (~> 2.0.0)
171
+ orm_adapter (~> 0.0.7)
172
+ refinerycms-core (= 2.0.8)
173
+ refinerycms-core (2.0.8)
174
+ acts_as_indexed (~> 0.7.7)
175
+ awesome_nested_set (~> 2.1.3)
176
+ coffee-rails (~> 3.2.1)
177
+ friendly_id (~> 4.0.1)
178
+ globalize3 (~> 0.2.0)
179
+ jquery-rails (~> 2.0.0)
180
+ rails (>= 3.1.3, < 3.3)
181
+ sass-rails (~> 3.2.3)
182
+ truncate_html (~> 0.5)
183
+ uglifier (>= 1.0.3)
184
+ will_paginate (~> 3.0.2)
185
+ refinerycms-dashboard (2.0.8)
186
+ refinerycms-core (= 2.0.8)
187
+ refinerycms-images (2.0.8)
188
+ dragonfly (~> 0.9.8)
189
+ rack-cache (>= 0.5.3)
190
+ refinerycms-core (= 2.0.8)
191
+ refinerycms-pages (2.0.8)
192
+ awesome_nested_set (~> 2.1.3)
193
+ babosa (!= 0.3.6)
194
+ refinerycms-core (= 2.0.8)
195
+ seo_meta (~> 1.3.0)
196
+ refinerycms-resources (2.0.8)
197
+ dragonfly (~> 0.9.8)
198
+ rack-cache (>= 0.5.3)
199
+ refinerycms-core (= 2.0.8)
200
+ refinerycms-testing (2.0.8)
201
+ capybara (~> 1.1.2)
202
+ database_cleaner (~> 0.7.2)
203
+ factory_girl_rails (~> 1.7.0)
204
+ refinerycms-core (= 2.0.8)
205
+ rspec-rails (~> 2.11)
206
+ rspec (2.11.0)
207
+ rspec-core (~> 2.11.0)
208
+ rspec-expectations (~> 2.11.0)
209
+ rspec-mocks (~> 2.11.0)
210
+ rspec-core (2.11.1)
211
+ rspec-expectations (2.11.3)
212
+ diff-lcs (~> 1.1.3)
213
+ rspec-mocks (2.11.3)
214
+ rspec-rails (2.11.0)
215
+ actionpack (>= 3.0)
216
+ activesupport (>= 3.0)
217
+ railties (>= 3.0)
218
+ rspec (~> 2.11.0)
219
+ ruby_gntp (0.3.4)
220
+ rubyzip (0.9.9)
221
+ sass (3.2.1)
222
+ sass-rails (3.2.5)
223
+ railties (~> 3.2.0)
224
+ sass (>= 3.1.10)
225
+ tilt (~> 1.3)
226
+ selenium-webdriver (2.25.0)
227
+ childprocess (>= 0.2.5)
228
+ libwebsocket (~> 0.1.3)
229
+ multi_json (~> 1.0)
230
+ rubyzip
231
+ seo_meta (1.3.0)
232
+ railties (>= 3.0.0)
233
+ simple_oauth (0.1.9)
234
+ spork (0.9.2)
235
+ sprockets (2.1.3)
236
+ hike (~> 1.2)
237
+ rack (~> 1.0)
238
+ tilt (~> 1.1, != 1.3.0)
239
+ sqlite3 (1.3.6)
240
+ thor (0.16.0)
241
+ tilt (1.3.3)
242
+ treetop (1.4.10)
243
+ polyglot
244
+ polyglot (>= 0.3.1)
245
+ truncate_html (0.5.5)
246
+ tzinfo (0.3.33)
247
+ uglifier (1.3.0)
248
+ execjs (>= 0.3.0)
249
+ multi_json (~> 1.0, >= 1.0.2)
250
+ warden (1.1.1)
251
+ rack (>= 1.0)
252
+ will_paginate (3.0.3)
253
+ xml-simple (1.1.1)
254
+ xpath (0.1.4)
255
+ nokogiri (~> 1.3)
256
+ youtube_it (2.1.7)
257
+ builder
258
+ faraday (~> 0.8)
259
+ nokogiri (~> 1.5.2)
260
+ oauth (~> 0.4.4)
261
+ oauth2 (~> 0.6)
262
+ simple_oauth (~> 0.1.5)
263
+
264
+ PLATFORMS
265
+ ruby
266
+
267
+ DEPENDENCIES
268
+ activerecord-jdbcmysql-adapter
269
+ activerecord-jdbcpostgresql-adapter
270
+ activerecord-jdbcsqlite3-adapter
271
+ coffee-rails
272
+ guard-rspec (~> 0.7.0)
273
+ guard-spork (~> 0.5.2)
274
+ jquery-rails (~> 2.0.0)
275
+ jruby-openssl
276
+ mysql2
277
+ pg
278
+ rb-fchange (~> 0.0.5)
279
+ rb-fsevent (~> 0.9.0)
280
+ rb-notifu (~> 0.0.4)
281
+ refinerycms (~> 2.0.3)
282
+ refinerycms-sl-videos!
283
+ refinerycms-testing (~> 2.0.3)
284
+ ruby_gntp (~> 0.3.4)
285
+ sass-rails
286
+ spork (~> 0.9.0)
287
+ sqlite3
288
+ uglifier
289
+ win32console (~> 1.3.0)
data/Guardfile ADDED
@@ -0,0 +1,27 @@
1
+ guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
2
+ watch('config/application.rb')
3
+ watch('config/environment.rb')
4
+ watch(%r{^config/environments/.+\.rb$})
5
+ watch(%r{^config/initializers/.+\.rb$})
6
+ watch('spec/spec_helper.rb')
7
+ watch(%r{^spec/support/.+\.rb$})
8
+ watch(%r{^vendor/extensions/(.+)/spec/support/.+\.rb$})
9
+ end
10
+
11
+ guard 'rspec', :version => 2, :cli => (['~/.rspec', '.rspec'].map{|f| File.read(File.expand_path(f)).split("\n").join(' ') if File.exists?(File.expand_path(f))}.join(' ')) do
12
+ watch(%r{^spec/.+_spec\.rb$})
13
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
14
+ watch('spec/spec_helper.rb') { "spec" }
15
+
16
+ # Rails example
17
+ watch(%r{^spec/.+_spec\.rb$})
18
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
19
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
20
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
21
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
22
+ watch('spec/spec_helper.rb') { "spec" }
23
+ watch('config/routes.rb') { "spec/routing" }
24
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
25
+ # Capybara request specs
26
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
27
+ end
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+
8
+ ENGINE_PATH = File.dirname(__FILE__)
9
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
10
+
11
+ if File.exists?(APP_RAKEFILE)
12
+ load 'rails/tasks/engine.rake'
13
+ end
14
+
15
+ require "refinerycms-testing"
16
+ Refinery::Testing::Railtie.load_tasks
17
+ Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
18
+
19
+ load File.expand_path('../tasks/testing.rake', __FILE__)
20
+ load File.expand_path('../tasks/rspec.rake', __FILE__)
21
+
22
+ task :default => :spec
@@ -0,0 +1,12 @@
1
+ module Refinery
2
+ module Videos
3
+ module Admin
4
+ class VideosController < ::Refinery::AdminController
5
+
6
+ crudify :'refinery/videos/video', :xhr_paging => true,
7
+ :order => "created_at DESC", :sortable => false
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,34 @@
1
+ module Refinery
2
+ module Videos
3
+ class VideosController < ::ApplicationController
4
+
5
+ before_filter :find_all_videos
6
+ before_filter :find_page
7
+
8
+ def index
9
+ # you can use meta fields from your model instead (e.g. browser_title)
10
+ # by swapping @page for @video in the line below:
11
+ present(@page)
12
+ end
13
+
14
+ def show
15
+ @video = Video.find(params[:id])
16
+
17
+ # you can use meta fields from your model instead (e.g. browser_title)
18
+ # by swapping @page for @video in the line below:
19
+ present(@page)
20
+ end
21
+
22
+ protected
23
+
24
+ def find_all_videos
25
+ @videos = Video.order('position ASC')
26
+ end
27
+
28
+ def find_page
29
+ @page = ::Refinery::Page.where(:link_url => "/videos").first
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,64 @@
1
+ module Refinery
2
+ module Videos
3
+ class Video < Refinery::Core::BaseModel
4
+ self.table_name = 'refinery_videos'
5
+
6
+ attr_accessor :video_data
7
+
8
+ translates :title, :video_text, :video_url, :custom_url, :slug, :include => :seo_meta
9
+
10
+ extend FriendlyId
11
+ friendly_id :friendly_id_source, :use => [:slugged, :globalize]
12
+
13
+ is_seo_meta if self.table_exists?
14
+ class Translation
15
+ is_seo_meta
16
+ attr_accessible :browser_title, :meta_description, :meta_keywords, :locale
17
+ end
18
+
19
+ # Delegate SEO Attributes to globalize3 translation
20
+ seo_fields = ::SeoMeta.attributes.keys.map{|a| [a, :"#{a}="]}.flatten
21
+ delegate(*(seo_fields << {:to => :translation}))
22
+
23
+ attr_accessible :title, :video_url, :video_text, :custom_url, :position, :width, :height
24
+ attr_accessible :browser_title, :meta_keywords, :meta_description
25
+ attr_accessor :locale # to hold temporarily
26
+
27
+ acts_as_indexed :fields => [:title, :video_text]
28
+
29
+ validates :title, :presence => true, :uniqueness => true
30
+ validates :video_url, :presence => true
31
+
32
+ before_save { |m| m.translation.save }
33
+ after_initialize :initialize_attributes
34
+ before_validation :set_title_from_video, :if => 'title.blank?'
35
+
36
+ delegate :thumbnail, :embed_html, :to => :video_data, :allow_nil => true
37
+
38
+ def friendly_id_source
39
+ custom_url.presence || title
40
+ end
41
+
42
+ def initialize_attributes
43
+ self.load_video_data
44
+ end
45
+
46
+ def load_video_data
47
+ self.video_data = self.video_url.blank? ? nil : (UnvlogIt.new(self.video_url) rescue nil)
48
+ end
49
+
50
+ def video_url= video_url
51
+ self[:video_url] = video_url
52
+ self.load_video_data
53
+ end
54
+
55
+ def set_title_from_video
56
+ self.title = self.video_data.title unless self.video_data.blank?
57
+ end
58
+
59
+ def embed_html_with_dimensions
60
+ self.width && self.height ? self.embed_html(self.width, self.height) : self.embed_html
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,11 @@
1
+ <input type='hidden' name='switch_locale' id='switch_locale' value='<%= local_assigns[:current_locale] %>' />
2
+ <% if (locales ||= Refinery::I18n.frontend_locales).present? and locales.many? %>
3
+ <ul id='switch_locale_picker' class='clearfix'>
4
+ <% locales.each do |locale| %>
5
+ <li<%= " class='selected'" if locale.to_s == local_assigns[:current_locale].to_s %>>
6
+ <%= link_to refinery_icon_tag("flags/#{locale}.png", :size => "32x22"),
7
+ refinery.url_for(:switch_locale => locale) %>
8
+ </li>
9
+ <% end %>
10
+ </ul>
11
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <ul>
2
+ <% if ::Refinery::Videos::Admin::VideosController.searchable? %>
3
+ <li>
4
+ <%= render '/refinery/admin/search', :url => refinery.videos_admin_videos_path %>
5
+ </li>
6
+ <% end %>
7
+ <li>
8
+ <%= link_to t('.create_new'), refinery.new_videos_admin_video_path,
9
+ :class => "add_icon" %>
10
+ </li>
11
+ <% if !searching? && ::Refinery::Videos::Admin::VideosController.sortable? && ::Refinery::Videos::Video.any? %>
12
+ <li>
13
+ <%= link_to t('.reorder', :what => "Videos"),
14
+ refinery.videos_admin_videos_path,
15
+ :id => "reorder_action",
16
+ :class => "reorder_icon" %>
17
+
18
+ <%= link_to t('.reorder_done', :what => "Videos"),
19
+ refinery.videos_admin_videos_path,
20
+ :id => "reorder_action_done",
21
+ :style => "display: none;",
22
+ :class => "reorder_icon" %>
23
+ </li>
24
+ <% end %>
25
+ </ul>
@@ -0,0 +1,44 @@
1
+ <%= form_for [refinery, :videos_admin, @video] do |f| -%>
2
+ <%= render '/refinery/admin/error_messages',
3
+ :object => @video,
4
+ :include_object_name => true %>
5
+
6
+ <%= render "/refinery/videos/admin/shared/locale_picker",
7
+ :current_locale => Thread.current[:globalize_locale] if Refinery.i18n_enabled? %>
8
+
9
+ <div class='field'>
10
+ <%= f.label :title -%>(<%= t '.title_description' %>)
11
+ <%= f.text_field :title, :class => 'larger widest' -%>
12
+ </div>
13
+
14
+ <div class='field'>
15
+ <%= f.label :video_url -%>
16
+ <%= f.text_field :video_url -%>
17
+ </div>
18
+
19
+ <div class='field'>
20
+ <%= f.label :width -%>
21
+ <%= f.text_field :width -%>
22
+ <%= f.label :height -%>
23
+ <%= f.text_field :height -%>
24
+ </div>
25
+
26
+ <div class='field'>
27
+ <%= f.label :video_text -%>
28
+ <%= f.text_area :video_text, :rows => 20, :class => 'wymeditor widest' -%>
29
+ </div>
30
+
31
+ <div class='field'>
32
+ <%= f.label :custom_url -%>
33
+ <%= f.text_field :custom_url -%>
34
+ </div>
35
+
36
+ <div>
37
+ <%= render '/seo_meta/form', :form => f %>
38
+ </div>
39
+
40
+ <%= render '/refinery/admin/form_actions', :f => f,
41
+ :continue_editing => false,
42
+ :delete_title => t('delete', :scope => 'refinery.videos.admin.videos.video'),
43
+ :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @video.title) %>
44
+ <% end -%>
@@ -0,0 +1,18 @@
1
+ <% if searching? %>
2
+ <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
3
+ <% end %>
4
+ <div class='pagination_container'>
5
+ <% if @videos.any? %>
6
+ <%= render 'videos' %>
7
+ <% else %>
8
+ <p>
9
+ <% unless searching? %>
10
+ <strong>
11
+ <%= t('.no_items_yet') %>
12
+ </strong>
13
+ <% else %>
14
+ <%= t('no_results', :scope => 'refinery.admin.search') %>
15
+ <% end %>
16
+ </p>
17
+ <% end %>
18
+ </div>
@@ -0,0 +1,5 @@
1
+ <ul id='sortable_list'>
2
+ <%= render :partial => 'video', :collection => @videos %>
3
+ </ul>
4
+ <%= render '/refinery/admin/sortable_list',
5
+ :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %>
@@ -0,0 +1,33 @@
1
+ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(video) -%>">
2
+ <span class='title'>
3
+ <%= video.title %>
4
+ <span class="preview">
5
+ <% video.translations.each do |translation| %>
6
+ <% if translation.title.present? %>
7
+ <%= link_to refinery_icon_tag("flags/#{translation.locale}.png", :size => '16x11'),
8
+ refinery.edit_videos_admin_video_path(video, :switch_locale => translation.locale),
9
+ :class => 'locale' %>
10
+ <% end %>
11
+ <% end %>
12
+ <%= video.created_at.try(:strftime, '%b %d, %Y') %>
13
+ <% if video.video_data %>
14
+ <div style="text-align: center;"><%= image_tag video.thumbnail %></div>
15
+ <% end %>
16
+ </span>
17
+
18
+ </span>
19
+ <span class='actions'>
20
+
21
+ <%= link_to refinery_icon_tag("application_go.png"), refinery.videos_video_path(video),
22
+ :title => t('.view_live_html'),
23
+ :target => "_blank" %>
24
+
25
+ <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_videos_admin_video_path(video),
26
+ :title => t('.edit') %>
27
+ <%= link_to refinery_icon_tag("delete.png"), refinery.videos_admin_video_path(video),
28
+ :class => "cancel confirm-delete",
29
+ :title => t('.delete'),
30
+ :confirm => t('message', :scope => 'refinery.admin.delete', :title => video.title),
31
+ :method => :delete %>
32
+ </span>
33
+ </li>
@@ -0,0 +1,2 @@
1
+ <%= will_paginate @videos if Refinery::Videos::Admin::VideosController.pageable? %>
2
+ <%= render 'sortable_list' %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,7 @@
1
+ <section id='records'>
2
+ <%= render 'records' %>
3
+ </section>
4
+ <aside id='actions'>
5
+ <%= render 'actions' %>
6
+ </aside>
7
+ <%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::Videos::Admin::VideosController.sortable? and ::Refinery::Videos::Video.count > 1 %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>