1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 18:17:03 +00:00

ui: Make the error flash look nice

This commit is contained in:
James Hillyerd
2018-12-15 21:17:37 -08:00
parent af3ed04100
commit ffaf296faa
3 changed files with 21 additions and 8 deletions

View File

@@ -63,8 +63,8 @@ errorFlash error =
{ flash { flash
| table = | table =
flash.table flash.table
++ [ ( "Method", error.request.method ) ++ [ ( "Request URL", error.request.url )
, ( "URL", error.request.url ) , ( "HTTP Method", error.request.method )
] ]
} }
in in
@@ -92,7 +92,7 @@ errorFlash error =
Http.BadBody body -> Http.BadBody body ->
{ title = "Bad HTTP body" { title = "Bad HTTP body"
, table = [ ( "Body", body ) ] , table = [ ( "Error", body ) ]
} }

View File

@@ -90,10 +90,9 @@ errorFlash : FrameControls msg -> Maybe Session.Flash -> Html msg
errorFlash controls maybeFlash = errorFlash controls maybeFlash =
let let
row ( heading, message ) = row ( heading, message ) =
pre [] tr []
[ text heading [ th [] [ text (heading ++ ":") ]
, text ": " , td [] [ pre [] [ text message ] ]
, text message
] ]
in in
case maybeFlash of case maybeFlash of

View File

@@ -136,13 +136,18 @@ h1 {
font-weight: 500; font-weight: 500;
} }
h2 {
font-size: 16px;
font-weight: 700;
}
.error { .error {
background-color: #f58080; background-color: #f58080;
background-image: linear-gradient(to bottom, #e86060 0, #f58080 100%); background-image: linear-gradient(to bottom, #e86060 0, #f58080 100%);
border: 1px solid #e86060; border: 1px solid #e86060;
border-radius: 4px; border-radius: 4px;
box-shadow: 0 1px 2px rgba(0,0,0,.05); box-shadow: 0 1px 2px rgba(0,0,0,.05);
padding: 4px 10px; padding: 6px 10px;
margin: 20px 0; margin: 20px 0;
} }
@@ -155,13 +160,22 @@ h1 {
text-decoration: underline; text-decoration: underline;
} }
.error th {
padding-right: 5px;
text-align: left;
white-space: nowrap;
}
.flash-header { .flash-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.flash-table { .flash-table {
border-left: 4px solid rgba(0,0,0,0.2);
overflow: auto; overflow: auto;
padding-bottom: 4px;
padding-left: 4px;
} }
.greeting { .greeting {