[spalenque] - #6968 *download pdfs

Conflicts:

	marketplace/templates/Layout/CloudsDirectoryPage_cloud.ss
	marketplace/templates/Layout/CloudsDirectoryPage_pdf.ss
	marketplace/templates/Layout/ConsultantsDirectoryPage_pdf.ss
	marketplace/templates/Layout/DistributionsDirectoryPage_pdf.ss
	openstack/code/Company.php
This commit is contained in:
santipalenque 2014-10-27 17:08:33 -03:00 committed by Sebastian Marcet
parent a47bd50bcc
commit b70162348b
7 changed files with 518 additions and 387 deletions

View File

@ -1005,11 +1005,57 @@ class MarketPlaceAdminPage_Controller extends Page_Controller
return CloudViewModel::getDataCenterLocationsJson($cloud);
}
public function getCurrentDataCenterStaticMapForPDF()
{
$static_map_url = "http://maps.googleapis.com/maps/api/staticmap?zoom=2&size=300x200&maptype=roadmap";
$instance_id = intval($this->request->param('ID'));
$marketplace_type = $this->request->param('MARKETPLACETYPE');
$query = new QueryObject();
$query->addAddCondition(QueryCriteria::equal('ID', $instance_id));
switch (strtolower($marketplace_type)) {
case 'public_cloud': {
$cloud = $this->public_clouds_repository->getBy($query);
}
break;
case 'private_cloud': {
$cloud = $this->private_clouds_repository->getBy($query);
}
break;
}
if (!$cloud) throw new NotFoundEntityException('', '');
$locations = json_decode(CloudViewModel::getDataCenterLocationsJson($cloud));
foreach ($locations as $loc) {
$static_map_url .= "&markers=".$loc->lat.",".$loc->lng;
}
return $static_map_url;
}
public function getPricingSchemas()
{
return CloudViewModel::getPricingSchemas();
}
public function getPricingSchemasForPDF()
{
$pricing_schemas = CloudViewModel::getPricingSchemas();
$enabled_ps = json_decode($this->getEnabledPricingSchemas());
foreach($pricing_schemas as $ps) {
$ps->Enabled = 0;
foreach ($enabled_ps as $eps) {
if ($ps->ID == $eps) {
$ps->Enabled = 1;
}
}
}
return $pricing_schemas;
}
public function getEnabledPricingSchemas()
{
$instance_id = intval($this->request->param('ID'));
@ -1055,11 +1101,7 @@ class MarketPlaceAdminPage_Controller extends Page_Controller
$appliance->IsPreview = true;
$render = new ApplianceSapphireRender($appliance);
$html_inner = $render->pdf();
$css = @file_get_contents($base . "/themes/openstack/css/main.pdf.css");
$css .= ' '.@file_get_contents($base . "/themes/openstack/css/chosen.css");
//$css .= ' '.@file_get_contents($base . "/themes/openstack/css/combined.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/admin/css/colorpicker.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/frontend/css/marketplace.css");
$css = @file_get_contents($base . "/marketplace/code/ui/admin/css/pdf.css");
}
break;
case 'public_cloud': {
@ -1068,11 +1110,7 @@ class MarketPlaceAdminPage_Controller extends Page_Controller
if (!$public_cloud) throw new NotFoundEntityException('', '');
$render = new PublicCloudSapphireRender($public_cloud);
$html_inner = $render->pdf();
$css = @file_get_contents($base . "/themes/openstack/css/main.pdf.css");
$css .= ' '.@file_get_contents($base . "/themes/openstack/css/chosen.css");
//$css .= ' '.@file_get_contents($base . "/themes/openstack/css/combined.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/admin/css/colorpicker.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/frontend/css/marketplace.css");
$css = @file_get_contents($base . "/marketplace/code/ui/admin/css/pdf.css");
}
break;
case 'private_cloud': {
@ -1080,11 +1118,7 @@ class MarketPlaceAdminPage_Controller extends Page_Controller
$private_cloud->IsPreview = true;
$render = new PrivateCloudSapphireRender($private_cloud);
$html_inner = $render->pdf();
$css = @file_get_contents($base . "/themes/openstack/css/main.pdf.css");
$css .= ' '.@file_get_contents($base . "/themes/openstack/css/chosen.css");
//$css .= ' '.@file_get_contents($base . "/themes/openstack/css/combined.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/admin/css/colorpicker.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/frontend/css/marketplace.css");
$css = @file_get_contents($base . "/marketplace/code/ui/admin/css/pdf.css");
}
break;
@ -1094,11 +1128,7 @@ class MarketPlaceAdminPage_Controller extends Page_Controller
$consultant->IsPreview = true;
$render = new ConsultantSapphireRender($consultant);
$html_inner = $render->pdf();
$css = @file_get_contents($base . "/themes/openstack/css/main.pdf.css");
$css .= ' '.@file_get_contents($base . "/themes/openstack/css/chosen.css");
//$css .= ' '.@file_get_contents($base . "/themes/openstack/css/combined.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/admin/css/colorpicker.css");
$css .= ' '.@file_get_contents($base . "/marketplace/code/ui/frontend/css/marketplace.css");
$css = @file_get_contents($base . "/marketplace/code/ui/admin/css/pdf.css");
}
break;
default:

