Remove old ui code in frontend

This commit is contained in:
Eike Kettner
2021-03-09 20:16:05 +01:00
parent ee694dc719
commit b95338e744
90 changed files with 50 additions and 11038 deletions

View File

@@ -4,7 +4,6 @@ module Comp.CollectiveSettingsForm exposing
, getSettings
, init
, update
, view
, view2
)
@@ -198,148 +197,6 @@ update flags msg model =
--- View
view : Flags -> UiSettings -> Model -> Html Msg
view flags settings model =
div
[ classList
[ ( "ui form error success", True )
, ( "error", Maybe.map .success model.fullTextReIndexResult == Just False )
, ( "success", Maybe.map .success model.fullTextReIndexResult == Just True )
]
]
[ h3 [ class "ui dividing header" ]
[ text "Document Language"
]
, div [ class "field" ]
[ label [] [ text "Document Language" ]
, Html.map LangDropdownMsg (Comp.Dropdown.view settings model.langModel)
, span [ class "small-info" ]
[ text "The language of your documents. This helps text recognition (OCR) and text analysis."
]
]
, h3
[ classList
[ ( "ui dividing header", True )
, ( "invisible hidden", not flags.config.integrationEnabled )
]
]
[ text "Integration Endpoint"
]
, div
[ classList
[ ( "field", True )
, ( "invisible hidden", not flags.config.integrationEnabled )
]
]
[ div [ class "ui checkbox" ]
[ input
[ type_ "checkbox"
, onCheck (\_ -> ToggleIntegrationEndpoint)
, checked model.intEnabled
]
[]
, label [] [ text "Enable integration endpoint" ]
, span [ class "small-info" ]
[ text "The integration endpoint allows (local) applications to submit files. "
, text "You can choose to disable it for your collective."
]
]
]
, h3
[ classList
[ ( "ui dividing header", True )
, ( "invisible hidden", not flags.config.fullTextSearchEnabled )
]
]
[ text "Full-Text Search"
]
, div
[ classList
[ ( "inline field", True )
, ( "invisible hidden", not flags.config.fullTextSearchEnabled )
]
]
[ div [ class "ui action input" ]
[ input
[ type_ "text"
, value model.fullTextConfirmText
, onInput SetFullTextConfirm
]
[]
, button
[ class "ui primary right labeled icon button"
, onClick TriggerReIndex
]
[ i [ class "refresh icon" ] []
, text "Re-Index All Data"
]
]
, div [ class "small-info" ]
[ text "This starts a task that clears the full-text index and re-indexes all your data again."
, text "You must type OK before clicking the button to avoid accidental re-indexing."
]
, renderResultMessage model.fullTextReIndexResult
]
, h3
[ classList
[ ( "ui dividing header", True )
, ( "invisible hidden", not flags.config.showClassificationSettings )
]
]
[ text "Auto-Tagging"
]
, div
[ classList
[ ( "field", True )
, ( "invisible hidden", not flags.config.showClassificationSettings )
]
]
[ Html.map ClassifierSettingMsg
(Comp.ClassifierSettingsForm.view settings model.classifierModel)
, div [ class "ui vertical segment" ]
[ button
[ class "ui small secondary basic button"
, title "Starts a task to train a classifier"
, onClick StartClassifierTask
]
[ text "Start now"
]
, renderResultMessage model.startClassifierResult
]
]
, div [ class "ui divider" ] []
, button
[ classList
[ ( "ui primary button", True )
, ( "disabled", getSettings model |> Data.Validated.isInvalid )
]
, onClick SaveSettings
]
[ text "Save"
]
]
renderResultMessage : Maybe BasicResult -> Html msg
renderResultMessage result =
div
[ classList
[ ( "ui message", True )
, ( "error", Maybe.map .success result == Just False )
, ( "success", Maybe.map .success result == Just True )
, ( "hidden invisible", result == Nothing )
]
]
[ Maybe.map .message result
|> Maybe.withDefault ""
|> text
]
--- View2