<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div flex="100" class="md-padding">
	<div flex="100" layout="column" style="width:100%">	
		<h5 class="md-subhead">Implementation</h5>
		   <md-input-container class="md-padding-left">
			 	<md-radio-group ng-model="ctrl.deployment.outputType" class="md-padding-left" style="display:inline;">
			 	 		<md-radio-button value="{{outputType.type}}" ng-repeat="outputType in ctrl.deploymentSettings.outputTypes">{{outputType.description}}</md-radio-button>
					   	</md-radio-group>	
			</md-input-container> 
		 <md-divider style="border-top-color:rgba(63, 81, 181, 0.5)"></md-divider> 
		 <div flex="100" ng-show="ctrl.deployment.outputType == 'DESCRIPTION'">
		 	<h5 class="md-subhead">Code generation options</h5>
				    <div flex="100" layout="row" class="md-padding-left">
				    	<div layout="row"> 
						    <md-input-container>
						    	<label>Class name prefix</label>
						        <input ng-model="ctrl.deployment.classNamePrefix">
						    </md-input-container>
					    </div>
					    <div flex="100" layout="column"> 
			    			<md-button ng-click="ctrl.generateDescription()" class="md-accent">Generate code</md-button>
		    			</div>
					</div> 
		</div>  
		<div flex="100" ng-show="ctrl.deployment.outputType == 'IMPLEMENTATION'">
		 	<h5 class="md-subhead">{{ctrl.deployment.runtimeType.title}}</h5>
				    <md-radio-group ng-model="ctrl.deployment.runtimeType" class="md-padding-left" style="display:inline;">
				     	 <md-radio-button value="{{runtimeType.type}}" ng-repeat="runtimeType in ctrl.deploymentSettings.runtimeType.runtimeTypes">{{runtimeType.description}}</md-radio-button>
					 </md-radio-group> 	  
			<md-divider style="border-top-color:rgba(63, 81, 181, 0.5)"></md-divider>
			<div flex="100" layout="column">
			 	<deployment-type deployment="ctrl.deployment"/>
			</div>
		 	<div flex="100" layout="column"> 
		    	<md-button ng-click="ctrl.generateImplementation()" class="md-accent">Generate Implementation</md-button>
		    </div>
		</div> 	
		<md-progress-circular class="md-accent" md-mode="indeterminate" ng-show="ctrl.loading"></md-progress-circular>
		<div flex="100" layout="row" layout-align="center center" ng-if="ctrl.deployment.outputType == 'DESCRIPTION' && ctrl.resultReturned">
			<div flex="100" layout="column">
				<md-divider style="border-top-color:rgba(63, 81, 181, 0.5)"></md-divider>
				<h5 class="md-subhead">Description</h5>
				<generated-element-description jsonld="ctrl.jsonld" java="ctrl.java" element="element"/>
			</div>
		</div>
		<div flex="100" layout="row" layout-align="center center" ng-if="ctrl.deployment.outputType == 'IMPLEMENTATION' && ctrl.resultReturned">
			<div flex="100" layout="column">
				<md-divider style="border-top-color:rgba(63, 81, 181, 0.5)"></md-divider>
				<h5 class="md-subhead">Generated Implementation</h5>
				<generated-element-implementation zip-file="ctrl.zipFile" element="ctrl.element"/>
			</div>
		</div>
	</div>
</div>