<commit_before><div class="unit-dates-selector">
  <div class="panel panel-primary">
    <div class="panel-heading">
      <h3 class="panel-title">Create Unit</h3>
      Duplicate an existing unit by specifying the time period.
    </div>
    <form class="form-horizontal" role="form" name="rolloverUnitForm" ng-submit="saveUnit()">
      <div class="panel-body">
        <div class="form-group">
          <label class="col-sm-2 control-label" for="teachingperiod">Teaching Period</label>
          <div class="col-sm-9">
            <select class="form-control" ng-model="unit.teaching_period_id">
              <option value="">Custom Period</option>
              <option ng-value="tp.id" value="{{tp.id}}" ng-repeat="tp in teachingPeriods.loadedPeriods">{{tp.period}}</option>
            </select>
          </div>
        </div><!--/teaching-period-date-->

        <div class="form-group">
          <label tooltip="Date for the start of teaching in the unit." class="col-sm-2 control-label" for="startdate">Start Date</label>
          <div class="col-sm-9">
            <div class="col-sm-4 input-group">
              <input datepicker-popup="yyyy-MM-dd" is-open="calOptions.startOpened" type="text" class="form-control" id="startdate" ng-model="unit.start_date" ng-required="true" placeholder="yyyy-MM-dd" close-text="Close" ng-if="!unit.teaching_period_id" />
              <input datepicker-popup="yyyy-MM-dd" is-open="calOptions.startOpened" type="text" class="form-control" id="startdate" ng-model="tp.start_date" ng-required="true" placeholder="yyyy-MM-dd" close-text="Close" ng-disabled="unit.teaching_period_id" ng-repeat="tp in teachingPeriods.loadedPeriods" ng-if="unit.teaching_period_id && tp.id == unit.teaching_period_id" />
              <span class="input-group-btn">
                <button class="btn btn-default" type="button" ng-click="open($event,'start')">
                  <i class="fa fa-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div><!--/start-date-->

        <div class="form-group">
          <label class="col-sm-2 control-label" for="enddate">End Date</label>
          <div class="col-sm-9">
            <div class="col-sm-4 input-group">
              <input datepicker-popup="{{format}}" id="enddate" type="text" class="form-control" ng-model="unit.end_date" is-open="calOptions.endOpened" ng-required="true" close-text="Close" ng-if="!unit.teaching_period_id" />
              <input datepicker-popup="{{format}}" id="enddate" type="text" class="form-control" ng-model="tp.end_date" is-open="calOptions.endOpened" ng-required="true" close-text="Close" ng-disabled="unit.teaching_period_id" ng-repeat="tp in teachingPeriods.loadedPeriods" ng-if="unit.teaching_period_id && tp.id == unit.teaching_period_id" />
              <span class="input-group-btn">
                <button class="btn btn-default" type="button" ng-click="open($event,'end')">
                  <i class="fa fa-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div><!--/end-date-->
      </div>
      <div class="panel-footer text-right">
        <input type="submit" value="Create Unit" class="btn btn-success" />
      </div>
    </form><commit_msg>FIX: Disable unit custom date button when Teaching Period<commit_after><div class="unit-dates-selector">
  <div class="panel panel-primary">
    <div class="panel-heading">
      <h3 class="panel-title">Create Unit</h3>
      Duplicate an existing unit by specifying the time period.
    </div>
    <form class="form-horizontal" role="form" name="rolloverUnitForm" ng-submit="saveUnit()">
      <div class="panel-body">
        <div class="form-group">
          <label class="col-sm-2 control-label" for="teachingperiod">Teaching Period</label>
          <div class="col-sm-9">
            <select class="form-control" ng-model="unit.teaching_period_id">
              <option value="">Custom Period</option>
              <option ng-value="tp.id" value="{{tp.id}}" ng-repeat="tp in teachingPeriods.loadedPeriods">{{tp.period}}</option>
            </select>
          </div>
        </div><!--/teaching-period-date-->

        <div class="form-group">
          <label tooltip="Date for the start of teaching in the unit." class="col-sm-2 control-label" for="startdate">Start Date</label>
          <div class="col-sm-9">
            <div class="col-sm-4 input-group">
              <input datepicker-popup="yyyy-MM-dd" is-open="calOptions.startOpened" type="text" class="form-control" id="startdate" ng-model="unit.start_date" ng-required="true" placeholder="yyyy-MM-dd" close-text="Close" ng-if="!unit.teaching_period_id" />
              <input datepicker-popup="yyyy-MM-dd" is-open="calOptions.startOpened" type="text" class="form-control" id="startdate" ng-model="tp.start_date" ng-required="true" placeholder="yyyy-MM-dd" close-text="Close" ng-disabled="unit.teaching_period_id" ng-repeat="tp in teachingPeriods.loadedPeriods" ng-if="unit.teaching_period_id && tp.id == unit.teaching_period_id" />
              <span class="input-group-btn">
                <button class="btn btn-default" type="button" ng-click="open($event,'start')" ng-disabled="unit.teaching_period_id">
                  <i class="fa fa-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div><!--/start-date-->

        <div class="form-group">
          <label class="col-sm-2 control-label" for="enddate">End Date</label>
          <div class="col-sm-9">
            <div class="col-sm-4 input-group">
              <input datepicker-popup="{{format}}" id="enddate" type="text" class="form-control" ng-model="unit.end_date" is-open="calOptions.endOpened" ng-required="true" close-text="Close" ng-if="!unit.teaching_period_id" />
              <input datepicker-popup="{{format}}" id="enddate" type="text" class="form-control" ng-model="tp.end_date" is-open="calOptions.endOpened" ng-required="true" close-text="Close" ng-disabled="unit.teaching_period_id" ng-repeat="tp in teachingPeriods.loadedPeriods" ng-if="unit.teaching_period_id && tp.id == unit.teaching_period_id" />
              <span class="input-group-btn">
                <button class="btn btn-default" type="button" ng-click="open($event,'end')" ng-disabled="unit.teaching_period_id">
                  <i class="fa fa-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div><!--/end-date-->
      </div>
      <div class="panel-footer text-right">
        <input type="submit" value="Create Unit" class="btn btn-success" />
      </div>
    </form>
{'fraction_non_alphanumeric': 0.1773039069490009, 'fraction_numerical': 0.0029824038174768863, 'mean_word_length': 2.8347627215551743, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, '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': '538458', 'n_tokens_mistral': 2087, 'n_tokens_neox': 2055, 'n_words': 369}