Skip to content
Snippets Groups Projects
Commit da0c85c3 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

not working

parent 275358e9
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,10 @@ window.osuny.translation = {
},
translate: function (field) {
console.log(field);
var text = field.value,
xhr = new XMLHttpRequest();
console.log(text);
xhr.open("POST", this.url, false);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
......
......@@ -153,6 +153,10 @@ class Communication::Block < ApplicationRecord
block
end
def is_a_translation?
about.is_a_translation?
end
def translate!(about_translation, heading_id = nil)
translation = self.dup
translation.about = about_translation
......
......@@ -6,6 +6,7 @@
<div class="summernote mb-3">
<textarea :id="<%= dom_id.html_safe %>"
class="form-control summernote-vue"
data-translatable="true"
v-model="<%= model %>.<%= property %>"
data-summernote-config="<%= summernote_config %>"
placeholder="<%= placeholder %>"></textarea>
......
......@@ -33,6 +33,7 @@
<% content_for :action_bar_left do %>
<%= destroy_link @block %>
<%= duplicate_link @block %>
<%= render 'admin/application/i18n/translate_button', about: @block %>
<% end %>
<% content_for :action_bar_right do %>
<%= submit f %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment