adds label to step in report [fixes SCI-488]

This commit is contained in:
zmagod 2017-05-05 09:45:18 +02:00
parent 41df727e57
commit b22350136f
3 changed files with 14 additions and 0 deletions

View file

@ -92,4 +92,15 @@ module ReportsHelper
'/4.6.3/css/font-awesome.min.css'
)
end
def step_status_label(step)
if step.completed
style = 'success'
text = t('protocols.steps.completed')
else
style = 'default'
text = t('protocols.steps.uncompleted')
end
"<span class=\"label label-#{style}\">#{text}</span>".html_safe
end
end

View file

@ -21,6 +21,7 @@
<h5>
<span class="glyphicon glyphicon-circle-arrow-right"></span>
<b><%=t "projects.reports.elements.step.step_pos", pos: (step.position + 1) %></b>&nbsp;<%= step.name %>
<%= step_status_label(step) %>
</h5>
</div>
</div>

View file

@ -1369,6 +1369,8 @@ en:
row_in_repository_public: "%{protocol} - <i>into public protocols</i>"
row_in_repository_private: "%{protocol} - <i>into private protocols</i>"
steps:
completed: 'Completed'
uncompleted: 'Uncompleted'
expand_label: "Expand all"
collapse_label: "Collapse all"
new_step: "Add new"