Unified hash options style
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<%= link_to t(".link_import_ingredients"), '#', :class => 'icon icon-multiple',
|
||||
:onclick => '$("#import-ingredients").show(); $("#filename").focus(); return false;' %>
|
||||
<%= link_to t(".link_new_ingredient"), '#', :class => 'icon icon-add',
|
||||
:onclick => '$("#add-ingredient").show(); $("#ingredient_name").focus(); return false;' %>
|
||||
<%= link_to t(".link_import_ingredients"), '#', class: 'icon icon-multiple',
|
||||
onclick: '$("#import-ingredients").show(); $("#filename").focus(); return false;' %>
|
||||
<%= link_to t(".link_new_ingredient"), '#', class: 'icon icon-add',
|
||||
onclick: '$("#add-ingredient").show(); $("#ingredient_name").focus(); return false;' %>
|
||||
<% end %>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<h2><%= t ".heading_new_ingredient" %></h2>
|
||||
|
||||
<%= labelled_form_for @ingredient,
|
||||
:url => project_ingredients_path(@project),
|
||||
:html => {:id => 'ingredient-form'} do |f| %>
|
||||
url: project_ingredients_path(@project),
|
||||
html: {id: 'ingredient-form'} do |f| %>
|
||||
<%= error_messages_for @ingredient %>
|
||||
|
||||
<div class="box tabular">
|
||||
@@ -33,19 +33,20 @@
|
||||
<%= ff.select :unit_id, unit_options, {label: ''} %>
|
||||
<%= ff.check_box :_destroy, {style: "display:none", label: ''} %>
|
||||
<%= link_to t(".button_delete_nutrient"), '#',
|
||||
:class => 'icon icon-del',
|
||||
:style => (@ingredient.nutrients.length > 1 ? "" : "display:none"),
|
||||
:onclick => "deleteNutrient(); return false;" %>
|
||||
class: 'icon icon-del',
|
||||
style: (@ingredient.nutrients.length > 1 ? "" : "display:none"),
|
||||
onclick: "deleteNutrient(); return false;" %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<p>
|
||||
<%= link_to t(".button_add_nutrient"), '#', :class => 'icon icon-add',
|
||||
:onclick => 'addNutrient(); return false;' %>
|
||||
<%= link_to t(".button_add_nutrient"), '#', class: 'icon icon-add',
|
||||
onclick: 'addNutrient(); return false;' %>
|
||||
</p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-ingredient").hide()' %>
|
||||
<%= link_to l(:button_cancel), "#",
|
||||
onclick: '$("#add-ingredient").hide(); return false;' %>
|
||||
<% end %>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<h2><%= t ".heading_import_ingredients" %></h2>
|
||||
|
||||
<%= form_tag import_project_ingredients_path(@project),
|
||||
:multipart => true,
|
||||
:id => 'import-form' do %>
|
||||
multipart: true,
|
||||
id: 'import-form' do %>
|
||||
<div class="box tabular">
|
||||
<p>
|
||||
<label><%= t ".label_import_select_csv_file" %></label>
|
||||
@@ -14,7 +14,8 @@
|
||||
</p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_import) %>
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#import-ingredients").hide()' %>
|
||||
<%= link_to l(:button_cancel), "#",
|
||||
onclick: '$("#import-ingredients").hide(); return false;' %>
|
||||
<% end %>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%= render :partial => 'ingredients/filters',
|
||||
:locals => {:url => filter_project_ingredients_path(@project)} %>
|
||||
<%= render partial: 'ingredients/filters',
|
||||
locals: {url: filter_project_ingredients_path(@project)} %>
|
||||
|
||||
<% if @ingredients.any? { |i| i.persisted? } %>
|
||||
<table class="list">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<%= render :partial => 'ingredients/filters',
|
||||
:locals => {:url => filter_nutrients_project_ingredients_path(@project)} %>
|
||||
<%= render partial: 'ingredients/filters',
|
||||
locals: {url: filter_nutrients_project_ingredients_path(@project)} %>
|
||||
|
||||
<% if @nutrients.any? %>
|
||||
<%= render :partial => 'ingredients/options' %>
|
||||
<%= render partial: 'ingredients/options' %>
|
||||
|
||||
<table class="nutrients list odd-even">
|
||||
<thead>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'body_trackers/sidebar' %>
|
||||
<%= render partial: 'body_trackers/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to t(".heading_nutrient_view"), nutrients_project_ingredients_path(@project),
|
||||
:class => 'icon icon-stats' %>
|
||||
<%= render :partial => 'ingredients/contextual' %>
|
||||
class: 'icon icon-stats' %>
|
||||
<%= render partial: 'ingredients/contextual' %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'ingredients/import' %>
|
||||
<%= render partial: 'ingredients/import' %>
|
||||
|
||||
<%= render :partial => 'ingredients/form' %>
|
||||
<%= render partial: 'ingredients/form' %>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<div id='ingredients'>
|
||||
<%= render :partial => 'ingredients/list' %>
|
||||
<%= render partial: 'ingredients/list' %>
|
||||
</div>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'body_trackers/sidebar' %>
|
||||
<%= render partial: 'body_trackers/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to t(".heading_ingredient_list"), project_ingredients_path(@project),
|
||||
:class => 'icon icon-list' %>
|
||||
<%= render :partial => 'ingredients/contextual' %>
|
||||
class: 'icon icon-list' %>
|
||||
<%= render partial: 'ingredients/contextual' %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'ingredients/import' %>
|
||||
<%= render partial: 'ingredients/import' %>
|
||||
|
||||
<%= render :partial => 'ingredients/form' %>
|
||||
<%= render partial: 'ingredients/form' %>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<div id='nutrients'>
|
||||
<%= render :partial => 'ingredients/list_nutrients' %>
|
||||
<%= render partial: 'ingredients/list_nutrients' %>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
$('div[id^=flash_]').remove();
|
||||
$('#content').prepend('<%= escape_javascript(render_flash_messages) %>');
|
||||
$('#ingredients').html('<%= escape_javascript(render :partial => 'ingredients/list') %>');
|
||||
$('#ingredients').html('<%= escape_javascript(render partial: 'ingredients/list') %>');
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
$('div[id^=flash_]').remove();
|
||||
$('#content').prepend('<%= escape_javascript(render_flash_messages) %>');
|
||||
$('#nutrients').html('<%= escape_javascript(render :partial => 'ingredients/list_nutrients') %>');
|
||||
$('#nutrients').html('<%= escape_javascript(render partial: 'ingredients/list_nutrients') %>');
|
||||
|
||||
Reference in New Issue
Block a user