ce.widget-lab.sonar-widget-lab-plugin.1.8.1.source-code.differential_dropdown_widget.html.erb Maven / Gradle / Ivy
The newest version!
<%
def period_names
p1=Property.value('sonar.timemachine.period1', nil, 'previous_analysis')
p2=Property.value('sonar.timemachine.period2', nil, '5')
p3=Property.value('sonar.timemachine.period3', nil, '30')
[period_name(p1), period_name(p2), period_name(p3)]
end
def period_name(property)
if property=='previous_analysis'
message('delta_since_previous_analysis')
elsif property =~ /^[\d]+(\.[\d]+){0,1}$/
# is integer
message('delta_over_x_days', :params => property)
elsif property =~ /\d{4}-\d{2}-\d{2}/
message('delta_since', :params => property)
elsif !property.blank?
message('delta_since_version', :params => property)
else
nil
end
end
%>