Skip to content

Instantly share code, notes, and snippets.

@tinnguyenz
Created October 24, 2014 04:43
Show Gist options
  • Save tinnguyenz/cf9f062cccec96861e34 to your computer and use it in GitHub Desktop.
Save tinnguyenz/cf9f062cccec96861e34 to your computer and use it in GitHub Desktop.
- content_for :sub_title do
= @project.name
- content_for :left_panel do
= render :partial => 'shared/left_panel', :locals => {:target => "service_sheet"}
%table.list-wrapper.list
%thead
%tr
%th{:style => "width:25%;"}
= link_to I18n.t("servicesheet.name"), "#", :class => "icon-link icon-slide-up"
%th{:style => "width:20%;"}
= link_to I18n.t("servicesheet.provider"), "#", :class => "icon-link icon-slide-up"
%th{:style => "width:15%;"}
= link_to I18n.t("servicesheet.turnover"), "#", :class => "icon-link icon-slide-up"
%th{:style => "width:15%;"}
= link_to I18n.t("servicesheet.total_orders"), "#", :class => "icon-link icon-slide-up"
%th{:style => "width:20%;"}
= link_to I18n.t("servicesheet.total_billing"), "#", :class => "icon-link icon-slide-up"
%tr
%th{:colspan => 5}
.dot-bar
%tbody
- service_sheets = service_sheets_for(@project)
- unless service_sheets.blank?
- service_sheets.each do |service_sheet|
%tr{:class => cycle("odd", "even")}
%td
- if can_do_action?(Menu::PROJECT_SERVICE_SHEET, :view)
%a{:href => edit_project_pgi_service_sheet_path(@project, service_sheet)}
= service_sheet.name
- else
= service_sheet.name
%td= (service_sheet.service ? service_sheet.service.name : "")
%td.number= format_money(service_sheet.total_financial_statements)
%td.number= format_money(service_sheet.total_orders)
%td.number= format_money(service_sheet.total_billing_plans)
- else
%td{:colspan => 5}
= t('servicesheet.no_service')
- count = Service.count
- if can_do_action?(Menu::PROJECT_SERVICE_SHEET, :creation) and count > 0
= link_to t('project.service_sheet.new_service_sheet'), new_project_pgi_service_sheet_path , :class => "button medium", :id => "new_sheet"
- elsif count <= 0
- content_for :flash do
= flash_message(:warning, t("servicesheet.contact_admin_to_create_service"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment