Merge pull request #1456 from consul/accessibility-embed-videos

improves accessibility on proposals embed videos
This commit is contained in:
Juanjo Bazán
2017-03-23 12:33:54 +01:00
committed by GitHub
3 changed files with 4 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ module EmbedVideosHelper
def embedded_video_code def embedded_video_code
link = @proposal.video_url link = @proposal.video_url
title = t('proposals.show.embed_video_title', proposal: @proposal.title)
if link.match(/vimeo.*/) if link.match(/vimeo.*/)
server = "Vimeo" server = "Vimeo"
elsif link.match(/youtu*.*/) elsif link.match(/youtu*.*/)
@@ -21,7 +22,7 @@ module EmbedVideosHelper
end end
if match and match[2] if match and match[2]
'<iframe src="' + src + match[2] + '" frameborder="0" allowfullscreen></iframe>' '<iframe src="' + src + match[2] + '" style="border:0;" allowfullscreen title="' + title + '"></iframe>'
else else
'' ''
end end

View File

@@ -384,6 +384,7 @@ en:
share: Share share: Share
send_notification: Send notification send_notification: Send notification
no_notifications: "This proposal has any notifications." no_notifications: "This proposal has any notifications."
embed_video_title: "Video on %{proposal}"
update: update:
form: form:
submit_button: Save changes submit_button: Save changes

View File

@@ -384,6 +384,7 @@ es:
send_notification: Enviar notificación send_notification: Enviar notificación
share: Compartir share: Compartir
no_notifications: "Esta propuesta no tiene notificaciones." no_notifications: "Esta propuesta no tiene notificaciones."
embed_video_title: "Vídeo en %{proposal}"
update: update:
form: form:
submit_button: Guardar cambios submit_button: Guardar cambios