refinerycms-6hoursdaily-photo-gallery 0.0.4.dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. data/Gemfile +27 -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/fi.js +33 -0
  44. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr-ca.js +35 -0
  45. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr.js +25 -0
  46. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hr.js +25 -0
  47. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hu.js +33 -0
  48. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/it.js +24 -0
  49. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ja.js +37 -0
  50. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ko.js +36 -0
  51. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lv.js +33 -0
  52. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/nl.js +21 -0
  53. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pl.js +24 -0
  54. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt-br.js +35 -0
  55. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ro.js +24 -0
  56. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ru.js +21 -0
  57. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sk.js +37 -0
  58. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sr.js +14 -0
  59. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sv.js +12 -0
  60. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js +195 -0
  61. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.js +383 -0
  62. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/license.txt +339 -0
  63. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.browserplus.js +1 -0
  64. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.js +226 -0
  65. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.swf +0 -0
  66. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js +2525 -0
  67. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js.default +2525 -0
  68. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.gears.js +1 -0
  69. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html4.js +1 -0
  70. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js +765 -0
  71. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js.default +765 -0
  72. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.js +618 -0
  73. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.js +1 -0
  74. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.xap +0 -0
  75. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/readme.md +46 -0
  76. data/app/assets/javascripts/refinery/photo_gallery/fancybox/CHANGELOG.md +68 -0
  77. data/app/assets/javascripts/refinery/photo_gallery/fancybox/README.md +212 -0
  78. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.js +115 -0
  79. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-media.js +85 -0
  80. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.js +157 -0
  81. data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.js +1463 -0
  82. data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.pack.js +35 -0
  83. data/app/assets/javascripts/refinery/photo_gallery/fancybox/lib/jquery.mousewheel-3.0.6.pack.js +13 -0
  84. data/app/assets/stylesheets/refinery/photo_gallery/admin/chosen.css.scss +396 -0
  85. data/app/assets/stylesheets/refinery/photo_gallery/admin/photo_gallery.css.scss +109 -0
  86. data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css.scss +177 -0
  87. data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.css.scss +147 -0
  88. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.css.scss +85 -0
  89. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.css +54 -0
  90. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/jquery.fancybox.css.scss +234 -0
  91. data/app/controllers/refinery/photo_gallery/admin/albums_controller.rb +23 -0
  92. data/app/controllers/refinery/photo_gallery/admin/collections_controller.rb +10 -0
  93. data/app/controllers/refinery/photo_gallery/admin/photos_controller.rb +67 -0
  94. data/app/controllers/refinery/photo_gallery/albums_controller.rb +23 -0
  95. data/app/controllers/refinery/photo_gallery/collections_controller.rb +28 -0
  96. data/app/helpers/refinery/photo_gallery/admin/photos_helper.rb +10 -0
  97. data/app/helpers/refinery/photo_gallery/albums_helper.rb +11 -0
  98. data/app/helpers/refinery/photo_gallery/photo_gallery_helper.rb +113 -0
  99. data/app/middleware/refinery/photo_gallery/admin/flash_session_cookie_middleware.rb +27 -0
  100. data/app/models/refinery/photo_gallery/album.rb +63 -0
  101. data/app/models/refinery/photo_gallery/collection.rb +29 -0
  102. data/app/models/refinery/photo_gallery/collection_album.rb +8 -0
  103. data/app/models/refinery/photo_gallery/photo.rb +63 -0
  104. data/app/uploaders/refinery/photo_gallery/admin/file_uploader.rb +122 -0
  105. data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +44 -0
  106. data/app/views/refinery/photo_gallery/admin/albums/_album.html.erb +31 -0
  107. data/app/views/refinery/photo_gallery/admin/albums/_form.html.erb +78 -0
  108. data/app/views/refinery/photo_gallery/admin/albums/_sortable_list.html.erb +7 -0
  109. data/app/views/refinery/photo_gallery/admin/albums/edit.html.erb +2 -0
  110. data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +28 -0
  111. data/app/views/refinery/photo_gallery/admin/albums/new.html.erb +2 -0
  112. data/app/views/refinery/photo_gallery/admin/collections/_collection.html.erb +23 -0
  113. data/app/views/refinery/photo_gallery/admin/collections/_form.html.erb +32 -0
  114. data/app/views/refinery/photo_gallery/admin/collections/_sortable_list.html.erb +7 -0
  115. data/app/views/refinery/photo_gallery/admin/collections/edit.html.erb +2 -0
  116. data/app/views/refinery/photo_gallery/admin/collections/index.html.erb +28 -0
  117. data/app/views/refinery/photo_gallery/admin/collections/new.html.erb +2 -0
  118. data/app/views/refinery/photo_gallery/admin/collections/test.html.erb +39 -0
  119. data/app/views/refinery/photo_gallery/admin/photos/_destroy.js.erb +15 -0
  120. data/app/views/refinery/photo_gallery/admin/photos/_form.html.erb +7 -0
  121. data/app/views/refinery/photo_gallery/admin/photos/_form_actions.html.erb +6 -0
  122. data/app/views/refinery/photo_gallery/admin/photos/_form_fields.html.erb +31 -0
  123. data/app/views/refinery/photo_gallery/admin/photos/_form_fields_actions.html.erb +15 -0
  124. data/app/views/refinery/photo_gallery/admin/photos/edit_multiple.html.erb +9 -0
  125. data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +87 -0
  126. data/app/views/refinery/photo_gallery/albums/show.html.erb +49 -0
  127. data/app/views/refinery/photo_gallery/collections/index.html.erb +13 -0
  128. data/app/views/refinery/photo_gallery/collections/show.html.erb +33 -0
  129. data/app/views/refinery/photo_gallery/shared/_layout.html.erb +22 -0
  130. data/app/views/refinery/photo_gallery/shared/_submenu.html.erb +5 -0
  131. data/config/initializers/carrierwave.rb +5 -0
  132. data/config/initializers/form_builder.rb +26 -0
  133. data/config/initializers/refinery/core.rb +10 -0
  134. data/config/initializers/s3.rb +11 -0
  135. data/config/initializers/session_store.rb +10 -0
  136. data/config/locales/en.yml +95 -0
  137. data/config/locales/sk.yml +94 -0
  138. data/config/routes.rb +37 -0
  139. data/db/migrate/20120804063842_create_albums.rb +18 -0
  140. data/db/migrate/20120805131321_create_collections.rb +14 -0
  141. data/db/migrate/20120805131547_create_collection_albums.rb +12 -0
  142. data/db/migrate/20120805165238_create_photos.rb +19 -0
  143. data/db/migrate/20120805222125_add_indexes.rb +24 -0
  144. data/db/seeds.rb +21 -0
  145. data/lib/generators/refinery/photo_gallery_generator.rb +25 -0
  146. data/lib/generators/refinery/templates/config/initializers/refinery/photo_gallery.rb.erb +40 -0
  147. data/lib/refinery/photo_gallery/configuration.rb +33 -0
  148. data/lib/refinery/photo_gallery/engine.rb +33 -0
  149. data/lib/refinery/photo_gallery/version.rb +17 -0
  150. data/lib/refinery/photo_gallery.rb +30 -0
  151. data/lib/refinerycms-photo-gallery.rb +1 -0
  152. data/refinerycms-6hoursdaily-photo-gallery.gemspec +38 -0
  153. data/screenshots/01_collections#index.png +0 -0
  154. data/screenshots/02_albums#create.png +0 -0
  155. data/screenshots/03_photos#upload.png +0 -0
  156. data/screenshots/04_photos#upload- chooser.png +0 -0
  157. data/screenshots/05_photo#upoad-queue.png +0 -0
  158. data/screenshots/06_photos#upload-uploading.png +0 -0
  159. data/screenshots/07_photos#upload-uploading_2.png +0 -0
  160. data/screenshots/08_photos#edit_multiple.png +0 -0
  161. data/screenshots/09_albums#index.png +0 -0
  162. data/screenshots/10_albums_EXIF_reading.png +0 -0
  163. data/screenshots/11_frontend_show.png +0 -0
  164. data/screenshots/12_show_photo_using_fancybox.png +0 -0
  165. metadata +353 -0
