sutty/app/views/posts/attributes/_content.haml

85 lines
4.2 KiB
Plaintext
Raw Normal View History

2019-08-23 18:29:07 +00:00
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata
2020-11-14 15:10:55 +00:00
.editor{ id: attribute }
-# Esto es para luego decirle al navegador que se olvide estas cosas.
= hidden_field_tag 'storage_keys[]', "#{request.original_url}##{attribute}", data: { target: 'storage-key' }
2020-11-18 14:06:59 +00:00
.alert.alert-info
:markdown
#{t('editor.alert')}
2020-11-14 21:02:30 +00:00
= text_area_tag "post[#{attribute}]", '',
2020-11-14 15:10:55 +00:00
dir: dir, lang: locale,
**field_options(attribute, metadata), class: 'd-none'
.editor-toolbar
.editor-primary-toolbar.scrollbar-black
%button.btn{ data: { button: 'bold' } }= t('editor.bold')
%button.btn{ data: { button: 'italic' } }= t('editor.italic')
%button.btn{ data: { button: 'deleted' } }= t('editor.deleted')
%button.btn{ data: { button: 'underline' } }= t('editor.underline')
2020-11-19 01:55:33 +00:00
%button.btn{ data: { button: 'sup' } }= t('editor.sup')
%button.btn{ data: { button: 'sub' } }= t('editor.sub')
2020-11-14 15:10:55 +00:00
%button.btn{ data: { button: 'mark' } }= t('editor.mark')
2020-11-18 16:37:15 +00:00
%button.btn{ data: { button: 'a' } }= t('editor.a')
2020-11-14 15:10:55 +00:00
%button.btn{ data: { button: 'h1' } }= t('editor.h1')
%button.btn{ data: { button: 'h2' } }= t('editor.h2')
%button.btn{ data: { button: 'h3' } }= t('editor.h3')
%button.btn{ data: { button: 'h4' } }= t('editor.h4')
%button.btn{ data: { button: 'h5' } }= t('editor.h5')
%button.btn{ data: { button: 'h6' } }= t('editor.h6')
%button.btn{ data: { button: 'ul' } }= t('editor.ul')
%button.btn{ data: { button: 'ol' } }= t('editor.ol')
%button.btn{ data: { button: 'left' } }= t('editor.left')
%button.btn{ data: { button: 'center' } }= t('editor.center')
%button.btn{ data: { button: 'right' } }= t('editor.right')
%button.btn{ data: { button: 'img' } }= t('editor.img')
%button.btn{ data: { button: 'video' } }= t('editor.video')
%button.btn{ data: { button: 'audio' } }= t('editor.audio')
%button.btn{ data: { button: 'pdf' } }= t('editor.pdf')
-#
HAML cringe
TODO: generar IDs para labels
2020-11-17 22:03:32 +00:00
.editor-auxiliary-toolbar.mt-1.scrollbar-black{ data: { editor: { auxiliary: { toolbar: '' } } } }
2020-11-14 15:10:55 +00:00
.form-group{ data: { editor: { auxiliary: 'mark' } } }
%label{ for: 'mark-color' }= t('editor.color')
2020-11-17 22:03:32 +00:00
%input.form-control{ type: 'color', data: { prop: 'mark-color' } }/
2020-11-14 15:10:55 +00:00
%div{ data: { editor: { auxiliary: 'img' } } }
.row
2020-11-19 21:50:28 +00:00
.col-12.col-lg.form-group.d-flex.align-items-end
2020-11-14 15:10:55 +00:00
.custom-file
%input.custom-file-input{ type: 'file', data: { prop: 'img-file' }, accept: 'image/*' }/
%label.custom-file-label{ for: 'img-file' }= t('editor.file.img')
2020-11-19 21:50:28 +00:00
.col-12.col-lg.form-group
2020-11-14 15:10:55 +00:00
%label{ for: 'img-alt' }= t('editor.description')
%input.form-control{ type: 'text', data: { prop: 'img-alt' } }/
-# https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
.form-group{ data: { editor: { auxiliary: 'audio' } } }
.custom-file
2020-11-17 22:03:32 +00:00
%input.custom-file-input{ type: 'file', data: { prop: 'audio-file' }, accept: 'audio/*' }/
2020-11-14 15:10:55 +00:00
%label.custom-file-label{ for: 'audio-file' }= t('editor.file.audio')
.form-group{ data: { editor: { auxiliary: 'video' } } }
.custom-file
2020-11-17 22:03:32 +00:00
%input.custom-file-input{ type: 'file', data: { prop: 'video-file' }, accept: 'video/*' }/
2020-11-14 15:10:55 +00:00
%label.custom-file-label{ for: 'video-file' }= t('editor.file.video')
.form-group{ data: { editor: { auxiliary: 'pdf' } } }
.custom-file
%input.custom-file-input{ type: 'file', data: { prop: 'pdf-file' }, accept: 'application/pdf' }/
%label.custom-file-label{ for: 'pdf-file' }= t('editor.file.pdf')
2020-11-19 21:48:50 +00:00
.form-group{ data: { editor: { auxiliary: 'a' } } }
%label{ for: 'a-href' }= t('editor.url')
%input.form-control{ type: 'url', data: { prop: 'a-href' } }/
2020-11-19 21:54:26 +00:00
.editor-aviso-word.alert.alert-info
%p= t('editor.word')
2020-11-14 15:10:55 +00:00
2020-11-17 20:41:15 +00:00
.editor-content.form-control.h-auto.mt-1{ contenteditable: 'true' }
2020-11-16 20:05:07 +00:00
= metadata.value.html_safe