mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Made code more aesthetic
This commit is contained in:
parent
096ee00e07
commit
a40a63ae50
|
@ -12,78 +12,73 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" role="tabpanel">
|
<div class="tab-pane active" role="tabpanel">
|
||||||
<div data-val="description" class="ql-editor">
|
<div data-val="description" class="ql-editor">
|
||||||
<br>
|
<br>
|
||||||
<% prot_info_string = '' %>
|
<% prot_info_string = '' %>
|
||||||
<% protocol_table_elements_array = [] %>
|
<% protocol_table_elements_array = [] %>
|
||||||
<% if json_object['before_start'].present? %>
|
<% if json_object['before_start'].present? %>
|
||||||
<% prot_info_string += (json_object['before_start']) %>
|
<% prot_info_string += (json_object['before_start']) %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.b_s_p') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.b_s_p') %></strong>
|
||||||
<%= sanitize_input(string_html_table_remove(json_object['before_start']).html_safe) %><br>
|
<%= sanitize_input(string_html_table_remove(json_object['before_start']).html_safe) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['warning'].present? %>
|
<% if json_object['warning'].present? %>
|
||||||
<% prot_info_string += (json_object['warning']) %>
|
<% prot_info_string += (json_object['warning']) %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.warn') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.warn') %></strong>
|
||||||
<%= sanitize_input(string_html_table_remove(json_object['warning']).html_safe) %><br>
|
<%= sanitize_input(string_html_table_remove(json_object['warning']).html_safe) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['guidelines'].present? %>
|
<% if json_object['guidelines'].present? %>
|
||||||
<% prot_info_string += (json_object['guidelines']) %>
|
<% prot_info_string += (json_object['guidelines']) %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.guideln') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.guideln') %></strong>
|
||||||
<%= sanitize_input(string_html_table_remove(json_object['guidelines']).html_safe) %><br>
|
<%= sanitize_input(string_html_table_remove(json_object['guidelines']).html_safe) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['manuscript_citation'].present? %>
|
<% if json_object['manuscript_citation'].present? %>
|
||||||
<% prot_info_string += (json_object['manuscript_citation']) %>
|
<% prot_info_string += (json_object['manuscript_citation']) %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.manu_cit') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.manu_cit') %></strong>
|
||||||
<%= sanitize_input(string_html_table_remove(json_object['manuscript_citation']).html_safe) %><br>
|
<%= sanitize_input(string_html_table_remove(json_object['manuscript_citation']).html_safe) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['publish_date'].present? %>
|
<% if json_object['publish_date'].present? %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.pbl_date') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.pbl_date') %></strong>
|
||||||
<%= sanitize_input(json_object['publish_date']) %><br>
|
<%= sanitize_input(json_object['publish_date']) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['vendor_name'].present? %>
|
<% if json_object['vendor_name'].present? %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.vnd_name') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.vnd_name') %></strong>
|
||||||
<%= sanitize_input(json_object['vendor_name']) %><br>
|
<%= sanitize_input(json_object['vendor_name']) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['vendor_link'].present? %>
|
<% if json_object['vendor_link'].present? %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.vnd_link') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.vnd_link') %></strong>
|
||||||
<%= sanitize_input(json_object['vendor_link'].html_safe) %><br>
|
<%= sanitize_input(json_object['vendor_link'].html_safe) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['keywords'].present? %>
|
<% if json_object['keywords'].present? %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.key_wrd') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.key_wrd') %></strong>
|
||||||
<%= sanitize_input(json_object['keywords']) %><br>
|
<%= sanitize_input(json_object['keywords']) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['tags'].present? %>
|
<% if json_object['tags'].present? %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.tags') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.tags') %></strong>
|
||||||
<% json_object['tags'].each do |tag| %>
|
<% json_object['tags'].each do |tag| %>
|
||||||
<%= sanitize_input(tag['tag_name'])+' , ' %><br>
|
<%= sanitize_input(tag['tag_name'])+' , ' %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if json_object['link'].present? %>
|
<% if json_object['link'].present? %>
|
||||||
<strong><%= t('protocols.protocols_io_import.preview.p_link') %></strong>
|
<strong><%= t('protocols.protocols_io_import.preview.p_link') %></strong>
|
||||||
<%= sanitize_input(json_object['link'].html_safe) %><br>
|
<%= sanitize_input(json_object['link'].html_safe) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% tables, garbage = protocolsio_string_to_table_element(prot_info_string) %>
|
<% tables, garbage = protocolsio_string_to_table_element(prot_info_string) %>
|
||||||
<% if tables.present? %>
|
<% if tables.present? %>
|
||||||
<br><hr><br>
|
<br><hr><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% table_count = 0 %>
|
<% table_count = 0 %>
|
||||||
<% tables.each do |index, table| %>
|
<% tables.each do |index, table| %>
|
||||||
<% table_hash = JSON.parse((Base64.decode64(table['contents']))) %>
|
<% table_hash = JSON.parse((Base64.decode64(table['contents']))) %>
|
||||||
<% pio_table_id = "pio_table_prot_info_"+table_count.to_s %>
|
<% pio_table_id = "pio_table_prot_info_"+table_count.to_s %>
|
||||||
<% protocol_table_elements_array.push([pio_table_id,table_hash['data']]) %>
|
<% protocol_table_elements_array.push([pio_table_id,table_hash['data']]) %>
|
||||||
|
<div id="<%=pio_table_id%>" ></div>
|
||||||
|
<% table_count += 1 %>
|
||||||
<div id="<%=pio_table_id%>" ></div>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<% table_count += 1 %>
|
</div>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('#modal-import-json-protocol-preview').on('shown.bs.modal', function (e) {
|
$('#modal-import-json-protocol-preview').on('shown.bs.modal', function (e) {
|
||||||
|
|
|
@ -108,21 +108,16 @@
|
||||||
<% end #step component loop %>
|
<% end #step component loop %>
|
||||||
<% tables, garbage = protocolsio_string_to_table_element(step_info_string) %>
|
<% tables, garbage = protocolsio_string_to_table_element(step_info_string) %>
|
||||||
<% if tables.present? %>
|
<% if tables.present? %>
|
||||||
<br><hr><br>
|
<br><hr><br>
|
||||||
|
<% end %>
|
||||||
|
<% table_count = 0 %>
|
||||||
|
<% tables.each do |index, table| %>
|
||||||
|
<% table_hash = JSON.parse((Base64.decode64(table['contents']))) %>
|
||||||
|
<% pio_table_id = "pio_table_step_"+counter.to_s+"_info_"+table_count.to_s %>
|
||||||
|
<% step_table_elements_array.push([pio_table_id,table_hash['data']]) %>
|
||||||
|
<div id="<%=pio_table_id%>" ></div>
|
||||||
|
<% table_count += 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% table_count = 0 %>
|
|
||||||
<% tables.each do |index, table| %>
|
|
||||||
<% table_hash = JSON.parse((Base64.decode64(table['contents']))) %>
|
|
||||||
<% pio_table_id = "pio_table_step_"+counter.to_s+"_info_"+table_count.to_s %>
|
|
||||||
<% step_table_elements_array.push([pio_table_id,table_hash['data']]) %>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="<%=pio_table_id%>" ></div>
|
|
||||||
|
|
||||||
|
|
||||||
<% table_count += 1 %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue