Skip to content

Commit 71d668b

Browse files
authored
Merge pull request #128 from netgen/JGLWEB-1835-local-caption-alt-override
JGLWEB-1835 add local alt text and caption overrides
2 parents 3a1e619 + f60b5c5 commit 71d668b

40 files changed

Lines changed: 842 additions & 11 deletions

‎bundle/Controller/Configuration.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ private function resolveTranslations(): array
117117
'preview_alternate_text_info' => $this->translator->trans('ngrm.edit.vue.preview.alternate_text_info', [], 'ngremotemedia'),
118118
'preview_caption' => $this->translator->trans('ngrm.edit.vue.preview.caption', [], 'ngremotemedia'),
119119
'preview_caption_info' => $this->translator->trans('ngrm.edit.vue.preview.caption_info', [], 'ngremotemedia'),
120+
'preview_alternate_text_override' => $this->translator->trans('ngrm.edit.vue.preview.alternate_text_override', [], 'ngremotemedia'),
121+
'preview_alternate_text_override_info' => $this->translator->trans('ngrm.edit.vue.preview.alternate_text_override_info', [], 'ngremotemedia'),
122+
'preview_caption_override' => $this->translator->trans('ngrm.edit.vue.preview.caption_override', [], 'ngremotemedia'),
123+
'preview_caption_override_info' => $this->translator->trans('ngrm.edit.vue.preview.caption_override_info', [], 'ngremotemedia'),
120124
'preview_tags' => $this->translator->trans('ngrm.edit.vue.preview.tags', [], 'ngremotemedia'),
121125
'preview_tags_info' => $this->translator->trans('ngrm.edit.vue.preview.tags_info', [], 'ngremotemedia'),
122126
'preview_watermark_text' => $this->translator->trans('ngrm.edit.vue.preview.watermark_text', [], 'ngremotemedia'),

‎bundle/Controller/Location/SelectedImage.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public function __invoke(int $locationId): JsonResponse
5454
'alternateText' => $remoteResource->getAltText(),
5555
'caption' => $remoteResource->getCaption(),
5656
'watermarkText' => $remoteResourceLocation->getWatermarkText(),
57+
'altTextOverride' => $remoteResourceLocation->getAltTextOverride(),
58+
'captionOverride' => $remoteResourceLocation->getCaptionOverride(),
5759
'tags' => $remoteResource->getTags(),
5860
'size' => $remoteResource->getSize(),
5961
'variations' => $this->service->resolveCropSettingsJson($remoteResourceLocation),

‎bundle/DependencyInjection/Configuration.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ private function addNamedObjectsConfiguration(ArrayNodeDefinition $rootNode): vo
237237
->scalarNode('watermark_text')
238238
->defaultValue(null)
239239
->end()
240+
->scalarNode('alt_text')
241+
->info('Alt text override local to the location')
242+
->defaultValue(null)
243+
->end()
244+
->scalarNode('caption')
245+
->info('Caption override local to the location')
246+
->defaultValue(null)
247+
->end()
240248
->end()
241249
->end()
242250
->end()

‎bundle/Resources/config/doctrine/RemoteResourceLocation.orm.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<field name="source" column="source" type="string" length="255" nullable="true" />
1717
<field name="cropSettings" column="crop_settings" type="array" />
1818
<field name="watermarkText" column="watermark_text" type="text" length="1000" nullable="true" />
19+
<field name="altTextOverride" column="alt_text_override" type="text" length="1000" nullable="true" />
20+
<field name="captionOverride" column="caption_override" type="text" length="1000" nullable="true" />
1921
<field name="createdAt" column="created_at" type="datetime_immutable" />
2022
<field name="updatedAt" column="updated_at" type="datetime_immutable" />
2123

