<commit_before><?hh

class SettingsController extends BaseController {
  public static function getPath(): string {
    return '/settings';
  }

  public static function getConfig(): ControllerConfig {
    return (new ControllerConfig())
      ->setUserRoles(array(UserRole::Superuser));
  }

  public static function get(): :xhp {
    $applications_open = Settings::get('applications_open');
    return
      <div class="col-md-6 col-md-offset-3">
        <div class="panel panel-default">
          <div class="panel-body">
            <form class="form" action="/settings" method="post">
              <div class="form-group">
                <div class="checkbox">
                  <label>
                    <input type="checkbox" name="applications_disabled" checked={!$applications_open}/> Disable Applications
                  </label>
                </div>
              </div>
              <div class="form-group">
                <button type="submit" class="btn btn-primary">Save</button>
              </div>
            </form>
          </div>
        </div>
      </div>;
  }

  public static function post(): void {
    if(isset($_POST['applications_disabled'])) {
      Settings::set('applications_open', false);
    } else {
      Settings::set('applications_open', true);
    }

    Route::redirect('/settings');
  }
}<commit_msg>Move things around on the settings controller<commit_after><?hh

class SettingsController extends BaseController {
  public static function getPath(): string {
    return '/settings';
  }

  public static function getConfig(): ControllerConfig {
    return (new ControllerConfig())
      ->setUserRoles(array(UserRole::Superuser));
  }

  public static function get(): :xhp {
    $applications_open = Settings::get('applications_open');
    return
      <div class="col-md-6 col-md-offset-3">
        <form class="form" action="/settings" method="post">
          <div class="panel panel-default">
            <div class="panel-body">
                <div class="form-group">
                  <div class="checkbox">
                    <label>
                      <input type="checkbox" name="applications_disabled" checked={!$applications_open}/> Disable Applications
                    </label>
                  </div>
                </div>
            </div>
          </div>
          <button type="submit" class="btn btn-primary pull-right">Save</button>
        </form>
      </div>;
  }

  public static function post(): void {
    if(isset($_POST['applications_disabled'])) {
      Settings::set('applications_open', false);
    } else {
      Settings::set('applications_open', true);
    }

    Route::redirect('/settings');
  }
}
{'fraction_non_alphanumeric': 0.14142910033320993, 'fraction_numerical': 0.001480932987782303, 'mean_word_length': 2.287104622871046, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '1345693', 'n_tokens_mistral': 728, 'n_tokens_neox': 705, 'n_words': 160}