Rubocop beautified code

This commit is contained in:
Zanz2 2017-09-26 13:20:55 +02:00
parent 8d961c934a
commit ad1847256c

View file

@ -1,4 +1,4 @@
<%= form_for(@protocol, :url => url_for(:controller => 'protocols', :action =>'protocolsio_import_save'),method: :post,format: :javascript,remote: true,:html=> { :id => "protocolsio-import-form" }) do |f| %> <%= form_for(@protocol, :url => url_for(:controller => 'protocols', :action=>'protocolsio_import_save'),method: :post,format: :javascript,remote: true,:html=> { :id => "protocolsio-import-form" }) do |f| %>
<%= hidden_field_tag :json_object, JSON.generate(@json_object) %> <%= hidden_field_tag :json_object, JSON.generate(@json_object) %>
<%= hidden_field_tag :type, <%= hidden_field_tag :type,
@ -47,13 +47,16 @@ CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
<label><%= t("protocols.import_export.import_modal.created_at_label") %></label> <label><%= t("protocols.import_export.import_modal.created_at_label") %></label>
<% display_created_at=Time.at(@json_object['created_on'].to_i) %> <% display_created_at=Time.at(@json_object['created_on'].to_i) %>
<%= f.text_field :created_at, :value => display_created_at.to_s+"(Protocols.io value)",readonly: true, class: "form-control" %> <%= f.text_field :created_at, :value => display_created_at.to_s+"(Protocols.io
value)",readonly: true, class: "form-control" %>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<label><%= t("protocols.import_export.import_modal.updated_at_label") %></label> <label><%= t("protocols.import_export.import_modal.updated_at_label") %></label>
<% display_last_modified=Time.at(@json_object['last_modified'].to_i) %> <% display_last_modified=Time.at(@json_object['last_modified'].to_i) %>
<%= f.text_field :last_modified, :value => display_last_modified.to_s+"(Protocols.io value)",readonly: true, class: "form-control" %> <%= f.text_field :last_modified, :value =>
display_last_modified.to_s+"(Protocols.io value)",readonly: true, class:
"form-control" %>
</div> </div>
</div> </div>
</div> </div>
@ -121,7 +124,6 @@ CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
<% title=nil %> <% title=nil %>
<% step["components"].each do |key1,value1| #finding section (title of step) %> <% step["components"].each do |key1,value1| #finding section (title of step) %>
<% if value1.class==Hash %> <% if value1.class==Hash %>
<% key1=value1 %> <% key1=value1 %>
<% end %> <% end %>
@ -153,10 +155,10 @@ CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
<% key=value %> <% key=value %>
<% end %> <% end %>
<% if whitelist_simple.include?(key["component_type_id"]) && key["data"]!="" && key["data"] %> <% if whitelist_simple.include?(key["component_type_id"]) && key["data"]!="" &&
key["data"] %>
<br> <br>
<% case key["component_type_id"]%> <% case key["component_type_id"]%><% when "1" %>
<% when "1" %>
<br> <br>
<strong> <strong>
Description: Description:
@ -171,8 +173,7 @@ CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
<% end %> <% end %>
<% elsif key && whitelist_complex.include?(key["component_type_id"]) %> <% elsif key && whitelist_complex.include?(key["component_type_id"]) %>
<% case key["component_type_id"]%> <% case key["component_type_id"]%><% when "8"%>
<% when "8"%>
<br> <br>
<strong><%= key["name"]+": " %></strong> <strong><%= key["name"]+": " %></strong>
<%= (key["source_data"]["name"]) %> <%= (key["source_data"]["name"]) %>
@ -327,7 +328,8 @@ CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
</div> </div>
</div> </div>
</div> </div>
<%# the below script resets all the fields after you decide not to import the file (cancel (modal hide)) %> <%# the below script resets all the fields after you decide not to import the
file (cancel (modal hide)) %>
<script> <script>
$('#modal-import-json-protocol-preview').on('hide.bs.modal', function () { $('#modal-import-json-protocol-preview').on('hide.bs.modal', function () {
$('#protocols_io_form').trigger("reset"); $('#protocols_io_form').trigger("reset");