<commit_before>-@ val errors: List[io.backchat.oauth2.model.ValidationError] = Nil
-@ val profiles: Seq[(String, String)] = Nil
-@ val authTypes: Seq[(String, String)] = Nil
-@ val profile: String = params.get("profile").getOrElse("")
-@ val displayName: String = params.get("display_name").getOrElse("")
-@ val authType: String = params.get("auth_type").getOrElse("code_and_token")
-@ val scope: List[String] = multiParams("scope")
-@ val redirectUri: String = params.get("redirect_uri").getOrElse("")
-@ val link: String = params.get("link").getOrElse(link)
 
- render("../shared/validation_errors.jade", Map("errors" -> errors))

form.form-horizontal(method="post" action="/")
  fieldset
    legend Create a new client
    div{:class => {if (errors.exists(_.field == "profile")) "error control-group" else "control-group"} }
      label.control-label(for="profile") Profile:
      div.controls
        select#profile(name="profile")
          option{:value => "", :selected => {if (profile == null || profile.isEmpty) "selected" else ""} }
          - profiles foreach
            - prof =>
              - if (profile == prof._1)
                option(value="#{prof._1}" selected )= prof._2
              - else
                option(value="#{prof._1}" )= prof._2
    div{:class => {if (errors.exists(_.field == "display_name")) "error control-group" else "control-group"} }
      label.control-label(for="display_name") Display name:
      div.controls
        input#display_name(name="display_name" type="text" value=displayName placeholder="Name" )
    div{:class => {if (errors.exists(_.field == "display_name")) "error control-group" else "control-group"} }
      label.control-label(for="auth_type") Authorization type:
      div.controls
        input#auth_type(name="auth_type" type="text" value=authType.toString placeholder="Name" )
    div{:class => {if (errors.exists(_.field == "display_name")) "error control-group" else "control-group"} }
      label.control-label(for="display_name") Scope:
      div.controls
        input#profile(name="display_name" type="text" value=displayName placeholder="Name" )
    div{:class => {if (errors.exists(_.field == "redirect_uri")) "error control-group" else "control-group"} }
      label.control-label(for="redirect_uri") Redirect url:
      div.controls
        input#redirect_uri(name="redirect_uri" type="text" value=redirectUri placeholder="Redirect url" )
    div{:class => {if (errors.exists(_.field == "link")) "error control-group" else "control-group"} }
      label.control-label(for="link") Link:
      div.controls
        input#link(name="link" type="text" value=link placeholder="Link" )
    div.form-actions
      button.btn.btn-primary(type="submit") Create
      button.btn(type="reset") Cancel
<commit_msg>a few tweaks<commit_after>-@ val errors: List[io.backchat.oauth2.model.ValidationError] = Nil
-@ val profiles: Seq[(String, String)] = Nil
-@ val authTypes: Seq[(String, String)] = Nil
-@ val profile: String = params.get("profile").getOrElse("")
-@ val displayName: String = params.get("display_name").getOrElse("")
-@ val authType: String = params.get("auth_type").getOrElse("code_and_token")
-@ val scope: List[String] = multiParams("scope")
-@ val redirectUri: String = params.get("redirect_uri").getOrElse("")
-@ val link: String = params.get("link").getOrElse(link)

- render("../shared/validation_errors.jade", Map("errors" -> errors))

form.form-horizontal{:method => "post", :action=>{""+params.get("id").getOrElse("")}}
  fieldset
    legend Create a new client
    div{:class => {if (errors.exists(_.field == "profile")) "error control-group" else "control-group"} }
      label.control-label(for="profile") Profile:
      div.controls
        select#profile(name="profile")
          option{:value => "", :selected => {if (profile == null || profile.isEmpty) "selected" else ""} }
          - profiles foreach
            - prof =>
              - if (profile == prof._1)
                option(value="#{prof._1}" selected )= prof._2
              - else
                option(value="#{prof._1}" )= prof._2
    div{:class => {if (errors.exists(_.field == "display_name")) "error control-group" else "control-group"} }
      label.control-label(for="display_name") Display name:
      div.controls
        input#display_name(name="display_name" type="text" value=displayName placeholder="Name" )
    div{:class => {if (errors.exists(_.field == "auth_type")) "error control-group" else "control-group"} }
      label.control-label(for="auth_type") Authorization type:
      div.controls
        input#auth_type(name="auth_type" type="text" value=authType.toString placeholder="Name" )
    div{:class => {if (errors.exists(_.field == "scope")) "error control-group" else "control-group"} }
      label.control-label(for="scope") Scope:
      div.controls
        input#scope(name="scope" type="text" value=scope.mkString(", ") placeholder="Scope" )
    div{:class => {if (errors.exists(_.field == "redirect_uri")) "error control-group" else "control-group"} }
      label.control-label(for="redirect_uri") Redirect url:
      div.controls
        input#redirect_uri(name="redirect_uri" type="text" value=redirectUri placeholder="Redirect url" )
    div{:class => {if (errors.exists(_.field == "link")) "error control-group" else "control-group"} }
      label.control-label(for="link") Link:
      div.controls
        input#link(name="link" type="text" value=link placeholder="Link" )
    div.form-actions
      button.btn.btn-primary(type="submit") Create
      button.btn(type="reset") Cancel

{'fraction_non_alphanumeric': 0.173734120594024, 'fraction_numerical': 0.0021470746108427268, 'mean_word_length': 3.823123382226057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '1368587', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1683, 'n_words': 335}