refinerycms-photo-gallery 0.0.1.dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/Gemfile +26 -0
  2. data/LICENSE.md +8 -0
  3. data/README.md +224 -0
  4. data/app/assets/images/refinery/photo_gallery/admin/chosen-sprite.png +0 -0
  5. data/app/assets/images/refinery/photo_gallery/admin/icons/album.png +0 -0
  6. data/app/assets/images/refinery/photo_gallery/admin/icons/album_add.png +0 -0
  7. data/app/assets/images/refinery/photo_gallery/admin/icons/album_edit.png +0 -0
  8. data/app/assets/images/refinery/photo_gallery/admin/icons/cog.png +0 -0
  9. data/app/assets/images/refinery/photo_gallery/admin/icons/down.gif +0 -0
  10. data/app/assets/images/refinery/photo_gallery/admin/icons/folder.png +0 -0
  11. data/app/assets/images/refinery/photo_gallery/admin/icons/folder_add.png +0 -0
  12. data/app/assets/images/refinery/photo_gallery/admin/icons/folder_edit.png +0 -0
  13. data/app/assets/images/refinery/photo_gallery/admin/icons/loading.gif +0 -0
  14. data/app/assets/images/refinery/photo_gallery/admin/icons/page_copy.png +0 -0
  15. data/app/assets/images/refinery/photo_gallery/admin/icons/photo.png +0 -0
  16. data/app/assets/images/refinery/photo_gallery/admin/icons/photo_add.png +0 -0
  17. data/app/assets/images/refinery/photo_gallery/admin/icons/photo_edit.png +0 -0
  18. data/app/assets/images/refinery/photo_gallery/admin/icons/up.gif +0 -0
  19. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/backgrounds.gif +0 -0
  20. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons-disabled.png +0 -0
  21. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons.png +0 -0
  22. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/delete.gif +0 -0
  23. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/done.gif +0 -0
  24. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/error.gif +0 -0
  25. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/throbber.gif +0 -0
  26. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/transp50.png +0 -0
  27. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload-bw.png +0 -0
  28. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload.png +0 -0
  29. data/app/assets/images/refinery/photo_gallery/admin/rss-feed.png +0 -0
  30. data/app/assets/images/refinery/photo_gallery/fancybox/blank.gif +0 -0
  31. data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_loading.gif +0 -0
  32. data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_sprite.png +0 -0
  33. data/app/assets/images/refinery/photo_gallery/fancybox/helpers/fancybox_buttons.png +0 -0
  34. data/app/assets/javascripts/refinery/photo_gallery/admin/jquery.chosen.min.js +10 -0
  35. data/app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js +28 -0
  36. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/changelog.txt +218 -0
  37. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/cs.js +14 -0
  38. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/da.js +12 -0
  39. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/de.js +24 -0
  40. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/el.js +14 -0
  41. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/es.js +25 -0
  42. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/et.js +33 -0
  43. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fa.js +37 -0
  44. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fi.js +33 -0
  45. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr-ca.js +35 -0
  46. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr.js +25 -0
  47. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hr.js +25 -0
  48. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hu.js +33 -0
  49. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/it.js +24 -0
  50. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ja.js +37 -0
  51. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ko.js +36 -0
  52. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lv.js +33 -0
  53. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/nl.js +21 -0
  54. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pl.js +24 -0
  55. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt-br.js +35 -0
  56. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ro.js +24 -0
  57. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ru.js +21 -0
  58. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sk.js +37 -0
  59. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sr.js +14 -0
  60. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sv.js +12 -0
  61. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js +195 -0
  62. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.js +383 -0
  63. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/license.txt +339 -0
  64. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.browserplus.js +1 -0
  65. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.js +226 -0
  66. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.swf +0 -0
  67. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js +2525 -0
  68. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js.default +2525 -0
  69. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.gears.js +1 -0
  70. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html4.js +1 -0
  71. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js +765 -0
  72. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js.default +765 -0
  73. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.js +618 -0
  74. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.js +1 -0
  75. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.xap +0 -0
  76. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/readme.md +46 -0
  77. data/app/assets/javascripts/refinery/photo_gallery/fancybox/CHANGELOG.md +68 -0
  78. data/app/assets/javascripts/refinery/photo_gallery/fancybox/README.md +212 -0
  79. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.js +115 -0
  80. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-media.js +85 -0
  81. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.js +157 -0
  82. data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.js +1463 -0
  83. data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.pack.js +35 -0
  84. data/app/assets/javascripts/refinery/photo_gallery/fancybox/lib/jquery.mousewheel-3.0.6.pack.js +13 -0
  85. data/app/assets/stylesheets/refinery/photo_gallery/admin/chosen.css.scss +396 -0
  86. data/app/assets/stylesheets/refinery/photo_gallery/admin/photo_gallery.css.scss +109 -0
  87. data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css.scss +177 -0
  88. data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.css.scss +147 -0
  89. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.css.scss +85 -0
  90. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.css +54 -0
  91. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/jquery.fancybox.css.scss +234 -0
  92. data/app/controllers/refinery/photo_gallery/admin/albums_controller.rb +23 -0
  93. data/app/controllers/refinery/photo_gallery/admin/collections_controller.rb +10 -0
  94. data/app/controllers/refinery/photo_gallery/admin/photos_controller.rb +67 -0
  95. data/app/controllers/refinery/photo_gallery/albums_controller.rb +21 -0
  96. data/app/controllers/refinery/photo_gallery/collections_controller.rb +28 -0
  97. data/app/helpers/refinery/photo_gallery/admin/photos_helper.rb +10 -0
  98. data/app/helpers/refinery/photo_gallery/albums_helper.rb +11 -0
  99. data/app/helpers/refinery/photo_gallery/photo_gallery_helper.rb +58 -0
  100. data/app/middleware/refinery/photo_gallery/admin/flash_session_cookie_middleware.rb +27 -0
  101. data/app/models/refinery/photo_gallery/album.rb +60 -0
  102. data/app/models/refinery/photo_gallery/collection.rb +29 -0
  103. data/app/models/refinery/photo_gallery/collection_album.rb +8 -0
  104. data/app/models/refinery/photo_gallery/photo.rb +54 -0
  105. data/app/uploaders/refinery/photo_gallery/admin/file_uploader.rb +121 -0
  106. data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +44 -0
  107. data/app/views/refinery/photo_gallery/admin/albums/_album.html.erb +31 -0
  108. data/app/views/refinery/photo_gallery/admin/albums/_form.html.erb +78 -0
  109. data/app/views/refinery/photo_gallery/admin/albums/_sortable_list.html.erb +7 -0
  110. data/app/views/refinery/photo_gallery/admin/albums/edit.html.erb +2 -0
  111. data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +28 -0
  112. data/app/views/refinery/photo_gallery/admin/albums/new.html.erb +2 -0
  113. data/app/views/refinery/photo_gallery/admin/collections/_collection.html.erb +23 -0
  114. data/app/views/refinery/photo_gallery/admin/collections/_form.html.erb +32 -0
  115. data/app/views/refinery/photo_gallery/admin/collections/_sortable_list.html.erb +7 -0
  116. data/app/views/refinery/photo_gallery/admin/collections/edit.html.erb +2 -0
  117. data/app/views/refinery/photo_gallery/admin/collections/index.html.erb +28 -0
  118. data/app/views/refinery/photo_gallery/admin/collections/new.html.erb +2 -0
  119. data/app/views/refinery/photo_gallery/admin/collections/test.html.erb +39 -0
  120. data/app/views/refinery/photo_gallery/admin/photos/_destroy.js.erb +15 -0
  121. data/app/views/refinery/photo_gallery/admin/photos/_form.html.erb +7 -0
  122. data/app/views/refinery/photo_gallery/admin/photos/_form_actions.html.erb +6 -0
  123. data/app/views/refinery/photo_gallery/admin/photos/_form_fields.html.erb +31 -0
  124. data/app/views/refinery/photo_gallery/admin/photos/_form_fields_actions.html.erb +15 -0
  125. data/app/views/refinery/photo_gallery/admin/photos/edit_multiple.html.erb +9 -0
  126. data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +87 -0
  127. data/app/views/refinery/photo_gallery/albums/show.html.erb +26 -0
  128. data/app/views/refinery/photo_gallery/collections/index.html.erb +9 -0
  129. data/app/views/refinery/photo_gallery/collections/show.html.erb +19 -0
  130. data/app/views/refinery/photo_gallery/shared/_layout.html.erb +22 -0
  131. data/app/views/refinery/photo_gallery/shared/_submenu.html.erb +4 -0
  132. data/config/initializers/carrierwave.rb +7 -0
  133. data/config/initializers/form_builder.rb +26 -0
  134. data/config/initializers/refinery/core.rb +10 -0
  135. data/config/initializers/s3.rb +13 -0
  136. data/config/initializers/session_store.rb +10 -0
  137. data/config/locales/en.yml +95 -0
  138. data/config/locales/sk.yml +94 -0
  139. data/config/routes.rb +37 -0
  140. data/db/migrate/20120804063842_create_albums.rb +18 -0
  141. data/db/migrate/20120805131321_create_collections.rb +14 -0
  142. data/db/migrate/20120805131547_create_collection_albums.rb +12 -0
  143. data/db/migrate/20120805165238_create_photos.rb +19 -0
  144. data/db/migrate/20120805222125_add_indexes.rb +24 -0
  145. data/db/seeds.rb +21 -0
  146. data/lib/generators/refinery/photo_gallery_generator.rb +25 -0
  147. data/lib/generators/refinery/templates/config/initializers/refinery/photo_gallery.rb.erb +40 -0
  148. data/lib/refinery/photo_gallery.rb +30 -0
  149. data/lib/refinery/photo_gallery/configuration.rb +33 -0
  150. data/lib/refinery/photo_gallery/engine.rb +33 -0
  151. data/lib/refinery/photo_gallery/version.rb +17 -0
  152. data/lib/refinerycms-photo-gallery.rb +1 -0
  153. data/refinerycms-balder-photo-gallery.gemspec +30 -0
  154. data/screenshots/01_collections#index.png +0 -0
  155. data/screenshots/02_albums#create.png +0 -0
  156. data/screenshots/03_photos#upload.png +0 -0
  157. data/screenshots/04_photos#upload- chooser.png +0 -0
  158. data/screenshots/05_photo#upoad-queue.png +0 -0
  159. data/screenshots/06_photos#upload-uploading.png +0 -0
  160. data/screenshots/07_photos#upload-uploading_2.png +0 -0
  161. data/screenshots/08_photos#edit_multiple.png +0 -0
  162. data/screenshots/09_albums#index.png +0 -0
  163. data/screenshots/10_albums_EXIF_reading.png +0 -0
  164. data/screenshots/11_frontend_show.png +0 -0
  165. data/screenshots/12_show_photo_using_fancybox.png +0 -0
  166. metadata +323 -0