@@ -0,0 +1,78 @@
1
+ <%= form_for [refinery, :photo_gallery_admin, @album] do |f| -%>
2
+ <% album_photos_count = @album.photos.count #reduce sql queries%>
3
+ <%= render :partial => "/refinery/admin/error_messages",
4
+ :locals => {
5
+ :object => f.object,
6
+ :include_object_name => true
7
+ } %>
8
+
9
+ <div class='field'>
10
+ <%= f.label :title, :class=>"required" %><br />
11
+ <%= f.text_field :title, {:class => 'larger widest'} %><br />
12
+ </div>
13
+
14
+ <%# TODO use pop up to create collection %>
15
+ <div class='field'>
16
+ <%= label :collection, t('.album_belongs_to_collection') %>
17
+ <%= collection_select(:album, :collection_ids, Refinery::PhotoGallery::Collection.all(:order=> "title ASC"), :id, :title,
18
+ { },
19
+ { :data => {:placeholder=> t('.choose_collection')}, :multiple=> true, :class=> "chzn-select", :style=>"width:400px;"}) %>
20
+ </div>
21
+
22
+ <% if @album.title.blank? || @album.path.blank? # during creating album %>
23
+ <div class='field'>
24
+ <%= f.label :path_prefix, t('.path_prefix') %><br />
25
+ <%= f.text_field :path_prefix, :size=> 5, :maxlength=> 5 %><br />
26
+ </div>
27
+ <% elsif album_photos_count == 0 # allow to edit path only if there are no photos in album %>
28
+ <%#TODO if there are some photos in album, we must change folder paths on disk %>
29
+ <div class='field'>
30
+ <%= f.label :path %><br />
31
+ <%= f.text_field :path %><br />
32
+ </div>
33
+ <% end %>
34
+
35
+ <div class='field'>
36
+ <%= f.label :description %><br />
37
+ <%= f.text_area :description, :cols=>'65', :rows=>'7' %><br />
38
+ </div>
39
+
40
+ <div id="more_photo_options_field">
41
+ <p><a href="#" id="toggle_advanced_options" title="<%= t('.more_options_tooltip') %>"><%= t('.more_options') %></a></p>
42
+ </div>
43
+
44
+ <div id="more_options" style="display: none;">
45
+ <div class='field'>
46
+ <%= f.label :address %><br />
47
+ <%= f.text_area :address, { :rows => 3} %><br />
48
+ </div>
49
+
50
+ <div class='field'>
51
+ <%= f.label :latitude %><br />
52
+ <%= f.text_field :latitude %><br />
53
+ </div>
54
+
55
+ <div class='field'>
56
+ <%= f.label :longitude %><br />
57
+ <%= f.text_field :longitude %><br />
58
+ </div>
59
+
60
+
61
+ <div class='field'>
62
+ <%= f.label :note %><br />
63
+ <%= f.text_area :note, :cols=>65, :rows=> 7 %><br />
64
+ </div>
65
+ </div>
66
+
67
+
68
+ <br />
69
+ <%= t('.number_of_photos', :number=> album_photos_count ) %><br/>
70
+
71
+
72
+ <%= render :partial => "/refinery/admin/form_actions",
73
+ :locals => {
74
+ :f => f,
75
+ :continue_editing => false,
76
+ :delete_title => t('delete', :scope => 'refinery.photo_gallery.admin.albums.album')
77
+ } %>
78
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <ul id='sortable_list'>
2
+ <%= render :partial => 'album', :collection => @albums %>
3
+ </ul>
4
+ <%= render :partial => "/refinery/admin/sortable_list",
5
+ :locals => {
6
+ :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
7
+ } %>
@@ -0,0 +1,2 @@
1
+ <h2 ><%= t('.title') %></h2>
2
+ <%= render :partial=> "form" %>
@@ -0,0 +1,28 @@
1
+ <%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
2
+
3
+ <div id='records'>
4
+ <% if searching? %>
5
+ <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
6
+ <% if @albums.any? %>
7
+ <ul>
8
+ <%= render :partial => "album", :album => @albums %>
9
+ </ul>
10
+ <% else %>
11
+ <p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
12
+ <% end %>
13
+ <% else %>
14
+ <% if @albums.any? %>
15
+ <%= will_paginate @albums %>
16
+
17
+ <%= render :partial => "sortable_list" %>
18
+
19
+ <%= will_paginate @albums %>
20
+ <% else %>
21
+ <p>
22
+ <strong>
23
+ <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.albums')) %>
24
+ </strong>
25
+ </p>
26
+ <% end %>
27
+ <% end %>
28
+ </div>
@@ -0,0 +1,2 @@
1
+ <h2 ><%= t('.title') %></h2>
2
+ <%= render :partial=> "form" %>
@@ -0,0 +1,23 @@
1
+ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(collection) -%>">
2
+ <span class='title'>
3
+ <%= collection.title %>
4
+ <span class="preview">
5
+ <%= collection.created_at.try(:strftime, '%b %d, %Y') %>
6
+ </span>
7
+ </span>
8
+ <span class='actions'>
9
+ <%#= link_to refinery_icon_tag("application_go.png"), refinery.photo_gallery_collection_path(collection),
10
+ :title => t('.view_live_html'),
11
+ :target => "_blank" %>
12
+ <%= link_to (image_tag 'refinery/photo_gallery/admin/icons/folder_edit.png'),
13
+ refinery.edit_photo_gallery_admin_collection_path(collection),
14
+ :title => t('.edit') %>
15
+ <%= link_to refinery_icon_tag("delete.png"), refinery.photo_gallery_admin_collection_path(collection),
16
+ :class => "cancel confirm-delete",
17
+ :title => t('.delete'),
18
+ :method => :delete,
19
+ :data => {
20
+ :confirm => t('message', :scope => 'refinery.admin.delete', :title => collection.title)
21
+ } %>
22
+ </span>
23
+ </li>
@@ -0,0 +1,32 @@
1
+ <%= form_for [refinery, :photo_gallery_admin, @collection] do |f| -%>
2
+ <%= render :partial => "/refinery/admin/error_messages",
3
+ :locals => {
4
+ :object => f.object,
5
+ :include_object_name => true
6
+ } %>
7
+
8
+ <div class='field'>
9
+ <%= f.label :title -%>
10
+ <%= f.text_field :title, :class => 'larger widest' -%>
11
+ </div>
12
+
13
+ <div class='field'>
14
+ <%= f.label :description %><br />
15
+ <%= f.text_area :description, :cols=>'65', :rows=>'7' %><br />
16
+ </div>
17
+
18
+ <%= render :partial => "/refinery/admin/form_actions",
19
+ :locals => {
20
+ :f => f,
21
+ :continue_editing => false,
22
+ :delete_title => t('delete', :scope => 'refinery.photo_gallery.admin.collections.collection')
23
+ } %>
24
+ <% end %>
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
@@ -0,0 +1,7 @@
1
+ <ul id='sortable_list'>
2
+ <%= render :partial => 'collection', :collection => @collections %>
3
+ </ul>
4
+ <%= render :partial => "/refinery/admin/sortable_list",
5
+ :locals => {
6
+ :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
7
+ } %>
@@ -0,0 +1,2 @@
1
+ <h2 ><%= t('.title') %></h2>
2
+ <%= render :partial=> "form" %>
@@ -0,0 +1,28 @@
1
+ <%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
2
+
3
+ <div id='records'>
4
+ <% if searching? %>
5
+ <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
6
+ <% if @collections.any? %>
7
+ <ul>
8
+ <%= render :partial => "collection", :collection => @collections %>
9
+ </ul>
10
+ <% else %>
11
+ <p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
12
+ <% end %>
13
+ <% else %>
14
+ <% if @collections.any? %>
15
+ <%= will_paginate @collections %>
16
+
17
+ <%= render :partial => "sortable_list" %>
18
+
19
+ <%= will_paginate @collections %>
20
+ <% else %>
21
+ <p>
22
+ <strong>
23
+ <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.collections')) %>
24
+ </strong>
25
+ </p>
26
+ <% end %>
27
+ <% end %>
28
+ </div>
@@ -0,0 +1,2 @@
1
+ <h2 ><%= t('.title') %></h2>
2
+ <%= render :partial=> "form" %>
@@ -0,0 +1,39 @@
1
+ <%= form.label :title, :Title, {:class => 'big'} %><br />
2
+ <%= form.text_field :title, {:class => 'big'} %><br />
3
+
4
+ <%= form.label :description %><br />
5
+ <%= form.text_area :description %><br />
6
+
7
+
8
+ <% unless @collection.albums.empty? %>
9
+ <%= form.label :albums %><br />
10
+ <div id="collection_albums">
11
+ <% for album in @collection.albums %>
12
+ <%= form.fields_for :album_list do |album_fields| %>
13
+ <span>
14
+ <%= image_tag "delete-24x24.png", :class => "delete", :alt => "Delete" -%>
15
+
16
+ <% if album.photos.empty? %>
17
+ <%= album.title %>
18
+ <% else %>
19
+ <%= image_tag album.photos.first.file.album.url, :alt => album.title %>
20
+ <% end %>
21
+ <%= album_fields.hidden_field album.id %>
22
+ </span>
23
+ <% end %>
24
+ <% end %>
25
+ </div>
26
+
27
+ <p class="clear">
28
+ <%
29
+ grouped_options = [
30
+ ['Available albums',[['Choose album to add','']]],
31
+ ['Not used', Album.unused.map{|album|[album.title, album.id]} ],
32
+ ['In use', Album.used.map{|album|[album.title, album.id]} ]
33
+ ]
34
+ grouped_options_for_select(grouped_options)
35
+ %>
36
+ <%= select_tag 'available_albums', grouped_options_for_select(grouped_options) %>
37
+ </p>
38
+
39
+ <% end %>
@@ -0,0 +1,15 @@
1
+ $(function() {
2
+ if( $('#photo-<%= photo.id %>').remove().fadeOut('slow') ) {
3
+
4
+ var flash_msg = '<div id="flash_container">' +
5
+ '<div id="flash" class="flash flash_notice" style="visibility: visible; opacity: 1;">'+
6
+ '<%= t('deleted', :scope=> 'refinery.photo_gallery.admin.photos.photo', :title=> @photo.title) %>' +
7
+ '<a href="" id="flash_close">' +
8
+ '<%= t('close', :scope=> "refinery.message") %>' +
9
+ '</a>' +
10
+ '</div>' +
11
+ '</div>';
12
+
13
+ $('#flash_container').replaceWith(flash_msg);
14
+ }
15
+ });
@@ -0,0 +1,7 @@
1
+ <%= form_for :photos, :url => refinery.update_multiple_photo_gallery_admin_photos_path, :html => { :method => :put, :id=> "form_edit_photos" } do |f| %>
2
+ <% for photo in @photos %>
3
+ <%= render :partial=> 'form_fields', :locals => {:f => f, :photo => photo} %>
4
+ <% end%>
5
+
6
+ <%= render :partial=> 'form_actions', :locals => {:f => f} %>
7
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <div class="form-actions">
2
+ <div class="form-actions-left">
3
+ <%= f.submit t('refinery.admin.form_actions.save'), :class=> "wymupdate button" %>
4
+ <%= link_to t('refinery.admin.form_actions.cancel'), refinery.photo_gallery_admin_albums_path, :class=> "close_dialog button", :title=> t('refinery.admin.form_actions.cancel_lose_changes') %>
5
+ </div>
6
+ </div>
@@ -0,0 +1,31 @@
1
+ <div id="photo-<%= photo.id %>" class="form-photo-field">
2
+ <%= fields_for "photos[photo]", photo, :index => photo.id do |p|%>
3
+ <div class="form_photo_left">
4
+ <%= link_to (image_tag photo.file.collection.url), photo.file.single.url, {:target=> "_blank"} %>
5
+ </div>
6
+
7
+ <div class="form_photo_right">
8
+ <div class='field'>
9
+ <%= p.label :title %>
10
+ <%= p.text_field :title, :class => "larger" %>
11
+ </div>
12
+
13
+ <div class='field'>
14
+ <%= p.label :description %>
15
+ <%= p.text_area :description, :rows => "5", :cols=> "57" %>
16
+ </div>
17
+
18
+ <div class='field-group'>
19
+ <%= p.label :longitude, :tooltip=> t('.use_decimal_format') %>
20
+ <%= p.text_field :longitude, :size=> 13 %>
21
+
22
+ <%= p.label :latitude , :tooltip=> t('.use_decimal_format') %>
23
+ <%= p.text_field :latitude, :size=> 13 %>
24
+ </div>
25
+
26
+
27
+ <%= render :partial => "form_fields_actions", :locals => { :photo => photo } %>
28
+ </div>
29
+ <% end%>
30
+ <div class="form_photo_cleaner"></div>
31
+ </div>
@@ -0,0 +1,15 @@
1
+ <div class="form-actions">
2
+ <div class="form-actions-left">
3
+ <%#TODO <input type="checkbox"> Set as album preview image %>
4
+
5
+ </div>
6
+ <div class="form-actions-right">
7
+ <%= link_to( t('refinery.admin.form_actions.delete'), refinery.photo_gallery_admin_photo_path(photo.id),
8
+ :title=> t('refinery.photo_gallery.admin.photos.photo.delete'),
9
+ :method => :delete,
10
+ :data => {:confirm => t('refinery.admin.delete.message', :title=> photo.title) },
11
+ :class => "button confirm-delete")
12
+
13
+ %>
14
+ </div>
15
+ </div>
@@ -0,0 +1,9 @@
1
+ <% if @photos.length > 0 %>
2
+ <%= render :partial=> "form" %>
3
+ <% else %>
4
+ <%= raw t('.no_photos_yet',
5
+ :create => (link_to t('refinery.photo_gallery.admin.albums.album.upload_photos'), refinery.upload_photo_gallery_admin_album_photos_path( @album) )
6
+ )
7
+ %>
8
+
9
+ <% end %>
@@ -0,0 +1,87 @@
1
+ <%= content_for :javascripts do %>
2
+ <style type="text/css">@import url('/assets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css');</style>
3
+
4
+ <%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/plupload.full.js" -%>
5
+ <%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js" -%>
6
+ <% if Refinery::PhotoGallery.plupload_locale.present? %>
7
+ <%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/i18n/" + Refinery::PhotoGallery.plupload_locale + ".js" -%>
8
+ <% end %>
9
+
10
+ <script type="text/javascript">
11
+ <% session_key = Rails.application.config.session_options[:key] %>
12
+ $(document).ready(function() {
13
+ $("#uploader").pluploadQueue({
14
+
15
+ // General settings
16
+ runtimes : '<%= Refinery::PhotoGallery.runtimes %>',
17
+ url : '<%= refinery.photo_gallery_admin_photos_path %>',
18
+ max_file_size : '<%= Refinery::PhotoGallery.max_file_size %>',
19
+ multipart: true,
20
+ multipart_params: {
21
+ '<%= session_key %>' : encodeURIComponent('<%= cookies[session_key] %>'),
22
+ 'authenticity_token' : '<%= form_authenticity_token %>',
23
+ 'photo[album_id]' : "<%= @album.id %>"
24
+ },
25
+
26
+
27
+ // Resize images on clientside if we can
28
+ <% if Refinery::PhotoGallery.client_side_resize %>
29
+ resize : {width : <%= Refinery::PhotoGallery.client_side_resize_params[:width] %>,
30
+ height : <%= Refinery::PhotoGallery.client_side_resize_params[:height] %>,
31
+ quality : <%= Refinery::PhotoGallery.client_side_resize_params[:quality] %>},
32
+ <% end %>
33
+
34
+ // Flash settings
35
+ flash_swf_url : '/assets/refinery/photo_gallery/admin/plupload/plupload.flash.swf',
36
+
37
+ // Silverlight settings
38
+ silverlight_xap_url : '/assets/refinery/photo_gallery/admin/plupload/plupload.silverlight.xap',
39
+
40
+ // Post init events, bound after the internal events
41
+ init : {
42
+ FileUploaded: function(up, file, info) {
43
+ if (info.status == 500){
44
+ alert(info.reponse);
45
+ }
46
+ else {
47
+ $('form div#multiple_photo_edit').append(info.response).fadeIn('slow');
48
+ }
49
+ },
50
+ //TODO this hiding/showing is ugly. Rework this.
51
+ StateChanged: function(up) {
52
+ // Called when the state of the queue is changed
53
+ if (up.state == plupload.STARTED ){
54
+ $('form div#upload_progress').show();
55
+ }
56
+ else if (up.state == plupload.STOPPED){
57
+ $('form div#upload_progress').hide();
58
+ $('form div#form_actions').fadeIn('slow');
59
+ }
60
+ }
61
+ }
62
+ });
63
+ })
64
+ </script>
65
+ <% end %>
66
+
67
+ <form>
68
+ <div id="uploader">
69
+ <p>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
70
+ </div>
71
+ <br>
72
+ </form>
73
+
74
+ <%= form_for :photos, :url => refinery.update_multiple_photo_gallery_admin_photos_path, :html => { :method => :put, :id=> "form_edit_photos"} do |f| %> <%#TODO DRY %>
75
+ <div id="multiple_photo_edit"></div>
76
+ <div id="upload_progress">
77
+ <%= image_tag 'refinery/photo_gallery/admin/icons/loading.gif' %>
78
+ </div>
79
+ <div id="form_actions" >
80
+ <%= render :partial=> 'form_actions', :locals => {:f => f} %>
81
+ </div>
82
+ <% end %>
83
+
84
+
85
+
86
+ <br><%#= link_to "Edit uploaded photos", untouched_album_photos_path( @album ) %>
87
+ <br><%#= link_to "Back to #{@album.title}", @album %>
@@ -0,0 +1,49 @@
1
+ <% content_for :body_content_right do %>
2
+ <%= message_photos_length_is_zero %>
3
+
4
+ <!--
5
+ <h1 class="single-thumbnail-title post-title-color gdl-title">
6
+ </h1>
7
+ -->
8
+ <h2>
9
+ <%= @collection.title %> >>
10
+ <%= @album.title %>
11
+ </h1>
12
+
13
+ <div class='well'>
14
+ <%= raw @album.description %>
15
+ </div>
16
+
17
+
18
+ <div class='well'>
19
+ <% @photos.each_with_index do |photo, index| %>
20
+ <li style='display: inline; list-style-type: none;'>
21
+ <%= link_to (image_tag photo.file.album.url), photo.file.single.url, {
22
+ :target=> "_blank",
23
+ :class=>"fancybox",
24
+ :data =>{:title=> photo_description(photo,@photos, index)},
25
+ :rel=>"group",
26
+ :title=> photo.title } %>
27
+ </li>
28
+ <% end %>
29
+ </div>
30
+
31
+ <div style="clear:both;"></div>
32
+
33
+ <div class="digg_pagination" style='float:right; padding-right: 10px;'>
34
+ <div clas="page_info">
35
+ <%= page_entries_info @photos %>
36
+ </div>
37
+ <span style='margin: 0 auto;'>
38
+ <%= will_paginate @photos, :container => false %>
39
+ </span>
40
+ </div>
41
+
42
+ <div style="clear:both;"></div>
43
+ <% end %>
44
+
45
+ <% content_for :body_content_left do %>
46
+ <%= render :partial=> "refinery/photo_gallery/shared/submenu" %>
47
+ <% end %>
48
+
49
+ <%= render :partial=> "refinery/photo_gallery/shared/layout" %>
@@ -0,0 +1,13 @@
1
+ <% content_for :body_content_right do %>
2
+ <% if message_collections_length_is_zero %>
3
+ <h1 id='body_content_title' style='padding-top: 50px;'>
4
+ <%= message_collections_length_is_zero %>
5
+ </h1>
6
+ <% end %>
7
+ <% end %>
8
+
9
+ <% content_for :body_content_left do %>
10
+ <%= render :partial=> "refinery/photo_gallery/shared/submenu" %>
11
+ <% end %>
12
+
13
+ <%= render :partial=> "refinery/photo_gallery/shared/layout" %>
@@ -0,0 +1,33 @@
1
+ <% content_for :body_content_right do %>
2
+ <%= message_albums_length_is_zero %>
3
+
4
+ <!--
5
+ <ul style="list-style-type: disc;">
6
+ <% @albums.each do |album| %>
7
+ <li>
8
+ <% if album.photos.respond_to?('file') %>
9
+ <%= link_to image_tag(album.photos.first.file.album.url),
10
+ refinery.photo_gallery_collection_album_path(
11
+ :collection_id=> params[:id],
12
+ :id => album.id)
13
+ -%>
14
+ <% else %>
15
+ <span>No photos yet</span>
16
+ <% end %>
17
+ <%= link_to album.title, refinery.photo_gallery_collection_album_path(:collection_id=> params[:id], :id => album.id) %>
18
+ </li>
19
+
20
+ <%#TODO image thumbnail + description? %>
21
+ <%#= link_to (image_tag photo.file.album.url), photo.file.single.url %>
22
+
23
+ <% end %>
24
+ </ul>
25
+ -->
26
+
27
+ <% end %>
28
+
29
+ <% content_for :body_content_left do %>
30
+ <%= render :partial=> "refinery/photo_gallery/shared/submenu" %>
31
+ <% end %>
32
+
33
+ <%= render :partial=> "refinery/photo_gallery/shared/layout" %>
@@ -0,0 +1,22 @@
1
+ <div class="content-wrapper sidebar-included left-sidebar">
2
+ <div class="clear"></div>
3
+ <div class="gdl-page-float-left">
4
+ <div class="gdl-page-item">
5
+ <div class="sixteen columns mt0">
6
+ <%= yield(:body_content_right) %>
7
+ </div>
8
+ </div>
9
+
10
+ <div class="five columns mt0 gdl-left-sidebar">
11
+ <div class="left-sidebar-wrapper gdl-divider">
12
+ <%= yield(:body_content_left) %>
13
+ </div>
14
+ </div>
15
+
16
+ </div>
17
+ <div class="clear"></div>
18
+ </div>
19
+
20
+
21
+
22
+
@@ -0,0 +1,5 @@
1
+ <div class="custom-sidebar gdl-divider">
2
+ <h1 id='body_content_title' style='padding-bottom: 25px;'>Gallery Collections</h1>
3
+ <%= generate_photo_gallery_menu(@collections, @albums, {:ul=>{:class => "classtest", :id=>"idtest" }}) %>
4
+ </div>
5
+ <div class="pt30"></div>
@@ -0,0 +1,5 @@
1
+ CarrierWave.configure do |config|
2
+ config.root = Rails.root.to_s + Refinery::PhotoGallery.photo_gallery_dir_relative_to_root
3
+ #Prefix in Uploader#url See https://github.com/jnicklas/carrierwave/pull/445
4
+ config.base_path = Refinery::PhotoGallery.photo_gallery_dir
5
+ end
@@ -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,11 @@
1
+ require 'carrierwave'
2
+
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
@@ -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