Move NSFW button to the draft action bar.

This commit is contained in:
Nicolas Perriault 2017-05-18 23:23:44 +02:00
parent 310fc2705e
commit 6f09a341e4
No known key found for this signature in database
GPG Key ID: DA5E4C83904F7A2A
2 changed files with 26 additions and 18 deletions

View File

@ -143,10 +143,14 @@ li.load-more {
padding-top: 6px; padding-top: 6px;
} }
.btn-group-justified .btn,
.btn-group-justified .btn:focus {
outline: 0;
}
.btn-group-justified.column-menu .btn { .btn-group-justified.column-menu .btn {
border-radius: 0; border-radius: 0;
border-bottom: 0; border-bottom: 0;
outline: 0;
} }
.notification.reblog, .notification.reblog,
@ -403,13 +407,14 @@ li.load-more {
clear: both; clear: both;
} }
.charcount { .btn-nsfw {
cursor: default; font-size: 10px;
font-weight: bold;
line-height: 20px;
} }
.draft-actions .btn-group:nth-child(2) { .charcount {
width: .5%; cursor: default;
min-width: 30px;
} }
.in-reply-to .well { .in-reply-to .well {

View File

@ -256,24 +256,27 @@ draftView ({ draft, currentUser } as model) =
] ]
, visibilitySelector draft , visibilitySelector draft
, fileUploadField draft , fileUploadField draft
, div [ class "form-group checkbox" ]
[ label []
[ input
[ type_ "checkbox"
, onCheck <| DraftEvent << UpdateSensitive
, checked draft.sensitive
]
[]
, text " This post is NSFW"
]
]
, Common.justifiedButtonGroup "draft-actions" , Common.justifiedButtonGroup "draft-actions"
[ button [ button
[ type_ "button" [ type_ "button"
, class "btn btn-default" , class "btn btn-default"
, title "Clear this draft"
, onClick (DraftEvent ClearDraft) , onClick (DraftEvent ClearDraft)
] ]
[ text "Clear" ] [ Common.icon "trash" ]
, button
[ type_ "button"
, class <|
"btn btn-default btn-nsfw "
++ (if draft.sensitive then
"btn-primary active"
else
""
)
, title "Mark this post as Not Safe For Work (sensitive content)"
, onClick <| DraftEvent (UpdateSensitive (not draft.sensitive))
]
[ text "NSFW" ]
, div , div
[ class <| [ class <|
if limitExceeded then if limitExceeded then