5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 04:51:43 +00:00
panel/app/views/posts/attributes/_content.haml

128 lines
6.5 KiB
Text
Raw Permalink Normal View History

2019-08-23 18:29:07 +00:00
.form-group
= label_tag "#{base}_#{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
2021-02-13 01:14:36 +00:00
.editor{ id: attribute, data: { editor: '' } }
-# 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')}
= text_area_tag "#{base}[#{attribute}]", '',
2020-11-14 15:10:55 +00:00
dir: dir, lang: locale,
**field_options(attribute, metadata), class: 'd-none'
2021-02-19 20:57:19 +00:00
-#
el > se come el salto de línea y hace que los botones no tengan
espacio adicional
TODO: Eliminar todo el espacio en blanco para minificar HTML
2021-02-19 17:31:38 +00:00
.editor-toolbar{ style: 'z-index: 1' }
2020-11-14 15:10:55 +00:00
.editor-primary-toolbar.scrollbar-black
2021-02-19 20:57:19 +00:00
%button.btn{ type: 'button', title: t('editor.multimedia'), data: { editor_button: 'multimedia' } }>
%i.fa.fa-fw.fa-upload>
%span.sr-only>= t('editor.multimedia')
%button.btn{ type: 'button', title: t('editor.bold'), data: { editor_button: 'mark-bold' } }>
%i.fa.fa-fw.fa-bold>
%span.sr-only>= t('editor.bold')
%button.btn{ type: 'button', title: t('editor.italic'), data: { editor_button: 'mark-italic' } }>
%i.fa.fa-fw.fa-italic>
%span.sr-only>= t('editor.italic')
%button.btn{ type: 'button', title: t('editor.mark'), data: { editor_button: 'mark-mark' } }>
%i.fa.fa-fw.fa-tint>
%span.sr-only>= t('editor.mark')
%button.btn{ type: 'button', title: t('editor.link'), data: { editor_button: 'mark-link' } }>
%i.fa.fa-fw.fa-link>
%span.sr-only>= t('editor.link')
%button.btn{ type: 'button', title: t('editor.deleted'), data: { editor_button: 'mark-deleted' } }>
%i.fa.fa-fw.fa-strikethrough>
%span.sr-only>= t('editor.deleted')
%button.btn{ type: 'button', title: t('editor.underline'), data: { editor_button: 'mark-underline' } }>
%i.fa.fa-fw.fa-underline>
%span.sr-only>= t('editor.underline')
%button.btn{ type: 'button', title: t('editor.super'), data: { editor_button: 'mark-super' } }>
%i.fa.fa-fw.fa-superscript>
%span.sr-only>= t('editor.super')
%button.btn{ type: 'button', title: t('editor.sub'), data: { editor_button: 'mark-sub' } }>
%i.fa.fa-fw.fa-subscript>
%span.sr-only>= t('editor.sub')
2021-03-26 15:31:36 +00:00
%button.btn{ type: 'button', title: t('editor.small'), data: { editor_button: 'mark-small' } }>
%i.fa.fa-fw.fa-subscript>
%span.sr-only>= t('editor.small')
2021-02-19 20:57:19 +00:00
%button.btn.mr-0{ type: 'button', title: t('editor.h1'), data: { editor_button: 'block-h1' } }>
%i.fa.fa-fw.fa-heading>
1
%span.sr-only>= t('editor.h1')
%details.d-inline>
%summary.d-inline>
%span.btn.ml-0{ role: 'button', title: t('editor.more') }>
%i.fa.fa-caret-right>
%span.sr-only= t('editor.more')
.d-inline>
%button.btn{ type: 'button', title: t('editor.h2'), data: { editor_button: 'block-h2' } }>
%i.fa.fa-fw.fa-heading>
2
%span.sr-only>= t('editor.h2')
%button.btn{ type: 'button', title: t('editor.h3'), data: { editor_button: 'block-h3' } }>
%i.fa.fa-fw.fa-heading>
3
%span.sr-only>= t('editor.h3')
%button.btn{ type: 'button', title: t('editor.h4'), data: { editor_button: 'block-h4' } }>
%i.fa.fa-fw.fa-heading>
4
%span.sr-only>= t('editor.h4')
%button.btn{ type: 'button', title: t('editor.h5'), data: { editor_button: 'block-h5' } }>
%i.fa.fa-fw.fa-heading>
5
%span.sr-only>= t('editor.h5')
%button.btn{ type: 'button', title: t('editor.h6'), data: { editor_button: 'block-h6' } }>
%i.fa.fa-fw.fa-heading>
6
%span.sr-only>= t('editor.h6')
%button.btn{ type: 'button', title: t('editor.ul'), data: { editor_button: 'block-unordered_list' } }>
%i.fa.fa-fw.fa-list-ul>
%span.sr-only>= t('editor.ul')
%button.btn{ type: 'button', title: t('editor.ol'), data: { editor_button: 'block-ordered_list' } }>
%i.fa.fa-fw.fa-list-ol>
%span.sr-only>= t('editor.ol')
%button.btn{ type: 'button', title: t('editor.left'), data: { editor_button: 'parentBlock-left' } }>
%i.fa.fa-fw.fa-align-left>
%span.sr-only>= t('editor.left')
%button.btn{ type: 'button', title: t('editor.center'), data: { editor_button: 'parentBlock-center' } }>
%i.fa.fa-fw.fa-align-center>
%span.sr-only>= t('editor.center')
%button.btn{ type: 'button', title: t('editor.right'), data: { editor_button: 'parentBlock-right' } }>
%i.fa.fa-fw.fa-align-right>
%span.sr-only>= t('editor.right')
2020-11-14 15:10:55 +00:00
2021-02-19 20:57:19 +00:00
-# HAML cringe
.editor-auxiliary-toolbar.mt-1.scrollbar-black{ data: { editor_auxiliary_toolbar: '' } }
.form-group{ data: { editor_auxiliary: 'mark' } }
2020-11-14 15:10:55 +00:00
%label{ for: 'mark-color' }= t('editor.color')
2021-02-13 01:14:36 +00:00
%input.form-control{ type: 'color', name: 'mark-color' }/
%label{ for: 'mark-text-color' }= t('editor.text-color')
%input.form-control{ type: 'color', name: 'mark-text-color' }/
2020-11-14 15:10:55 +00:00
2021-02-19 20:57:19 +00:00
%div{ data: { editor_auxiliary: 'multimedia' } }
2021-02-19 17:31:38 +00:00
.form-group
2021-02-14 16:01:41 +00:00
.custom-file
2021-02-19 20:57:19 +00:00
%input.custom-file-input{ type: 'file', id: 'multimedia-file', name: 'multimedia-file' }/
2021-02-18 21:43:47 +00:00
%label.custom-file-label{ for: 'multimedia-file' }= t('editor.multimedia-select')
2021-02-19 17:31:38 +00:00
.form-group
2021-02-14 16:01:41 +00:00
%label{ for: 'multimedia-alt' }= t('editor.description')
2021-02-19 20:57:19 +00:00
%input.form-control{ type: 'text', id: 'multimedia-alt', name: 'multimedia-alt' }/
2021-02-19 17:31:38 +00:00
.form-group
2021-02-19 20:57:19 +00:00
%button.btn{ type: 'button', id: 'multimedia-file-upload', name: 'multimedia-file-upload' }= t('editor.multimedia-upload')
%button.btn{ type: 'button', id: 'multimedia-remove', name: 'multimedia-remove' }= t('editor.multimedia-remove')
2020-11-14 15:10:55 +00:00
2021-02-19 20:57:19 +00:00
.form-group{ data: { editor_auxiliary: 'link' } }
2021-02-13 01:14:36 +00:00
%label{ for: 'link-url' }= t('editor.url')
2021-02-19 20:57:19 +00:00
%input.form-control{ type: 'url', id: 'link-url', name: 'link-url' }/
2020-11-19 21:48:50 +00:00
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