mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Update source form to specify folder
This commit is contained in:
@ -2,7 +2,7 @@ module Page.CollectiveSettings.Data exposing
|
||||
( Model
|
||||
, Msg(..)
|
||||
, Tab(..)
|
||||
, emptyModel
|
||||
, init
|
||||
)
|
||||
|
||||
import Api.Model.BasicResult exposing (BasicResult)
|
||||
@ -11,6 +11,7 @@ import Api.Model.ItemInsights exposing (ItemInsights)
|
||||
import Comp.CollectiveSettingsForm
|
||||
import Comp.SourceManage
|
||||
import Comp.UserManage
|
||||
import Data.Flags exposing (Flags)
|
||||
import Http
|
||||
|
||||
|
||||
@ -24,15 +25,21 @@ type alias Model =
|
||||
}
|
||||
|
||||
|
||||
emptyModel : Model
|
||||
emptyModel =
|
||||
{ currentTab = Just InsightsTab
|
||||
, sourceModel = Comp.SourceManage.emptyModel
|
||||
, userModel = Comp.UserManage.emptyModel
|
||||
, settingsModel = Comp.CollectiveSettingsForm.init Api.Model.CollectiveSettings.empty
|
||||
, insights = Api.Model.ItemInsights.empty
|
||||
, submitResult = Nothing
|
||||
}
|
||||
init : Flags -> ( Model, Cmd Msg )
|
||||
init flags =
|
||||
let
|
||||
( sm, sc ) =
|
||||
Comp.SourceManage.init flags
|
||||
in
|
||||
( { currentTab = Just InsightsTab
|
||||
, sourceModel = sm
|
||||
, userModel = Comp.UserManage.emptyModel
|
||||
, settingsModel = Comp.CollectiveSettingsForm.init Api.Model.CollectiveSettings.empty
|
||||
, insights = Api.Model.ItemInsights.empty
|
||||
, submitResult = Nothing
|
||||
}
|
||||
, Cmd.map SourceMsg sc
|
||||
)
|
||||
|
||||
|
||||
type Tab
|
||||
|
@ -59,7 +59,7 @@ view flags settings model =
|
||||
[ div [ class "" ]
|
||||
(case model.currentTab of
|
||||
Just SourceTab ->
|
||||
viewSources flags model
|
||||
viewSources flags settings model
|
||||
|
||||
Just UserTab ->
|
||||
viewUsers settings model
|
||||
@ -153,15 +153,15 @@ makeTagStats nc =
|
||||
]
|
||||
|
||||
|
||||
viewSources : Flags -> Model -> List (Html Msg)
|
||||
viewSources flags model =
|
||||
viewSources : Flags -> UiSettings -> Model -> List (Html Msg)
|
||||
viewSources flags settings model =
|
||||
[ h2 [ class "ui header" ]
|
||||
[ i [ class "ui upload icon" ] []
|
||||
, div [ class "content" ]
|
||||
[ text "Sources"
|
||||
]
|
||||
]
|
||||
, Html.map SourceMsg (Comp.SourceManage.view flags model.sourceModel)
|
||||
, Html.map SourceMsg (Comp.SourceManage.view flags settings model.sourceModel)
|
||||
]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user