‎bundle/Resources/public/css/remotemedia.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bundle/Resources/public/js/ckeditor-plugin/constants.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ export const defaultValue = {
126126
'preview_alternate_text_info': 'preview_alternate_text_info',
127127
'preview_caption': 'preview_caption',
128128
'preview_caption_info': 'preview_caption_info',
129+
'preview_alternate_text_override': 'preview_alternate_text_override',
130+
'preview_alternate_text_override_info': 'preview_alternate_text_override_info',
131+
'preview_caption_override': 'preview_caption_override',
132+
'preview_caption_override_info': 'preview_caption_override_info',
129133
'preview_tags': 'preview_tags',
130134
'preview_tags_info': 'preview_tags_info',
131135
'preview_watermark_text': 'preview_watermark_text',
@@ -150,6 +154,8 @@ export const defaultValue = {
150154
type: 'type',
151155
altText: 'altText',
152156
caption: 'caption',
157+
altTextOverride: 'altTextOverride',
158+
captionOverride: 'captionOverride',
153159
tags: 'tags[]',
154160
cropSettings: 'cropSettings',
155161
source: 'source',
@@ -178,6 +184,8 @@ export const defaultValue = {
178184
alternateText: '',
179185
caption: '',
180186
watermarkText: '',
187+
altTextOverride: '',
188+
captionOverride: '',
181189
tags: [],
182190
size: '',
183191
variations: {},

‎bundle/Resources/public/js/remotemedia.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bundle/Resources/translations/ngremotemedia.en.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ ngrm:
3535
alternate_text_info: 'Alt text is stored directly in Cloudinary on a resource so updating it here will also update it on all other locations which are using that same resource.'
3636
caption: 'Caption'
3737
caption_info: 'Caption is stored directly in Cloudinary on a resource so updating it here will also update it on all other locations which are using that same resource.'
38+
alternate_text_override: 'Alternate text override'
39+
alternate_text_override_info: 'Alt text override is stored only on this location and takes precedence over the alt text stored in Cloudinary. Leave it empty to use the alt text from Cloudinary.'
40+
caption_override: 'Caption override'
41+
caption_override_info: 'Caption override is stored only on this location and takes precedence over the caption stored in Cloudinary. Leave it empty to use the caption from Cloudinary.'
3842
tags: 'Tags'
3943
tags_info: 'Tags are stored directly in Cloudinary on a resource so updating them here will also update them on all other locations which are using that same resource.'
4044
watermark_text: 'Watermark text'

‎bundle/Resources/translations/ngremotemedia.hr.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ ngrm:
3535
alternate_text_info: 'Alternativni tekst se sprema direktno na resurs u oblaku. Ukoliko se promjeni ovdje, promjenit će se i na svim ostalim lokacijama koje koriste taj resurs.'
3636
caption: 'Naslov'
3737
caption_info: 'Naslov se sprema direktno na resurs u oblaku. Ukoliko se promjeni ovdje, promjenit će se i na svim ostalim lokacijama koje koriste taj resurs.'
38+
alternate_text_override: 'Zamjenski alternativni tekst'
39+
alternate_text_override_info: 'Zamjenski alternativni tekst sprema se samo na ovu lokaciju i ima prednost pred alternativnim tekstom iz oblaka. Ostavite prazno kako bi se koristio alternativni tekst iz oblaka.'
40+
caption_override: 'Zamjenski naslov'
41+
caption_override_info: 'Zamjenski naslov sprema se samo na ovu lokaciju i ima prednost pred naslovom iz oblaka. Ostavite prazno kako bi se koristio naslov iz oblaka.'
3842
tags: 'Tagovi'
3943
tags_info: 'Tagovi se spremaju direktno na resurs u oblaku. Ukoliko se promjene ovdje, promjenit će se i na svim ostalim lokacijama koje koriste taj resurs.'
4044
watermark_text: 'Tekst vodenog žiga'

‎bundle/Resources/translations/ngremotemedia.no.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ ngrm:
3535
alternate_text_info: 'Alt text is stored directly to the resource in the cloud. Changing it here will also change it on all other locations which are using that same resource.'
3636
caption: 'Caption'
3737
caption_info: 'Caption is stored directly to the resource in the cloud. Changing it here will also change it on all other locations which are using that same resource.'
38+
alternate_text_override: 'Alt text override'
39+
alternate_text_override_info: 'Alt text override is stored only on this location and takes precedence over the alt text stored in the cloud. Leave it empty to use the alt text from the cloud.'
40+
caption_override: 'Caption override'
41+
caption_override_info: 'Caption override is stored only on this location and takes precedence over the caption stored in the cloud. Leave it empty to use the caption from the cloud.'
3842
tags: 'Tags'
3943
tags_info: 'Tags are stored directly to the resource in the cloud. Changing them here will also change them on all other locations which are using that same resource.'
4044
watermark_text: 'Watermark text'

0 commit comments

Comments
 (0)