diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index 9e1f0c4..5be9481 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -660,6 +660,11 @@ class Admin::GalleriesController < OrbitAdminController end end + def select_albums + filter_album() + @category_id_albums_maps = @fiter_albums.group_by{|album| album.category_id} + end + private def crop_but_no_backup(image) fname = image.file.path diff --git a/app/views/admin/galleries/_select_albums_form.html.erb b/app/views/admin/galleries/_select_albums_form.html.erb new file mode 100644 index 0000000..d1462dd --- /dev/null +++ b/app/views/admin/galleries/_select_albums_form.html.erb @@ -0,0 +1,198 @@ +<% unless @include_js_css_flag %> + <%= javascript_include_tag "lib/checkbox.card.js" %> + <%= stylesheet_link_tag 'basic/global' %> + <%= stylesheet_link_tag 'member_select' %> + + <% @include_js_css_flag = true %> +<% end %> +<% index = '' unless defined?(index) %> +
+ +
+
+ <% albums.each do |album| %> + + x + <% if album.cover == "default" %> + <%= image_tag "gallery/default.jpg" %> + <% else %> + + <% end %> +

<%= album.name %>

+ <%= hidden_field_tag field, album.id %> +
+ <% end %> +
+ <%= t(:add) %> +
+
+ \ No newline at end of file diff --git a/app/views/admin/galleries/select_albums.html.erb b/app/views/admin/galleries/select_albums.html.erb new file mode 100644 index 0000000..56d106b --- /dev/null +++ b/app/views/admin/galleries/select_albums.html.erb @@ -0,0 +1,85 @@ + + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index fcf9e33..dbdc552 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,6 +76,9 @@ Rails.application.routes.draw do get "excel_format" post "importimages" end + collection do + post 'select_albums' + end end resources :images post "galleries/upload_image" => "galleries#upload_image"