<commit_before><!DOCTYPE html>
<html lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:use-macro="profile.macros['profile']">

<tal:block metal:fill-slot="header-title">Identity providers</tal:block>

<tal:block metal:fill-slot="content">

  <h2>Identity providers</h2>

  <p>You are registered with the following accounts:</p>

  <form action="" method="post">

  <table class="table table-striped">
    <thead>
      <th><input type="checkbox" /></th>
      <th>Provider</th>
      <th>Passwords</th>
      <th>Is current?</th>
      <th>Is email verified?</th>
      <th>Available actions</th>
    </thead>
    <tbody>
      <tr tal:repeat="account accounts">
        <td>
          <input
             type="checkbox"
             name="account-${account['id']}" id="account-${account['id']}"
             tal:attributes="disabled None if account.is_verified else 'disabled'" />
        </td>
        <td>
          <div tal:omit-tag="" tal:repeat="provider account['providers']">
            <img tal:attributes="class 'current provider' if provider['is_current'] else 'provider'"
                 src="${request.static_path('yithlibraryserver:static/img/' + provider['name'] + '-mini-logo.png')}"
                 alt="${provider['name']}"
                 title="${provider['name']}"
                 width="32"
                 height="32" />
          </div>
        </td>
        <td>
          <span class="badge" title="${account['passwords']} passwords" tal:content="account['passwords']">Number of passwords</span>
        </td>
        <td>
          <span class="badge badge-inverse" tal:condition="account.is_current">Current</span>
        </td>
        <td>
          <span class="badge badge-success" tal:condition="account.is_verified">Email verified</span>
          <span class="badge badge-warning" tal:condition="request.user.email and not account.is_verified">Email not verified</span>
          <span class="badge" tal:condition="not request.user.email">No email available</span>
        </td>
        <td>
          <div tal:omit-tag="" tal:condition="not account.is_verified">
            <a tal:condition="account.is_current and request.user.email" id="open-email-verification-dialog" href="#email-verification-dialog" class="btn btn-mini btn-primary" data-toggle="modal">Verify email address</a>

            <a tal:condition="not account.is_current" href="#" class="btn btn-mini btn-primary disabled" title="You need to log in with this provider to verify this email address">Verify email address</a>
          </div>
        </td>
      </tr>
    </tbody>
  </table>

  <div class="buttons form-actions">
    <input
       class="btn btn-primary"
       value="Merge my accounts"
       type="submit"
       name="submit"
       tal:attributes="disabled None if can_merge else 'disabled'"
       />
  </div>
  </form>


  <div tal:condition="can_merge" class="alert alert-info">
    <button type="button" class="close" data-dismiss="alert">×</button>
    <strong>Tip:</strong> If you merge your accounts you will be able to access your passwords in a unified way: no matter which provider you use to log in you will always see the same set of passwords.
  </div>

  <tal:block
     tal:define="email_verification_dialog load: email_verification_dialog.pt"
     metal:use-macro="email_verification_dialog"
     />

</tal:block>

<tal:block metal:fill-slot="extra-scripts">

  <script src="${request.static_path('yithlibraryserver:static/js/email_verification_dialog.js')}"></script>

</tal:block>

</html><commit_msg>Implement the check all button for the identity providers table<commit_after><!DOCTYPE html>
<html lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:use-macro="profile.macros['profile']">

<tal:block metal:fill-slot="header-title">Identity providers</tal:block>

<tal:block metal:fill-slot="content">

  <h2>Identity providers</h2>

  <p>You are registered with the following accounts:</p>

  <form action="" method="post">

  <table class="table table-striped">
    <thead>
      <th><input id="check-all" type="checkbox" /></th>
      <th>Provider</th>
      <th>Passwords</th>
      <th>Is current?</th>
      <th>Is email verified?</th>
      <th>Available actions</th>
    </thead>
    <tbody>
      <tr tal:repeat="account accounts">
        <td>
          <input
             type="checkbox"
             name="account-${account['id']}" id="account-${account['id']}"
             tal:attributes="disabled None if account.is_verified else 'disabled'" />
        </td>
        <td>
          <div tal:omit-tag="" tal:repeat="provider account['providers']">
            <img tal:attributes="class 'current provider' if provider['is_current'] else 'provider'"
                 src="${request.static_path('yithlibraryserver:static/img/' + provider['name'] + '-mini-logo.png')}"
                 alt="${provider['name']}"
                 title="${provider['name']}"
                 width="32"
                 height="32" />
          </div>
        </td>
        <td>
          <span class="badge" title="${account['passwords']} passwords" tal:content="account['passwords']">Number of passwords</span>
        </td>
        <td>
          <span class="badge badge-inverse" tal:condition="account.is_current">Current</span>
        </td>
        <td>
          <span class="badge badge-success" tal:condition="account.is_verified">Email verified</span>
          <span class="badge badge-warning" tal:condition="request.user.email and not account.is_verified">Email not verified</span>
          <span class="badge" tal:condition="not request.user.email">No email available</span>
        </td>
        <td>
          <div tal:omit-tag="" tal:condition="not account.is_verified">
            <a tal:condition="account.is_current and request.user.email" id="open-email-verification-dialog" href="#email-verification-dialog" class="btn btn-mini btn-primary" data-toggle="modal">Verify email address</a>

            <a tal:condition="not account.is_current" href="#" class="btn btn-mini btn-primary disabled" title="You need to log in with this provider to verify this email address">Verify email address</a>
          </div>
        </td>
      </tr>
    </tbody>
  </table>

  <div class="buttons form-actions">
    <input
       class="btn btn-primary"
       value="Merge my accounts"
       type="submit"
       name="submit"
       tal:attributes="disabled None if can_merge else 'disabled'"
       />
  </div>
  </form>


  <div tal:condition="can_merge" class="alert alert-info">
    <button type="button" class="close" data-dismiss="alert">×</button>
    <strong>Tip:</strong> If you merge your accounts you will be able to access your passwords in a unified way: no matter which provider you use to log in you will always see the same set of passwords.
  </div>

  <tal:block
     tal:define="email_verification_dialog load: email_verification_dialog.pt"
     metal:use-macro="email_verification_dialog"
     />

</tal:block>

<tal:block metal:fill-slot="extra-scripts">

  <script src="${request.static_path('yithlibraryserver:static/js/email_verification_dialog.js')}"></script>
  <script type="text/javascript">
    (function ($) {
        "use strict";
        $(document).ready(function () {
            $("#check-all").click(function (event) {
                var is_checked = $("#" + this.id + ":checked").size() === 1,
                    $inputs = $("table input[type='checkbox'][name^='account-']:not([disabled])");

                if (is_checked) {
                    $inputs.attr("checked", "checked");
                } else {
                    $inputs.removeAttr("checked");
                }

            });
        });
    }(jQuery));
  </script>

</tal:block>

</html>
{'fraction_non_alphanumeric': 0.16123325751832196, 'fraction_numerical': 0.0016426585797321203, 'mean_word_length': 2.87041564792176, 'pattern_counts': {'":': 1, '<': 165, '<?xml version=': 0, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '7656115', 'n_tokens_mistral': 2382, 'n_tokens_neox': 2306, 'n_words': 507}