Added test_create_binding_target
Goals (incl. binding) are required to have targets Plugin fixtures are available through accessors
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_import_foods"), '#', class: 'icon icon-multiple',
|
||||
onclick: '$("#import-foods").show(); $("#filename").focus(); return false;' %>
|
||||
<%= link_to t(".link_new_food"), new_project_food_path(@project, view: view),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%= fields_for 'goal', goal do |ff| %>
|
||||
<label><%= l(:field_goal) %><span class="required"> *</span></label>
|
||||
<label for="goal_id"><%= l(:field_goal) %><span class="required"> *</span></label>
|
||||
<%= ff.select :id,
|
||||
options_from_collection_for_select(@project.goals, :id, :name, goal.id),
|
||||
{required: true}, autocomplete: 'off',
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<li><%= link_to t(".link_sources"), project_sources_path(@project) %></li>
|
||||
<li><%= link_to t(".link_quantities"), project_quantities_path(@project) %></li>
|
||||
<li><%= link_to t(".link_units"), project_units_path(@project) %></li>
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<li> </li>
|
||||
<li><p><%= link_to t(".link_defaults"), defaults_project_body_trackers_path(@project),
|
||||
method: :post, data: {confirm: t(".confirm_defaults")} %></li>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_new_meal"), new_project_meal_path(@project),
|
||||
{remote: true, class: 'icon icon-add'} %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_new_measurement"),
|
||||
new_project_measurement_path(@project, @view_params),
|
||||
{remote: true, class: 'icon icon-add'} %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_new_quantity"), new_project_quantity_path(@project),
|
||||
{remote: true, class: 'icon icon-add'} %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_new_source"), '#', class: 'icon icon-add',
|
||||
onclick: '$("#add-source").show(); $("#source_name").focus(); return false;' %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_new_target"),
|
||||
new_project_target_path(@project, @view_params),
|
||||
{remote: true, class: 'icon icon-add'} %>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<div id='goal-form' class="tabular">
|
||||
<% if goal.persisted? || goal.is_binding? %>
|
||||
<p><%= render partial: 'goals/show_form', locals: {goal: goal} %></p>
|
||||
<%#= t '.effective_from' %>
|
||||
<p><%= f.date_field :effective_from, disabled: !goal.is_binding? %></p>
|
||||
<% else %>
|
||||
<%= render partial: 'goals/form', locals: {goal: goal} %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_new_unit"), '#', class: 'icon icon-add',
|
||||
onclick: '$("#add-unit").show(); $("#unit_shortname").focus(); return false;' %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user