Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
181 lines (159 sloc) 4.24 KB
<apex:component layout="none" access="global">
<apex:attribute name="station" description="The battle station." type="Battle_Station__c" />
<head>
<style type="text/css" media="print">
@page :first {
@top-center {
content: element(header);
}
}
@page {
<apex:outputPanel layout="none" rendered="{!station.Project_Status__c != 'Complete'}">
background: url("{!$Resource.BattleStationDraft}") no-repeat center center;
</apex:outputPanel>
@bottom-left {
content: element(footer);
}
thead {
display: table-header-group;
}
}
* {
margin: 0px;
padding: 0px;
}
div.header {
background: url("{!$Resource.BattleStationHeader}") no-repeat center center;
margin-top: 30px;
height: 130px;
width: 715px;
text-align: center;
position: running(header);
}
div.content {
padding-top: 130px;
}
div.footer {
display: block;
padding: 5px;
position: running(footer);
}
div.subfooter {
display: inline-block;
}
div.right {
float: right;
}
.pagenumber:before {
content: counter(page);
}
.pagecount:before {
content: counter(pages);
}
.stationName {
text-align: center;
font-weight: bold;
font-size: 20pt;
margin-bottom: 30px;
}
table {
width: 100%;
-fs-table-paginate: paginate;
}
.tableHeader {
border-width: 0px 0px 1px 0px;
border-color: #000;
border-style: solid;
}
.sectionHeader {
width: 100%;
background-color: #eee;
font-size: 16pt;
padding: 5px;
margin: 20px 0px;
font-weight: bold;
}
#totalCost {
width: 100%;
text-align: right;
margin-top: 15px;
}
#totalCostLabel {
font-weight: bold;
margin-right: 10px;
}
.supply_Unit_Cost__c, .supply_Total_Cost__c {
text-align: right;
}
.resource_Quantity__c, .resource_Utilization__c, .supply_Quantity__c {
text-align: center;
}
</style>
</head>
<body>
<div class="header"></div>
<div class="content">
<h1 class="stationName">
{!station.Name}
</h1>
<table id="status">
<apex:repeat value="{!$ObjectType.Battle_Station__c.FieldSets.Battle_Station_Invoice}" var="f">
<tr>
<td class="label">{!$ObjectType.Battle_Station__c.fields[f].Label}</td>
<td><apex:outputText value="{!station[f]}" /></td>
</tr>
</apex:repeat>
</table>
<div class="sectionHeader">{!$ObjectType.Resource__c.labelPlural}</div>
<table id="resources">
<thead>
<tr>
<apex:repeat value="{!$ObjectType.Resource__c.FieldSets.Battle_Station_Invoice}" var="f">
<th class="tableHeader resource_{!$ObjectType.Resource__c.fields[f].Name}">{!$ObjectType.Resource__c.fields[f].Label}</th>
</apex:repeat>
</tr>
</thead>
<tbody>
<apex:repeat value="{!station.Resources__r}" var="resource">
<tr>
<apex:repeat value="{!$ObjectType.Resource__c.FieldSets.Battle_Station_Invoice}" var="f">
<td class="resource_{!$ObjectType.Resource__c.fields[f].Name}"><apex:outputField value="{!resource[f]}"/></td>
</apex:repeat>
</tr>
</apex:repeat>
</tbody>
</table>
<div class="sectionHeader">{!$ObjectType.Supply__c.labelPlural}</div>
<table id="supplies">
<thead>
<tr>
<apex:repeat value="{!$ObjectType.Supply__c.FieldSets.Battle_Station_Invoice}" var="f">
<th class="tableHeader supply_{!$ObjectType.Supply__c.fields[f].Name}">{!$ObjectType.Supply__c.fields[f].Label}</th>
</apex:repeat>
</tr>
</thead>
<tbody>
<apex:repeat value="{!station.Supplies__r}" var="supply">
<tr>
<apex:repeat value="{!$ObjectType.Supply__c.FieldSets.Battle_Station_Invoice}" var="f">
<td class="supply_{!$ObjectType.Supply__c.fields[f].Name}"><apex:outputField value="{!supply[f]}"/></td>
</apex:repeat>
</tr>
</apex:repeat>
</tbody>
</table>
<br class="clearboth" />
<div id="totalCost">
<span id="totalCostLabel">{!$ObjectType.Battle_Station__c.Fields.Total_Cost__c.Label}:</span>
<apex:outputField value="{!station.Total_Cost__c}"/>
</div>
</div>
<div class="footer">
<div class="centered">Generated by {!$User.FirstName} {!$User.LastName}</div>
<div>
<div class="subfooter">{!NOW()}</div>
<div class="subfooter right">Page <span class="pagenumber"/> of <span class="pagecount"/></div>
</div>
</div>
</body>
</apex:component>