View File

@ -219,6 +219,26 @@ class ConsultantsDirectoryPage_Controller extends MarketPlaceDirectoryPage_Contr
return json_encode($res);
}
public function getCurrentOfficesStaticMapForPDF()
{
$static_map_url = "http://maps.googleapis.com/maps/api/staticmap?zoom=2&size=300x200&maptype=roadmap";
$params = $this->request->allParams();
$company_url_segment = Convert::raw2sql($params["Company"]);
$slug = Convert::raw2sql($params["Slug"]);
$query = new QueryObject();
$query->addAddCondition(QueryCriteria::equal('Slug',$slug));
$consultant = $this->consultant_repository->getBy($query);
if(!$consultant) throw new NotFoundEntityException('Consultant','by slug');
if($consultant->getCompany()->URLSegment != $company_url_segment) throw new NotFoundEntityException('','');
foreach($consultant->getOffices() as $office){
$static_map_url .= "&markers=".$office->getLat().",".$office->getLng();
}
return $static_map_url;
}
public function ServicesCombo(){
$source = array();
$result = $this->consultants_service_query->handle(new OpenStackImplementationNamesQuerySpecification(''));

View File

@ -19,24 +19,24 @@
<th>Service</th>
<th>OpenStack Version</th>
</tr>
<% loop Capabilities %>
<% control Capabilities %>
<tr>
<td>
<% with ReleaseSupportedApiVersion %>
<% with OpenStackComponent %>
<% control ReleaseSupportedApiVersion %>
<% control OpenStackComponent %>
$Name
<% end_with %>
<% end_with %>
<% end_control %>
<% end_control %>
</td>
<td>
<% with ReleaseSupportedApiVersion %>
<% with Release %>
<% control ReleaseSupportedApiVersion %>
<% control Release %>
$Name
<% end_with %>
<% end_with %>
<% end_control %>
<% end_control %>
</td>
</tr>
<% end_loop %>
<% end_control %>
</tbody>
</table>
<% end_if %>
@ -45,12 +45,13 @@
<h3 style="color: #{$Company.CompanyColor} !important;">Pricing Options</h3>
<table class="pricing">
<tbody>
<% loop Top.PricingSchemas %>
<% control Top.PricingSchemas %>
<tr>
<td>$Type</td>
<td id="enabled_{$ID}"></td>
</tr>
<% end_loop %>
<% end_control %>
</tbody>
</table>
<script>
@ -60,10 +61,10 @@
<% if HyperVisors %>
<h3 style="color: #{$Company.CompanyColor} !important;">Supported Hypervisors</h3>
<p>
<% loop HyperVisors %>
<% control HyperVisors %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_loop %>
<% end_control %>
</p>
<% end_if %>
@ -71,10 +72,10 @@
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Supported Guests</h3>
<p>
<% loop Guests %>
<% control Guests %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_loop %>
<% end_control %>
</p>
<% end_if %>
@ -83,14 +84,14 @@
<h3 style="color: #{$Company.CompanyColor} !important;">Regions</h3>
<table class="regions">
<tbody>
<% loop DataCenterRegions %>
<% control DataCenterRegions %>
<tr>
<td class="region-key">
<span style="background-color: #{$Color}"></span>
</td>
<td>$Name</td>
</tr>
<% end_loop %>
<% end_control %>
</tbody>
</table>
<% end_if %>
@ -101,10 +102,10 @@
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;" >Data Center Locations</h3>
<p>
<% loop DataCenters %>
<% control DataCenters %>
<% if First == 0 %>,<% end_if %>
$City
<% end_loop %>
<% end_control %>
</p>
<div style="width: 300px; height: 200px; position: relative;" id="mini-map" tabindex="0">
</div>
@ -115,13 +116,13 @@
<h3 style="color: #{$Company.CompanyColor} !important;">Regions where support is offered</h3>
<table class="regions">
<tbody>
<% loop RegionalSupports %>
<% control RegionalSupports %>
<tr>
<% with Region %>
<% control Region %>
<td>$Name</td>
<% end_with %>
<% end_control %>
</tr>
<% end_loop %>
<% end_control %>
</tbody>
</table>
<% end_if %>
@ -136,12 +137,12 @@
<% end_if %>
<% if Videos %>
<div id="videos">
<% loop Videos %>
<% control Videos %>
<h3 style="color: #{$Top.Company.CompanyColor} !important;" class="video-title">$Name<span class="video-duration">($FormattedLength)</span></h3>
<iframe frameborder="0" width="250" height="200" allowfullscreen=""
src="//www.youtube.com/embed/{$YouTubeId}?rel=0&amp;showinfo=0&amp;modestbranding=1&amp;controls=2">
</iframe>
<% end_loop %>
<% end_control %>
</div>
<% end_if %>
@ -149,9 +150,9 @@
<div id="more-resources">
<h3 style="color: #{$Company.CompanyColor} !important;">More Resources</h3>
<ul>
<% loop Resources %>
<% control Resources %>
<li><a href="{$Uri}" style="color: #{$Company.CompanyColor} !important;" target="_blank" class="outbound-link">$Name</a></li>
<% end_loop %>
<% end_control %>
</ul>
</div>
<% end_if %>

View File

@ -1,179 +1,208 @@
<div class="grey-bar">
<div class="container">
<p class="back-label">
<a href="$Top.Link">All Clouds</a>
</p>
<h1>$Name</h1>
</div>
<h1>$Name</h1>
</div>
<div class="container marketplace-content">
<% include MarketPlaceCompany %>
<div class="col-lg-6">
<div class="info-area">
<% if Capabilities %>
<h3 style="color: #{$Company.CompanyColor} !important;">OpenStack Services Offered</h3>
<table>
<tbody>
<tr>
<th>Service</th>
<th>OpenStack Version</th>
</tr>
<% loop Capabilities %>
<tr>
<td>
<% loop ReleaseSupportedApiVersion %>
<% loop OpenStackComponent %>
$Name
<% end_loop %>
<% end_loop %>
</td>
<td>
<% loop ReleaseSupportedApiVersion %>
<% loop Release %>
$Name
<% end_loop %>
<% end_loop %>
</td>
</tr>
<% end_loop %>
</tbody>
</table>
<% end_if %>
<% if Top.PricingSchemas %>
<h3 style="color: #{$Company.CompanyColor} !important;">Pricing Options</h3>
<table class="pricing">
<tbody>
<% loop Top.PricingSchemas %>
<tr>
<td>$Type</td>
<td id="enabled_{$ID}"></td>
</tr>
<% end_loop %>
</tbody>
</table>
<% end_if %>
<% if HyperVisors %>
<h3 style="color: #{$Company.CompanyColor} !important;">Supported Hypervisors</h3>
<p>
<% loop HyperVisors %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_loop %>
</p>
<% end_if %>
<% if Guests %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Supported Guests</h3>
<p>
<% loop Guests %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_loop %>
</p>
<% end_if %>
<% if DataCenterRegions %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Regions</h3>
<table class="regions">
<tbody>
<% loop DataCenterRegions %>
<tr>
<td class="region-key">
<span style="background-color: #{$Color}"></span>
</td>
<td>$Name</td>
</tr>
<% end_loop %>
</tbody>
</table>
<% end_if %>
<% if DataCenters %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;" >Data Center Locations</h3>
<p>
<% loop DataCenters %>
<% if First == 0 %>,<% end_if %>
$City
<% end_loop %>
</p>
<div style="width: 300px; height: 200px; position: relative;" id="mini-map" tabindex="0">
</div>
<p>Click any location to see availability zones and API endpoints</p>
<% end_if %>
<% if RegionalSupports %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Regions where support is offered</h3>
<table class="regions">
<tbody>
<% loop RegionalSupports %>
<tr>
<% loop Region %>
<td>$Name</td>
<% end_loop %>
</tr>
<% end_loop %>
</tbody>
</table>
<% end_if %>
<% if Capabilities %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">OpenStack API Coverage</h3>
<table class="api-coverage">
<tbody>
<% loop Capabilities %>
<% if SupportsVersioning %>
<% loop ReleaseSupportedApiVersion %>
<% if ApiVersion %>
<% loop OpenStackComponent %>
<table width="540px">
<tr>
<td rowspan="5" valign="top" style="width:140px;padding-right:15px">
$Company.SmallLogoPreview(150)
<h2 style="color: {$Company.CompanyColorRGB} !important;">About $Company.Name</h2>
<p>$Company.Overview</p>
<hr>
<div class="pullquote">
<h2 style="color: {$Company.CompanyColorRGB} !important;">$Company.Name Commitment</h2>
<div <% if Company.CommitmentAuthor %>class="commitment"<% end_if %>>$Company.Commitment</div>
<% if Company.CommitmentAuthor %>
<p class="author">&mdash;$Company.CommitmentAuthor, $Company.Name</p>
<% end_if %>
</div>
</td>
<td colspan="2" valign="top" style="width:400px;padding-left:15px;">
<div class="info-area">
<h1 style="color: {$Company.CompanyColorRGB} !important;">
$Name
</h1>
<p>$Overview</p>
</div>
</td>
</tr>
<tr>
<td valign="top" style="width:200px;padding-left:15px;">
<div class="info-area">
<% if HyperVisors %>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Supported Hypervisors</h3>
<p>
<% control HyperVisors %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_control %>
</p>
<% end_if %>
<% if Guests %>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Supported Guests</h3>
<p>
<% control Guests %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_control %>
</p>
<% end_if %>
<% if DataCenterRegions %>
<hr>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Regions</h3>
<table class="regions">
<tbody>
<% control DataCenterRegions %>
<tr>
<td class="region-key">
<span style="background-color: #{$Color}"></span>
</td>
<td>$Name</td>
</tr>
<% end_control %>
</tbody>
</table>
<% end_if %>
<% if DataCenters %>
<hr>
<h3 style="color: {$Company.CompanyColorRGB} !important;" >Data Center Locations</h3>
<p>
<% control DataCenters %>
<% if First == 0 %>,<% end_if %>
$City
<% end_control %>
</p>
<div style="width: 300px; height: 200px; position: relative;" tabindex="0">
<img src="$Top.getCurrentOfficesStaticMapForPDF" />
</div>
<p>Click any location to see availability zones and API endpoints</p>
<% end_if %>
<% if RegionalSupports %>
<hr>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Regions where support is offered</h3>
<table class="regions">
<tbody>
<% control RegionalSupports %>
<tr>
<td style="max-width:200px;" width="60%">
$Name API
<% if SupportsExtensions %> & Extensions<% end_if %>
</td>
<td width="30%">
$CodeName
<% end_loop %>
<% loop ApiVersion %> $Version<% end_loop %>
</td>
<td width="10%" class="coverage"></td>
<% control Region %>
<td>$Name</td>
<% end_control %>
</tr>
<% end_if %>
<% end_loop %>
<% end_if %>
<% end_loop %>
</tbody>
</table>
<% end_if %>
</div>
</div>
<div class="col-lg-6">
<% include MarketPlaceDirectoryPage_Rating_Placeholder %>
<% if Videos %>
<div id="videos">
<% loop Videos %>
<h3 style="color: #{$Top.Company.CompanyColor} !important;" class="video-title">$Name<span class="video-duration">($FormattedLength)</span></h3>
<iframe frameborder="0" width="250" height="200" allowfullscreen=""
src="//www.youtube.com/embed/{$YouTubeId}?rel=0&amp;showinfo=0&amp;modestbranding=1&amp;controls=2">
</iframe>
<% end_loop %>
</div>
<% end_if %>
<% end_control %>
</tbody>
</table>
<% end_if %>
<% if Capabilities %>
<hr>
<h3 style="color: {$Company.CompanyColorRGB} !important;">OpenStack API Coverage</h3>
<table class="api-coverage">
<tbody>
<% control Capabilities %>
<% if SupportsVersioning %>
<% control ReleaseSupportedApiVersion %>
<% if ApiVersion %>
<% control OpenStackComponent %>
<tr>
<td>
$Name API
<% if SupportsExtensions %> & Extensions<% end_if %>
</td>
<td>
$CodeName
<% end_control %>
<% control ApiVersion %> $Version<% end_control %>
</td>
<% if Resources %>
<div id="more-resources">
<h3 style="color: #{$Company.CompanyColor} !important;">More Resources</h3>
<ul>
<% loop Resources %>
<li><a href="{$Uri}" style="color: #{$Company.CompanyColor} !important;" target="_blank" class="outbound-link">$Name</a></li>
<% end_loop %>
</ul>
</div>
<% end_if %>
</div>
</div>
<% end_if %>
<% end_control %>
<td class="coverage">
<span>$CoveragePercent %</span>
</td>
</tr>
<% end_if %>
<% end_control %>
</tbody>
</table>
<% end_if %>
</div>
</td>
<td valign="top" style="width:200px;padding-left:15px;padding-right:15px">
<% if Capabilities %>
<h3 style="color: {$Company.CompanyColorRGB} !important;">OpenStack Services Offered</h3>
<table>
<tbody>
<tr>
<th width="50%">Service</th>
<th>OpenStack Version</th>
</tr>
<% control Capabilities %>
<tr>
<td>
<% control ReleaseSupportedApiVersion %>
<% control OpenStackComponent %>
$Name
<% end_control %>
<% end_control %>
</td>
<td>
<% control ReleaseSupportedApiVersion %>
<% control Release %>
$Name
<% end_control %>
<% end_control %>
</td>
</tr>
<% end_control %>
</tbody>
</table>
<hr>
<% end_if %>
<% if Top.PricingSchemas %>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Pricing Options</h3>
<table class="pricing">
<tbody>
<% control Top.PricingSchemasForPDF %>
<tr>
<td>$Type</td>
<td id="enabled_{$ID}"><% if Enabled==1 %>Yes<% else %>No<% end_if %></td>
</tr>
<% end_control %>
</tbody>
</table>
<hr>
<% end_if %>
<div id="reviews" style="min-height: 400px;">
<h3 style="color: {$Company.CompanyColorRGB} !important;">Reviews</h3>
<p>* No Reviews available on preview mode.</p>
<!--This script should be places anywhere on a page you want to see rating box-->
<div style='font-size:10px'>Powered by Rating-System.com</div>
<!-- DO NOT REMOVE THE LAST LINE, please contact us first if you need to do it -->
</div>
<% if Videos %>
<hr>
<div id="videos">
<% control Videos %>
<h3 style="color: {$Top.Company.CompanyColorRGB} !important;" class="video-title">$Name<span class="video-duration">($FormattedLength)</span></h3>
<a href="//www.youtube.com/embed/{$YouTubeId}"> Video </a>
<% end_control %>
</div>
<% end_if %>
<% if Resources %>
<hr>
<div id="more-resources">
<h3 style="color: {$Company.CompanyColorRGB} !important;">More Resources</h3>
<ul>
<% control Resources %>
<li style="color: {$Company.CompanyColorRGB}>$Name</li>
<% end_control %>
</ul>
</div>
<% end_if %>
</td>
</tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>

View File

@ -1,128 +1,154 @@
<div class="grey-bar">
<div class="container">
<p class="back-label">
<a href="$Top.Link">All Providers</a>
</p>
<h1>$Name</h1>
</div>
<h1>$Name</h1>
</div>
<% loop Consultant %>
<% control Consultant %>
<div class="container marketplace-content">
<% include MarketPlaceCompany %>
<div class="col-lg-6">
<div class="info-area">
<% if ExpertiseAreas %>
<h3 style="color: #{$Company.CompanyColor} !important;">Areas of OpenStack Expertise</h3>
<table>
<tbody>
<% loop ExpertiseAreas %>
<tr>
<td>$Name</td>
<td>$CodeName</td>
</tr>
<% end_loop %>
</tbody>
</table>
<% end_if %>
<% if Top.Services %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Services Offered</h3>
<ul>
<% loop Top.Services %>
<li>$Type</li>
<% end_loop %>
</ul>
<% end_if %>
<% if PreviousClients %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Select Clients</h3>
<ul>
<% loop PreviousClients %>
<li>$Name</li>
<% end_loop %>
</ul>
<% end_if %>
<% if ConfigurationManagementExpertises %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Configuration Management Expertise</h3>
<ul>
<% loop ConfigurationManagementExpertises %>
<li>$Type</li>
<% end_loop %>
</ul>
<% end_if %>
<% if SpokenLanguages %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Languages</h3>
<ul>
<% loop SpokenLanguages %>
<li>$Name</li>
<% end_loop %>
</ul>
<% end_if %>
<% if Top.Regions %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Regions with local offices</h3>
<ul>
<% loop Top.Regions %>
<li>$Name</li>
<% end_loop %>
</ul>
<% end_if %>
<% if Offices %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Offices</h3>
<script type="text/javascript">
var offices_instance = $Top.CurrentOfficesLocationsJson;
</script>
<div style="width: 300px; height: 200px; position: relative;" id="mini-map" tabindex="0">
</div>
<p>
Click any map pin to see office address
</p>
<% end_if %>
<% if RegionalSupports %>
<table width="540px">
<tr>
<td rowspan="5" valign="top" style="width:140px;padding-right:15px">
$Company.SmallLogoPreview(150)
<h2 style="color: {$Company.CompanyColorRGB} !important;">About $Company.Name</h2>
<p>$Company.Overview</p>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Regions where support is offered</h3>
<table class="regions">
<tbody>
<% loop RegionalSupports %>
<div class="pullquote">
<h2 style="color: {$Company.CompanyColorRGB} !important;">$Company.Name Commitment</h2>
<div <% if Company.CommitmentAuthor %>class="commitment"<% end_if %>>$Company.Commitment</div>
<% if Company.CommitmentAuthor %>
<p class="author">&mdash;$Company.CommitmentAuthor, $Company.Name</p>
<% end_if %>
</div>
</td>
<td colspan="2" valign="top" style="width:400px;padding-left:15px;">
<div class="info-area">
<h1 style="color: {$Company.CompanyColorRGB} !important;">
$Name
</h1>
<p>$Overview</p>
</div>
</td>
</tr>
<tr>
<td valign="top" style="width:200px;padding-left:15px;">
<div class="info-area">
<% if Top.Services %>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Services Offered</h3>
<ul>
<% control Top.Services %>
<li>$Type</li>
<% end_control %>
</ul>
<% end_if %>
<% if PreviousClients %>
<hr>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Select Clients</h3>
<ul>
<% control PreviousClients %>
<li>$Name</li>
<% end_control %>
</ul>
<% end_if %>
<% if ConfigurationManagementExpertises %>
<hr>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Configuration Management Expertise</h3>
<ul>
<% control ConfigurationManagementExpertises %>
<li>$Type</li>
<% end_control %>
</ul>
<% end_if %>
<% if SpokenLanguages %>
<hr>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Languages</h3>
<ul>
<% control SpokenLanguages %>
<li>$Name</li>
<% end_control %>
</ul>
<% end_if %>
<% if Top.Regions %>
<hr>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Regions with local offices</h3>
<ul>
<% control Top.Regions %>
<li>$Name</li>
<% end_control %>
</ul>
<% end_if %>
<% if Offices %>
<hr>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Offices</h3>
<div style="width: 300px; height: 200px; position: relative;" tabindex="0">
<img src="$Top.CurrentDataCenterStaticMapForPDF" />
</div>
<p>
Click any map pin to see office address
</p>
<% end_if %>
<% if RegionalSupports %>
<hr>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Regions where support is offered</h3>
<table class="regions">
<tbody>
<% control RegionalSupports %>
<tr>
<% control Region %>
<td>$Name</td>
<% end_control %>
</tr>
<% end_control %>
</tbody>
</table>
<% end_if %>
<% end_if %>
</div>
</td>
<td valign="top" style="width:200px;padding-left:15px;padding-right:15px">
<% if ExpertiseAreas %>
<h3 style="color: #{$Company.CompanyColorRGB} !important;">Areas of OpenStack Expertise</h3>
<table>
<tbody>
<% control ExpertiseAreas %>
<tr>
<% loop Region %>
<td>$Name</td>
<% end_loop %>
<td>$CodeName</td>
</tr>
<% end_loop %>
</tbody>
</table>
<% end_if %>
</div>
</div>
<div class="col-lg-6">
<% include MarketPlaceDirectoryPage_Rating_Placeholder %>
<% if Videos %>
<div id="videos">
<% loop Videos %>
<h3 style="color: #{$Top.Company.CompanyColor} !important;" class="video-title">$Name<span class="video-duration">($FormattedLength)</span></h3>
<iframe frameborder="0" width="250" height="200" allowfullscreen=""
src="//www.youtube.com/embed/{$YouTubeId}?rel=0&amp;showinfo=0&amp;modestbranding=1&amp;controls=2">
</iframe>
<% end_loop %>
</div>
<% end_if %>
<% if Resources %>
<div id="more-resources">
<h3 style="color: #{$Company.CompanyColor} !important;">More Resources</h3>
<ul>
<% loop Resources %>
<li><a href="{$Uri}" style="color: #{$Company.CompanyColor} !important;" class="outbound-link" target="_blank">$Name</a></li>
<% end_loop %>
</ul>
</div>
<% end_if %>
</div>
<% end_control %>
</tbody>
</table>
<hr>
<% end_if %>
<div id="reviews" style="min-height: 400px;">
<h3 style="color: {$Company.CompanyColorRGB} !important;">Reviews</h3>
<p>* No Reviews available on preview mode.</p>
<!--This script should be places anywhere on a page you want to see rating box-->
<div style='font-size:10px'>Powered by Rating-System.com</div>
<!-- DO NOT REMOVE THE LAST LINE, please contact us first if you need to do it -->
</div>
<% if Videos %>
<hr>
<div id="videos">
<% control Videos %>
<h3 style="color: {$Top.Company.CompanyColorRGB} !important;" class="video-title">$Name<span class="video-duration">($FormattedLength)</span></h3>
<a href="//www.youtube.com/embed/{$YouTubeId}"> Video </a>
<% end_control %>
</div>
<% end_if %>
<% if Resources %>
<hr>
<div id="more-resources">
<h3 style="color: {$Company.CompanyColorRGB} !important;">More Resources</h3>
<ul>
<% control Resources %>
<li style="color: {$Company.CompanyColorRGB}>$Name</li>
<% end_control %>
</ul>
</div>
<% end_if %>
</td>
</tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>
</div>
<% end_loop %>

View File

@ -1,16 +1,16 @@
<div class="grey-bar">
<h1 style="color: #{$Company.CompanyColor} !important;">$Name</h1>
<h1 style="color: {$Company.CompanyColorRGB} !important;">$Name</h1>
</div>
<div class="container marketplace-content">
<table width="540px">
<tr>
<td rowspan="5" valign="top" style="width:140px;padding-right:15px">
$Company.SmallLogoPreview(150)
<h2 style="color: #{$Company.CompanyColor} !important;">About $Company.Name</h2>
<h2 style="color: {$Company.CompanyColorRGB} !important;">About $Company.Name</h2>
<p>$Company.Overview</p>
<hr>
<div class="pullquote">
<h2 style="color: #{$Company.CompanyColor} !important;">$Company.Name Commitment</h2>
<h2 style="color: {$Company.CompanyColorRGB} !important;">$Company.Name Commitment</h2>
<div <% if Company.CommitmentAuthor %>class="commitment"<% end_if %>>$Company.Commitment</div>
<% if Company.CommitmentAuthor %>
<p class="author">&mdash;$Company.CommitmentAuthor, $Company.Name</p>
@ -19,7 +19,7 @@
</td>
<td colspan="2" valign="top" style="width:400px;padding-left:15px;">
<div class="info-area">
<h1 style="color: #{$Company.CompanyColor} !important;">
<h1 style="color: {$Company.CompanyColorRGB} !important;">
$Name
</h1>
<p>$Overview</p>
@ -30,78 +30,78 @@
<td valign="top" style="width:200px;padding-left:15px;">
<div class="info-area">
<% if Capabilities %>
<h3 style="color: #{$Company.CompanyColor} !important;">OpenStack Services Enabled</h3>
<h3 style="color: {$Company.CompanyColorRGB} !important;">OpenStack Services Enabled</h3>
<table>
<tbody>
<tr>
<th width="50%">Service</th>
<th>OpenStack Version</th>
</tr>
<% loop Capabilities %>
<% control Capabilities %>
<tr>
<td>
<% loop ReleaseSupportedApiVersion %>
<% loop OpenStackComponent %>
<% control ReleaseSupportedApiVersion %>
<% control OpenStackComponent %>
$Name
<% end_loop %>
<% end_loop %>
<% end_control %>
<% end_control %>
</td>
<td>
<% loop ReleaseSupportedApiVersion %>
<% loop Release %>
<% control ReleaseSupportedApiVersion %>
<% control Release %>
$Name
<% end_loop %>
<% end_loop %>
<% end_control %>
<% end_control %>
</td>
</tr>
<% end_loop %>
<% end_control %>
</tbody>
</table>
<% end_if %>
<hr>
<% if HyperVisors %>
<h3 style="color: #{$Company.CompanyColor} !important;">Supported Hypervisors</h3>
<hr>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Supported Hypervisors</h3>
<p>
<% loop HyperVisors %>
<% control HyperVisors %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_loop %>
<% end_control %>
</p>
<% end_if %>
<% if Guests %>
<h3 style="color: #{$Company.CompanyColor} !important;">Supported Guests</h3>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Supported Guests</h3>
<p>
<% loop Guests %>
<% control Guests %>
<% if First == 0 %>,<% end_if %>
$Type
<% end_loop %>
<% end_control %>
</p>
<% end_if %>
<% if RegionalSupports %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">Regions where support is offered</h3>
<h3 style="color: {$Company.CompanyColorRGB} !important;">Regions where support is offered</h3>
<table class="regions">
<tbody>
<% loop RegionalSupports %>
<% control RegionalSupports %>
<tr>
<% loop Region %>
<% control Region %>
<td>$Name</td>
<% end_loop %>
<% end_control %>
</tr>
<% end_loop %>
<% end_control %>
</tbody>
</table>
<% end_if %>
<% if Capabilities %>
<hr>
<h3 style="color: #{$Company.CompanyColor} !important;">OpenStack API Coverage</h3>
<h3 style="color: {$Company.CompanyColorRGB} !important;">OpenStack API Coverage</h3>
<table class="api-coverage">
<tbody>
<% loop Capabilities %>
<% control Capabilities %>
<% if SupportsVersioning %>
<% loop ReleaseSupportedApiVersion %>
<% control ReleaseSupportedApiVersion %>
<% if ApiVersion %>
<% loop OpenStackComponent %>
<% control OpenStackComponent %>
<tr>
<td>
$Name API
@ -109,43 +109,49 @@
</td>
<td>
$CodeName
<% end_loop %>
<% loop ApiVersion %> $Version<% end_loop %>
<% end_control %>
<% control ApiVersion %> $Version<% end_control %>
</td>
<% end_if %>
<% end_loop %>
<% end_control %>
<td class="coverage">
<span>$CoveragePercent %</span>
</td>
</tr>
<% end_if %>
<% end_loop %>
<% end_control %>
</tbody>
</table>
<% end_if %>
</div>
</td>
<td valign="top" style="width:200px;padding-left:15px;padding-right:15px">
<% include MarketPlaceDirectoryPage_Rating_Placeholder %>
<div id="reviews" style="min-height: 400px;">
<h3 style="color: {$Company.CompanyColorRGB} !important;">Reviews</h3>
<p>* No Reviews available on preview mode.</p>
<!--This script should be places anywhere on a page you want to see rating box-->
<div style='font-size:10px'>Powered by Rating-System.com</div>
<!-- DO NOT REMOVE THE LAST LINE, please contact us first if you need to do it -->
</div>
<% if Videos %>
<hr>
<div id="videos">
<% loop Videos %>
<h3 style="color: #{$Top.Company.CompanyColor} !important;" class="video-title">$Name<span class="video-duration">($FormattedLength)</span></h3>
<iframe frameborder="0" width="250" height="200" allowfullscreen=""
src="//www.youtube.com/embed/{$YouTubeId}?rel=0&amp;showinfo=0&amp;modestbranding=1&amp;controls=2">
</iframe>
<% end_loop %>
<% control Videos %>
<h3 style="color: {$Top.Company.CompanyColorRGB} !important;" class="video-title">$Name<span class="video-duration">($FormattedLength)</span></h3>
<a href="//www.youtube.com/embed/{$YouTubeId}"> Video </a>
<% end_control %>
</div>
<% end_if %>
<% if Resources %>
<hr>
<div id="more-resources">
<h3 style="color: #{$Company.CompanyColor} !important;">More Resources</h3>
<h3 style="color: {$Company.CompanyColorRGB} !important;">More Resources</h3>
<ul>
<% loop Resources %>
<li><a href="{$Uri}" style="color: #{$Company.CompanyColor} !important;" target="_blank" class="outbound-link">$Name</a></li>
<% end_loop %>
<% control Resources %>
<li style="color: {$Company.CompanyColorRGB}>$Name</li>
<% end_control %>
</ul>
</div>
<% end_if %>

View File

@ -82,7 +82,26 @@ class Company extends DataObject implements PermissionProvider {
return empty($this->Color)?"C34431":$this->Color;
}
private static $has_one = array(
public function getCompanyColorRGB() {
$rgb_color = "rgb(195,68,49)";
if (!empty($this->Color)) {
if(strlen($this->Color) == 3) {
$r = hexdec(substr($this->Color,0,1).substr($this->Color,0,1));
$g = hexdec(substr($this->Color,1,1).substr($this->Color,1,1));
$b = hexdec(substr($this->Color,2,1).substr($this->Color,2,1));
} else {
$r = hexdec(substr($this->Color,0,2));
$g = hexdec(substr($this->Color,2,2));
$b = hexdec(substr($this->Color,4,2));
}
$rgb_color = 'rgb('.$r.','.$g.','.$b.')';
}
return $rgb_color;
}
static $has_one = array(
'CompanyListPage' => 'CompanyListPage',
'Logo' => 'BetterImage',
'BigLogo' => 'BetterImage',