1
0

Unified hash options style

This commit is contained in:
cryptogopher
2019-11-27 21:24:49 +01:00
parent 1982f3b526
commit 158685459d
21 changed files with 99 additions and 96 deletions

View File

@@ -2,8 +2,8 @@
<h2><%= t ".heading_new_measurement" %></h2>
<%= labelled_form_for @measurement,
:url => project_measurements_path(@project),
:html => {:id => 'measurement-form'} do |f| %>
url: project_measurements_path(@project),
html: {id: 'measurement-form'} do |f| %>
<%= error_messages_for @measurement %>
<div class="box tabular">
@@ -17,19 +17,20 @@
<%= ff.select :unit_id, unit_options, {label: ''} %>
<%= ff.check_box :_destroy, {style: "display:none", label: ''} %>
<%= link_to t(".button_delete_readout"), '#',
:class => 'icon icon-del',
:style => (@measurement.readouts.length > 1 ? "" : "display:none"),
:onclick => "deleteReadout(); return false;" %>
class: 'icon icon-del',
style: (@measurement.readouts.length > 1 ? "" : "display:none"),
onclick: "deleteReadout(); return false;" %>
</p>
<% end %>
<% end %>
<p>
<%= link_to t(".button_add_readout"), '#', :class => 'icon icon-add',
:onclick => 'addReadout(); return false;' %>
<%= link_to t(".button_add_readout"), '#', class: 'icon icon-add',
onclick: 'addReadout(); return false;' %>
</p>
</div>
<%= submit_tag l(:button_create) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-measurement").hide()' %>
<%= link_to l(:button_cancel), "#",
onclick: '$("#add-measurement").hide(); return false;' %>
<% end %>
<hr>
</div>

View File

@@ -1,17 +1,17 @@
<% content_for :sidebar do %>
<%= render :partial => 'body_trackers/sidebar' %>
<%= render partial: 'body_trackers/sidebar' %>
<% end %>
<div class="contextual">
<% if User.current.allowed_to?(:manage_common, @project) %>
<%= link_to t(".link_new_measurement"), '#', :class => 'icon icon-add',
:onclick => '$("#add-measurement").show(); $("#measurement_name").focus(); return false;' %>
<%= link_to t(".link_new_measurement"), '#', class: 'icon icon-add',
onclick: '$("#add-measurement").show(); $("#measurement_name").focus(); return false;' %>
<% end %>
</div>
<%= render :partial => 'measurements/form' %>
<%= render partial: 'measurements/form' %>
<h2><%= t ".heading" %></h2>
<div id='measurements'>
<%= render :partial => 'measurements/list' %>
<%= render partial: 'measurements/list' %>
</div>