Commit 933ff3c46873ef90e5eb552f6d360447c1145996
Committed by
Rafael Manzo
1 parent
2dae7177
Exists in
colab
and in
4 other branches
Listing ranges in metric configuration show
Reading color should be displayed in other way instead of show its color in the ranges label text. signed-off-by: Diego Araújo <diegoamc90@gmail.com>
Showing
4 changed files
with
15 additions
and
3 deletions
Show diff stats
app/controllers/metric_configurations_controller.rb
| @@ -32,6 +32,7 @@ class MetricConfigurationsController < ApplicationController | @@ -32,6 +32,7 @@ class MetricConfigurationsController < ApplicationController | ||
| 32 | 32 | ||
| 33 | def show | 33 | def show |
| 34 | @reading_group = ReadingGroup.find(@metric_configuration.reading_group_id) | 34 | @reading_group = ReadingGroup.find(@metric_configuration.reading_group_id) |
| 35 | + @mezuro_ranges = @metric_configuration.mezuro_ranges | ||
| 35 | @metric_configuration.configuration_id = params[:mezuro_configuration_id].to_i | 36 | @metric_configuration.configuration_id = params[:mezuro_configuration_id].to_i |
| 36 | end | 37 | end |
| 37 | 38 |
app/views/metric_configurations/show.html.erb
| @@ -63,12 +63,14 @@ | @@ -63,12 +63,14 @@ | ||
| 63 | </tr> | 63 | </tr> |
| 64 | </thead> | 64 | </thead> |
| 65 | <tbody> | 65 | <tbody> |
| 66 | - | 66 | + <% if @mezuro_ranges.size == 0 %> |
| 67 | + <%= render partial: 'no_ranges' %> | ||
| 68 | + <% else %> | ||
| 69 | + <%= render partial: 'ranges', collection: @mezuro_ranges, as: :mezuro_range %> | ||
| 70 | + <% end %> | ||
| 67 | </tbody> | 71 | </tbody> |
| 68 | </table> | 72 | </table> |
| 69 | 73 | ||
| 70 | -<hr> | ||
| 71 | - | ||
| 72 | <p> | 74 | <p> |
| 73 | <%= link_to 'Back', mezuro_configuration_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> | 75 | <%= link_to 'Back', mezuro_configuration_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> |
| 74 | <% if mezuro_configuration_owner? @metric_configuration.configuration_id %> | 76 | <% if mezuro_configuration_owner? @metric_configuration.configuration_id %> |