Files
codeocean/app/views/tips/_form.html.slim
Julia Casamitjana 9c71c6667a Install and use ToastUi markdown editor
Replace all usages of pagedown-bootstrap editor with the new editor.
Add styles to ensure the editor preview matches the final output.
2024-04-26 13:31:49 +02:00

29 lines
1.2 KiB
Plaintext

- content_for :head do
// Force a full page reload, see https://github.com/turbolinks/turbolinks/issues/326.
Otherwise, code might not be highlighted correctly (race condition)
meta name='turbolinks-visit-control' content='reload'
- append_javascript_pack_tag('toast-ui')
- append_stylesheet_pack_tag('toast-ui')
= form_for(@tip, builder: PagedownFormBuilder) do |f|
= render('shared/form_errors', object: @tip)
.mb-3
= f.label(:title, class: 'form-label')
= f.text_field(:title, class: 'form-control', required: false)
.mb-3
= f.label(:description, class: 'form-label')
= f.pagedown :description
.mb-3
= f.label(:file_type_id, t('activerecord.attributes.file.file_type_id'), class: 'form-label')
= f.collection_select(:file_type_id, @file_types, :id, :name, {include_blank: true}, class: 'form-control')
.mb-3
= f.label(:example, class: 'form-label')
= f.text_area(:example, class: 'code-field form-control', rows: 5, style: 'display:none;', required: false)
#editor-edit.original-input data-file-id=@tip.id
#frames
.edit-frame
.editor-content.d-none
.editor.allow_ace_tooltip
.actions = render('shared/submit_button', f:, object: @tip)
.editor