mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 15:05:26 +08:00
Added new preview tables code
This commit is contained in:
parent
a732c8afa7
commit
2413dc251a
2 changed files with 12 additions and 0 deletions
|
@ -1145,6 +1145,7 @@ class ProtocolsController < ApplicationController
|
|||
# return string_without_tables, tables
|
||||
return tables, string_without_tables
|
||||
end
|
||||
helper_method :protocolsio_string_to_table_element
|
||||
|
||||
def move_protocol(action)
|
||||
rollbacked = false
|
||||
|
|
|
@ -16,21 +16,26 @@
|
|||
<div class="tab-pane active" role="tabpanel">
|
||||
<div data-val="description" class="ql-editor">
|
||||
<br>
|
||||
<% prot_info_string = '' %>
|
||||
<% if json_object['before_start'].present? %>
|
||||
<strong><%= t('protocols.protocols_io_import.preview.b_s_p') %></strong>
|
||||
<%= sanitize_input(json_object['before_start'].html_safe) %><br>
|
||||
<% prot_info_string += (json_object['before_start']) %>
|
||||
<% end %>
|
||||
<% if json_object['warning'].present? %>
|
||||
<strong><%= t('protocols.protocols_io_import.preview.warn') %></strong>
|
||||
<%= sanitize_input(json_object['warning'].html_safe) %><br>
|
||||
<% prot_info_string += (json_object['warning']) %>
|
||||
<% end %>
|
||||
<% if json_object['guidelines'].present? %>
|
||||
<strong><%= t('protocols.protocols_io_import.preview.guideln') %></strong>
|
||||
<%= sanitize_input(json_object['guidelines'].html_safe) %><br>
|
||||
<% prot_info_string += (json_object['guidelines']) %>
|
||||
<% end %>
|
||||
<% if json_object['manuscript_citation'].present? %>
|
||||
<strong><%= t('protocols.protocols_io_import.preview.manu_cit') %></strong>
|
||||
<%= sanitize_input(json_object['manuscript_citation'].html_safe) %><br>
|
||||
<% prot_info_string += (json_object['manuscript_citation']) %>
|
||||
<% end %>
|
||||
<% if json_object['publish_date'].present? %>
|
||||
<strong><%= t('protocols.protocols_io_import.preview.pbl_date') %></strong>
|
||||
|
@ -58,6 +63,12 @@
|
|||
<strong><%= t('protocols.protocols_io_import.preview.p_link') %></strong>
|
||||
<%= sanitize_input(json_object['link'].html_safe) %><br>
|
||||
<% end %>
|
||||
<% tables, garbage = protocolsio_string_to_table_element(prot_info_string) %>
|
||||
<% tables.each do |index, table| %>
|
||||
<% table_hash = JSON.parse(Base64.decode64(table['contents'])) %>
|
||||
<% byebug %>
|
||||
<hot-table datarows="{{ <%= table_hash['data'] %> }}"></hot-table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue