<commit_before><%inherit file="/template.html" />
<%namespace name="components" file="/components.html"/>
<%def name="title()">${_("Settings: %s") % c.page_user.name}</%def>

<%def name="breadcrumbs()">
    ${h.user.breadcrumbs(c.page_user)|n} &raquo; ${_("Edit")}
</%def>


<%block name="headline">
    <h3>${_("Your User Details")}</h3>
    ${tiles.user.header(c.page_user, c.tile, active='activity')}
</%block>

<%block name="main_content">

<div class="form_wrapper">
  <form name="settings" class="inplace" method="POST" action="/user/${c.page_user.user_name}">
    ${h.field_token()|n}
    <input type="hidden" name="_method" value="PUT" />

    <fieldset>
        <legend>${_("Language")}</legend>
        <ul>
            %for locale in c.locales:
            <li style="list-style-type: none;"><input type="radio" name="locale" value="${str(locale)}" 
            %if locale == c.page_user.locale:
            checked="checked"
            %endif
            /> ${locale.display_name}</li>
            %endfor
        </ul>
    </fieldset>
    <fieldset>
      <legend>${_("Display name for")} ${c.page_user.user_name}</legend>
      <p class="info">${_("You can chose which name other users see.")}</p>
      <div class="input_wrapper">
        <input type="text" tabindex="1" class="title" name="display_name" value="${c.page_user.display_name}" placeholder="${c.page_user.name}" />
      </div>
    </fieldset>

    <fieldset>
      <legend>${_("Password")}</legend>
      <p class="info">${_("Select a new password or leave the fields blank to keep your old one.")}</p>
      <div class="input_wrapper">
        <label for="password_change">${_("Password:")}</label>
        <input type="password" name="password_change">
      </div>
      <div class="input_wrapper">
        <label for="password_confirm">${_("Password (confirm):")}</label>
        <input type="password" name="password_confirm">
      </div>
    </fieldset>

    %if c.enable_gender:
    <fieldset>
        <legend>${_("Gender")}</legend>
        <p class="info">${_("Select your gender")}</p>
        <div class="input_wrapper">
            <label for="gender">${_("Gender")}</label>
            <select id="gender" name="gender">
		<option value="u"
                %if c.page_user.gender == "u": 
                    selected="selected" 
                %endif
                >${_("Unspecified")}</option>
                <option value="m" 
                %if c.page_user.gender == "m":
                    selected="selected" 
                %endif
                >${_("Male")}</option>
                <option value="f"
                %if c.page_user.gender == "f":
                    selected="selected"
                %endif
                >${_("Female")}</option>
            </select>
        </div>
    </fieldset>
    %endif    

    <fieldset>
      <legend>${_("Notifications")}</legend>
      <p class="info">
        ${_("Select how you would like to be notified of events.")}
        <a target="_new" href="/static/notification_faq.html#howmany">${_("Help.")}</a>
      </p>
        
      <div class="input_wrapper">
        <label for="email">${_("E-Mail:")}</label>
        <input type="text" name="email" value="${c.page_user.email}"/>
      </div>
      <div class="input_wrapper">
          <table border="0" width="100%">
              <tr>
                  <th colspan="4">${_("fewer")}</th>
                  <th colspan="2">${_("more notifications")}</th>
              </tr>
              <tr>
                  %if c.page_user.is_email_activated():
                      <td><input type="radio" name="email_priority" value="6" 
                          ${"checked='checked'" if c.page_user.email_priority==6 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="4" 
                          ${"checked='checked'" if c.page_user.email_priority==4 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="3" 
                          ${"checked='checked'" if c.page_user.email_priority==3 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="2" 
                          ${"checked='checked'" if c.page_user.email_priority==2 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="1" 
                          ${"checked='checked'" if c.page_user.email_priority==1 else ""} /></td>
                  %else:
                      <td colspan="5">${_("Not confirmed.")}
                          <a href="/user/${c.page_user.user_name}/resend?${h.url_token()}">${_("Re-send activation link")}</a></td>
                  %endif
              </tr>
          </table>
      </div>
    </fieldset>

    <fieldset>
      <legend><img src="/img/icons/openid_20.png" class="cd" /> ${_("OpenID")}</legend>  
      <p class="info">${_("OpenID allows you to use a single login on many web sites.")}</p>
      %if not len(c.page_user.openids):
        <div class="infobox">
            ${_("There are no associated OpenIDs.")}
        </div>
      %else:
        <div class="input_wrapper">
          <table border="0" width="100%">
              %for openid in c.page_user.openids:
              <tr>
                  <td><code>${openid.identifier}</code></td>
                  <td><a href="/openid/revoke?id=${openid.id}&amp;${h.url_token()}">${_("remove")}</a></td>
              </tr>
              %endfor
          </table>
        </div>
      %endif
      <a class="add" href="/openid/connect">${_("Add OpenID")}</a>
    </fieldset>
    
    <fieldset>
      <legend>${_("Short biography")}</legend>
      <p class="info">${_("A bio will allow others to learn about you and perhaps even get you a few delegations.")}</p>
      <div class="input_wrapper">
        <textarea tabindex="2" class="description" name="bio">${c.page_user.bio}</textarea>
        ${components.formatting()}
      </div>
    </fieldset>
    
    <fieldset>
      <legend>${_("Advanced Settings")}</legend>
      <p class="info">${_("The pre-set number of entries in listing pages.")}</p>
      <div class="input_wrapper">
        <label for="page_size">${_("List size:")}</label><commit_msg>Fix empty user display name and bio setting<commit_after><%inherit file="/template.html" />
<%namespace name="components" file="/components.html"/>
<%def name="title()">${_("Settings: %s") % c.page_user.name}</%def>

<%def name="breadcrumbs()">
    ${h.user.breadcrumbs(c.page_user)|n} &raquo; ${_("Edit")}
</%def>


<%block name="headline">
    <h3>${_("Your User Details")}</h3>
    ${tiles.user.header(c.page_user, c.tile, active='activity')}
</%block>

<%block name="main_content">

<div class="form_wrapper">
  <form name="settings" class="inplace" method="POST" action="/user/${c.page_user.user_name}">
    ${h.field_token()|n}
    <input type="hidden" name="_method" value="PUT" />

    <fieldset>
        <legend>${_("Language")}</legend>
        <ul>
            %for locale in c.locales:
            <li style="list-style-type: none;"><input type="radio" name="locale" value="${str(locale)}" 
            %if locale == c.page_user.locale:
            checked="checked"
            %endif
            /> ${locale.display_name}</li>
            %endfor
        </ul>
    </fieldset>
    <fieldset>
      <legend>${_("Display name for")} ${c.page_user.user_name}</legend>
      <p class="info">${_("You can chose which name other users see.")}</p>
      <div class="input_wrapper">
        <input type="text" tabindex="1" class="title" name="display_name" ${('value="%s"'%c.page_user.display_name) if c.page_user.display_name is not None else '' | n} placeholder="${c.page_user.user_name}" />
      </div>
    </fieldset>

    <fieldset>
      <legend>${_("Password")}</legend>
      <p class="info">${_("Select a new password or leave the fields blank to keep your old one.")}</p>
      <div class="input_wrapper">
        <label for="password_change">${_("Password:")}</label>
        <input type="password" name="password_change">
      </div>
      <div class="input_wrapper">
        <label for="password_confirm">${_("Password (confirm):")}</label>
        <input type="password" name="password_confirm">
      </div>
    </fieldset>

    %if c.enable_gender:
    <fieldset>
        <legend>${_("Gender")}</legend>
        <p class="info">${_("Select your gender")}</p>
        <div class="input_wrapper">
            <label for="gender">${_("Gender")}</label>
            <select id="gender" name="gender">
		<option value="u"
                %if c.page_user.gender == "u": 
                    selected="selected" 
                %endif
                >${_("Unspecified")}</option>
                <option value="m" 
                %if c.page_user.gender == "m":
                    selected="selected" 
                %endif
                >${_("Male")}</option>
                <option value="f"
                %if c.page_user.gender == "f":
                    selected="selected"
                %endif
                >${_("Female")}</option>
            </select>
        </div>
    </fieldset>
    %endif    

    <fieldset>
      <legend>${_("Notifications")}</legend>
      <p class="info">
        ${_("Select how you would like to be notified of events.")}
        <a target="_new" href="/static/notification_faq.html#howmany">${_("Help.")}</a>
      </p>
        
      <div class="input_wrapper">
        <label for="email">${_("E-Mail:")}</label>
        <input type="text" name="email" value="${c.page_user.email}"/>
      </div>
      <div class="input_wrapper">
          <table border="0" width="100%">
              <tr>
                  <th colspan="4">${_("fewer")}</th>
                  <th colspan="2">${_("more notifications")}</th>
              </tr>
              <tr>
                  %if c.page_user.is_email_activated():
                      <td><input type="radio" name="email_priority" value="6" 
                          ${"checked='checked'" if c.page_user.email_priority==6 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="4" 
                          ${"checked='checked'" if c.page_user.email_priority==4 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="3" 
                          ${"checked='checked'" if c.page_user.email_priority==3 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="2" 
                          ${"checked='checked'" if c.page_user.email_priority==2 else ""} /></td>
                      <td><input type="radio" name="email_priority" value="1" 
                          ${"checked='checked'" if c.page_user.email_priority==1 else ""} /></td>
                  %else:
                      <td colspan="5">${_("Not confirmed.")}
                          <a href="/user/${c.page_user.user_name}/resend?${h.url_token()}">${_("Re-send activation link")}</a></td>
                  %endif
              </tr>
          </table>
      </div>
    </fieldset>

    <fieldset>
      <legend><img src="/img/icons/openid_20.png" class="cd" /> ${_("OpenID")}</legend>  
      <p class="info">${_("OpenID allows you to use a single login on many web sites.")}</p>
      %if not len(c.page_user.openids):
        <div class="infobox">
            ${_("There are no associated OpenIDs.")}
        </div>
      %else:
        <div class="input_wrapper">
          <table border="0" width="100%">
              %for openid in c.page_user.openids:
              <tr>
                  <td><code>${openid.identifier}</code></td>
                  <td><a href="/openid/revoke?id=${openid.id}&amp;${h.url_token()}">${_("remove")}</a></td>
              </tr>
              %endfor
          </table>
        </div>
      %endif
      <a class="add" href="/openid/connect">${_("Add OpenID")}</a>
    </fieldset>
    
    <fieldset>
      <legend>${_("Short biography")}</legend>
      <p class="info">${_("A bio will allow others to learn about you and perhaps even get you a few delegations.")}</p>
      <div class="input_wrapper">
        <textarea tabindex="2" class="description" name="bio">${c.page_user.bio if c.page_user.bio else ''}</textarea>
        ${components.formatting()}
      </div>
    </fieldset>
    
    <fieldset>
      <legend>${_("Advanced Settings")}</legend>
      <p class="info">${_("The pre-set number of entries in listing pages.")}</p>
      <div class="input_wrapper">
        <label for="page_size">${_("List size:")}</label>
{'fraction_non_alphanumeric': 0.1948216980382813, 'fraction_numerical': 0.004288777698355968, 'mean_word_length': 2.1582643591672936, 'pattern_counts': {'":': 6, '<': 309, '<?xml version=': 0, '>': 309, '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': '3848389', 'n_tokens_mistral': 4012, 'n_tokens_neox': 3827, 'n_words': 743}