Project

General

Profile

Patch #7190 ยป date_range.diff

a first version of the patch - Daniel Neis Araujo, 2010-12-29 00:46

View differences:

app/views/time_entry_reports/report.rhtml
<%= hidden_field_tag('project_id', params[:project_id]) if @project %>
<%= hidden_field_tag('issue_id', params[:issue_id]) if @issue %>
<%= render :partial => 'timelog/date_range' %>
<%= render :partial => 'timelog/tabs' %>
<p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
[l(:label_month), 'month'],
app/views/timelog/_date_range.rhtml
:end => (text_field_tag('to', @to, :size => 10) + calendar_for('to'))) %>
</span>
</p>
</div>
</fieldset>
<p class="buttons">
<%= link_to_remote l(:button_apply),
{ :url => { },
......
:method => :get
}, :class => 'icon icon-checked' %>
</p>
<div class="tabs">
<% url_params = @free_period ? { :from => @from, :to => @to } : { :period => params[:period] } %>
<ul>
<li><%= link_to(l(:label_details), url_params.merge({:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue }),
:class => (@controller.action_name == 'index' ? 'selected' : nil)) %></li>
<li><%= link_to(l(:label_report), url_params.merge({:controller => 'time_entry_reports', :action => 'report', :project_id => @project, :issue_id => @issue}),
:class => (@controller.action_name == 'report' ? 'selected' : nil)) %></li>
</ul>
</div>
</fieldset>
app/views/timelog/_tabs.rhtml
<div class="tabs">
<% url_params = @free_period ? { :from => @from, :to => @to } : { :period => params[:period] } %>
<ul>
<li><%= link_to(l(:label_details), url_params.merge({:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue }),
:class => (@controller.action_name == 'index' ? 'selected' : nil)) %></li>
<li><%= link_to(l(:label_report), url_params.merge({:controller => 'time_entry_reports', :action => 'report', :project_id => @project, :issue_id => @issue}),
:class => (@controller.action_name == 'report' ? 'selected' : nil)) %></li>
</ul>
</div>
app/views/timelog/index.html.erb
<%= hidden_field_tag('project_id', params[:project_id]) if @project %>
<%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %>
<%= render :partial => 'date_range' %>
<%= render :partial => 'tabs' %>
<% end %>
<div class="total-hours">
public/stylesheets/application.css
fieldset.collapsible legend { padding-left: 16px; background: url(../images/arrow_expanded.png) no-repeat 0% 40%; cursor:pointer; }
fieldset.collapsible.collapsed legend { background-image: url(../images/arrow_collapsed.png); }
fieldset#date-range p { margin: 2px 0 2px 0; }
fieldset#date-range p { margin: 2px 0 2px 0; display: inline; }
fieldset#filters table { border-collapse: collapse; }
fieldset#filters table td { padding: 0; vertical-align: middle; }
fieldset#filters tr.filter { height: 2em; }
    (1-1/1)