git-svn-id: https://dev.finn.de/svn/cockpit/trunk@56 7926756e-e54e-46e6-9721-ed318f58905epull/6827/head
parent
1b23ee97e0
commit
5add325bf0
@ -0,0 +1,31 @@ |
||||
<% labelled_tabular_form_for :deliverable, @deliverable, |
||||
:url => {:action => 'edit', :id => @deliverable}, |
||||
:html => {:multipart => true, |
||||
:id => 'deliverable-form', |
||||
:class => nil} do |f| %> |
||||
<%= error_messages_for 'deliverable' %> |
||||
<div class="box"> |
||||
<fieldset class="tabular"><legend><%= l(:label_deliverable) %></legend> |
||||
<%= render :partial => 'form', :locals => {:f => f} %> |
||||
</fieldset> |
||||
<fieldset><legend><%= l(:label_attachment_plural )%></legend> |
||||
<p><%= render :partial => 'attachments/form' %></p> |
||||
</fieldset> |
||||
</div> |
||||
<%= submit_tag l(:button_submit) %> |
||||
<%= link_to_remote l(:label_preview), |
||||
{ :url => { :controller => 'deliverables', :action => 'preview', :project_id => @project }, |
||||
:method => 'post', |
||||
:update => 'preview', |
||||
:with => "Form.serialize('deliverable-form')", |
||||
:complete => "Element.scrollTo('preview')" |
||||
}, :accesskey => accesskey(:preview) %> |
||||
<% end %> |
||||
|
||||
<div id="preview" class="wiki"></div> |
||||
|
||||
<% content_for :header_tags do %> |
||||
<%= stylesheet_link_tag 'scm' %> |
||||
<%= stylesheet_link_tag 'costs', :plugin => 'redmine_costs' %> |
||||
<%= javascript_include_tag 'deliverables', :plugin => 'redmine_costs' %> |
||||
<% end %> |
@ -0,0 +1,60 @@ |
||||
<% |
||||
show_cost_budget_col = User.current.allowed_to?(:view_unit_price, @project) |
||||
show_hour_budget_col = User.current.allowed_to?(:view_all_rates, @project) || User.current.allowed_to?(:view_own_rate, @project) |
||||
-%> |
||||
|
||||
<table width="100%"><tr style="vertical-align: top"><td width="50%"> |
||||
<h4><%= l(:caption_materials_budget)%></h4> |
||||
<% unless @deliverable.deliverable_costs.empty? %> |
||||
<table class="deliverable_costs"> |
||||
<thead><tr> |
||||
<th><%= l(:caption_cost_unit_plural)%></th> |
||||
<th><%= l(:caption_cost_type) %></th> |
||||
<% if show_cost_budget_col %> |
||||
<th><%= l(:caption_budget) %></th> |
||||
<%end%> |
||||
</tr></thead> |
||||
<tbody> |
||||
<% @deliverable.deliverable_costs.each do |deliverable_cost| %> |
||||
<tr> |
||||
<td><%=h pluralize(deliverable_cost.units, deliverable_cost.cost_type.unit, deliverable_cost.cost_type.unit_plural) %></td> |
||||
<td><%=h deliverable_cost.cost_type.name %></td> |
||||
<% if show_cost_budget_col %> |
||||
<td class="currency"><%= number_to_currency(deliverable_cost.costs) %></td> |
||||
<% end %> |
||||
</tr> |
||||
<% end %> |
||||
<% if show_cost_budget_col %> |
||||
<tr><td colspan="3" class="currency"><strong><%= number_to_currency(@deliverable.materials_budget) %></strong></td></tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
<% end %> |
||||
</td><td width="50%"> |
||||
<h4><%= l(:caption_labor_budget)%></h4> |
||||
<% unless @deliverable.deliverable_hours.empty? %> |
||||
<table class="deliverable_hours"> |
||||
<thead><tr> |
||||
<th><%= l(:field_hours)%></th> |
||||
<th><%= l(:label_user) %></th> |
||||
<% if show_hour_budget_col %> |
||||
<th><%= l(:caption_budget) %></th> |
||||
<%end%> |
||||
</tr></thead> |
||||
<tbody> |
||||
<% @deliverable.deliverable_hours.each do |deliverable_hour| %> |
||||
<tr> |
||||
<td class=""><%= deliverable_hour.hours %>h</td> |
||||
<td><%=h deliverable_hour.user.name %></td> |
||||
<% if show_hour_budget_col %> |
||||
<td class="currency"><%= number_to_currency(deliverable_hour.costs) %></td> |
||||
<% end %> |
||||
</tr> |
||||
<% end %> |
||||
<% if User.current.allowed_to?(:view_all_rates, @project) %> |
||||
<tr><td colspan="3" class="currency"><strong><%= number_to_currency(@deliverable.labor_budget) %></strong></td></tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
<% end %> |
||||
</td></tr></table> |
@ -0,0 +1,4 @@ |
||||
<h2><%=h "Deliverable ##{@deliverable.id}" %></h2> |
||||
|
||||
<%= render :partial => 'edit' %> |
||||
<%= javascript_tag "Form.Element.focus('deliverable_subject');" %> |
Loading…
Reference in new issue