From bd73214219b78bbb723d753a0290a6a93cdbd5eb Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sat, 19 Sep 2015 13:53:50 +0200 Subject: [PATCH] Use Bootstrap media objects for posts --- app/assets/stylesheets/_application.scss | 1 - app/assets/stylesheets/comments.scss | 5 +- app/assets/stylesheets/media-box.scss | 17 ---- app/assets/stylesheets/single-post-view.scss | 3 - app/assets/stylesheets/stream_element.scss | 57 ++++++------ .../templates/comment-stream_tpl.jst.hbs | 14 +-- app/assets/templates/comment_tpl.jst.hbs | 6 +- app/assets/templates/likes-info_tpl.jst.hbs | 30 +++---- app/assets/templates/photo_tpl.jst.hbs | 48 +++++----- app/assets/templates/reshare_tpl.jst.hbs | 10 ++- .../single-post-content_tpl.jst.hbs | 90 ++++++++++--------- .../templates/stream-element_tpl.jst.hbs | 14 +-- 12 files changed, 135 insertions(+), 160 deletions(-) delete mode 100644 app/assets/stylesheets/media-box.scss diff --git a/app/assets/stylesheets/_application.scss b/app/assets/stylesheets/_application.scss index 38302959e..de61d106f 100644 --- a/app/assets/stylesheets/_application.scss +++ b/app/assets/stylesheets/_application.scss @@ -6,7 +6,6 @@ /* core */ -@import 'media-box'; @import 'entypo'; @import 'icons'; @import 'mentions'; diff --git a/app/assets/stylesheets/comments.scss b/app/assets/stylesheets/comments.scss index 67a654a93..5de2c2f43 100644 --- a/app/assets/stylesheets/comments.scss +++ b/app/assets/stylesheets/comments.scss @@ -1,12 +1,11 @@ .comment_stream { .show_comments { - margin-top: 5px; border-top: 1px solid $border-grey; + padding: 10px; a { color: $text-grey; font-size: 13px; } - .media { margin-top: 10px; } } .comments > .comment, .comment.new_comment_form_wrapper { .avatar { @@ -34,11 +33,9 @@ float: right; } padding-left: 12px; - width: 95%; display: none; } .comment_box { - width: 95%; height: 35px; resize: none; } diff --git a/app/assets/stylesheets/media-box.scss b/app/assets/stylesheets/media-box.scss deleted file mode 100644 index 2c11626d9..000000000 --- a/app/assets/stylesheets/media-box.scss +++ /dev/null @@ -1,17 +0,0 @@ -.media { margin: 10px; } - -.media, -.bd { - overflow: hidden; - _overflow: visible; - zoom: 1; -} - -.media .img { - float: left; - margin-right: 10px; -} - -.media .img img { display: block } -.media .imgEt { float: right; margin-left: 10px; } - diff --git a/app/assets/stylesheets/single-post-view.scss b/app/assets/stylesheets/single-post-view.scss index 0166d1802..79e41ec73 100644 --- a/app/assets/stylesheets/single-post-view.scss +++ b/app/assets/stylesheets/single-post-view.scss @@ -19,9 +19,6 @@ line-height: $font-size-base; } } - .bd { - padding-left: 10px; - } } .near-from { color: $text-grey; diff --git a/app/assets/stylesheets/stream_element.scss b/app/assets/stylesheets/stream_element.scss index 2449a3c47..eb2eb9a7b 100644 --- a/app/assets/stylesheets/stream_element.scss +++ b/app/assets/stylesheets/stream_element.scss @@ -1,8 +1,5 @@ #main_stream .stream_element, #main_stream > div > .photo { - & > .media { - margin: 0px; - } &.deleting { > .media { opacity: 0.3; } .control-icons { display: none !important; } @@ -11,48 +8,43 @@ #main_stream > div > .photo { & > .media { - overflow: visible; - > .bd { - position: relative; - overflow: inherit; - > .control-icons { - border-radius: 4px; - padding-left: 5px; - position: absolute; - right: 6px; - text-align: center; - top: 1px; - } + background: $white; + box-shadow: $card-shadow; + margin: 0 0 15px; + padding: 10px; + > .control-icons { + border-radius: 4px; + padding-left: 5px; + position: absolute; + right: 20px; + text-align: center; + top: 1px; } - &:hover > .bd > .control-icons { background: $white; } + &:hover > .control-icons { background: $white; } } .thumbnail { - padding: 10px; - margin: 0 0 15px; - background: $white; + border: none; border-radius: 0; - box-shadow: $card-shadow; + margin: 0; + padding: 0; img.big_photo { max-height: 200px; } } } #main_stream .stream_element { - padding: 10px; - margin-bottom: 20px; background-color: $white; border: 1px solid $light-grey; box-shadow: $card-shadow; + margin-bottom: 20px; + padding: 10px; & > .media { &.shield-active .nsfw-hidden { display: none; } &:not(.shield-active) .nsfw-shield { display: none; } &:not(.shield-off) .nsfw-off { display: none; } - & > .img > .avatar { - margin-top: 5px; - &.small { - height: 50px; - width: 50px; - } + > .media-object .avatar.small { + height: 50px; + width: 50px; } .author-name { font-weight: bold; @@ -66,10 +58,10 @@ line-height: $font-size-small; } .likes { - margin-top: 10px; + margin: 10px; font-size: 12px; line-height: 16px; - .author-name, .bd { display: inline-block; } + .author-name { display: inline-block; } .author-name { margin-right: 3px; } .entypo-heart { display: inline-block; @@ -78,6 +70,7 @@ margin-top: -2px; margin-right: 5px; } + .media-left { padding-right: 0; } } .stream_photo { float: left; @@ -103,10 +96,10 @@ div.reshare { border-left: 2px solid $border-grey; - margin-top: 3px; + padding-left: 10px; & > .media .avatar { - margin-top: 5px; + margin-top: 3px; height: 30px; width: 30px; } diff --git a/app/assets/templates/comment-stream_tpl.jst.hbs b/app/assets/templates/comment-stream_tpl.jst.hbs index ac8f118e4..2a05ae017 100644 --- a/app/assets/templates/comment-stream_tpl.jst.hbs +++ b/app/assets/templates/comment-stream_tpl.jst.hbs @@ -12,13 +12,15 @@ {{#if loggedIn}}