<style>
    .advancedSettingsExpander {
        cursor: pointer;
    }

    .advancedSettingsDeviderLine {
        border-bottom: 1px solid #cccccc;
        padding-top: 5px;
    }
</style>

<div class="modal-header">
    <button type="button" class="close closebtn" data-ng-click="cancel()" aria-hidden="true">&times;</button>
    <h1 class="modal-title">{{'Birthday' | translate}}</h1>
</div>
<div class="modal-body">
    <form>
        <div class="form-group">
            <label class="control-label">{{'Template' | translate}}</label>
            <wizdom365-template-picker template-url="data.templateUrl" directory-path="Birthday/Templates/ViewTemplates"></wizdom365-template-picker>
        </div>
        <div class="form-group">
            <label class="control-label">{{'Plus days' | translate}}</label>
            <input type="number" placeholder="0..365" class="form-control" ng-model="data.plusDays" />
        </div>
        <div class="form-group">
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="data.useUsersDepartment" />
                    {{"User's current department" | translate}}
                </label>
            </div>
            <div  ng-hide="data.useUsersDepartment">
                <label class="control-label">{{'Department' | translate}}</label>
                <div wizdom365-departments-dropdown="" selecteddepartment="data.department"></div>
            </div>
        </div>

        <div class="form-group">
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="data.useUsersLocation" />
                    {{"User's current location" | translate}}
                </label>
            </div>
            <div ng-hide="data.useUsersLocation">
                <label class="control-label">{{'Location' | translate}}</label>
                <div wizdom365-locations-dropdown="" selectedlocation="data.location"></div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="advancedSettingsExpander" ng-click="isAdvancedSettingsOpen = !isAdvancedSettingsOpen">
                    <span class="advancedSettingsExpanderArrow"><i class="ms-Icon" ng-class="isAdvancedSettingsOpen == true ? 'ms-Icon--ChevronDownMed' : 'ms-Icon--ChevronRightMed'"></i></span>
                    <span class="advancedSettingsExpanderText">{{'Advanced' | translate}}</span>
                </div>
                <div class="advancedSettingsDeviderLine" ng-show="isAdvancedSettingsOpen"></div>

                <!-- Advanced settings start -->
                <div class="advancedSettings" ng-show="isAdvancedSettingsOpen" id="advancedSettings">
                    <div class="form-group">
                        <label class="control-label">{{'Source id' | translate}}</label>
                        <input type="text" class="form-control" ng-model="data.sourceId" />
                    </div>
                    <div class="form-group">
                        <label class="control-label">{{'Managed property' | translate}}</label>
                        <input type="text" class="form-control" ng-model="data.managedProperty" />
                    </div>
                </div>
                <!-- Advanced settings end -->
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button class="btn btn-success wiz-btn-padding" ng-click="updateConfig();">{{'Save' | translate}}</button>
    <button class="btn btn-default wiz-btn-padding" ng-disabled="loading" ng-click="cancel();">{{"Cancel" | translate}}</button>
</div>