<div class="col-md-12" ng-controller="CurrencyConfigController">
    <div ng-hide="hideview">
        <ul class="breadcrumb">
            <li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
            <li class="active">{{'label.anchor.currencyconfig' | translate}}</li>
        </ul>
    </div>
    <div ng-show="hideview">
        <ul class="breadcrumb">
            <li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
            <li class="active">{{'label.anchor.editcurrencyconfig' | translate}}</li>
        </ul>
    </div>
    <div class="pull-right">
        <a ng-click="hideview = !hideview" class="btn btn-primary" has-permission='UPDATE_CURRENCY' id="edit-currency"><i
                class="icon-plus icon-white"></i>{{'label.button.addedit' | translate}}</a>
    </div>
    <br>
    <table class="table" ng-hide="hideview">
        <thead>
        <tr class="graybg">
            <th>{{'label.heading.currencyname' | translate}}</th>
            <th>{{'label.heading.currencycode' | translate}}</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="currency in selectedCurrOptions  | filter:filterText">
            <td>{{currency.name}}</td>
            <td>{{currency.code}}</td>
        </tr>
        </tbody>
    </table>
    <div ng-show="hideview">
    	<br>
		<div class="col-md-12">
               <api-validate></api-validate>
               <br>
               <div class="col-sm-4 col-md-4">
			    <input class="form-control input-xxlarge" id="new-currency"
			           ng-model="selected"
			           placeholder="New Currency"
			           type="text"
			           ng-autofocus="true"
			           autocomplete="off"
			           typeahead="item as item.displayLabel for item in allCurrOptions | filter:$viewValue | limitTo:8"/>&nbsp;&nbsp;
			</div>
               <div class="col-sm-2 col-md-2">
				<button id="add-currency" ng-click="addCur()" has-permission="UPDATE_CURRENCY" class="btn btn-primary"><i class="icon-plus"></i></button>
			</div>
			<div class="clear"></div>
            <div ng-repeat="currency in selectedCurrOptions">
                <div class="col-sm-4 col-md-4">
					<input disabled="" class="form-control input-xxlarge" placeholder={{currency.displayLabel}}
                       type="text"/>&nbsp;&nbsp;
				</div>
                <div class="col-sm-2 col-md-2">
					<a ng-click='deleteCur(currency.code)' has-permission='UPDATE_CURRENCY'><i class="icon-remove"></i></a>
				</div>
            </div>
    	</div>
    	<div class="col-md-offset-5">
	        <button id="cancel" type="reset" ng-click="cancel()" class="btn btn-default">{{'label.button.cancel' | translate}}
	        </button>
	        <button id="save" type="submit" ng-click="submit()" has-permission='UPDATE_CURRENCY' class="btn btn-primary">{{'label.button.save' | translate}}
	        </button>
        </div>
	</div>
</div>
