effective_pages 3.10.3 → 3.11.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/effective/permalinks_controller.rb +4 -2
- data/app/datatables/effective_permalinks_datatable.rb +11 -2
- data/app/models/effective/permalink.rb +1 -0
- data/app/views/admin/permalinks/_form.html.haml +8 -2
- data/config/routes.rb +1 -1
- data/db/migrate/101_create_effective_pages.rb +1 -0
- data/lib/effective_pages/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f608a5aa1318fab93ca116d9edea04aeb3a2077ecbcd41378dad81b3fb3018a5
|
4
|
+
data.tar.gz: 803a6fbc21a969464faf8d149b724d1a65b1b970e2a4b2e5ac57ddd17cf02e87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 482a07502489d6b6e6494bc6bf17f5b17c82ee05a68f500b85a33d380b71abc49074c371f556816b60142f131d523f46a3f66271c0ea69094dda69fb147523aa
|
7
|
+
data.tar.gz: dd26dfe9186dc3d1e8408f42967431a3e94d8db2882d8c96f7d53deb9103bb8af0888ccbd5bd247c52a5ba99ff9f0caf8d141caa037d478d5cb5aa98fee64e0b
|
@@ -1,9 +1,11 @@
|
|
1
1
|
module Effective
|
2
2
|
class PermalinksController < ApplicationController
|
3
|
-
|
3
|
+
include Effective::CrudController
|
4
|
+
|
5
|
+
def show
|
4
6
|
@permalink = Effective::Permalink.find_by! slug: params[:slug]
|
5
7
|
|
6
|
-
authorize! :
|
8
|
+
authorize! :show, @permalink
|
7
9
|
|
8
10
|
redirect_to redirect_path_for(@permalink), allow_other_host: (@permalink.target == :url)
|
9
11
|
end
|
@@ -5,9 +5,18 @@ class EffectivePermalinksDatatable < Effective::Datatable
|
|
5
5
|
col :updated_at, visible: false
|
6
6
|
|
7
7
|
col :title
|
8
|
-
|
8
|
+
|
9
|
+
col(:url) do |permalink|
|
10
|
+
url = (root_url + "link/" + permalink.slug)
|
11
|
+
link_to(url, url, target: '_blank')
|
12
|
+
end
|
13
|
+
|
9
14
|
col :summary
|
10
|
-
|
15
|
+
|
16
|
+
col :slug, visible: false
|
17
|
+
col :tags, visible: false
|
18
|
+
|
19
|
+
col :tracks_count, label: 'Views'
|
11
20
|
|
12
21
|
actions_col
|
13
22
|
end
|
@@ -3,5 +3,11 @@
|
|
3
3
|
= render '/admin/permalinks/form_permalink', permalink: permalink
|
4
4
|
|
5
5
|
- if permalink.persisted?
|
6
|
-
|
7
|
-
=
|
6
|
+
- if permalink.class.respond_to?(:acts_as_trackable?)
|
7
|
+
= tab 'Tracks' do
|
8
|
+
- datatable = Admin::EffectiveTracksDatatable.new(owner: permalink)
|
9
|
+
= render_datatable(datatable, inline: true, namespace: :admin)
|
10
|
+
|
11
|
+
- if permalink.respond_to?(:log_changes_datatable)
|
12
|
+
= tab 'Logs' do
|
13
|
+
= render_datatable(permalink.log_changes_datatable, inline: true, namespace: :admin)
|
data/config/routes.rb
CHANGED
@@ -14,7 +14,7 @@ EffectivePages::Engine.routes.draw do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
scope module: 'effective' do
|
17
|
-
get '/link/:slug', to: 'permalinks#
|
17
|
+
get '/link/:slug', to: 'permalinks#show', as: :permalink_redirect
|
18
18
|
|
19
19
|
match '*id', to: 'pages#show', via: :get, as: :page, constraints: lambda { |req|
|
20
20
|
Effective::Page.find_by_slug_or_id(req.path_parameters[:id] || '/').present?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|