ecm_links2 2.0.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ecm/links/categories_controller.rb +2 -2
- data/app/decorators/ecm/links/category_decorator.rb +1 -1
- data/app/models/ecm/links/category.rb +8 -19
- data/app/models/ecm/links/link.rb +6 -14
- data/app/views/ecm/links/_link_footer.html.erb +1 -1
- data/app/views/ecm/links/categories/_category.html.erb +2 -2
- data/app/views/ecm/links/categories/_category_in_index.html.erb +2 -2
- data/app/views/ecm/links/categories/show.html.erb +1 -1
- data/app/views/ecm/links/links/_link_in_table.html.erb +1 -1
- data/config/locales/ecm.links.category.de.yml +2 -2
- data/config/locales/ecm.links.category.en.yml +2 -2
- data/config/locales/ecm.links.de.yml +3 -6
- data/config/locales/ecm.links.en.yml +3 -6
- data/config/locales/ecm.links.link.de.yml +2 -2
- data/config/locales/ecm.links.link.en.yml +2 -2
- data/config/routes.rb +7 -0
- data/db/migrate/001_create_ecm_links_categories.rb +1 -1
- data/db/migrate/002_create_ecm_links_links.rb +1 -1
- data/db/migrate/20170605034337_remove_counter_caches_from_ecm_links_categories.rb +5 -0
- data/db/migrate/20170605034440_rename_ecm_links_category_id_on_ecm_links_links.rb +5 -0
- data/lib/ecm/links/engine.rb +1 -5
- data/lib/ecm/links/version.rb +1 -1
- data/lib/ecm/links.rb +11 -0
- data/lib/ecm_links2.rb +1 -13
- data/lib/generators/ecm/links/install/install_generator.rb +1 -1
- metadata +7 -105
- data/app/admin/ecm_links_categories.rb +0 -120
- data/app/admin/ecm_links_links.rb +0 -56
- data/lib/ecm/links/routing.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7252b1793098998c2a8c750335d2b46c62dac1d1
|
4
|
+
data.tar.gz: bfa1d8303f5162224500587ac642c356a26778ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b3c4013f3715abe1880db4cbb8d64d6e0fbfdf482474d058c638559265a88b474f027ae512b3f2508a4f55039ac83751bf84a2f0d6e1417ceac40d6d2429ff3
|
7
|
+
data.tar.gz: 9de509dbada3da70e06ea2184b82a7a677aba97431755d730ce7794e1f28495897ef85339354c1f44fdf0a71908362350100a32888cc2bf7252557e7226f4eb2
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Ecm::Links
|
2
2
|
class CategoriesController < ApplicationController
|
3
3
|
def index
|
4
|
-
@categories = Category.includes(:
|
4
|
+
@categories = Category.includes(:links).all.decorate
|
5
5
|
end
|
6
6
|
|
7
7
|
def show
|
8
|
-
@category = Category.includes(:
|
8
|
+
@category = Category.includes(:links).find(params[:id]).decorate
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -3,25 +3,10 @@ require_dependency 'redcloth'
|
|
3
3
|
module Ecm::Links
|
4
4
|
class Category < ActiveRecord::Base
|
5
5
|
# associations
|
6
|
-
has_many :
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
# attributes
|
12
|
-
attr_accessible :depth,
|
13
|
-
:ecm_links_links_attributes,
|
14
|
-
:lft,
|
15
|
-
:link_footer_column,
|
16
|
-
:locale,
|
17
|
-
:long_description,
|
18
|
-
:markup_language,
|
19
|
-
:name,
|
20
|
-
:parent_id,
|
21
|
-
:rgt,
|
22
|
-
:short_description,
|
23
|
-
:slug if respond_to? :attr_accessible
|
24
|
-
accepts_nested_attributes_for :ecm_links_links, allow_destroy: true
|
6
|
+
has_many :links, -> { order(:position) },
|
7
|
+
dependent: :destroy
|
8
|
+
|
9
|
+
accepts_nested_attributes_for :links, allow_destroy: true
|
25
10
|
|
26
11
|
# awesome nested set
|
27
12
|
acts_as_nested_set
|
@@ -78,6 +63,10 @@ module Ecm::Links
|
|
78
63
|
end
|
79
64
|
end
|
80
65
|
|
66
|
+
def links_count
|
67
|
+
links.count
|
68
|
+
end
|
69
|
+
|
81
70
|
private
|
82
71
|
|
83
72
|
def markup(text)
|
@@ -2,20 +2,12 @@ require_dependency 'redcloth'
|
|
2
2
|
|
3
3
|
class Ecm::Links::Link < ActiveRecord::Base
|
4
4
|
# acts as list
|
5
|
-
acts_as_list scope: :
|
5
|
+
acts_as_list scope: :category
|
6
6
|
|
7
7
|
# associations
|
8
|
-
belongs_to :
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# attributes
|
13
|
-
attr_accessible :description,
|
14
|
-
:ecm_links_category_id,
|
15
|
-
:markup_language,
|
16
|
-
:name,
|
17
|
-
:position,
|
18
|
-
:url if respond_to? :attr_accessible
|
8
|
+
belongs_to :category,
|
9
|
+
optional: true
|
10
|
+
|
19
11
|
|
20
12
|
# callbacks
|
21
13
|
after_initialize :set_defaults
|
@@ -24,8 +16,8 @@ class Ecm::Links::Link < ActiveRecord::Base
|
|
24
16
|
MARKUP_LANGUAGES = %w(markdown textile rdoc)
|
25
17
|
|
26
18
|
# validations
|
27
|
-
validates :name, presence: true
|
28
|
-
validates :url, presence: true
|
19
|
+
validates :name, presence: true
|
20
|
+
validates :url, presence: true
|
29
21
|
validates :markup_language, presence: true,
|
30
22
|
inclusion: MARKUP_LANGUAGES
|
31
23
|
|
@@ -13,10 +13,10 @@
|
|
13
13
|
|
14
14
|
<div class="download_category-downloads item_list">
|
15
15
|
<h2><%= Ecm::Links::Category.human_attribute_name(:ecm_links_links) %></h2>
|
16
|
-
<% if category.
|
16
|
+
<% if category.links.count == 0 %>
|
17
17
|
<p><%= t('ecm.links.category.messages.no_links_available') %></p>
|
18
18
|
<% else %>
|
19
|
-
<%= render partial: 'ecm/links/links/table', locals: { links: category.
|
19
|
+
<%= render partial: 'ecm/links/links/table', locals: { links: category.links } %>
|
20
20
|
<% end %>
|
21
21
|
</div>
|
22
22
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%= link_to(category, class: "list-group-item left-padding-#{category.depth * 3}", title: category.short_description) do %>
|
1
|
+
<%= link_to([ecm_links, category], class: "list-group-item left-padding-#{category.depth * 3}", title: category.short_description) do %>
|
2
2
|
<%= category.tree_name %>
|
3
3
|
<%= category.locale_label %>
|
4
|
-
<%= category.
|
4
|
+
<%= category.links_count_label %>
|
5
5
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<div class="well">
|
4
4
|
<% if @category.root? %>
|
5
|
-
<%= link_to(t('ecm.links.category.actions.back_to_index'),
|
5
|
+
<%= link_to(t('ecm.links.category.actions.back_to_index'), ecm_links.categories_path, class: 'btn btn-default') if respond_to?(:ecm_links_categories_path) %>
|
6
6
|
<% else %>
|
7
7
|
<%= link_to(Ecm::Links::Category.human_attribute_name(:parent), @category.parent, class: 'btn btn-default') %>
|
8
8
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<tr class="<%= link.class.name.underscore.gsub('/', ' ') %>" id="<%= "#{link.class.name.underscore.gsub('/', '-')}-#{link.to_param}" %>">
|
2
2
|
<td><%= link_to link.name, link.url %></td>
|
3
|
-
<td><%= link_to link.
|
3
|
+
<td><%= link_to link.category.human, link.category %></td>
|
4
4
|
<td><%= link.description(as: :html).html_safe %></td>
|
5
5
|
</tr>
|
@@ -12,7 +12,7 @@ de:
|
|
12
12
|
created_at: Erstellt am
|
13
13
|
updated_at: Aktualisiert am
|
14
14
|
url: URL
|
15
|
-
|
16
|
-
|
15
|
+
category: Link Kategorie
|
16
|
+
category_id: Link Kategorie
|
17
17
|
markup_language: Markup Sprache
|
18
18
|
description: Beschreibung
|
@@ -12,7 +12,7 @@ en:
|
|
12
12
|
created_at: created at
|
13
13
|
updated_at: updated at
|
14
14
|
url: url
|
15
|
-
|
16
|
-
|
15
|
+
category: link category
|
16
|
+
category_id: link category
|
17
17
|
markup_language: markup language
|
18
18
|
description: description
|
data/config/routes.rb
ADDED
data/lib/ecm/links/engine.rb
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
module Ecm
|
2
2
|
module Links
|
3
3
|
class Engine < ::Rails::Engine
|
4
|
-
|
5
|
-
ActiveAdmin.setup do |config|
|
6
|
-
config.load_paths += Dir[root.join('app', 'admin')]
|
7
|
-
end
|
8
|
-
end if Gem::Specification.find_all_by_name('activeadmin').any?
|
4
|
+
isolate_namespace Ecm::Links
|
9
5
|
end
|
10
6
|
end
|
11
7
|
end
|
data/lib/ecm/links/version.rb
CHANGED
data/lib/ecm/links.rb
ADDED
data/lib/ecm_links2.rb
CHANGED
@@ -1,21 +1,9 @@
|
|
1
|
-
require 'active_admin-acts_as_list' if Gem::Specification.find_all_by_name('activeadmin').any?
|
2
|
-
require 'active_admin-awesome_nested_set' if Gem::Specification.find_all_by_name('activeadmin').any?
|
3
1
|
require 'acts_as_list'
|
4
2
|
require 'awesome_nested_set'
|
5
3
|
require 'awesome_nested_set-tools'
|
6
4
|
require 'friendly_id'
|
7
5
|
require 'draper'
|
8
6
|
|
7
|
+
require 'ecm/links'
|
9
8
|
require 'ecm/links/engine'
|
10
|
-
require 'ecm/links/configuration'
|
11
|
-
require 'ecm/links/routing'
|
12
9
|
|
13
|
-
module Ecm
|
14
|
-
module Links
|
15
|
-
extend Configuration
|
16
|
-
|
17
|
-
def self.table_name_prefix
|
18
|
-
'ecm_links_'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_links2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.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:
|
11
|
+
date: 2017-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -206,104 +206,6 @@ dependencies:
|
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: activeadmin
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - "~>"
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: 1.0.0.pre2
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - "~>"
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: 1.0.0.pre2
|
223
|
-
- !ruby/object:Gem::Dependency
|
224
|
-
name: therubyracer
|
225
|
-
requirement: !ruby/object:Gem::Requirement
|
226
|
-
requirements:
|
227
|
-
- - ">="
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: '0'
|
230
|
-
type: :development
|
231
|
-
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
requirements:
|
234
|
-
- - ">="
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: '0'
|
237
|
-
- !ruby/object:Gem::Dependency
|
238
|
-
name: less-rails
|
239
|
-
requirement: !ruby/object:Gem::Requirement
|
240
|
-
requirements:
|
241
|
-
- - ">="
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: '0'
|
244
|
-
type: :development
|
245
|
-
prerelease: false
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
247
|
-
requirements:
|
248
|
-
- - ">="
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: '0'
|
251
|
-
- !ruby/object:Gem::Dependency
|
252
|
-
name: sass-rails
|
253
|
-
requirement: !ruby/object:Gem::Requirement
|
254
|
-
requirements:
|
255
|
-
- - ">="
|
256
|
-
- !ruby/object:Gem::Version
|
257
|
-
version: '0'
|
258
|
-
type: :development
|
259
|
-
prerelease: false
|
260
|
-
version_requirements: !ruby/object:Gem::Requirement
|
261
|
-
requirements:
|
262
|
-
- - ">="
|
263
|
-
- !ruby/object:Gem::Version
|
264
|
-
version: '0'
|
265
|
-
- !ruby/object:Gem::Dependency
|
266
|
-
name: coffee-rails
|
267
|
-
requirement: !ruby/object:Gem::Requirement
|
268
|
-
requirements:
|
269
|
-
- - ">="
|
270
|
-
- !ruby/object:Gem::Version
|
271
|
-
version: '0'
|
272
|
-
type: :development
|
273
|
-
prerelease: false
|
274
|
-
version_requirements: !ruby/object:Gem::Requirement
|
275
|
-
requirements:
|
276
|
-
- - ">="
|
277
|
-
- !ruby/object:Gem::Version
|
278
|
-
version: '0'
|
279
|
-
- !ruby/object:Gem::Dependency
|
280
|
-
name: active_admin-acts_as_list
|
281
|
-
requirement: !ruby/object:Gem::Requirement
|
282
|
-
requirements:
|
283
|
-
- - ">="
|
284
|
-
- !ruby/object:Gem::Version
|
285
|
-
version: '0'
|
286
|
-
type: :development
|
287
|
-
prerelease: false
|
288
|
-
version_requirements: !ruby/object:Gem::Requirement
|
289
|
-
requirements:
|
290
|
-
- - ">="
|
291
|
-
- !ruby/object:Gem::Version
|
292
|
-
version: '0'
|
293
|
-
- !ruby/object:Gem::Dependency
|
294
|
-
name: active_admin-awesome_nested_set
|
295
|
-
requirement: !ruby/object:Gem::Requirement
|
296
|
-
requirements:
|
297
|
-
- - ">="
|
298
|
-
- !ruby/object:Gem::Version
|
299
|
-
version: '0'
|
300
|
-
type: :development
|
301
|
-
prerelease: false
|
302
|
-
version_requirements: !ruby/object:Gem::Requirement
|
303
|
-
requirements:
|
304
|
-
- - ">="
|
305
|
-
- !ruby/object:Gem::Version
|
306
|
-
version: '0'
|
307
209
|
- !ruby/object:Gem::Dependency
|
308
210
|
name: capybara
|
309
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -412,8 +314,6 @@ files:
|
|
412
314
|
- MIT-LICENSE
|
413
315
|
- README.rdoc
|
414
316
|
- Rakefile
|
415
|
-
- app/admin/ecm_links_categories.rb
|
416
|
-
- app/admin/ecm_links_links.rb
|
417
317
|
- app/controllers/ecm/links/categories_controller.rb
|
418
318
|
- app/decorators/ecm/links/category_decorator.rb
|
419
319
|
- app/helpers/ecm/links/categories_helper.rb
|
@@ -435,11 +335,14 @@ files:
|
|
435
335
|
- config/locales/ecm.links.en.yml
|
436
336
|
- config/locales/ecm.links.link.de.yml
|
437
337
|
- config/locales/ecm.links.link.en.yml
|
338
|
+
- config/routes.rb
|
438
339
|
- db/migrate/001_create_ecm_links_categories.rb
|
439
340
|
- db/migrate/002_create_ecm_links_links.rb
|
341
|
+
- db/migrate/20170605034337_remove_counter_caches_from_ecm_links_categories.rb
|
342
|
+
- db/migrate/20170605034440_rename_ecm_links_category_id_on_ecm_links_links.rb
|
343
|
+
- lib/ecm/links.rb
|
440
344
|
- lib/ecm/links/configuration.rb
|
441
345
|
- lib/ecm/links/engine.rb
|
442
|
-
- lib/ecm/links/routing.rb
|
443
346
|
- lib/ecm/links/version.rb
|
444
347
|
- lib/ecm_links2.rb
|
445
348
|
- lib/generators/ecm/links/install/install_generator.rb
|
@@ -468,9 +371,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
468
371
|
version: '0'
|
469
372
|
requirements: []
|
470
373
|
rubyforge_project:
|
471
|
-
rubygems_version: 2.
|
374
|
+
rubygems_version: 2.6.11
|
472
375
|
signing_key:
|
473
376
|
specification_version: 4
|
474
377
|
summary: Link management module for ruby on rails.
|
475
378
|
test_files: []
|
476
|
-
has_rdoc:
|
@@ -1,120 +0,0 @@
|
|
1
|
-
include ActiveAdmin::ActsAsList::Helper if defined?(ActiveAdmin)
|
2
|
-
include ActiveAdmin::AwesomeNestedSet::Helper if defined?(ActiveAdmin)
|
3
|
-
|
4
|
-
ActiveAdmin.register Ecm::Links::Category do
|
5
|
-
# menu entry settings
|
6
|
-
menu parent: proc { I18n.t('ecm.links.active_admin.menu') }.call
|
7
|
-
|
8
|
-
# awesome nested set
|
9
|
-
sortable_tree_member_actions
|
10
|
-
|
11
|
-
permit_params :link_footer_column,
|
12
|
-
:locale,
|
13
|
-
:long_description,
|
14
|
-
:markup_language,
|
15
|
-
:name,
|
16
|
-
:parent_id,
|
17
|
-
:short_description,
|
18
|
-
ecm_links_links_attributes: [
|
19
|
-
:description,
|
20
|
-
:ecm_links_category_id,
|
21
|
-
:markup_language,
|
22
|
-
:name,
|
23
|
-
:position,
|
24
|
-
:url
|
25
|
-
]
|
26
|
-
|
27
|
-
form do |f|
|
28
|
-
f.inputs do
|
29
|
-
f.input :parent, as: :select, collection: nested_set_options(Ecm::Links::Category, f.object) { |c| "#{'    ' * c.level} |-- #{c}".html_safe }
|
30
|
-
f.input :locale, as: :select, collection: I18n.available_locales.map(&:to_s)
|
31
|
-
f.input :name
|
32
|
-
f.input :short_description
|
33
|
-
f.input :long_description
|
34
|
-
end
|
35
|
-
|
36
|
-
f.inputs do
|
37
|
-
f.input :markup_language, as: :select, collection: Ecm::Links::Configuration.markup_languages.map(&:to_s)
|
38
|
-
f.input :link_footer_column, as: :select, collection: (1..Ecm::Links::Configuration.link_footer_columns).to_a
|
39
|
-
end
|
40
|
-
|
41
|
-
f.inputs do
|
42
|
-
f.has_many :ecm_links_links do |l|
|
43
|
-
if l.object.persisted?
|
44
|
-
l.input :_destroy, as: :boolean, label: I18n.t('active_admin.delete')
|
45
|
-
end
|
46
|
-
l.input :name
|
47
|
-
l.input :url
|
48
|
-
l.input :description
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
f.actions
|
53
|
-
end
|
54
|
-
|
55
|
-
index as: :nested_set do
|
56
|
-
selectable_column
|
57
|
-
sortable_tree_columns
|
58
|
-
column :locale
|
59
|
-
column :name do |c|
|
60
|
-
span(style: "margin-left: #{30 * c.level}px") { c.name }
|
61
|
-
end
|
62
|
-
column :short_description
|
63
|
-
column :ecm_links_links_count
|
64
|
-
column :link_footer_column
|
65
|
-
column :created_at
|
66
|
-
column :updated_at
|
67
|
-
actions
|
68
|
-
end
|
69
|
-
|
70
|
-
show do
|
71
|
-
attributes_table do
|
72
|
-
row :parent
|
73
|
-
row :locale
|
74
|
-
row :name
|
75
|
-
row :ecm_links_links_count
|
76
|
-
row :markup_language
|
77
|
-
row :link_footer_column
|
78
|
-
row :created_at
|
79
|
-
row :updated_at
|
80
|
-
end
|
81
|
-
|
82
|
-
panel Ecm::Links::Category.human_attribute_name(:short_description) do
|
83
|
-
div { ecm_links_category.short_description }
|
84
|
-
end
|
85
|
-
|
86
|
-
panel Ecm::Links::Category.human_attribute_name(:long_description) do
|
87
|
-
div { ecm_links_category.long_description }
|
88
|
-
end
|
89
|
-
|
90
|
-
panel Ecm::Links::Category.human_attribute_name(:children) do
|
91
|
-
table_for ecm_links_category.descendants, i18n: Ecm::Links::Category do
|
92
|
-
sortable_tree_columns
|
93
|
-
column(:name) { |child| link_to child, [:admin, child], style: "margin-left: #{30 * (child.level - ecm_links_category.level - 1)}px" }
|
94
|
-
column :short_description
|
95
|
-
column :ecm_links_links_count
|
96
|
-
column :link_footer_column
|
97
|
-
column :created_at
|
98
|
-
column :updated_at
|
99
|
-
column do |child|
|
100
|
-
link_to(I18n.t('active_admin.view'), [:admin, child], class: 'member_link view_link') +
|
101
|
-
link_to(I18n.t('active_admin.edit'), [:edit, :admin, child], class: 'member_link edit_link')
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
panel Ecm::Links::Category.human_attribute_name(:ecm_links_links) do
|
107
|
-
table_for ecm_links_category.ecm_links_links, i18n: Ecm::Links::Link do
|
108
|
-
sortable_columns
|
109
|
-
column(:name) { |link| link_to link.name, [:admin, link] }
|
110
|
-
column(:url) { |link| link_to link.url, link.url }
|
111
|
-
column :created_at
|
112
|
-
column :updated_at
|
113
|
-
column do |link|
|
114
|
-
link_to(I18n.t('active_admin.view'), [:admin, link], class: 'member_link view_link') +
|
115
|
-
link_to(I18n.t('active_admin.edit'), [:edit, :admin, link], class: 'member_link edit_link')
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end if defined?(ActiveAdmin)
|
@@ -1,56 +0,0 @@
|
|
1
|
-
include ActiveAdmin::ActsAsList::Helper if defined?(ActiveAdmin)
|
2
|
-
|
3
|
-
ActiveAdmin.register Ecm::Links::Link do
|
4
|
-
# menu entry settings
|
5
|
-
menu parent: proc { I18n.t('ecm.links.active_admin.menu') }.call
|
6
|
-
|
7
|
-
permit_params :description,
|
8
|
-
:ecm_links_category_id,
|
9
|
-
:markup_language,
|
10
|
-
:name,
|
11
|
-
:position,
|
12
|
-
:url
|
13
|
-
|
14
|
-
# acts as list
|
15
|
-
sortable_member_actions
|
16
|
-
|
17
|
-
form do |f|
|
18
|
-
f.inputs do
|
19
|
-
f.input :ecm_links_category, as: :select, collection: nested_set_options(Ecm::Links::Category) { |c| "#{'    ' * c.level} |-- #{c}".html_safe }
|
20
|
-
f.input :name
|
21
|
-
f.input :url
|
22
|
-
f.input :description
|
23
|
-
end
|
24
|
-
|
25
|
-
f.inputs do
|
26
|
-
f.input :markup_language, as: :select, collection: Ecm::Links::Link::MARKUP_LANGUAGES
|
27
|
-
end
|
28
|
-
|
29
|
-
f.actions
|
30
|
-
end
|
31
|
-
|
32
|
-
index do
|
33
|
-
selectable_column
|
34
|
-
column :ecm_links_category
|
35
|
-
column :name
|
36
|
-
column :url
|
37
|
-
column :created_at
|
38
|
-
column :updated_at
|
39
|
-
actions
|
40
|
-
end
|
41
|
-
|
42
|
-
show do
|
43
|
-
attributes_table do
|
44
|
-
row :ecm_links_category
|
45
|
-
row :name
|
46
|
-
row :url
|
47
|
-
row :markup_language
|
48
|
-
row :created_at
|
49
|
-
row :updated_at
|
50
|
-
end
|
51
|
-
|
52
|
-
panel Ecm::Links::Link.human_attribute_name(:description) do
|
53
|
-
div { ecm_links_link.description }
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end if defined?(ActiveAdmin)
|
data/lib/ecm/links/routing.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
module Ecm
|
2
|
-
module Links
|
3
|
-
class Routing
|
4
|
-
def self.routes(router, options = {})
|
5
|
-
options.reverse_merge!(links_category_actions: [:index, :show])
|
6
|
-
|
7
|
-
router.resources :ecm_links_categories, only: options[:links_category_actions], controller: 'ecm/links/categories'
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|