ecm_galleries_backend 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b3f776d4b06f1ee04b2cfdf1e065df48061ad146a480f83d9f7a3a77d072412
4
- data.tar.gz: d4207496e0ea8c91879ec8f87182c2a5cf503755a0fd6be52b17b7e5f99cb162
3
+ metadata.gz: 1133a4578fd396958c6bd729dd7b31da405e4db1a99ea97fd371c55b7c491100
4
+ data.tar.gz: 64ebfc2006642982366a3ca6164ae2fcd471b04012cd22b1926b0323998684e2
5
5
  SHA512:
6
- metadata.gz: dd692aff9b2f0769c38c63cfa8f6d931561b9786a5f69483d45c6a3a7ac5c51edc48a1a1b671064924809a3e0324f45feb60b3a58a507d1c7259e347eb7fa3d0
7
- data.tar.gz: 73582b2de3101ae81e2e79b5eef827c652d93278cb564feab8bdadb1a61db87ca182c3a7e46343b50a5f62fa13a3829193c9c73f1291b52ef0cec871cffd5863
6
+ metadata.gz: 94402ad6d8524e3f918088193874a580da42e28db54bdb3c51e1eb8f763b8f0c3f4dc9907d5278cf7c390dc13eae2bb60f334d8454a910f00227581c6d91d2e6
7
+ data.tar.gz: 2d6645c12736b1c48c0c29262735b770308134888a6aea8323c5c5ad69a70df0bc67038a3dee2f6435ed2f8193fe56d13062500b26e362c358375316dd2f4337
@@ -9,6 +9,9 @@ module Ecm
9
9
 
10
10
  helper Twitter::Bootstrap::Components::Rails::V3::ComponentsHelper
11
11
 
12
+ include Rao::Query::Controller::QueryConcern
13
+ view_helper Rao::Query::ApplicationHelper, as: :query_helper
14
+
12
15
  def self.resource_class
13
16
  Ecm::Galleries::PictureDetail
14
17
  end
@@ -16,7 +19,8 @@ module Ecm
16
19
  private
17
20
 
18
21
  def load_collection_scope
19
- super.joins(:picture_gallery).order(picture_gallery_id: :asc, position: :asc)
22
+ scope = super.joins(:picture_gallery).order(picture_gallery_id: :asc, position: :asc)
23
+ with_conditions_from_query(scope)
20
24
  end
21
25
 
22
26
  def after_destroy_location
@@ -0,0 +1,5 @@
1
+ = query_helper(self).form_for(collection, url: collection_path, method: :get, html: { class: 'form-inline' }) do |f|
2
+ = f.input :title_cont
3
+ = f.input :name_cont, association: :picture_gallery
4
+ = f.submit nil, class: 'btn btn-primary'
5
+ = f.reset nil, class: 'btn btn-default'
@@ -1,6 +1,6 @@
1
- = table.id
2
1
  = table.row :name
3
2
  = table.row :description
4
3
  = table.row :picture_details_count
5
4
  = table.timestamp :published_at, format: :short
5
+ = table.row :display_code_for_erb
6
6
  = table.timestamps(format: :short)
@@ -3,10 +3,19 @@
3
3
  = bootstrap_thumbnail(image_options: { src: main_app.url_for(picture_detail.asset) }) do
4
4
  %h5= picture_detail.title
5
5
  %p= picture_detail.description
6
- = link_to([:edit, picture_detail], class: 'btn btn-responsive btn-primary') do
7
- %span.glyphicon.glyphicon-pencil
8
- %span.btn-text= t('.edit')
6
+ - if picture_detail.published?
7
+ = link_to([:toggle_published, picture_detail], class: 'btn btn-xs btn-responsive btn-danger', method: :post) do
8
+ %span.glyphicon.glyphicon-eye-close
9
+ %span.btn-text= t('.unpublish')
10
+ - else
11
+ = link_to([:toggle_published, picture_detail], class: 'btn btn-xs btn-responsive btn-success', method: :post) do
12
+ %span.glyphicon.glyphicon-eye-open
13
+ %span.btn-text= t('.publish')
9
14
  .pull-right
10
- = link_to([picture_detail], class: 'btn btn-responsive btn-danger', method: :delete, data: { confirm: I18n.t('.confirmations.delete') }) do
11
- %span.glyphicon.glyphicon-fire
12
- %span.btn-text= t('.destroy')
15
+ .btn-group
16
+ = link_to([:edit, picture_detail], class: 'btn btn-xs btn-responsive btn-primary') do
17
+ %span.glyphicon.glyphicon-pencil
18
+ %span.btn-text= t('.edit')
19
+ = link_to([picture_detail], class: 'btn btn-xs btn-responsive btn-danger', method: :delete, data: { confirm: I18n.t('.confirmations.delete') }) do
20
+ %span.glyphicon.glyphicon-fire
21
+ %span.btn-text= t('.destroy')
@@ -1,7 +1,6 @@
1
1
  = table.column :preview do |resource|
2
2
  - if resource.picture_details.first.present?
3
3
  - bootstrap_thumbnail(image_options: { src: main_app.url_for(resource.picture_details.first.asset) })
4
- = table.column :id, sort: true
5
4
  = table.column :name, sort: true
6
5
  = table.column :picture_details_count
7
6
  = table.timestamps format: :short, sort: true
@@ -13,3 +13,5 @@ de:
13
13
  show_extras:
14
14
  destroy: Löschen
15
15
  edit: Bearbeiten
16
+ publish: Veröffentlichen
17
+ unpublish: Zurückziehen
@@ -12,4 +12,6 @@ en:
12
12
  picture_galleries:
13
13
  show_extras:
14
14
  destroy: Delete
15
- edit: Edit
15
+ edit: Edit
16
+ publish: Publish
17
+ unpublish: Unpublish
data/config/routes.rb CHANGED
@@ -3,7 +3,7 @@ Ecm::Galleries::Backend::Engine.routes.draw do
3
3
  post :toggle_published, on: :member
4
4
  end
5
5
 
6
- resources :picture_details do
6
+ resources :picture_details, except: [:new] do
7
7
  post :destroy_many, on: :collection
8
8
  post :reposition, on: :member
9
9
  post :toggle_published, on: :member
@@ -1,7 +1,7 @@
1
1
  module Ecm
2
2
  module Galleries
3
3
  module Backend
4
- VERSION = '0.0.3'.freeze
4
+ VERSION = '0.1.0'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,4 @@
1
+ require 'rao-query'
1
2
  require 'twitter-bootstrap-components-rails'
2
3
  require 'ecm_galleries'
3
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_galleries_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2018-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rao-query
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: twitter-bootstrap-components-rails
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -216,11 +230,8 @@ files:
216
230
  - app/jobs/ecm/galleries/backend/application_job.rb
217
231
  - app/mailers/ecm/galleries/backend/application_mailer.rb
218
232
  - app/models/ecm/galleries/backend/application_record.rb
219
- - app/views/ecm/galleries/backend/attachments/_table.haml
220
- - app/views/ecm/galleries/backend/galleries~/_form.haml
221
- - app/views/ecm/galleries/backend/galleries~/_show.haml
222
- - app/views/ecm/galleries/backend/galleries~/_show_extras.haml
223
- - app/views/ecm/galleries/backend/galleries~/_table.haml
233
+ - app/views/ecm/galleries/backend/attachments~/_table.haml
234
+ - app/views/ecm/galleries/backend/picture_details/_before_index_table.html.haml
224
235
  - app/views/ecm/galleries/backend/picture_details/_form.html.haml
225
236
  - app/views/ecm/galleries/backend/picture_details/_show.html.haml
226
237
  - app/views/ecm/galleries/backend/picture_details/_table.html.haml
@@ -1 +0,0 @@
1
- = form.input :assets, as: :file, input_html: { multiple: true }
@@ -1,2 +0,0 @@
1
- = table.row :assets_count
2
- = table.timestamps(format: :short, sort: true )
@@ -1,3 +0,0 @@
1
- = collection_table(collection: @resource.assets, resource_class: ActiveStorage::Attachment) do |t|
2
- = t.id
3
- = t.timestamp :created_at, format: :short
@@ -1,3 +0,0 @@
1
- = table.id sort: true
2
- = table.column :assets_count
3
- = table.timestamps sort: true, format: :short