<commit_before>{% extends "views/components/widgets/base.htm" %}
{% load i18n %}

{% block form %}
<div class="row widget-wrapper">
  <div class="form-group">
      <div style="display:flex; flex-direction: row"><div><p class="control-label widget-input-label" data-bind="text:label"></p></div><div>
          <!-- ko if: node -->
          <i data-bind="css: {'ion-asterisk widget-label-required': node.isrequired}"></i>
          <!-- /ko -->
      </div></div>
      <div class="col-xs-12">
        <div style="pad-hor">
        <label data-bind="css: { 'active': value() }, click: function () { value(true) }" class="form-radio form-normal form-text">
            <input type="radio" name="stat-w-label" data-bind="checked: value" value="true"><span data-bind="text:trueLabel"></span>
        </label>
        <label data-bind="css: { 'active': !value() }, click: function () { value(false) }" class="form-radio form-normal form-text">
            <input type="radio" name="stat-w-label" data-bind="checked: value" value="false"><span data-bind="text:config().falseLabel"></span>
        </label>
     </div>
   </div>
  </div>
</div>
{% endblock form %}

{% block config_form %}
<div class="control-label">
    {% trans "Label 'True'" %}
</div>
<div class="col-xs-12 pad-no crud-widget-container">
    <input type="" id="" class="form-control input-md widget-input" data-bind="value:trueLabel, valueUpdate: 'keyup'">
</div>
<div class="control-label">
    {% trans "Label 'False'" %}
</div>
<div class="col-xs-12 pad-no crud-widget-container">
    <input type="" id="" class="form-control input-md widget-input" data-bind="value: falseLabel, valueUpdate: 'keyup'">
</div>
<div class="control-label">
    {% trans "Default Value" %}
</div>
<div class="col-xs-12" style="display:flex; flex-direction: column; height: 50px">
  <div style="pad-hor">
      <label data-bind="css: { 'active': defaultValue() }, click: function () { defaultValue(true) }" class="form-radio form-normal form-text">
          <input type="radio" name="stat-w-label" data-bind="checked: defaultValue" value="true"><span data-bind="text:trueLabel"></span>
      </label>
      <label data-bind="css: { 'active': !defaultValue() }, click: function () { defaultValue(false) }" class="form-radio form-normal form-text">
          <input type="radio" name="stat-w-label" data-bind="checked: defaultValue" value="false"><span data-bind="text:config().falseLabel"></span><commit_msg>add disabled state for boolean widget, re #2701<commit_after>{% extends "views/components/widgets/base.htm" %}
{% load i18n %}

{% block form %}
<div class="row widget-wrapper">
  <div class="form-group">
      <div style="display:flex; flex-direction: row"><div><p class="control-label widget-input-label" data-bind="text:label"></p></div><div>
          <!-- ko if: node -->
          <i data-bind="css: {'ion-asterisk widget-label-required': node.isrequired}"></i>
          <!-- /ko -->
      </div></div>
      <div class="col-xs-12">
        <div style="pad-hor">
        <label data-bind="css: { 'active': value(), 'disabled': disabled }, click: function () { if(!disabled{value(true);} }" class="form-radio form-normal form-text">
            <input type="radio" name="stat-w-label" data-bind="checked: value" value="true"><span data-bind="text:trueLabel"></span>
        </label>
        <label data-bind="css: { 'active': !value(), 'disabled': disabled }, click: function () { if(!disabled{value(false);} }" class="form-radio form-normal form-text">
            <input type="radio" name="stat-w-label" data-bind="checked: value" value="false"><span data-bind="text:config().falseLabel"></span>
        </label>
     </div>
   </div>
  </div>
</div>
{% endblock form %}

{% block config_form %}
<div class="control-label">
    {% trans "Label 'True'" %}
</div>
<div class="col-xs-12 pad-no crud-widget-container">
    <input type="" id="" class="form-control input-md widget-input" data-bind="value:trueLabel, valueUpdate: 'keyup'">
</div>
<div class="control-label">
    {% trans "Label 'False'" %}
</div>
<div class="col-xs-12 pad-no crud-widget-container">
    <input type="" id="" class="form-control input-md widget-input" data-bind="value: falseLabel, valueUpdate: 'keyup'">
</div>
<div class="control-label">
    {% trans "Default Value" %}
</div>
<div class="col-xs-12" style="display:flex; flex-direction: column; height: 50px">
  <div style="pad-hor">
      <label data-bind="css: { 'active': defaultValue() }, click: function () { defaultValue(true) }" class="form-radio form-normal form-text">
          <input type="radio" name="stat-w-label" data-bind="checked: defaultValue" value="true"><span data-bind="text:trueLabel"></span>
      </label>
      <label data-bind="css: { 'active': !defaultValue() }, click: function () { defaultValue(false) }" class="form-radio form-normal form-text">
          <input type="radio" name="stat-w-label" data-bind="checked: defaultValue" value="false"><span data-bind="text:config().falseLabel"></span>
{'fraction_non_alphanumeric': 0.21251993620414672, 'fraction_numerical': 0.005582137161084529, 'mean_word_length': 3.957509881422925, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 109, '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': '3435105', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1581, 'n_words': 346}