<block id="page_body"><div class="container-center">
	<script>
		requirejs(['/intranet/projects/js/built/projects.company_detail.js', 'jquery', 'domReady'], function (app, $, domReady) {
			domReady(function ()
			{
				var app = $('#companyDetailApp');
				if (typeof app.scope() === 'undefined')
					angular.bootstrap(app[0], ['companyDetailApp', 'ui.bootstrap', 'ngResource', 'ngStorage', 'angularUtils.directives.dirPagination', 'cla.core.lmsg', 'projectListApp', 'cla.core.breadcrumb']);
			});
		});

		/*
							'/intranet/projects/js/project_list.js',
							'/intranet/projects/js/controller/companyDetailCtrl.js',
							'/intranet/projects/js/controller/projectListCtrl.js',
							});*/
	</script>

	<div class="main-panel" id="companyDetailApp">
		<div ng-controller="companyDetailCtrl as ctrl" ng-cloak="">
			<div ng-cloak="" class="form-horizontal">
				<div class="form-group row">
					<div class="col-md-12">
						<div class="form-control-static">
							<h2>{{ctrl.company.name}}
								&nbsp;&nbsp;<span name="can_edit">
									<a href="/projects/company/{{ctrl.company.id}}/edit" class="btn btn-secondary">
										<ion-icon name="create-outline"></ion-icon>
										<loc name="projects:companies:edit">[Edit]</loc>
									</a>
								</span>
							</h2>
						</div>
					</div>
				</div>

				<div class="form-group row">
					<label class="col-form-label col-md-2">
						<txt name="projects:companies:edit:contact_name">[Contact name]</txt>
					</label>

					<div class="col-md-10">
						<div class="form-control-static">
							{{ctrl.company.contact_name}}
						</div>
					</div>
				</div>

				<div class="form-group row">
					<label class="col-form-label col-md-2">
						<txt name="projects:companies:edit:contact_email">[Contact email]</txt>
					</label>

					<div class="col-md-10">
						<div class="form-control-static">
							{{ctrl.company.contact_email}}
						</div>
					</div>
				</div>

				<div class="form-group row">
					<label class="col-form-label col-md-2">
						<txt name="projects:companies:edit:contact_phone">[Contact landline]</txt>
					</label>

					<div class="col-md-10">
						<div class="form-control-static">
							{{ctrl.company.contact_phone}}
						</div>
					</div>
				</div>

				<div class="form-group row">
					<label class="col-form-label col-md-2">
						<txt name="projects:companies:edit:contact_mobile">[Contact mobile]</txt>
					</label>

					<div class="col-md-10">
						<div class="form-control-static">
							{{ctrl.company.contact_mobile}}
						</div>
					</div>
				</div>

				<div class="form-group row">
					<label class="col-form-label col-md-2">
						<txt name="projects:companies:edit:contact_notes">[Contact notes]</txt>
					</label>

					<div class="col-md-10">
						<div class="form-control-static">
							{{ctrl.company.contact_notes}}
						</div>
					</div>
				</div>



				<div class="col-md-10 offset-md-2" ng-controller="projectListCtrl">
					<div class="project-list cards row" ng-class="$storage.layoutType">
						<div class="card-wrapper col-sm-6 col-md-3 mb-3	" ng-repeat="project in projects">
							<include file="../components/project_list/card.html">
						</div>
					</div>

				</div>
			</div>
		</div>
	</div>

	<script>
		var company = ${company.json};
		var projects = ${projects.json};
		var project_count = ${project_count};
		var projects_per_page = ${projects_per_page};
		var current_page = ${current_page};
		var searchTerms = '${search_terms}';
		var project_company_filter = ${company_id};
		var project_filters = ${project_filters.json};
		var current_filter = '${current_filter}';
		var sort = ${sort};
	</script>
</div>
</block>

<include file="../layout/project_page.html" />
