diff --git a/modules/microsite/docs/doc/uploading.md b/modules/microsite/docs/doc/uploading.md index 44734958..a1955404 100644 --- a/modules/microsite/docs/doc/uploading.md +++ b/modules/microsite/docs/doc/uploading.md @@ -53,7 +53,7 @@ Example screenshot: This example shows a source with name "test". It defines two urls: -- `/app#/upload/` +- `/app/upload/` - `/api/v1/open/upload/item/` The first points to a web page where everyone could upload files into @@ -66,7 +66,7 @@ files (which is used by the first url). For example, this url can be used to upload files with curl: ``` bash -$ curl -XPOST -F file=@test.pdf http://localhost:7880/api/v1/open/upload/item/5DxhjkvWf9S-CkWqF3Kr892-WgoCspFWDo7-XBykwCyAUxQ +$ curl -XPOST -F file=@test.pdf http://localhost:7880/api/v1/open/upload/item/CqpFTb7UmGe-9nMVPZSmnwc-AHH6nWFh52t-M1JFQ9y7cdH {"success":true,"message":"Files submitted."} ``` @@ -126,5 +126,5 @@ uploading two files with meta data: curl -XPOST -F meta='{"multiple":false, "direction": "outgoing"}' \ -F file=@letter-en-source.pdf \ -F file=@letter-de-source.pdf \ - http://localhost:7880/api/v1/open/upload/item/5DxhjkvWf9S-CkWqF3Kr892-WgoCspFWDo7-XBykwCyAUxQ + http://localhost:7880/api/v1/open/upload/item/CqpFTb7UmGe-9nMVPZSmnwc-AHH6nWFh52t-M1JFQ9y7cdH ``` diff --git a/modules/microsite/src/main/resources/microsite/css/docspell.css b/modules/microsite/src/main/resources/microsite/css/docspell.css index 9b33b9bb..0a8b67b0 100644 --- a/modules/microsite/src/main/resources/microsite/css/docspell.css +++ b/modules/microsite/src/main/resources/microsite/css/docspell.css @@ -25,3 +25,7 @@ .docs h4 { text-decoration: underline; } + +.docs .thumbnail img { + width: 100%; +} diff --git a/modules/microsite/src/main/resources/microsite/img/sources-form.jpg b/modules/microsite/src/main/resources/microsite/img/sources-form.jpg index 685f0c0f..a4ab30ab 100644 Binary files a/modules/microsite/src/main/resources/microsite/img/sources-form.jpg and b/modules/microsite/src/main/resources/microsite/img/sources-form.jpg differ diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index 16a85cb0..50568f40 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -188,7 +188,7 @@ urlInfoMessage flags model = ] , p [] [ text "This source defines URLs that can be used by anyone to send files to " - , text "you. There is a web page that you can share or tha API url can be used " + , text "you. There is a web page that you can share or the API url can be used " , text "with other clients." ] , dl [ class "ui list" ] @@ -196,7 +196,7 @@ urlInfoMessage flags model = , dd [] [ let url = - flags.config.baseUrl ++ "/app#/upload/" ++ model.source.id + flags.config.baseUrl ++ "/app/upload/" ++ model.source.id in a [ href url, target "_blank" ] [ code [] [ text url ] ] ] diff --git a/modules/webapp/src/main/elm/Page.elm b/modules/webapp/src/main/elm/Page.elm index 12dafa24..f4839b47 100644 --- a/modules/webapp/src/main/elm/Page.elm +++ b/modules/webapp/src/main/elm/Page.elm @@ -139,44 +139,51 @@ pageToString : Page -> String pageToString page = case page of HomePage -> - "#/home" + "/app/home" LoginPage referer -> Maybe.map (\p -> "/" ++ p) referer |> Maybe.withDefault "" - |> (++) "#/login" + |> (++) "/app/login" ManageDataPage -> - "#/manageData" + "/app/managedata" CollectiveSettingPage -> - "#/collectiveSettings" + "/app/csettings" UserSettingPage -> - "#/userSettings" + "/app/usettings" QueuePage -> - "#/queue" + "/app/queue" RegisterPage -> - "#/register" + "/app/register" UploadPage sourceId -> Maybe.map (\id -> "/" ++ id) sourceId |> Maybe.withDefault "" - |> (++) "#/upload" + |> (++) "/app/upload" NewInvitePage -> - "#/newinvite" + "/app/newinvite" pageFromString : String -> Maybe Page pageFromString str = let + urlNormed = + if String.startsWith str "http" then + str + + else + "http://somehost" ++ str + url = - Url.Url Url.Http "" Nothing str Nothing Nothing + Url.fromString urlNormed in - Parser.parse parser url + Maybe.andThen (Parser.parse parser) url href : Page -> Attribute msg @@ -189,24 +196,28 @@ goto page = Nav.load (pageToString page) +pathPrefix : String +pathPrefix = + "app" + + parser : Parser (Page -> a) a parser = oneOf - [ Parser.map HomePage (oneOf [ s "", s "home" ]) - , Parser.map (\s -> LoginPage (Just s)) (s "login" string) - , Parser.map (LoginPage Nothing) (s "login") - , Parser.map ManageDataPage (s "manageData") - , Parser.map CollectiveSettingPage (s "collectiveSettings") - , Parser.map UserSettingPage (s "userSettings") - , Parser.map QueuePage (s "queue") - , Parser.map RegisterPage (s "register") - , Parser.map (\s -> UploadPage (Just s)) (s "upload" string) - , Parser.map (UploadPage Nothing) (s "upload") - , Parser.map NewInvitePage (s "newinvite") + [ Parser.map HomePage (oneOf [ Parser.top, s pathPrefix s "home" ]) + , Parser.map (\s -> LoginPage (Just s)) (s pathPrefix s "login" string) + , Parser.map (LoginPage Nothing) (s pathPrefix s "login") + , Parser.map ManageDataPage (s pathPrefix s "managedata") + , Parser.map CollectiveSettingPage (s pathPrefix s "csettings") + , Parser.map UserSettingPage (s pathPrefix s "usettings") + , Parser.map QueuePage (s pathPrefix s "queue") + , Parser.map RegisterPage (s pathPrefix s "register") + , Parser.map (\s -> UploadPage (Just s)) (s pathPrefix s "upload" string) + , Parser.map (UploadPage Nothing) (s pathPrefix s "upload") + , Parser.map NewInvitePage (s pathPrefix s "newinvite") ] fromUrl : Url -> Maybe Page fromUrl url = - { url | path = Maybe.withDefault "" url.fragment, fragment = Nothing } - |> Parser.parse parser + Parser.parse parser url