@@ -0,0 +1,4 @@
1
+ <div class="custom-sidebar gdl-divider">
2
+ <%= generate_photo_gallery_menu(@collections, @albums, {:ul=>{:class => "classtest", :id=>"idtest" }}) %>
3
+ </div>
4
+ <div class="pt30"></div>
@@ -0,0 +1,7 @@
1
+
2
+ CarrierWave.configure do |config|
3
+ config.root = Rails.root.to_s + Refinery::PhotoGallery.photo_gallery_dir_relative_to_root
4
+ #Prefix in Uploader#url See https://github.com/jnicklas/carrierwave/pull/445
5
+ config.base_path = Refinery::PhotoGallery.photo_gallery_dir
6
+ end
7
+
@@ -0,0 +1,26 @@
1
+ # Self-marking required fields http://davidsulc.com/blog/2011/05/01/self-marking-required-fields-in-rails-3/
2
+ # It works, but I'm leaving it commented. It affects all forms in refinery app, not only in this gem
3
+ =begin
4
+
5
+ class ActionView::Helpers::FormBuilder
6
+ alias :orig_label :label
7
+
8
+ # add a '*' after the field label if the field is required
9
+ def label(method, content_or_options = nil, options = nil, &block)
10
+ if content_or_options && content_or_options.class == Hash
11
+ options = content_or_options
12
+ else
13
+ content = content_or_options
14
+ end
15
+
16
+ required_mark = ''
17
+ required_mark = ' *'.html_safe if object.class.validators_on(method).map(&:class).include? ActiveModel::Validations::PresenceValidator
18
+
19
+ content ||= I18n.t("activerecord.attributes.#{object.class.name.underscore}.#{method}", :default=>method.to_s.humanize)
20
+ content = content + required_mark
21
+
22
+ self.orig_label(method, content, options || {}, &block)
23
+ end
24
+ end
25
+
26
+ =end
@@ -0,0 +1,10 @@
1
+ Refinery::Core.configure do |config|
2
+ # Register extra javascript for backend
3
+ config.register_javascript "refinery/photo_gallery/admin/photo_gallery.js"
4
+ config.register_javascript "refinery/photo_gallery/admin/jquery.chosen.min.js"
5
+
6
+ #Register extra stylesheet for backend (optional options)
7
+ config.register_stylesheet "refinery/photo_gallery/admin/photo_gallery.css"
8
+ config.register_stylesheet "refinery/photo_gallery/admin/chosen.css"
9
+
10
+ end
@@ -0,0 +1,13 @@
1
+ =begin
2
+ #TODO not tested
3
+ Refinery::PhotoGallery::CarrierWave.configure do |config|
4
+ config.fog_credentials = {
5
+ :provider => 'AWS',
6
+ :aws_access_key_id => ENV['S3_KEY'],
7
+ :aws_secret_access_key => ENV['S3_SECRET']
8
+ # :region => ENV['S3_REGION'] # Change this for different AWS region. Default is 'us-east-1'
9
+ }
10
+ config.fog_directory = ENV['S3_BUCKET']
11
+ end
12
+
13
+ =end
@@ -0,0 +1,10 @@
1
+ #Rails.application.config.session_store :cookie_store, :key => '_balder_session'
2
+
3
+ =begin
4
+ #TODO fix flash runtime
5
+ Rails.application.config.middleware.insert_before(
6
+ Rails.application.config.session_store,
7
+ Refinery::PhotoGallery::Admin::FlashSessionCookieMiddleware,
8
+ Rails.application.config.session_options[:key]
9
+ )
10
+ =end
@@ -0,0 +1,95 @@
1
+ en:
2
+ refinery:
3
+ plugins:
4
+ refinerycms_photo_gallery:
5
+ title: Photo Gallery
6
+ description: Provides advanced photo gallery
7
+ photo_gallery:
8
+ albums:
9
+ show:
10
+ image: Image
11
+ no_photos: There are no photos in this album yet
12
+ collections:
13
+ show:
14
+ no_albums: There are no albums in this collection yet
15
+ index:
16
+ no_collections: There are no collections yet
17
+ admin:
18
+ submenu:
19
+ collections:
20
+ title: Collections
21
+ manage: Manage
22
+ new: Create new collection
23
+ albums:
24
+ title: Albums
25
+ manage: Manage
26
+ new: Create new album
27
+ collections:
28
+ collection:
29
+ view_live_html: 'View this collection live <br/><em>(opens in a new window)</em>'
30
+ delete: Remove this collection forever
31
+ edit: Edit this collection
32
+ index:
33
+ no_items_yet: 'There are no collections yet. Click "%{create}" to add your first collection.'
34
+ new:
35
+ title: Create new collection
36
+ edit:
37
+ title: Edit collection
38
+ albums:
39
+ album:
40
+ view_live_html: 'View this album live <br/><em>(opens in a new window)</em>'
41
+ delete: Remove this album forever
42
+ edit: Edit this album
43
+ upload_photos: Upload new photos to album
44
+ edit_photos: Edit photos in album
45
+ index:
46
+ no_items_yet: 'There are no albums yet. Click "%{create}" to add your first album.'
47
+ new:
48
+ title: Create new album
49
+ edit:
50
+ title: Edit album
51
+ form:
52
+ album_belongs_to_collection: Album belongs to collection(s)
53
+ more_options: More options
54
+ more_options_tooltip: Enable edit more fields like adress, latitude, longitude, note
55
+ choose_collection: Choose collection(s)
56
+ path_prefix: Path prefix
57
+ number_of_photos: Contains %{number} photos
58
+ photos:
59
+ updated: Updated photos
60
+ title: Photos
61
+ manage: Manage
62
+ new: Upload new photos
63
+ edit_multiple:
64
+ no_photos_yet: There are no photos in album yet. Click "%{create} to add your first photos to album.'
65
+ photo:
66
+ delete: Remove this photo forever
67
+ deleted: Deleted photo "%{title}"
68
+ form_fields:
69
+ use_decimal_format: Use decimal format
70
+
71
+
72
+ activerecord:
73
+ models:
74
+ refinery/photo_gallery/collection: Collection
75
+ refinery/photo_gallery/collection: Album
76
+ attributes:
77
+ refinery/photo_gallery/collection:
78
+ title: Title
79
+ description: Description
80
+ refinery/photo_gallery/album:
81
+ title: Title
82
+ description: Description
83
+ longitude: Longitude
84
+ latitude: Latitude
85
+ path: Path
86
+ adress: Adress
87
+ note: Note
88
+ tags: Tags
89
+ refinery/photo_gallery/photo:
90
+ title: Title
91
+ description: Description
92
+ longitude: Longitude
93
+ latitude: Latitude
94
+ path: Path
95
+ file: File
@@ -0,0 +1,94 @@
1
+ sk:
2
+ refinery:
3
+ plugins:
4
+ refinerycms_photo_gallery:
5
+ title: Fotogaléria
6
+ description: Poskytuje fotogalériu
7
+ photo_gallery:
8
+ albums:
9
+ show:
10
+ image: Obrázok
11
+ no_photos: V albume sa zatiaľ nenachádzajú žiadne fotografie
12
+ collections:
13
+ show:
14
+ no_albums: V tejto skupine albumov sa zatiať nenachádza žiadny album
15
+ index:
16
+ no_collections: Zatiaľ neboli vytvorené žiadne skupiny albumov
17
+ admin:
18
+ submenu:
19
+ collections:
20
+ title: Skupiny albumov
21
+ manage: Spravovať
22
+ new: Vytvoriť novú skupinu albumov
23
+ albums:
24
+ title: Abumy
25
+ manage: Spravovať
26
+ new: Vytvoriť nový albun
27
+ collections:
28
+ collection:
29
+ view_live_html: 'Pozrieť náhľad skupiny albumov<br/><em>(otvorí sa v novom okne)</em>'
30
+ delete: Zmazať skupinu albumov
31
+ edit: Upraviť skupinu albumov
32
+ index:
33
+ no_items_yet: 'Zatiaľ neboli vytvorené žiadne skupiny albumov. Klikni "%{create}" pre vytvorenie prvej.'
34
+ new:
35
+ title: Vytvoriť novú skupinu albumov
36
+ edit:
37
+ title: Upraviť skupinu albumov
38
+ albums:
39
+ album:
40
+ view_live_html: 'Zobraziť náhľad albumu <br/><em>(otvorí sa v novom okne)</em>'
41
+ delete: Zmazať album
42
+ edit: Upraviť album
43
+ upload_photos: Nahrať fotografie do albumu
44
+ edit_photos: Upraviť fotografie v albume
45
+ index:
46
+ no_items_yet: 'Zatiaľ neboli vytvorené žiadne albumy. Klikni "%{create}" pre vytvorenie prvého.'
47
+ new:
48
+ title: Vytvoriť nový album
49
+ edit:
50
+ title: Upraviť album
51
+ form:
52
+ album_belongs_to_collection: Album patrí do skupiny albumov
53
+ more_options: Rozšírené nastavenia
54
+ more_options_tooltip: Umožní upraviť ďalšie polia ako adresa, zemepisná dĺžka/šírka, poznámka
55
+ choose_collection: Vyber skupiny albumov
56
+ path_prefix: Prefix priečinka
57
+ number_of_photos: 'Obsahuje fotografií: %{number}'
58
+ photos:
59
+ updated: Fotografie upravené
60
+ title: Fotografie
61
+ manage: Spravovať
62
+ new: Nahrať nové fotografie
63
+ edit_multiple:
64
+ no_photos_yet: Zatiaľ neboli nahrané žiadne fotografie. Klikni "%{create}" pre pridanie prvých.
65
+ photo:
66
+ delete: Zmazať fotografiu
67
+ deleted: Fotografia "%{title}" zmazaná
68
+ form_fields:
69
+ use_decimal_format: Použi decimálny zápis
70
+
71
+ activerecord:
72
+ models:
73
+ refinery/photo_gallery/collection: Skupina albumov
74
+ refinery/photo_gallery/collection: Album
75
+ attributes:
76
+ refinery/photo_gallery/collection:
77
+ title: Názov
78
+ description: Popis
79
+ refinery/photo_gallery/album:
80
+ title: Názov
81
+ description: Popis
82
+ longitude: Zemepisná dĺžka
83
+ latitude: Zemepisná šírka
84
+ path: Názov priečinku
85
+ adress: Adresa
86
+ note: Poznámka
87
+ tags: Tagy
88
+ refinery/photo_gallery/photo:
89
+ title: Názov
90
+ description: Popis
91
+ longitude: Zemepisná dĺžka
92
+ latitude: Zemepisná šírka
93
+ path: Názov priečinku
94
+ file: Súbor
data/config/routes.rb ADDED
@@ -0,0 +1,37 @@
1
+ Refinery::Core::Engine.routes.draw do
2
+ namespace "photo_gallery", :path => 'photo-gallery' do
3
+ root :to => "collections#index"
4
+
5
+ resources :collections, :only => [:index,:show] do
6
+ resources :albums, :only => [:show] do
7
+ end
8
+ end
9
+ end
10
+
11
+
12
+ namespace "photo_gallery", :path => '' do
13
+ namespace :admin, :path => 'refinery' do
14
+ scope :path => 'photo-gallery' do
15
+ root :to => "albums#index"
16
+
17
+ resources :photos do
18
+ collection do
19
+ put :update_multiple
20
+ end
21
+ end
22
+
23
+ resources :albums do
24
+ resources :photos do
25
+ collection do
26
+ get :upload
27
+ get :edit_multiple
28
+ end
29
+ end
30
+ end
31
+
32
+ resources :collections
33
+
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,18 @@
1
+ class CreateAlbums < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "refinery_photo_gallery_albums" do |t|
4
+ t.string :title, :length => 250, :null => false
5
+ t.text :description
6
+ t.string :path, :length => 100, :null=> true
7
+ t.string :address, :length => 200, :null=> true
8
+ t.decimal :longitude, :precision => 15, :scale => 10
9
+ t.decimal :latitude, :precision => 15, :scale => 10
10
+ t.text :note
11
+ t.timestamps
12
+ end
13
+ end
14
+
15
+ def self.down
16
+ drop_table "refinery_photo_gallery_albums"
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ class CreateCollections < ActiveRecord::Migration
2
+ def self.up
3
+ create_table Refinery::PhotoGallery::Collection.table_name do |t|
4
+ t.string :title, :null => false
5
+ t.text :description
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table Refinery::PhotoGallery::Collection.table_name
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCollectionAlbums < ActiveRecord::Migration
2
+ def self.up
3
+ create_table Refinery::PhotoGallery::CollectionAlbum.table_name do |t| #TODO primary id to false
4
+ t.references :collection
5
+ t.references :album
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ drop_table Refinery::PhotoGallery::CollectionAlbum.table_name
11
+ end
12
+ end
@@ -0,0 +1,19 @@
1
+ class CreatePhotos < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "refinery_photo_gallery_photos" do |t|
4
+ t.string :title, :length => 250, :null => false
5
+ t.text :description
6
+ t.string :path, :length => 100, :null=> true
7
+ t.decimal :longitude, :precision => 15, :scale => 10
8
+ t.decimal :latitude, :precision => 15, :scale => 10
9
+ t.string :file
10
+
11
+ t.references :album
12
+ t.timestamps
13
+ end
14
+ end
15
+
16
+ def self.down
17
+ drop_table "refinery_photo_gallery_photos"
18
+ end
19
+ end
@@ -0,0 +1,24 @@
1
+ class AddIndexes < ActiveRecord::Migration
2
+ def self.up
3
+ add_index Refinery::PhotoGallery::Album.table_name, :id, :unique => true
4
+ add_index Refinery::PhotoGallery::Collection.table_name, :id, :unique => true
5
+ add_index Refinery::PhotoGallery::Photo.table_name, :id, :unique => true
6
+
7
+
8
+ add_index Refinery::PhotoGallery::CollectionAlbum.table_name, :collection_id
9
+ add_index Refinery::PhotoGallery::CollectionAlbum.table_name, :album_id
10
+ add_index Refinery::PhotoGallery::Photo.table_name, :album_id
11
+ end
12
+
13
+ def self.down
14
+ remove_index Refinery::PhotoGallery::Album.table_name, :id
15
+ remove_index Refinery::PhotoGallery::Collection.table_name, :id
16
+ remove_index Refinery::PhotoGallery::Photo.table_name, :id
17
+
18
+
19
+ remove_index Refinery::PhotoGallery::CollectionAlbum.table_name, :collection_id
20
+ remove_index Refinery::PhotoGallery::CollectionAlbum.table_name, :album_id
21
+ remove_index Refinery::PhotoGallery::Photo.table_name, :album_id
22
+
23
+ end
24
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,21 @@
1
+ if defined?(::Refinery::User)
2
+ ::Refinery::User.all.each do |user|
3
+ if user.plugins.where(:name => 'refinerycms_photo_gallery').blank?
4
+ user.plugins.create(:name => 'refinerycms_photo_gallery',
5
+ :position => (user.plugins.maximum(:position) || -1) +1)
6
+ end
7
+ end
8
+ end
9
+
10
+ if defined?(Refinery::Page) and !Refinery::Page.exists?(:link_url => '/photo-gallery')
11
+ page = Refinery::Page.create(
12
+ :title => "Photo galleries",
13
+ :link_url => "/photo-gallery",
14
+ :deletable => false,
15
+ :menu_match => "^/photo-gallery?(\/|\/.+?|)$"
16
+ )
17
+
18
+ Refinery::Pages.default_parts.each do |default_page_part|
19
+ page.parts.create(:title => default_page_part, :body => nil)
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ module Refinery
2
+ class PhotoGalleryGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def generate_inquiries_initializer
6
+ template 'config/initializers/refinery/photo_gallery.rb.erb', File.join(destination_root, 'config', 'initializers', 'refinery', 'photo_gallery.rb')
7
+ end
8
+
9
+ def rake_db
10
+ rake("refinery_photo_gallery: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 PhotoGallery engine
19
+ Refinery::PhotoGallery::Engine.load_seed
20
+ EOH
21
+ end
22
+ end
23
+
24
+ end
25
+ end