<commit_before>module Views exposing (view)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)

import Templates exposing (..)
import Markup exposing (view)
import Form exposing (view)
import InputOptions exposing (..)
import Messages exposing (..)
import Models exposing (..)
import HtmlTree exposing (..)
import FormModel exposing (..)

import InputToHtmlTreeConverter exposing (..)

view model =
  case currentlyEdditedInput model of
    Nothing ->
      formEdit model
    Just input ->
      inputEdit input

-------------
-- Private --
-------------

formEdit : Model -> Html Msg
formEdit model =
  let
    inputs = List.map inputToHtmlTree model.form
    htmlTree = HtmlTree.Element "form" [] (HtmlTree.Children inputs) ""
  in
    div
      []
      [ div
        [ class "row" ]
        [ div
           [ class "col-sm-8"]
           [ div [ class "bd-example" ] (Form.view htmlTree)
           , div [ class "highlight" ] [ Markup.view htmlTree] ]
        , div
           [ class "col-sm-4" ]
           Templates.view
        ]
      ]

inputEdit : Input -> Html Msg
inputEdit input =
  let
    inputs = [inputToHtmlTree input]
    htmlTree = HtmlTree.Element "form" [] (HtmlTree.Children inputs) ""
  in
    div
      []
      [ a [href "javascript:void(0)", onClick (FormMessage StopEditing)] [text "Back to form"]
      , div
          [ class "row"]
          [ div
             [ class "col-sm-8"]
             [ div [ class "bd-example" ] (Form.view htmlTree)
             , div [ class "highlight" ] [ Markup.view htmlTree ] ]
          , div
             [ class "col-sm-4" ]
             (InputOptions.view input)
          ]
      ]<commit_msg>Add some spaces<commit_after>module Views exposing (view)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)

import Templates exposing (..)
import Markup exposing (view)
import Form exposing (view)
import InputOptions exposing (..)
import Messages exposing (..)
import Models exposing (..)
import HtmlTree exposing (..)
import FormModel exposing (..)

import InputToHtmlTreeConverter exposing (..)

view model =
  case currentlyEdditedInput model of
    Nothing ->
      formEdit model
    Just input ->
      inputEdit input

-------------
-- Private --
-------------

formEdit : Model -> Html Msg
formEdit model =
  let
    inputs = List.map inputToHtmlTree model.form
    htmlTree = HtmlTree.Element "form" [] (HtmlTree.Children inputs) ""
  in
    div
      []
      [ div
        [ class "row" ]
        [ div
           [ class "col-sm-8" ]
           [ div [ class "bd-example" ] (Form.view htmlTree)
           , div [ class "highlight" ] [ Markup.view htmlTree ] ]
        , div
           [ class "col-sm-4" ]
           Templates.view
        ]
      ]

inputEdit : Input -> Html Msg
inputEdit input =
  let
    inputs = [inputToHtmlTree input]
    htmlTree = HtmlTree.Element "form" [] (HtmlTree.Children inputs) ""
  in
    div
      []
      [ a [ href "javascript:void(0)", onClick (FormMessage StopEditing) ] [text "Back to form" ]
      , div
          [ class "row" ]
          [ div
             [ class "col-sm-8" ]
             [ div [ class "bd-example" ] (Form.view htmlTree)
             , div [ class "highlight" ] [ Markup.view htmlTree ] ]
          , div
             [ class "col-sm-4" ]
             (InputOptions.view input)
          ]
      ]
{'fraction_non_alphanumeric': 0.12983988355167395, 'fraction_numerical': 0.002911208151382824, 'mean_word_length': 1.9168081494057725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1809100', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1012, 'n_words': 286}