scinote-web/app/views/my_modules/_description_form.html.erb

24 lines
1.4 KiB
Text
Raw Normal View History

2023-08-09 21:47:33 +08:00
<%= form_with model: @my_module, url: update_description_my_module_path(@my_module, format: :json), data: { remote: true }, html: {class: 'tiny-mce-editor'}, builder: SciFormHelper::SciFormBuilder do |f| %>
<%= render partial: 'shared/tiny_mce_extra_buttons' %>
2020-03-19 22:45:14 +08:00
<div id="my_module_description_view"
class="ql-editor tinymce-view"
data-placeholder="<%= t('my_modules.notes.empty_description_edit_label') %>"
data-tinymce-init="tinymce-my-module-description-<%= @my_module.id %>"
><%= custom_auto_link(@my_module.tinymce_render(:description),
simple_format: false,
tags: %w(img),
team: current_team) if @my_module.description.present? %></div>
<%= f.tiny_mce_editor(:description,
id: :my_module_description_textarea,
class: 'hidden',
placeholder: t('my_modules.notes.empty_description_edit_label'),
hide_label: true,
value: sanitize_input(@my_module.tinymce_render(:description)),
autocomplete: 'off',
data: {
2020-03-19 22:45:14 +08:00
tinymce_object: "tinymce-my-module-description-#{@my_module.id}",
object_type: 'my_module',
object_id: @my_module.id,
last_updated: @my_module.updated_at.to_i * 1000 } ) %>
<% end %>