<div id="wrapper" class="container">
    <div class="row">
        <div class="bs-sidebar col-md-3 clearfix" data-ng-include data-src="'partials/realm-menu.html'"></div>
        <div id="content-area" class="col-md-9" role="main">
            <div class="top-nav">
                <ul class="rcue-tabs">
                    <li><a href="#/create/application/{{realm.id}}">New Application</a></li>
                    <li><a href="#/realms/{{realm.id}}/applications">Applications</a></li>
                    <li><a href="#/realms/{{realm.id}}/applications/{{application.id}}">Settings</a></li>
                    <li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/credentials">Credentials</a></li>
                    <li><a href="#">Installation</a></li>
                    <li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
                    <li class="active"><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
                    <li><a href="#">Sessions</a></li>
                </ul>
            </div>
            <div id="content">
                <h2 class="pull-left"><span>{{application.name}}</span> Scope Mappings</h2>
                <p class="subtitle"></p>
                <form name="realmForm" novalidate>
                    <legend uncollapsed><span class="text">Realm Roles</span> </legend>
                    <fieldset class="border-top">
                        <div class="form-group">
                            <div class="controls changing-selectors">
                                <div class="select-title">
                                    <label for="available">Available Roles</label>
                                    <select id="available" class="form-control" multiple size="5"
                                            ng-multiple="true"
                                            ng-model="selectedRealmRoles"
                                            ng-options="r.name for r in realmRoles">
                                    </select>
                                </div>
                                <div class="middle-buttons">
                                    <button type="submit" ng-click="addRealmRole()" data-original-title="Move right" class="tooltipRightTrigger"><span class="icon-arrow-right">Move right</span></button>
                                    <button type="submit" ng-click="deleteRealmRole()" data-original-title="Move left" class="tooltipRightTrigger"><span class="icon-arrow-left">Move left</span></button>
                                </div>
                                <div class="select-title">
                                    <label for="assigned">Assigned Roles</label>
                                    <select id="assigned" class="form-control" multiple size=5
                                            ng-multiple="true"
                                            ng-model="selectedRealmMappings"
                                            ng-options="r.name for r in realmMappings">
                                    </select>
                                </div>
                            </div>
                        </div>
                    </fieldset>

                    <fieldset ng-show="applications.length > 0">
                        <legend collapsed><span class="text">Application Roles</span> </legend>
                        <div class="form-group input-select">
                            <label for="applications">Application: </label>
                            <div class="input-group">
                                <div class="select-rcue">
                                    <select id="applications" name="applications" ng-change="changeApplication()" ng-model="targetApp" ng-options="a.name for a in applications">
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="controls changing-selectors">
                                <div class="select-title">
                                    <label for="app-available">Available Roles</label>
                                    <select id="app-available" class="form-control" multiple size="5"
                                            ng-multiple="true"
                                            ng-model="selectedApplicationRoles"
                                            ng-options="r.name for r in applicationRoles">
                                    </select>
                                </div>
                                <div class="middle-buttons">
                                    <button type="submit" ng-click="addApplicationRole()" data-original-title="Move right" class="tooltipRightTrigger"><span class="icon-arrow-right">Move right</span></button>
                                    <button type="submit" ng-click="deleteApplicationRole()" data-original-title="Move left" class="tooltipRightTrigger"><span class="icon-arrow-left">Move left</span></button>
                                </div>
                                <div class="select-title">
                                    <label for="app-assigned">Assigned Roles</label>
                                    <select id="app-assigned" class="form-control" multiple size=5
                                            ng-multiple="true"
                                            ng-model="selectedApplicationMappings"
                                            ng-options="r.name for r in applicationMappings">
                                    </select>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                </form>
            </div>
        </div>
        <div id="container-right-bg"></div>
    </div>
</div>