From 84caff7c97ceb13c9be80f60d743caeeee817149 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Wed, 16 May 2018 17:43:01 +0100 Subject: [PATCH] Adds global reply button to postlist. --- redesign/nimforum.scss | 49 +++++++++++++++++++++++++++++------------- redesign/postlist.nim | 7 ++++++ 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/redesign/nimforum.scss b/redesign/nimforum.scss index 45b8018..fe4bb53 100644 --- a/redesign/nimforum.scss +++ b/redesign/nimforum.scss @@ -91,25 +91,29 @@ $logo-height: $navbar-height - 20px; } // - Main buttons +.btn-secondary { + background: $secondary-btn-color; + border-color: darken($secondary-btn-color, 5%); + color: invert($secondary-btn-color); + + margin-right: $control-padding-x*2; + + &:hover, &:focus { + background: darken($secondary-btn-color, 5%); + border-color: darken($secondary-btn-color, 10%); + } + + &:focus { + @include control-shadow(darken($secondary-btn-color, 40%)); + } +} + #main-buttons { margin-top: $control-padding-y*2; margin-bottom: $control-padding-y*2; - .dropdown > .btn, .btn-secondary { - background: $secondary-btn-color; - border-color: darken($secondary-btn-color, 5%); - color: invert($secondary-btn-color); - - margin-right: $control-padding-x*2; - - &:hover, &:focus { - background: darken($secondary-btn-color, 5%); - border-color: darken($secondary-btn-color, 10%); - } - - &:focus { - @include control-shadow(darken($secondary-btn-color, 40%)); - } + .dropdown > .btn { + @extend .btn-secondary; } } @@ -244,6 +248,8 @@ $views-color: #545d70; @extend .container; margin: 0; padding: 0; + + margin-bottom: 10rem; // Just some empty space at the bottom. } .post { @@ -336,6 +342,19 @@ $views-color: #545d70; } } +#thread-buttons { + border-top: 1px solid $border-color; + width: 100%; + padding-top: $control-padding-y; + padding-bottom: $control-padding-y; + @extend .clearfix; + + .btn { + float: right; + margin-right: 0; + } +} + blockquote { border-left: 0.2rem solid darken($bg-color, 10%); background-color: $bg-color; diff --git a/redesign/postlist.nim b/redesign/postlist.nim index 5f90fd8..824aa94 100644 --- a/redesign/postlist.nim +++ b/redesign/postlist.nim @@ -249,4 +249,11 @@ when defined(js): if prevPost.isSome: genTimePassed(prevPost.get(), none[Post](), true) + tdiv(id="thread-buttons"): + button(class="btn btn-secondary", + onClick=(e: Event, n: VNode) => + onReplyClick(e, n, none[Post]())): + italic(class="fas fa-reply") + text " Reply" + render(state.replyBox, list.thread, state.replyingTo, false) \ No newline at end of file