end
def period_select_option_tags(snapshot, html_class = '')
- options = ""
- options = '<option selected="selected" value=""/>' unless params[:period]
+ selected=(!params[:period] || params[:period] == '0' ? 'selected' : '')
+ options = "<option #{selected} value='0' class='#{html_class}'/>#{message('time_changes')}...</option>"
(1..5).each { |index|
option = period_select_options(snapshot, index, html_class)
if option
<%= render :partial => 'header' -%>
-<div id="snapshot_title" class="page_title">
- <h4>
- <%
- profile_measure=@snapshot.measure(Metric::PROFILE)
- %>
- <% if profile_measure %>Profile <%= link_to profile_measure.data, :controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i %> -
- <% end %>
- <% if @snapshot.project_snapshot.periods? %>
- <form method="GET" action="<%= url_for :only_path=>true, :overwrite_params => {:period => nil} -%>" style="display: inline">
- <select id="select-comparison" name="period" onchange="submit()" class="small">
- <option value=""><%= message('time_changes') -%>...</option>
- <%= violation_period_select_options(@snapshot, 1) -%>
- <%= violation_period_select_options(@snapshot, 2) -%>
- <%= violation_period_select_options(@snapshot, 3) -%>
- <%= violation_period_select_options(@snapshot, 4) -%>
- <%= violation_period_select_options(@snapshot, 5) -%>
- </select>
- </form>
- <% end %>
- </h4>
+<div class="line-block">
+ <div id="snapshot_title" class="page_title">
+ <h4>
+ <%
+ profile_measure=@snapshot.measure(Metric::PROFILE)
+ %>
+ <% if profile_measure %>Profile <%= link_to profile_measure.data, :controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i %>
+ <% end %>
+ <% if @snapshot.project_snapshot.periods? %>
+ <form method="GET" action="<%= url_for :only_path=>true, :overwrite_params => {:period => nil} -%>" style="display: inline" class="spacer-left">
+ <%= dropdown_tag "period", period_select_option_tags(@snapshot, 'small'), {
+ :width => '200px',
+ }, {:id => 'select-comparison', :onchange => 'submit()'} -%>
+ </form>
+ <% end %>
+ </h4>
+ </div>
</div>
<table class="width100 spacer-bottom" cellpadding="0" cellspacing="0" id="columns">