templates/website/user/profile/user-profile-edit.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import ico, imgUpload, switch %}
  2. {# SETUP - IS BRAZILIAN #}
  3. {% if user.document is null %}
  4.     {% set isBrazilSetup = (getConfig('checkout_default_region') == '1')? false : true %}
  5. {% else %}
  6.     {% set isBrazilSetup = (user.country is not null and user.country.id == enum('AbstractEnum::COUNTRY_BRAZIL')) %}
  7. {% endif %}
  8. <div class="profile-edit">
  9.     <form action="{{ path('userEditInfoProfile') }}" method="POST"
  10.           id="formUserInfo" class="form-geral form-user"
  11.           data-is-brazil-active="{{ isBrazilSetup? '1':'0' }}">
  12.         {# WARN REQUIRED #}
  13.         <p class="warn-required">{{ getLanguage('required_fields', 'util')|raw }}</p>
  14.         {% set confreq = getConfig('complete_registration') ? 'required' : '' %}
  15.         {% set req = confreq ? ' <em>*</em>' :'' %}
  16.         {# PERFIL #}
  17.         <div class="cp-cols">
  18.             <div class="cp cp-4 cp-sm-md-2">
  19.                 <label for="name">{{ getLanguage('name', 'profile') }} <em>*</em></label>
  20.                 <input type="text" id="name" name="name" placeholder="{{ getLanguage('enter_full_name', 'profile') }}" value="{{ user.name }}" required>
  21.             </div>
  22.             <div class="cp cp-4 cp-sm-md-2">
  23.                 <label for="profile-phone">{{ getLanguage('phone', 'profile') }} <em>*</em></label>
  24.                 <input type="text" id="profile-phone" class="intlPhone" name="phone" value="{{ user.phone }}" required>
  25.             </div>
  26.             <div class="cp cp-4 cp-sm-md-2">
  27.                 <label for="email">E-mail</label>
  28.                 <input type="email" id="email" name="email" value="{{ user.email }}" disabled="disabled">
  29.             </div>
  30.             <div class="cp cp-4 cp-sm-md-2">
  31.                 <label for="password">{{ getLanguage('password', 'profile') }} <em>*</em></label>
  32.                 <input type="password" name="password" id="password" value="{{ user.password }}" required>
  33.             </div>
  34.         </div>
  35.         <div class="cp-cols">
  36.             <div class="cp cp-gd">
  37.                 {# DOCUMENT #}
  38.                 <label for="profile-document" data-country="{{ isBrazilSetup? 1:'' }}">
  39.                     {{ getLanguage('document', 'profile') }}
  40.                     <span class="document-type">&nbsp;(CPF&thinsp;/&thinsp;CNPJ)</span>
  41.                     {{ req|raw }}
  42.                 </label>
  43.                 <input type="text" name="document" id="profile-document" value="{{ user.document }}"
  44.                     data-apply-validation="{{ isBrazilSetup? 'true':'false' }}"
  45.                     data-alt-placeholder="{{ getLanguage('type_document', 'profile') }}" placeholder="{{ getLanguage('type_document', 'profile') }}" {{ confreq }}>
  46.             </div>
  47.             <div class="cp cp-gd">
  48.                 <label for="profile-birth-date">{{ getLanguage('birth_date', 'profile') }}{{ req|raw }}</label>
  49.                 <input type="text" id="profile-birth-date" name="birthDate" value="{{ user.birthDate ? user.birthDate|date('Y-m-d') : '' }}" {{ confreq }}>
  50.             </div>
  51.             <div class="cp cp-gd">
  52.                 <label for="user-name">{{ getLanguage('username', 'profile') }}</label>
  53.                 <div class="input-tag">
  54.                     <label for="username">
  55.                         <div class="domainMobile">{{ ico('user') }}</div>
  56.                         <div class="domainDesktop">{{ eadDomain }}/p/</div>
  57.                     </label>
  58.                     <input type="text" name="username" id="username" value="{{ user.username }}" placeholder="username" required>
  59.                 </div>
  60.             </div>
  61.         </div>
  62.         <section class="fotos">
  63.             {# PROFILE AVATAR #}
  64.             <div class="dropfile js--dropfile" data-status="{{ user.photo is empty? 'empty' }}">
  65.                 <div class="label-help">
  66.                     {{ getLanguage('profile_picture', 'profile') }}
  67.                 </div>
  68.                 <div class="avatar js--dropfile-area">
  69.                     {% if user.photo %}
  70.                         {{ imgUpload(user.photo, enum('AbstractEnum::PATH_PROFILES'), 'user-profile-big', user.name, 'js--dropfile-mini') }}
  71.                     {% else %}
  72.                         <img src="" class="js--dropfile-mini" onerror="imgError(this)">
  73.                     {% endif %}
  74.                     <div class="loader">{{ ico('loader-wish') }}</div>
  75.                 </div>
  76.                 <p class="filename js--dropfile-file-label">&hellip;</p>
  77.                     <input type="file" id="photo" name="photo" class="js--dropfile-input" accept="image/*"
  78.                       data-drop-url="{{ path('userEditTheme',   {'id': user.id}) }}"
  79.                     data-delete-url="{{ path('userDeletePhoto', {'id': user.id}) }}">
  80.                 <nav class="actions">
  81.                     <button type="button" class="js--dropfile-btn-edit btn-ed">{{ ico('edit') }}{{ getLanguage('edit', 'profile') }}</button>
  82.                     <button type="button" class="js--dropfile-btn-delete btn-ed btn-delete">{{ ico('delete') }}{{ getLanguage('delete', 'profile') }}</button>
  83.                 </nav>
  84.             </div>
  85.             {# PROFILE COVER #}
  86.             <div class="dropfile js--dropfile" data-status="{{ user.cover is empty? 'empty' }}">
  87.                 <p class="label-help">{{ getLanguage('cover_photo', 'profile') }}</p>
  88.                 <div class="cover js--dropfile-area">
  89.                     {% if user.cover %}
  90.                         {{ imgUpload(user.cover, enum('AbstractEnum::PATH_COVERS_PROFILE'), 'user-profile-cover', user.name, 'js--dropfile-mini') }}
  91.                     {% else %}
  92.                         <img src="" class="js--dropfile-mini" onerror="imgError(this)">
  93.                     {% endif %}
  94.                     <div class="drop-label">
  95.                         {{ ico('upload') }}
  96.                         <p>{{ getLanguage('drop_the_file', 'profile') }}</p>
  97.                     </div>
  98.                     <div class="loader">{{ ico('loader-wish') }}</div>
  99.                 </div>
  100.                 <p class="filename js--dropfile-file-label">&hellip;</p>
  101.                     <input type="file" name="cover" class="js--dropfile-input" accept="image/*"
  102.                       data-drop-url="{{ path('userEditTheme',   {'id': user.id}) }}"
  103.                     data-delete-url="{{ path('userDeleteCover', {'id': user.id}) }}">
  104.                 <nav class="actions actions-dir">
  105.                     <button type="button" class="js--dropfile-btn-edit btn-ed">{{ ico('edit') }}{{ getLanguage('edit', 'profile') }}</button>
  106.                     <button type="button" class="js--dropfile-btn-delete btn-ed btn-delete">{{ ico('delete') }}{{ getLanguage('delete', 'profile') }}</button>
  107.                 </nav>
  108.             </div>
  109.         </section>
  110.         {# BIOGRAPHY #}
  111.         <div class="cp-cols">
  112.             <div class="cp cp-1">
  113.                 <label for="biography">{{ getLanguage('biography', 'profile') }}</label>
  114.                 <input type="text" name="biography" id="biography" value="{{ user.biography }}" placeholder="{{ getLanguage('talk_about_you', 'profile') }}">
  115.                 <p class="count-result-caracteres"><span class="caracteres"></span></p>
  116.             </div>
  117.         </div>
  118.         {# RESUME #}
  119.         <div class="cp-cols">
  120.             <div class="cp cp-1">
  121.                 <label for="resume">{{ getLanguage('resume', 'profile') }}</label>
  122.                 <textarea name="resume" id="resume" placeholder="{{ getLanguage('resume', 'profile') }}" class="js--editor">{{ user.resume }}</textarea>
  123.                 <p class="count-result-caracteres"><span class="caracteres"></span></p>
  124.             </div>
  125.         </div>
  126.         {# ADDRESS #}
  127.         <h3>{{ getLanguage('address', 'profile') }}</h3>
  128.         <div class="cp-cols">
  129.             {# IS BRAZILIAN #}
  130.             <div class="cp cp-pq">
  131.                 <label for="profile-country">{{ getLanguage('am_brazilian', 'util') }}</label>
  132.                 {{ switch({
  133.                     id: 'profile-country',
  134.                     name: 'country',
  135.                     checked: isBrazilSetup,
  136.                     attribs: 'class="isBrazil_userProfile"',
  137.                 })}}
  138.             </div>
  139.             {# ZIP CODE #}
  140.             <div class="cp cp-4 cp-sm-md-2">
  141.                 <label for="profile-zipCode">{{ getLanguage('zipcode', 'profile') }}{{ req|raw }}</label>
  142.                 <input type="text" id="profile-zipCode" name="zipCode" placeholder="{{ getLanguage('enter_zip_code', 'profile') }}" data-apply-search="true" value="{{ user.zipCode }}" {{ confreq }}>
  143.             </div>
  144.             {# STATE #}
  145.             <div class="cp cp-4 cp-sm-md-2" data-show-brazil>
  146.                 <label for="profile-state">{{ getLanguage('state', 'profile') }}{{ req|raw }}</label>
  147.                 <div class="select-wrap">
  148.                     <select id="profile-state"
  149.                         name="state"
  150.                         class="custom-select custom-select--search"
  151.                         request="{{ path('stateList') }}" 
  152.                         save="{{ user.state ? user.state.id }}"
  153.                         {{ confreq }}>
  154.                     </select>
  155.                     <i class="loader">{{ ico('loader-wish') }}</i>
  156.                 </div>
  157.             </div>
  158.             {# CITY #}
  159.             <div class="cp cp-4 cp-sm-md-2" data-show-brazil>
  160.                 <label for="profile-city">{{ getLanguage('city', 'profile') }}{{ req|raw }}</label>
  161.                 <div class="select-wrap">
  162.                     <select id="profile-city"
  163.                         name="city" 
  164.                         class="custom-select custom-select--search"
  165.                         request="{{ path('cityList') }}" 
  166.                         save="{{ user.city ? user.city.id }}"
  167.                         {{ confreq }}>
  168.                     </select>
  169.                     <i class="loader">{{ ico('loader-wish') }}</i>
  170.                 </div>
  171.             </div>
  172.             {# ADDRESS #}
  173.             <div class="cp cp-4 cp-sm-md-2">
  174.                 <label for="profile-address">{{ getLanguage('address', 'profile') }}{{ req|raw }}</label>
  175.                 <input type="text" id="profile-address" name="address" placeholder="{{ getLanguage('type_your_address', 'profile') }}" value="{{ user.address }}" {{ confreq }}>
  176.             </div>
  177.             {# NUMBER #}
  178.             <div class="cp cp-4 cp-sm-md-2">
  179.                 <label for="profile-addressNumber">{{ getLanguage('number', 'profile') }}<span data-show-brazil>{{ req|raw }}</span></label>
  180.                 <input type="text" id="profile-addressNumber" name="addressNumber" placeholder="{{ getLanguage('type_your_number', 'profile') }}" value="{{ user.addressNumber }}" {{ confreq }}>
  181.             </div>
  182.             {# COMPLEMENT #}
  183.             <div class="cp cp-4 cp-sm-md-2">
  184.                 <label for="profile-addressComplement">{{ getLanguage('complement', 'profile') }}</label>
  185.                 <input type="text" id="profile-addressComplement" name="addressComplement" placeholder="{{ getLanguage('type_your_complement', 'profile') }}" value="{{ user.addressComplement }}">
  186.             </div>
  187.             {# NEIGHBORHOOD #}
  188.             <div class="cp cp-4 cp-sm-md-2">
  189.                 <label for="profile-addressNeighborhood">{{ getLanguage('district', 'profile') }}{{ req|raw }}</label>
  190.                 <input type="text" id="profile-addressNeighborhood" name="addressNeighborhood" placeholder="{{ getLanguage('enter_district', 'profile') }}" value="{{ user.addressNeighborhood }}" {{ confreq }}>
  191.             </div>
  192.         </div>
  193.         {# DADOS COMPLEMENTARES #}
  194.         {% if fields|length > 0 %}
  195.             <h3>{{ getLanguage('additional_data', 'profile') }}</h3>
  196.             <div class="cp-cols">
  197.                 {% include 'website/user/profile/user-custom-form.html.twig' %}
  198.             </div>
  199.         {% endif %}
  200.         {# CONTATO #}
  201.         <h3>{{ getLanguage('contacts', 'profile') }}</h3>
  202.         <div class="cp-cols">
  203.             <div class="cp cp-3 cp-sm-1 cp-md-2">
  204.                 <label for="linkedin">LinkedIn</label>
  205.                 <div class="input-tag">
  206.                     <label for="linkedin">
  207.                         <div class="icon">
  208.                             {{ ico('linkedin') }}
  209.                         </div>
  210.                     </label>
  211.                     <input type="text" name="linkedin" id="linkedin" value="{{ user.linkedin }}">
  212.                 </div>
  213.             </div>
  214.             <div class="cp cp-3 cp-sm-1 cp-md-2">
  215.                 <label for="website">{{ getLanguage('website_or_portfolio', 'profile') }}</label>
  216.                 <div class="input-tag">
  217.                     <label for="website">
  218.                         <div class="icon">
  219.                             {{ ico('globe') }}
  220.                         </div>
  221.                     </label>
  222.                     <input type="text" name="website" id="website" value="{{ user.website }}" >
  223.                 </div>
  224.             </div>
  225.             <div class="cp cp-3 cp-sm-1 cp-md-2">
  226.                 <label for="facebook">Facebook</label>
  227.                 <div class="input-tag">
  228.                     <label for="facebook">
  229.                         <div class="icon">
  230.                             {{ ico('facebook') }}
  231.                         </div>
  232.                     </label>
  233.                     <input type="text" name="facebook" id="facebook" value="{{ user.facebook }}">
  234.                 </div>
  235.             </div>
  236.             <div class="cp cp-3 cp-sm-1 cp-md-2">
  237.                 <label for="twitter">Twitter</label>
  238.                 <div class="input-tag">
  239.                     <label for="twitter">
  240.                         <div class="icon">
  241.                             {{ ico('twitter') }}
  242.                         </div>
  243.                     </label>
  244.                     <input type="text" name="twitter" id="twitter" value="{{ user.twitter }}">
  245.                 </div>
  246.             </div>
  247.             <div class="cp cp-3 cp-sm-1 cp-md-2">
  248.                 <label for="instagram">Instagram</label>
  249.                 <div class="input-tag">
  250.                     <label for="instagram">
  251.                         <div class="icon">
  252.                             {{ ico('instagram') }}
  253.                         </div>
  254.                     </label>
  255.                     <input type="text" name="instagram" id="instagram" value="{{ user.instagram }}">
  256.                 </div>
  257.             </div>
  258.             <div class="cp cp-3 cp-sm-1 cp-md-2">
  259.                 <label for="youtube">Youtube</label>
  260.                 <div class="input-tag">
  261.                     <label for="youtube">
  262.                         <div class="icon">
  263.                             {{ ico('youtube') }}
  264.                         </div>
  265.                     </label>
  266.                     <input type="text" name="youtube" id="youtube" value="{{ user.youtube }}">
  267.                 </div>
  268.             </div>
  269.             <div class="cp cp-3 cp-sm-1 cp-md-2">
  270.                 <label for="tiktok">Tiktok</label>
  271.                 <div class="input-tag">
  272.                     <label for="tiktok">
  273.                         <div class="icon">
  274.                             {{ ico('tiktok') }}
  275.                         </div>
  276.                     </label>
  277.                     <input type="text" name="tiktok" id="tiktok" value="{{ user.tiktok }}">
  278.                 </div>
  279.             </div>
  280.         </div>
  281.         <input type="hidden" name="customField" value="{{ user.customField }}">
  282.         <nav class="actions-confirm">
  283.             <a href="{{ path('userProfilePublic', { username: user.username }) }}" class="btn-visualizar-peq">{{ ico('eye') }}&nbsp;{{ getLanguage('view_profile', 'profile') }}</a>
  284.             <button type="button" id="btnUserInfo" class="btn-continuar-peq btn-load">
  285.                 <span>{{ ico('check-circle') }}&nbsp;&nbsp;{{ getLanguage('save', 'profile') }}</span>
  286.                 <span>{{ getLanguage('wait', 'util') }}&thinsp;&hellip;&ensp;<i class="loader">{{ ico('loader-wish') }}</i></span>
  287.             </button>
  288.         </nav>
  289.     </form>
  290. </div>