metadata_presenter 2.17.30 → 2.17.31
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebd03a0b8ab95da06e877747d9a167dfbf0ce86c0dd8dbaf9d557d2af375c675
|
4
|
+
data.tar.gz: 1b95daccf2365ca0e18144535864d42e80d64a25d4e52cce1ac6c6aa5e308b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb534bc3e0bf092396528ceed202c9615ea00276b56729e0179f82d5e22d1fd3092c15caf0491425f9ca7a94275d6b7f96d924cd364598935eb86e3f29af134c
|
7
|
+
data.tar.gz: 63da753a7b9d08593df3e78b4993886b9c3bbd80696a893dcbd2e16b303cc4eadb8e942a9e1b2bf26c2e0195da981ba4df0e110112927c9d2274afa34f664986
|
@@ -74,7 +74,11 @@ module MetadataPresenter
|
|
74
74
|
uri = URI.parse(link)
|
75
75
|
return link if uri.scheme.present? && uri.host.present?
|
76
76
|
|
77
|
-
|
77
|
+
if editor_preview?
|
78
|
+
File.join(request.script_name, link)
|
79
|
+
else
|
80
|
+
link.starts_with?('/') ? link : link.prepend('/')
|
81
|
+
end
|
78
82
|
end
|
79
83
|
helper_method :external_or_relative_link
|
80
84
|
|
@@ -108,5 +112,9 @@ module MetadataPresenter
|
|
108
112
|
render 'metadata_presenter/maintenance/show'
|
109
113
|
end
|
110
114
|
end
|
115
|
+
|
116
|
+
def editor_preview?
|
117
|
+
URI(request.original_url).path.split('/').last == 'preview'
|
118
|
+
end
|
111
119
|
end
|
112
120
|
end
|