<commit_before><!-- @TITLE: {{'USER.ADMIN_TITLE' | translate}} -->
<!-- @SUBTITLE: {{'USER.ADMIN_SUBTITLE' | translate}} -->
<!-- @LOGO: fa-user-secret -->
<!-- @NO-CONTAINER -->
<!-- @ISOLATED-SCOPE -->
<!-- @NG-INIT: 
isInitialized = false; 
euser.username = '';
euser.givenName = '';
euser.familyName = '';
euser.email = '';
euser.role = 'editor';
password.first = '';
password.second = '';
-->
<!-- @LOADING-SPINNER: isInitialized -->
<!-- @MCC-SIMPLE-TEMPLATE: userAdminSelected -->

<div 
  mcc-crud-repo="rest/mcc/root/users/user"
  mcc-crud-repo-create-location="admin/user"
  mcc-crud-repo-delete-location="admin/user"
  mcc-loading-var="isInitialized"
  mcc-ajax-scope-var="euser"
  mcc-ajax-scope-field="user"
  mcc-ajax-scope-route-param="id"
  mcc-ajax-scope="rest/mcc/root/users/user/">  

  <div class="@CONTAINER-CLASS mcc-sidebar-title">
    <span ng-hide="euser.id">{{'USER.ADMIN_ADD'| translate}}</span>
    <span ng-show="euser.id">{{'USER.ADMIN_MODIFY'| translate}}</span>
    <b>{{euser.givenName}} {{euser.familyName}}</b>    
  </div>

  <div class="@CONTAINER-CLASS">

    <div class="nice-width"> 

      <input 
        bs-form-control
        type="text" 
        label="{{'USER.GIVEN_NAME'| translate}}"
        ng-model="euser.givenName"                 
        placeholder="{{'USER.GIVEN_NAME'| translate}}"
        size="200"
        />

      <input 
        bs-form-control
        type="text" 
        label="{{'USER.FAMILY_NAME'| translate}}"
        ng-model="euser.familyName"                 
        placeholder="{{'USER.FAMILY_NAME'| translate}}"
        size="200"
        />

      <input 
        bs-form-control
        type="text" 
        label="{{'USER.USERNAME'| translate}}"
        ng-model="euser.username"                 
        placeholder="{{'USER.USERNAME'| translate}}"
        size="200"
        />

      <input 
        bs-form-control
        type="text" 
        label="{{'EMAIL'| translate}}"
        ng-model="euser.email"                 
        placeholder="{{'EMAIL'| translate}}"
        size="200"
        />

      <select bs-form-control
              label="{{'USER.ROLE'| translate}}"
              ng-model="euser.role">
        <option value="sysadmin">{{'USER.ROLE_SYSADMIN'|| translate}}</option>
        <option value="admin">{{'USER.ROLE_ADMIN'|| translate}}</option>
        <option value="editor">{{'USER.ROLE_EDITOR'|| translate}}</option>
        <option value="trainee">{{'USER.ROLE_TRAINEE'|| translate}}</option>
        <option value="external">{{'USER.ROLE_EXTERNAL'|| translate}}</option>        
      </select>         

      <button class="btn btn-primary" ng-click="update(euser)" ng-show="euser.id">{{'SAVE'| translate}}</button> 

      <button class="btn btn-danger pull-right" ng-click="delete(euser.id)" ng-show="euser.id">{{'DELETE'| translate}}</button> 

      <button class="btn btn-primary" ng-click="create(euser)" ng-hide="euser.id">{{'CREATE'| translate}}</button> 

    </div>
  </div>
  <div ng-show="euser.id">
    <div class="@CONTAINER-CLASS mcc-sidebar-title">
      {{'USER.UPDATE_PASSWORD'| translate}}
    </div>
    <div class="@CONTAINER-CLASS">
      <div class="nice-width"> 
        <input 
          bs-form-control
          type="password" 
          label="{{'PASSWORD'| translate}}"
          ng-model="password.first"                 
          placeholder="{{'PASSWORD'| translate}}"<commit_msg>Fixed position of user remove button<commit_after><!-- @TITLE: {{'USER.ADMIN_TITLE' | translate}} -->
<!-- @SUBTITLE: {{'USER.ADMIN_SUBTITLE' | translate}} -->
<!-- @LOGO: fa-user-secret -->
<!-- @NO-CONTAINER -->
<!-- @ISOLATED-SCOPE -->
<!-- @NG-INIT: 
isInitialized = false; 
euser.username = '';
euser.givenName = '';
euser.familyName = '';
euser.email = '';
euser.role = 'editor';
password.first = '';
password.second = '';
-->
<!-- @LOADING-SPINNER: isInitialized -->
<!-- @MCC-SIMPLE-TEMPLATE: userAdminSelected -->

<div 
  mcc-crud-repo="rest/mcc/root/users/user"
  mcc-crud-repo-create-location="admin/user"
  mcc-crud-repo-delete-location="admin/user"
  mcc-loading-var="isInitialized"
  mcc-ajax-scope-var="euser"
  mcc-ajax-scope-field="user"
  mcc-ajax-scope-route-param="id"
  mcc-ajax-scope="rest/mcc/root/users/user/">  

  <div class="@CONTAINER-CLASS mcc-sidebar-title">
    <span ng-hide="euser.id">{{'USER.ADMIN_ADD'| translate}}</span>
    <span ng-show="euser.id">{{'USER.ADMIN_MODIFY'| translate}}</span>
    <b>{{euser.givenName}} {{euser.familyName}}</b>    
  </div>

  <div class="@CONTAINER-CLASS">

    <div class="nice-width"> 

      <input 
        bs-form-control
        type="text" 
        label="{{'USER.GIVEN_NAME'| translate}}"
        ng-model="euser.givenName"                 
        placeholder="{{'USER.GIVEN_NAME'| translate}}"
        size="200"
        />

      <input 
        bs-form-control
        type="text" 
        label="{{'USER.FAMILY_NAME'| translate}}"
        ng-model="euser.familyName"                 
        placeholder="{{'USER.FAMILY_NAME'| translate}}"
        size="200"
        />

      <input 
        bs-form-control
        type="text" 
        label="{{'USER.USERNAME'| translate}}"
        ng-model="euser.username"                 
        placeholder="{{'USER.USERNAME'| translate}}"
        size="200"
        />

      <input 
        bs-form-control
        type="text" 
        label="{{'EMAIL'| translate}}"
        ng-model="euser.email"                 
        placeholder="{{'EMAIL'| translate}}"
        size="200"
        />

      <select bs-form-control
              label="{{'USER.ROLE'| translate}}"
              ng-model="euser.role">
        <option value="sysadmin">{{'USER.ROLE_SYSADMIN'|| translate}}</option>
        <option value="admin">{{'USER.ROLE_ADMIN'|| translate}}</option>
        <option value="editor">{{'USER.ROLE_EDITOR'|| translate}}</option>
        <option value="trainee">{{'USER.ROLE_TRAINEE'|| translate}}</option>
        <option value="external">{{'USER.ROLE_EXTERNAL'|| translate}}</option>        
      </select>         

      <button class="btn btn-danger pull-right" ng-click="delete(euser.id)" ng-show="euser.id">{{'DELETE'| translate}}</button> 
      <button class="btn btn-primary" ng-click="update(euser)" ng-show="euser.id">{{'SAVE'| translate}}</button> 

      <button class="btn btn-primary" ng-click="create(euser)" ng-hide="euser.id">{{'CREATE'| translate}}</button> 

    </div>
  </div>
  <div ng-show="euser.id">
    <div class="@CONTAINER-CLASS mcc-sidebar-title">
      {{'USER.UPDATE_PASSWORD'| translate}}
    </div>
    <div class="@CONTAINER-CLASS">
      <div class="nice-width"> 
        <input 
          bs-form-control
          type="password" 
          label="{{'PASSWORD'| translate}}"
          ng-model="password.first"                 
          placeholder="{{'PASSWORD'| translate}}"
{'fraction_non_alphanumeric': 0.20040721349621873, 'fraction_numerical': 0.0034904013961605585, 'mean_word_length': 2.532100667693888, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 99, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7312846', 'n_tokens_mistral': 2413, 'n_tokens_neox': 2259, 'n_words': 302}