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: 378303acb1d79cfa54b47568adc4a71e7ebf962afeb93f15e843fd9185f94314
4
- data.tar.gz: df2d1f7bef49a5f2555dac0092394498a2ed6de7e7f793978eb27a9d735c6a5d
3
+ metadata.gz: ebd03a0b8ab95da06e877747d9a167dfbf0ce86c0dd8dbaf9d557d2af375c675
4
+ data.tar.gz: 1b95daccf2365ca0e18144535864d42e80d64a25d4e52cce1ac6c6aa5e308b75
5
5
  SHA512:
6
- metadata.gz: 0bb5db0c1fd70e1a9b3a463e8338ec73f5dbe389d872569e23f6862271b9e5a9064586f02ce1191cc534f5926b9bd887eb02f32230b54789178e47590d71cd93
7
- data.tar.gz: 63bb8ce4122db2bb72366336a8ad838abf55733e50782d8b9a40cf3f7ee8388e66c6a83cff40895e22cb866c345a7c43572e28b335e472413e35cce5a9734765
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
- link.starts_with?('/') ? link : link.prepend('/')
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
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '2.17.30'.freeze
2
+ VERSION = '2.17.31'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.30
4
+ version: 2.17.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms