Fix description styling of components

This commit is contained in:
Urban Rotnik 2019-07-08 17:22:29 +02:00
parent 8411e92fa2
commit be77746aef
13 changed files with 46 additions and 23 deletions

View file

@ -118,9 +118,9 @@ module ProtocolImporters
{
type: 'reagent',
name: desc_component[:source][:name],
link: desc_component[:source][:url],
details: {
catalog_number: desc_component[:source][:sku],
link: desc_component[:source][:vendor][:link],
linear_formula: desc_component[:source][:linfor],
mol_weight: desc_component[:source][:mol_weight]
}

View file

@ -1,5 +1,11 @@
<p class="step-description-component-command"><b><%= t('protocol_importers.templates.command.title') %></b><br>
<%= "#{t('protocol_importers.templates.command.name')}: #{item[:name]}" %>
<%= "#{t('protocol_importers.templates.command.code')}: <code>#{item[:command]}</code>" %>
<% if item[:name].present? %>
<%= "#{t('protocol_importers.templates.command.name')}: #{item[:name]}" %> <br/>
<% end %>
<% if item[:command].present? %>
<%= t('protocol_importers.templates.command.code') %>: <br/>
<code> <%= item[:command] %> </code>
<% end %>
</p>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %>

View file

@ -1,5 +1,9 @@
<p class="step-description-component-dataset"><b><%= t('protocol_importers.templates.dataset.title') %></b><br>
<%= "#{t('protocol_importers.templates.dataset.name')}: #{item[:name]}" %>
<%= "#{t('protocol_importers.templates.dataset.link')}: <a href='#{item[:source]}'>#{item[:source]}</a>" if item[:source] %>
<% if item[:name].present? %>
<%= "#{t('protocol_importers.templates.dataset.name')}: #{item[:name]}" %> <br />
<% end %>
<% if item[:source].present? %>
<%= t('protocol_importers.templates.dataset.link') %>: <a href="<%= item[:source] %>" target="_blank"><%= item[:source] %></a>
<% end %>
</p>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %>

View file

@ -1,8 +1,9 @@
<p>
<% if item[:details]&.any? %>
<b> <%= t('protocol_importers.templates.details.title')%>: </b>
<% items = item[:details]&.reject { |_,v| v.blank? } %>
<% if items&.any? %>
<i> <%= t('protocol_importers.templates.details.title')%>: </i>
<br />
<% item[:details].reject { |_,v| v.blank? }.each do |k, v| %>
<% items.each do |k, v| %>
<%= "#{k.humanize}: #{v.to_s}" %>
<br />
<% end %>

View file

@ -1,4 +1,5 @@
<p class="step-description-component-gotostep"><b><%= t('protocol_importers.templates.gotostep.title') %></b><br/>
<%= "#{t('protocol_importers.templates.gotostep.number')}: #{item[:step_id]}" %><br/>
<%= "#{t('protocol_importers.templates.gotostep.reason')}: #{item[:value]}" %><br/>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %>
</p>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %>

View file

@ -1,4 +1,10 @@
<p class="step-description-component-note"><b><%= t('protocol_importers.templates.note.title') %></b><br/>
<%= "#{t('protocol_importers.templates.note.author')}: #{item[:author]}" %><br/>
<%= item[:body] %></p>
<% if item[:author].present? %>
<%= "#{t('protocol_importers.templates.note.author')}: #{item[:author]}" %><br/>
<% end %>
<% if item[:body].present? %>
<%= item[:body] %>
<% end %>
</p>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %>

View file

@ -1,11 +1,11 @@
<p class="step-description-component-reagent">
<b><%= t('protocol_importers.templates.reagent.title') %></b>
<br/>
<%= "#{t('protocol_importers.templates.reagent.name')}: #{item[:name]}" %>
<% if item[:source] %>
<%= "#{t('protocol_importers.templates.reagent.name')}: #{item[:name]}" %> <br />
<% if item[:link].present? %>
<%= t('protocol_importers.templates.reagent.link') %>:
<%= "<a href='#{item[:source]}'>#{item[:source]}</a>" %>
<% end -%>
<a href="<%= item[:link] %>" target="_blank"><%= item[:link] %></a>
<% end %>
</p>
<%= render(
partial: 'protocol_importers/templates/details',

View file

@ -1,6 +1,11 @@
<p class="step-description-component-software"><b><%= t('protocol_importers.templates.software.title') %></b><br>
<%= "#{t('protocol_importers.templates.software.name')}: #{item[:name]}" %>
<%= "#{t('protocol_importers.templates.software.link')}: #{ActionController::Base.helpers.link_to(item[:source], item[:source])}" %>
<% if item[:name].present? %>
<%= "#{t('protocol_importers.templates.software.name')}: #{item[:name]}" %>
<% end %>
<br>
<% if item[:source].present? %>
<%= t('protocol_importers.templates.software.link') %>: <a href="<%= item[:source] %>" target="_blank"><%= item[:source] %></a>
<% end %>
</p>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %>

View file

@ -1,3 +1,3 @@
<p class="step-description-component-warning"><b><%= t('protocol_importers.templates.warning.title') %><b><br/>
<p class="step-description-component-warning"><b><%= t('protocol_importers.templates.warning.title') %></b><br/>
<%= item[:body] %></p>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %>

View file

@ -1,8 +1,8 @@
<% if @description[:body] %>
<% if @description[:body].present? %>
<p> <%= sanitize(@description[:body], tags: Constants::PROTOCOLS_DESC_TAGS) %> </p>
<br/>
<% end %>
<% if @description[:image] %>
<% if @description[:image].present? %>
<br/>
<img src='<%= @description[:image] %>' />
<br/>

View file

@ -1,4 +1,4 @@
<% if @step_description[:body] %>
<% if @step_description[:body].present? %>
<p> <%= sanitize(@step_description[:body], tags: Constants::PROTOCOLS_DESC_TAGS) %> </p>
<% end %>

View file

@ -72,9 +72,9 @@
{
"type": "reagent",
"name": "2 mg Gastrin I, human",
"link": "https://www.biorbyt.com/gastrin-i-human-orb321073",
"details": {
"catalog_number": "",
"link": "https://www.biorbyt.com/gastrin-i-human-orb321073",
"linear_formula": "C130H204N38O31S",
"mol_weight": 0.1
}

View file

@ -486,7 +486,7 @@
"mol_weight": 0.1,
"name": "2 mg Gastrin I, human",
"linfor": "C130H204N38O31S",
"url": "",
"url": "https://www.biorbyt.com/gastrin-i-human-orb321073",
"sku": "",
"public": 0,
"vendor": {