ab_admin 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -0
- data/Guardfile +1 -1
- data/app/assets/images/admin/flags/b_uk.png +0 -0
- data/app/assets/images/admin/preloader.gif +0 -0
- data/app/assets/javascripts/ab_admin/application.js +1 -28
- data/app/assets/javascripts/ab_admin/components/admin_assets.js.coffee +29 -6
- data/app/assets/javascripts/ab_admin/components/gmaps.js.coffee +120 -91
- data/app/assets/javascripts/ab_admin/components/google_translate.js.coffee +3 -2
- data/app/assets/javascripts/ab_admin/core/batch_actions.js.coffee +4 -7
- data/app/assets/javascripts/ab_admin/core/init.js.coffee +8 -10
- data/app/assets/javascripts/ab_admin/core/ui_utils.js.coffee +53 -24
- data/app/assets/javascripts/ab_admin/core/utils.js.coffee +7 -0
- data/app/assets/javascripts/ab_admin/inputs/datetime_input.js.coffee +1 -2
- data/app/assets/javascripts/ab_admin/main.js +28 -0
- data/app/assets/stylesheets/ab_admin/application.css.scss +1 -10
- data/app/assets/stylesheets/ab_admin/bootstrap_and_overrides.css.scss +4 -0
- data/app/assets/stylesheets/ab_admin/components/_base.css.scss +4 -1
- data/app/assets/stylesheets/ab_admin/components/_form.css.scss +10 -13
- data/app/assets/stylesheets/ab_admin/components/_geo_input.css.scss +5 -9
- data/app/assets/stylesheets/ab_admin/fileupload.css.scss +68 -102
- data/app/assets/stylesheets/ab_admin/main.css.scss +8 -0
- data/app/controllers/admin/base_controller.rb +18 -14
- data/app/controllers/admin/manager_controller.rb +51 -6
- data/app/controllers/admin/users_controller.rb +23 -0
- data/app/views/admin/fileupload/_asset.html.slim +8 -0
- data/app/views/admin/fileupload/_container.html.slim +10 -0
- data/app/views/admin/fileupload/_file.html.slim +5 -0
- data/app/views/admin/fileupload/_ftmpl.html.slim +6 -0
- data/app/views/admin/fileupload/_tmpl.html.slim +9 -0
- data/app/views/admin/users/_form.html.slim +1 -0
- data/config/locales/en.yml +5 -60
- data/config/locales/ru.yml +14 -63
- data/config/routes.rb +7 -4
- data/features/dsl/custom_actions.feature +62 -0
- data/features/dsl/parent_resource.feature +18 -0
- data/features/step_definitions/configuration_steps.rb +6 -0
- data/features/step_definitions/dsl/parent_resource_steps.rb +8 -0
- data/features/step_definitions/settings_steps.rb +1 -1
- data/features/step_definitions/web_steps/transforms_steps.rb +3 -0
- data/features/support/paths.rb +3 -0
- data/lib/ab_admin.rb +5 -0
- data/lib/ab_admin/abstract_resource.rb +28 -4
- data/lib/ab_admin/carrierwave/base_uploader.rb +22 -22
- data/lib/ab_admin/concerns/admin_addition.rb +2 -2
- data/lib/ab_admin/concerns/utilities.rb +4 -4
- data/lib/ab_admin/config/base.rb +18 -0
- data/lib/ab_admin/controllers/head_options.rb +1 -1
- data/lib/ab_admin/core_ext/array.rb +4 -0
- data/lib/ab_admin/core_ext/string.rb +9 -10
- data/lib/ab_admin/hooks/quiet_scope_page.rb +16 -16
- data/lib/ab_admin/hooks/simple_form_hooks.rb +13 -13
- data/lib/ab_admin/i18n_tools/model_translator.rb +67 -0
- data/lib/ab_admin/models/asset.rb +32 -1
- data/lib/ab_admin/models/attachment_file.rb +1 -1
- data/lib/ab_admin/models/locator.rb +7 -0
- data/lib/ab_admin/models/settings.rb +7 -0
- data/lib/ab_admin/models/structure.rb +4 -0
- data/lib/ab_admin/utils.rb +2 -2
- data/lib/ab_admin/version.rb +1 -1
- data/lib/ab_admin/views/admin_helpers.rb +3 -3
- data/lib/ab_admin/views/admin_navigation_helpers.rb +1 -1
- data/lib/ab_admin/views/form_builder.rb +42 -39
- data/lib/ab_admin/views/helpers.rb +5 -0
- data/lib/ab_admin/views/manager_helpers.rb +10 -0
- data/lib/ab_admin/views/search_form_builder.rb +12 -5
- data/lib/generators/ab_admin/install/install_generator.rb +1 -1
- data/lib/generators/ab_admin/install/templates/config/admin_menu.rb +2 -2
- data/lib/generators/ab_admin/install/templates/helpers/admin/structures_helper.rb +1 -1
- data/lib/generators/ab_admin/install/templates/models/attachment_file.rb +2 -0
- data/lib/generators/ab_admin/install/templates/models/locator.rb +0 -1
- data/lib/generators/ab_admin/install/templates/models/settings.rb +0 -1
- data/lib/generators/ab_admin/install/templates/models/static_page.rb +1 -0
- data/lib/generators/ab_admin/install/templates/{scripts → script}/unicorn.sh +0 -0
- data/lib/generators/ab_admin/install/templates/uploaders/avatar_uploader.rb +4 -0
- data/lib/generators/ab_admin/resource/templates/_search_form.haml.erb +1 -1
- data/lib/generators/ab_admin/resource/templates/_search_form.slim.erb +1 -1
- data/lib/generators/ab_admin/resource/templates/_table.haml.erb +1 -2
- data/lib/generators/ab_admin/resource/templates/_table.slim.erb +1 -2
- data/lib/generators/template.rb +1 -0
- data/lib/tasks/i18n.rake +7 -0
- data/spec/dummy/app/models/ab_admin/ab_admin_collection.rb +35 -0
- data/spec/dummy/app/models/ab_admin/ab_admin_product.rb +2 -0
- data/spec/dummy/app/models/admin_menu.rb +4 -2
- data/spec/dummy/app/models/collection.rb +3 -1
- data/spec/generators/install_generator_spec.rb +1 -1
- data/spec/generators/resource_generator_spec.rb +1 -1
- data/spec/models/avatar_spec.rb +29 -2
- metadata +25 -12
- data/app/views/admin/fileupload/_asset.html.erb +0 -5
- data/app/views/admin/fileupload/_container.html.erb +0 -28
- data/app/views/admin/fileupload/_fcontainer.html.erb +0 -25
- data/app/views/admin/fileupload/_file.html.erb +0 -5
- data/app/views/admin/fileupload/_ftmpl.html.erb +0 -7
- data/app/views/admin/fileupload/_tmpl.html.erb +0 -9
- data/lib/ab_admin/utils/csv_builder.rb +0 -52
data/lib/generators/template.rb
CHANGED
data/lib/tasks/i18n.rake
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
class AbAdminCollection < AbAdmin::AbstractResource
|
|
2
|
+
|
|
3
|
+
table do
|
|
4
|
+
field :name, :sortable => false
|
|
5
|
+
field :description, :sortable => false
|
|
6
|
+
field :is_visible
|
|
7
|
+
field :products_count
|
|
8
|
+
field :created_at
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
search do
|
|
12
|
+
field :name
|
|
13
|
+
field :description
|
|
14
|
+
field :id
|
|
15
|
+
field :is_visible
|
|
16
|
+
field :products_count
|
|
17
|
+
field :created_at
|
|
18
|
+
field :updated_at
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
form do
|
|
22
|
+
group :base do
|
|
23
|
+
field :is_visible
|
|
24
|
+
field :products_count
|
|
25
|
+
end
|
|
26
|
+
locale_tabs do
|
|
27
|
+
field :name
|
|
28
|
+
field :description, :as => :editor
|
|
29
|
+
end
|
|
30
|
+
field :picture, :as => :uploader
|
|
31
|
+
field :pictures, :as => :uploader
|
|
32
|
+
field :attachment_files, :as => :uploader, :file => true
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
class AdminMenu < AbAdmin::MenuBuilder
|
|
2
2
|
draw do
|
|
3
|
+
model Collection
|
|
4
|
+
|
|
3
5
|
model User
|
|
4
6
|
group :system do
|
|
5
7
|
model Structure
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
link Locator.model_name.human, '/admin/locators'
|
|
9
|
+
link Settings.model_name.human, edit_admin_settings_path
|
|
8
10
|
end
|
|
9
11
|
group 'Moderator', :if => proc { moderator? } do
|
|
10
12
|
link 'for moderator', 'dummy_path'
|
|
@@ -5,8 +5,10 @@ class Collection < ActiveRecord::Base
|
|
|
5
5
|
has_many :products
|
|
6
6
|
|
|
7
7
|
has_one :picture, :as => :assetable, :dependent => :destroy, :conditions => {:is_main => true}
|
|
8
|
+
has_many :pictures, :as => :assetable, :dependent => :destroy, :conditions => {:is_main => false}
|
|
9
|
+
has_many :attachment_files, :as => :assetable, :dependent => :destroy
|
|
8
10
|
|
|
9
|
-
fileuploads :picture
|
|
11
|
+
fileuploads :picture, :pictures, :attachment_files
|
|
10
12
|
translates :name, :description
|
|
11
13
|
|
|
12
14
|
scope :visible, where(:is_visible => true)
|
|
@@ -18,7 +18,7 @@ describe AbAdmin::Generators::InstallGenerator do
|
|
|
18
18
|
|
|
19
19
|
it 'should copy_configurations' do
|
|
20
20
|
['config/initializers/ab_admin.rb', 'config/database.yml.sample', 'db/seeds.rb', 'config/i18n-js.yml', 'config/logrotate-config',
|
|
21
|
-
'config/nginx.conf', '
|
|
21
|
+
'config/nginx.conf', 'script/unicorn.sh', 'config/unicorn_config.rb', 'config/settings/settings.yml', 'config/settings/settings.local.yml',
|
|
22
22
|
'.gitignore'].each do |file|
|
|
23
23
|
assert_file file
|
|
24
24
|
end
|
|
@@ -29,7 +29,7 @@ describe AbAdmin::Generators::ResourceGenerator do
|
|
|
29
29
|
assert_file 'app/views/admin/headers/_table.html.slim',
|
|
30
30
|
/table/, /collection\.each/, /batch_action_item/, /td/, /item_index_actions/
|
|
31
31
|
assert_file 'app/views/admin/headers/_search_form.html.slim',
|
|
32
|
-
/f\.input :
|
|
32
|
+
/f\.input :title/, /f\.input :created_at/
|
|
33
33
|
assert_file 'app/helpers/admin/headers_helper.rb', /Admin::HeadersHelper/
|
|
34
34
|
end
|
|
35
35
|
|
data/spec/models/avatar_spec.rb
CHANGED
|
@@ -102,7 +102,34 @@ describe Avatar do
|
|
|
102
102
|
end
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
-
context '
|
|
105
|
+
context 'renaming' do
|
|
106
|
+
before(:each) do
|
|
107
|
+
@avatar = create(:asset_avatar)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
it 'rename file' do
|
|
111
|
+
old_name = @avatar.data_file_name
|
|
112
|
+
@avatar.rename!
|
|
113
|
+
@avatar.data_file_name.should_not == old_name
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
context 'rotation' do
|
|
119
|
+
before(:each) do
|
|
120
|
+
@avatar = create(:asset_avatar)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
it 'rotate image' do
|
|
124
|
+
@avatar.data.dimensions.should == [50, 64]
|
|
125
|
+
@avatar.rotate!
|
|
126
|
+
@avatar.data.dimensions.should == [64, 50]
|
|
127
|
+
@avatar.width.should == 64
|
|
128
|
+
@avatar.height.should == 50
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
context 'rotate', :focus => true do
|
|
106
133
|
before(:each) do
|
|
107
134
|
@avatar = create(:asset_avatar)
|
|
108
135
|
@avatar.rotate_degrees = '-90'
|
|
@@ -124,7 +151,7 @@ describe Avatar do
|
|
|
124
151
|
@avatar.save
|
|
125
152
|
end
|
|
126
153
|
|
|
127
|
-
it 'should
|
|
154
|
+
it 'should rotate image by degrees' do
|
|
128
155
|
@avatar.width.should == 64
|
|
129
156
|
@avatar.height.should == 50
|
|
130
157
|
@avatar.data.dimensions.should == [64, 50]
|
metadata
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
name: ab_admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.
|
|
5
|
+
version: 0.2.0
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Alex Leschenko
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-02-
|
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -606,6 +606,7 @@ files:
|
|
|
606
606
|
- app/assets/images/admin/flags/b_en.png
|
|
607
607
|
- app/assets/images/admin/flags/b_it.png
|
|
608
608
|
- app/assets/images/admin/flags/b_ru.png
|
|
609
|
+
- app/assets/images/admin/flags/b_uk.png
|
|
609
610
|
- app/assets/images/admin/flags/flag_en.gif
|
|
610
611
|
- app/assets/images/admin/flags/flag_en_nonact.gif
|
|
611
612
|
- app/assets/images/admin/flags/flag_it.gif
|
|
@@ -636,6 +637,7 @@ files:
|
|
|
636
637
|
- app/assets/javascripts/ab_admin/core/ui_utils.js.coffee
|
|
637
638
|
- app/assets/javascripts/ab_admin/core/utils.js.coffee
|
|
638
639
|
- app/assets/javascripts/ab_admin/inputs/datetime_input.js.coffee
|
|
640
|
+
- app/assets/javascripts/ab_admin/main.js
|
|
639
641
|
- app/assets/javascripts/i18n/translations.js
|
|
640
642
|
- app/assets/stylesheets/ab_admin/application.css.scss
|
|
641
643
|
- app/assets/stylesheets/ab_admin/bootstrap_and_overrides.css.scss
|
|
@@ -653,6 +655,7 @@ files:
|
|
|
653
655
|
- app/assets/stylesheets/ab_admin/components/_translations.css.scss
|
|
654
656
|
- app/assets/stylesheets/ab_admin/devise.css.scss
|
|
655
657
|
- app/assets/stylesheets/ab_admin/fileupload.css.scss
|
|
658
|
+
- app/assets/stylesheets/ab_admin/main.css.scss
|
|
656
659
|
- app/controllers/admin/admin_comments_controller.rb
|
|
657
660
|
- app/controllers/admin/assets_controller.rb
|
|
658
661
|
- app/controllers/admin/base_controller.rb
|
|
@@ -687,12 +690,11 @@ files:
|
|
|
687
690
|
- app/views/admin/base/show.html.slim
|
|
688
691
|
- app/views/admin/base/update.js.erb
|
|
689
692
|
- app/views/admin/dashboards/index.html.slim
|
|
690
|
-
- app/views/admin/fileupload/_asset.html.
|
|
691
|
-
- app/views/admin/fileupload/_container.html.
|
|
692
|
-
- app/views/admin/fileupload/
|
|
693
|
-
- app/views/admin/fileupload/
|
|
694
|
-
- app/views/admin/fileupload/
|
|
695
|
-
- app/views/admin/fileupload/_tmpl.html.erb
|
|
693
|
+
- app/views/admin/fileupload/_asset.html.slim
|
|
694
|
+
- app/views/admin/fileupload/_container.html.slim
|
|
695
|
+
- app/views/admin/fileupload/_file.html.slim
|
|
696
|
+
- app/views/admin/fileupload/_ftmpl.html.slim
|
|
697
|
+
- app/views/admin/fileupload/_tmpl.html.slim
|
|
696
698
|
- app/views/admin/headers/_form.html.slim
|
|
697
699
|
- app/views/admin/locators/edit.html.slim
|
|
698
700
|
- app/views/admin/locators/show.html.slim
|
|
@@ -736,10 +738,12 @@ files:
|
|
|
736
738
|
- features/dsl/admin_comments.feature
|
|
737
739
|
- features/dsl/batch_actions.feature
|
|
738
740
|
- features/dsl/config.feature
|
|
741
|
+
- features/dsl/custom_actions.feature
|
|
739
742
|
- features/dsl/export.feature
|
|
740
743
|
- features/dsl/form.feature
|
|
741
744
|
- features/dsl/in_place_edit.feature
|
|
742
745
|
- features/dsl/list_edit.feature
|
|
746
|
+
- features/dsl/parent_resource.feature
|
|
743
747
|
- features/dsl/resource_action_items.feature
|
|
744
748
|
- features/dsl/search.feature
|
|
745
749
|
- features/dsl/show.feature
|
|
@@ -754,6 +758,7 @@ files:
|
|
|
754
758
|
- features/step_definitions/dsl/admin_comments_steps.rb
|
|
755
759
|
- features/step_definitions/dsl/batch_actions_steps.rb
|
|
756
760
|
- features/step_definitions/dsl/in_place_edit_steps.rb
|
|
761
|
+
- features/step_definitions/dsl/parent_resource_steps.rb
|
|
757
762
|
- features/step_definitions/dsl/resource_action_items_steps.rb
|
|
758
763
|
- features/step_definitions/dsl/show_steps.rb
|
|
759
764
|
- features/step_definitions/dsl/table_steps.rb
|
|
@@ -768,6 +773,7 @@ files:
|
|
|
768
773
|
- features/step_definitions/web_steps/form_steps.rb
|
|
769
774
|
- features/step_definitions/web_steps/i18n_steps.rb
|
|
770
775
|
- features/step_definitions/web_steps/step_scoper.rb
|
|
776
|
+
- features/step_definitions/web_steps/transforms_steps.rb
|
|
771
777
|
- features/structure/tree.feature
|
|
772
778
|
- features/support/capybara_helpers.rb
|
|
773
779
|
- features/support/carrierwave.rb
|
|
@@ -810,6 +816,7 @@ files:
|
|
|
810
816
|
- lib/ab_admin/hooks/quiet_scope_page.rb
|
|
811
817
|
- lib/ab_admin/hooks/simple_form_hooks.rb
|
|
812
818
|
- lib/ab_admin/i18n_tools/google_translate.rb
|
|
819
|
+
- lib/ab_admin/i18n_tools/model_translator.rb
|
|
813
820
|
- lib/ab_admin/i18n_tools/translate_app.rb
|
|
814
821
|
- lib/ab_admin/mailers/development_mail_interceptor.rb
|
|
815
822
|
- lib/ab_admin/mailers/helpers.rb
|
|
@@ -824,7 +831,6 @@ files:
|
|
|
824
831
|
- lib/ab_admin/models/type_model.rb
|
|
825
832
|
- lib/ab_admin/models/user.rb
|
|
826
833
|
- lib/ab_admin/utils.rb
|
|
827
|
-
- lib/ab_admin/utils/csv_builder.rb
|
|
828
834
|
- lib/ab_admin/utils/csv_document.rb
|
|
829
835
|
- lib/ab_admin/utils/eval_helpers.rb
|
|
830
836
|
- lib/ab_admin/utils/logger.rb
|
|
@@ -1271,7 +1277,7 @@ files:
|
|
|
1271
1277
|
- lib/generators/ab_admin/install/templates/models/user_role_type.rb
|
|
1272
1278
|
- lib/generators/ab_admin/install/templates/models/user_state.rb
|
|
1273
1279
|
- lib/generators/ab_admin/install/templates/rspec
|
|
1274
|
-
- lib/generators/ab_admin/install/templates/
|
|
1280
|
+
- lib/generators/ab_admin/install/templates/script/unicorn.sh
|
|
1275
1281
|
- lib/generators/ab_admin/install/templates/spec/factories/sequences.rb
|
|
1276
1282
|
- lib/generators/ab_admin/install/templates/spec/factories/structure_factory.rb
|
|
1277
1283
|
- lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb
|
|
@@ -1297,6 +1303,7 @@ files:
|
|
|
1297
1303
|
- lib/generators/template.rb
|
|
1298
1304
|
- lib/tasks/assets.rake
|
|
1299
1305
|
- lib/tasks/cache.rake
|
|
1306
|
+
- lib/tasks/i18n.rake
|
|
1300
1307
|
- spec/ab_admin_spec.rb
|
|
1301
1308
|
- spec/dummy/Rakefile
|
|
1302
1309
|
- spec/dummy/app/assets/images/rails.png
|
|
@@ -1309,6 +1316,7 @@ files:
|
|
|
1309
1316
|
- spec/dummy/app/helpers/welcome_helper.rb
|
|
1310
1317
|
- spec/dummy/app/mailers/.gitkeep
|
|
1311
1318
|
- spec/dummy/app/models/ab_admin/ab_admin_catalogue.rb
|
|
1319
|
+
- spec/dummy/app/models/ab_admin/ab_admin_collection.rb
|
|
1312
1320
|
- spec/dummy/app/models/ab_admin/ab_admin_product.rb
|
|
1313
1321
|
- spec/dummy/app/models/admin_menu.rb
|
|
1314
1322
|
- spec/dummy/app/models/catalogue.rb
|
|
@@ -1840,7 +1848,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1840
1848
|
version: '0'
|
|
1841
1849
|
segments:
|
|
1842
1850
|
- 0
|
|
1843
|
-
hash:
|
|
1851
|
+
hash: 3413386508977600575
|
|
1844
1852
|
none: false
|
|
1845
1853
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1846
1854
|
requirements:
|
|
@@ -1849,7 +1857,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1849
1857
|
version: '0'
|
|
1850
1858
|
segments:
|
|
1851
1859
|
- 0
|
|
1852
|
-
hash:
|
|
1860
|
+
hash: 3413386508977600575
|
|
1853
1861
|
none: false
|
|
1854
1862
|
requirements: []
|
|
1855
1863
|
rubyforge_project:
|
|
@@ -1863,10 +1871,12 @@ test_files:
|
|
|
1863
1871
|
- features/dsl/admin_comments.feature
|
|
1864
1872
|
- features/dsl/batch_actions.feature
|
|
1865
1873
|
- features/dsl/config.feature
|
|
1874
|
+
- features/dsl/custom_actions.feature
|
|
1866
1875
|
- features/dsl/export.feature
|
|
1867
1876
|
- features/dsl/form.feature
|
|
1868
1877
|
- features/dsl/in_place_edit.feature
|
|
1869
1878
|
- features/dsl/list_edit.feature
|
|
1879
|
+
- features/dsl/parent_resource.feature
|
|
1870
1880
|
- features/dsl/resource_action_items.feature
|
|
1871
1881
|
- features/dsl/search.feature
|
|
1872
1882
|
- features/dsl/show.feature
|
|
@@ -1881,6 +1891,7 @@ test_files:
|
|
|
1881
1891
|
- features/step_definitions/dsl/admin_comments_steps.rb
|
|
1882
1892
|
- features/step_definitions/dsl/batch_actions_steps.rb
|
|
1883
1893
|
- features/step_definitions/dsl/in_place_edit_steps.rb
|
|
1894
|
+
- features/step_definitions/dsl/parent_resource_steps.rb
|
|
1884
1895
|
- features/step_definitions/dsl/resource_action_items_steps.rb
|
|
1885
1896
|
- features/step_definitions/dsl/show_steps.rb
|
|
1886
1897
|
- features/step_definitions/dsl/table_steps.rb
|
|
@@ -1895,6 +1906,7 @@ test_files:
|
|
|
1895
1906
|
- features/step_definitions/web_steps/form_steps.rb
|
|
1896
1907
|
- features/step_definitions/web_steps/i18n_steps.rb
|
|
1897
1908
|
- features/step_definitions/web_steps/step_scoper.rb
|
|
1909
|
+
- features/step_definitions/web_steps/transforms_steps.rb
|
|
1898
1910
|
- features/structure/tree.feature
|
|
1899
1911
|
- features/support/capybara_helpers.rb
|
|
1900
1912
|
- features/support/carrierwave.rb
|
|
@@ -1919,6 +1931,7 @@ test_files:
|
|
|
1919
1931
|
- spec/dummy/app/helpers/welcome_helper.rb
|
|
1920
1932
|
- spec/dummy/app/mailers/.gitkeep
|
|
1921
1933
|
- spec/dummy/app/models/ab_admin/ab_admin_catalogue.rb
|
|
1934
|
+
- spec/dummy/app/models/ab_admin/ab_admin_collection.rb
|
|
1922
1935
|
- spec/dummy/app/models/ab_admin/ab_admin_product.rb
|
|
1923
1936
|
- spec/dummy/app/models/admin_menu.rb
|
|
1924
1937
|
- spec/dummy/app/models/catalogue.rb
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<%= content_tag(:div, :class => 'asset ill', :'data-id' => asset.id, :id => "asset_#{asset.id}") do %>
|
|
2
|
-
<%= link_to '', admin_asset_path(asset), :title=>t('admin.delete'), :remote => true, :method => :delete,
|
|
3
|
-
:data => {:confirm => t('admin.delete_confirmation')}, :class => 'del' %>
|
|
4
|
-
<%= link_to image_tag(asset.thumb_url, :title => asset.filename), asset.url, :class => 'fileupload-file fancybox', :rel => 'fancybox' %>
|
|
5
|
-
<% end %>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<%= content_tag(:div, :class => "fileupload #{multiple ? 'many_assets' : 'one_asset'} #{asset_render_template}_asset_type",
|
|
2
|
-
:id => element_id, :data => container_data) do %>
|
|
3
|
-
<div class="gray-blocks">
|
|
4
|
-
<div>
|
|
5
|
-
<div class="fileupload-drop-area"><span><%= t('admin.fileupload.drop_here') %></span></div>
|
|
6
|
-
|
|
7
|
-
<div class="fileupload-list <%= 'ill-bl galery' unless asset_render_template == 'file' %>">
|
|
8
|
-
<%= render :partial => "admin/fileupload/#{asset_render_template}", :collection => assets %>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="file-types">
|
|
11
|
-
<span class="fileupload-button">
|
|
12
|
-
<button type="button" class="btn btn-primary"><%= t("admin.fileupload.button#{'s' if multiple}") %></button>
|
|
13
|
-
</span>
|
|
14
|
-
<div class="type-info">
|
|
15
|
-
<span><%= file_title %>. <%= t('admin.fileupload.max_size') %>:</span><strong><%= file_max_size %> MB</strong>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
<% end %>
|
|
21
|
-
|
|
22
|
-
<script type="text/javascript">
|
|
23
|
-
$(document).ready(function () {
|
|
24
|
-
var upl = new qq.FileUploaderInput(<%= raw script_options %>);
|
|
25
|
-
upl._setupDragDrop();
|
|
26
|
-
new AdminAssets('<%= element_id %>', '<%= sort_admin_assets_path(:klass => asset_klass) %>', <%= multiple ? 'true' : 'false' %>);
|
|
27
|
-
});
|
|
28
|
-
</script>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<%= content_tag(:div, :class => 'fileupload', :id => element_id) do %>
|
|
2
|
-
<div class="gray-blocks">
|
|
3
|
-
<div class="bg-bl">
|
|
4
|
-
<div class="gr-title"><%= label %></div>
|
|
5
|
-
<div class="fileupload-list ill-bl galery">
|
|
6
|
-
<%= render :partial => 'admin/fileupload/file', :collection => assets %>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="file-types">
|
|
9
|
-
<span class="fileupload-button">
|
|
10
|
-
<button type="button"><%= t('admin.fileupload.button') %></button>
|
|
11
|
-
</span>
|
|
12
|
-
<div class="type-info">
|
|
13
|
-
<span><%= file_title %>. <%= t('admin.fileupload.max_size') %>:</span><strong><%= file_max_size %> MB</strong>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
<% end %>
|
|
19
|
-
|
|
20
|
-
<script type="text/javascript">
|
|
21
|
-
$(document).ready(function(){
|
|
22
|
-
new qq.FileUploaderInput(<%=raw script_options %>);
|
|
23
|
-
new AdminAssets('<%= element_id %>', '<%= sort_admin_assets_path(:klass=>asset_klass) %>', <%= multiple ? 'true' : 'false' %>);
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<%= content_tag(:div, :class => "asset", :id => "asset_#{file.id}") do %>
|
|
2
|
-
<%= link_to file.original_name, file.url, :target => '_blank' %>
|
|
3
|
-
<%= link_to t('admin.delete'), admin_asset_path(file), :remote => true, :method => :delete,
|
|
4
|
-
:data => {:confirm => t('admin.delete_confirmation')}, :class => 'del btn btn-danger btn-mini' %>
|
|
5
|
-
<% end %>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<script id="fileupload_ftmpl" type="text/x-jquery-tmpl" xmlns="http://www.w3.org/1999/html">
|
|
2
|
-
<div class="asset" id="asset_${id}">
|
|
3
|
-
<a href="${url}" target="_blank">${original_name}</a>
|
|
4
|
-
<a href="/admin/assets/${id}" class="del btn btn-danger btn-mini"
|
|
5
|
-
data-confirm="<%= t('admin.delete_confirmation') %>" data-method="delete" data-remote="true" rel="nofollow"><%= t('admin.delete') %></a>
|
|
6
|
-
</div>
|
|
7
|
-
</script>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<script id="fileupload_tmpl" type="text/x-jquery-tmpl" xmlns="http://www.w3.org/1999/html">
|
|
2
|
-
<div class="asset ill" data-id="${id}" id="asset_${id}">
|
|
3
|
-
<%= link_to '', '/admin/assets/${id}', :title => t('admin.delete'), :remote => true, :method => :delete,
|
|
4
|
-
:data => {:confirm => t('admin.delete_confirmation')}, :class => 'fileupload-cancel del' %>
|
|
5
|
-
<a href="${url}" class="fileupload-file fancybox" rel='fancybox'>
|
|
6
|
-
<img src="${thumb_url}" title="${filename}">
|
|
7
|
-
</a>
|
|
8
|
-
</div>
|
|
9
|
-
</script>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
module AbAdmin
|
|
2
|
-
module Utils
|
|
3
|
-
# CSVBuilder stores CSV configuration
|
|
4
|
-
#
|
|
5
|
-
# Usage example:
|
|
6
|
-
#
|
|
7
|
-
# csv_builder = CSVBuilder.new
|
|
8
|
-
# csv_builder.column :id
|
|
9
|
-
# csv_builder.column("Name") { |resource| resource.full_name }
|
|
10
|
-
#
|
|
11
|
-
# csv_builder = CSVBuilder.new :separator => ";"
|
|
12
|
-
# csv_builder.column :id
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
class CSVBuilder
|
|
16
|
-
|
|
17
|
-
# Return a default CSVBuilder for a resource
|
|
18
|
-
# The CSVBuilder's columns would be Id followed by this
|
|
19
|
-
# resource's content columns
|
|
20
|
-
def self.default_for_resource(resource)
|
|
21
|
-
new.tap do |csv_builder|
|
|
22
|
-
csv_builder.column(:id)
|
|
23
|
-
resource.content_columns.each do |content_column|
|
|
24
|
-
csv_builder.column(content_column.name.to_sym)
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
attr_reader :columns, :column_separator
|
|
30
|
-
|
|
31
|
-
def initialize(options={}, &block)
|
|
32
|
-
@columns = []
|
|
33
|
-
@column_separator = options.delete(:separator)
|
|
34
|
-
instance_eval &block if block_given?
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# Add a column
|
|
38
|
-
def column(name, &block)
|
|
39
|
-
@columns << Column.new(name, block)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
class Column
|
|
43
|
-
attr_reader :name, :data
|
|
44
|
-
|
|
45
|
-
def initialize(name, block = nil)
|
|
46
|
-
@name = name.is_a?(Symbol) ? name.to_s.titleize : name
|
|
47
|
-
@data = block || name.to_sym
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|