pages_cms 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/routes.rb +17 -26
- data/lib/pages_cms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83d9122d822001c70fd71c92536a9addfd33259e
|
4
|
+
data.tar.gz: 557bb0a3680f40ed83ebbd653c500ce5bd68401c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89e20948af6c2393be3cb422b005c8c420c746c5d36b8daf7642e967f4aa5c1a265a0b720d36966b5daced25d13502a0cb519ad1dc370059e85b5c14a694f815
|
7
|
+
data.tar.gz: aedef50c6f1ea061287f904ffd16966efbf3801c57a01bbf487bbcbd0b4f30c75131f47e03f542ea9d06d13cacee1148cbfe3b7d867ec8bd8c204f360e38ed87
|
data/config/routes.rb
CHANGED
@@ -13,34 +13,25 @@ PagesCms::Engine.routes.draw do
|
|
13
13
|
post '/pages/order' => 'pages#order'
|
14
14
|
post '/accounts/site' => 'accounts#site'
|
15
15
|
end
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
# :
|
29
|
-
|
30
|
-
|
31
|
-
raccount = PagesCms::Account.find_by(mount_location: '/')
|
32
|
-
if accounts
|
33
|
-
accounts.each do |account|
|
34
|
-
get "/#{account.mount_location}/:parent/:slug" => 'pages#show', account: account.id
|
35
|
-
get "/#{account.mount_location}/:slug" => 'pages#show', account: account.id
|
36
|
-
get "/#{account.mount_location}/" => 'pages#home', account: account.id
|
16
|
+
begin
|
17
|
+
if PagesCms.const_defined?('Account')
|
18
|
+
accounts = PagesCms::Account.where("mount_location != '/'")
|
19
|
+
raccount = PagesCms::Account.find_by(mount_location: '/')
|
20
|
+
if accounts
|
21
|
+
accounts.each do |account|
|
22
|
+
get "/#{account.mount_location}/:parent/:slug" => 'pages#show', account: account.id
|
23
|
+
get "/#{account.mount_location}/:slug" => 'pages#show', account: account.id
|
24
|
+
get "/#{account.mount_location}/" => 'pages#home', account: account.id
|
25
|
+
end
|
26
|
+
end
|
27
|
+
if raccount
|
28
|
+
get '/:parent/:slug' => 'pages#show', account: raccount.id, root: true
|
29
|
+
get '/:slug' => 'pages#show', account: raccount.id, root: true
|
30
|
+
get '/' => 'pages#home', account: raccount.id, root: true, as: :root
|
37
31
|
end
|
38
32
|
end
|
39
|
-
|
40
|
-
|
41
|
-
get '/:slug' => 'pages#show', account: raccount.id, root: true
|
42
|
-
get '/' => 'pages#home', account: raccount.id, root: true, as: :root
|
43
|
-
end
|
33
|
+
rescue Exception => e
|
34
|
+
nil
|
44
35
|
end
|
45
36
|
|
46
37
|
end
|
data/lib/pages_cms/version.rb
CHANGED