<div class="anonymizeLogData">

    <div class="form-group row">
        <div class="col s12 input-field">
            <div>
                <label for="anonymizeSite" class="siteSelectorLabel">{{ 'PrivacyManager_AnonymizeSites'|translate }}</label>
                <div piwik-siteselector
                     class="sites_autocomplete"
                     ng-model="anonymizeLogData.site"
                     id="anonymizeSite"
                     show-all-sites-item="true"
                     switch-site-on-select="false"
                     show-selected-site="true"></div>
            </div>
        </div>
    </div>

    <div class="form-group row">
        <div class="col s6 input-field">
            <div>
                <label for="anonymizeStartDate" class="active">{{ 'PrivacyManager_AnonymizeRowDataFrom'|translate }}</label>
                <input type="text" ng-model="anonymizeLogData.start_date"
                       class="anonymizeStartDate"
                       name="anonymizeStartDate">
            </div>
        </div>
        <div class="col s6 input-field">
            <div>
                <label for="anonymizeEndDate" class="active">{{ 'PrivacyManager_AnonymizeRowDataTo'|translate }}</label>
                <input type="text" ng-model="anonymizeLogData.end_date"
                       class="anonymizeEndDate"
                       name="anonymizeEndDate">
            </div>
        </div>
    </div>

    <div piwik-field uicontrol="checkbox" name="anonymizeIp"
         data-title="{{ 'PrivacyManager_AnonymizeIp'|translate }}"
         ng-model="anonymizeLogData.anonymizeIp"
         introduction="{{ 'General_Visit'|translate }}"
         inline-help="{{ 'PrivacyManager_AnonymizeIpHelp'|translate }}">
    </div>

    <div piwik-field uicontrol="checkbox" name="anonymizeLocation"
         data-title="{{ 'PrivacyManager_AnonymizeLocation'|translate }}"
         ng-model="anonymizeLogData.anonymizeLocation"
         inline-help="{{ 'PrivacyManager_AnonymizeLocationHelp'|translate }}">
    </div>

    <div piwik-field uicontrol="checkbox" name="anonymizeTheUserId"
         data-title="{{ 'PrivacyManager_AnonymizeUserId'|translate }}"
         ng-model="anonymizeLogData.anonymizeUserId"
         inline-help="{{ 'PrivacyManager_AnonymizeUserIdHelp'|translate }}">
    </div>

    <div class="form-group row">
        <div class="col s12 m6">
            <div>
                <label for="visit_columns">{{ 'PrivacyManager_UnsetVisitColumns'|translate }}</label>

                <div ng-repeat="(index, visitColumn) in anonymizeLogData.selectedVisitColumns"
                     class="selectedVisitColumns selectedVisitColumns{{ index }} multiple valign-wrapper">

                    <div piwik-field uicontrol="select" name="visit_columns"
                         class="innerFormField"
                         full-width="true"
                         ng-model="anonymizeLogData.selectedVisitColumns[index].column"
                         ng-change="anonymizeLogData.onVisitColumnChange();"
                         options="anonymizeLogData.availableVisitColumns">
                    </div>

                    <span ng-click="anonymizeLogData.removeVisitColumn(index)"
                          title="{{ 'General_Remove'|translate }}"
                          ng-hide="(index + 1) == (anonymizeLogData.selectedVisitColumns|length)"
                          class="icon-minus valign"></span>
                </div>
            </div>
        </div>

        <div class="col s12 m6">
            <div class="form-help">
                <span class="inline-help">{{ 'PrivacyManager_UnsetVisitColumnsHelp'|translate }}</span>
            </div>
        </div>
    </div>

    <div class="form-group row">
        <div class="col s12"><h3>{{ 'General_Action'|translate }}</h3></div>
    </div>

    <div class="form-group row">
        <div class="col s12 m6">
            <div>
                <label for="action_columns">{{ 'PrivacyManager_UnsetActionColumns'|translate }}</label>

                <div ng-repeat="(index, actionColumn) in anonymizeLogData.selectedActionColumns"
                     class="selectedActionColumns selectedActionColumns{{ index }} multiple valign-wrapper">

                    <div piwik-field uicontrol="select" name="action_columns"
                         class="innerFormField"
                         full-width="true"
                         ng-model="anonymizeLogData.selectedActionColumns[index].column"
                         ng-change="anonymizeLogData.onActionColumnChange();"
                         options="anonymizeLogData.availableActionColumns">
                    </div>

                    <span ng-click="anonymizeLogData.removeActionColumn(index)"
                          title="{{ 'General_Remove'|translate }}"
                          ng-hide="(index + 1) == (anonymizeLogData.selectedActionColumns|length)"
                          class="icon-minus valign"></span>
                </div>
            </div>
        </div>

        <div class="col s12 m6">
            <div class="form-help">
                <span class="inline-help">{{ 'PrivacyManager_UnsetActionColumnsHelp'|translate }}</span>
            </div>
        </div>
    </div>

    <p><span class="icon-info"></span> {{ 'PrivacyManager_AnonymizeProcessInfo'|translate }}</p>

    <div piwik-save-button
         class="anonymizePastData"
         onconfirm="anonymizeLogData.scheduleAnonymization()"
         data-disabled="!anonymizeLogData.anonymizeIp && !anonymizeLogData.anonymizeLocation && !anonymizeLogData.selectedVisitColumns && !anonymizeLogData.selectedActionColumns"
         value="{{ 'PrivacyManager_AnonymizeDataNow'|translate }}">
    </div>

    <div class="ui-confirm" id="confirmAnonymizeLogData">
        <h2>{{ 'PrivacyManager_AnonymizeDataConfirm'|translate }}</h2>
        <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
        <input role="no" type="button" value="{{ 'General_No'|translate }}"/>
    </div>
</div>
