<commit_before>module Folders.List exposing (..)

import Html exposing (..)
import Html.Attributes exposing (class, href)
import Models exposing (Folder)
import Msgs exposing (Msg)
import Numeral exposing (format)
import RemoteData exposing (WebData)


view : WebData (List Folder) -> Html Msg
view response =
    div []
        [ maybeList response
        ]


maybeList : WebData (List Folder) -> Html Msg
maybeList response =
    case response of
        RemoteData.NotAsked ->
            text ""

        RemoteData.Loading ->
            text "Loading..."

        RemoteData.Success folders ->
            list folders

        RemoteData.Failure error ->
            text (toString error)


list : List Folder -> Html Msg
list folders =
    div [ class "grid-outer" ]
        [ headerRow
        , folderBody folders
        ]


headerRow : Html Msg
headerRow =
    div [ class "mdl-grid headers" ]
        [ div [ class "mdl-cell mdl-cell--2-col" ] [ text "Id" ]
        , div [ class "mdl-cell mdl-cell--8-col" ] [ text "Path" ]
        , div [ class "mdl-cell mdl-cell--2-col" ] [ text "Number of Worlds" ]
        ]


folderBody : List Folder -> Html Msg
folderBody folders =
    div [ class "grid-body" ] (List.map folderRow folders)


folderRow : Folder -> Html Msg
folderRow folder =
    div [ class "mdl-grid" ]
        [ div [ class "mdl-cell mdl-cell--2-col" ] [ text folder.id ]
        , div [ class "mdl-cell mdl-cell--8-col" ] [ text folder.path ]
        , div [ class "mdl-cell mdl-cell--2-col" ] [ text (format "0,0" (toFloat folder.numberOfWorlds)) ]
        ]<commit_msg>Got the last run working<commit_after>module Folders.List exposing (..)

import Html exposing (..)
import Html.Attributes exposing (class, href)
import Models exposing (Folder)
import Msgs exposing (Msg)
import Numeral exposing (format)
import RemoteData exposing (WebData)
import Time.DateTime as DateTime exposing (DateTime)


view : WebData (List Folder) -> Html Msg
view response =
    div []
        [ maybeList response
        ]


maybeList : WebData (List Folder) -> Html Msg
maybeList response =
    case response of
        RemoteData.NotAsked ->
            text ""

        RemoteData.Loading ->
            text "Loading..."

        RemoteData.Success folders ->
            list folders

        RemoteData.Failure error ->
            text (toString error)


list : List Folder -> Html Msg
list folders =
    div [ class "grid-outer" ]
        [ headerRow
        , folderBody folders
        ]


headerRow : Html Msg
headerRow =
    div [ class "mdl-grid headers" ]
        [ div [ class "mdl-cell mdl-cell--2-col" ] [ text "Id" ]
        , div [ class "mdl-cell mdl-cell--2-col" ] [ text "Last Run" ]
        , div [ class "mdl-cell mdl-cell--6-col" ] [ text "Path" ]
        , div [ class "mdl-cell mdl-cell--2-col" ] [ text "Number of Worlds" ]
        ]


folderBody : List Folder -> Html Msg
folderBody folders =
    div [ class "grid-body" ] (List.map folderRow folders)


folderRow : Folder -> Html Msg
folderRow folder =
    div [ class "mdl-grid" ]
        [ div [ class "mdl-cell mdl-cell--2-col" ] [ text folder.id ]
        , div [ class "mdl-cell mdl-cell--2-col" ] [ text (DateTime.toISO8601 folder.lastRun) ]
        , div [ class "mdl-cell mdl-cell--6-col" ] [ text folder.path ]
        , div [ class "mdl-cell mdl-cell--2-col" ] [ text (format "0,0" (toFloat folder.numberOfWorlds)) ]
        ]
{'fraction_non_alphanumeric': 0.12109716953603734, 'fraction_numerical': 0.006419608987452583, 'mean_word_length': 2.2218045112781954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '212310', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1078, 'n_words': 318}