Use Bootstrap media objects for posts

This commit is contained in:
Steffen van Bergerem 2015-09-19 13:53:50 +02:00
parent b40d5362cf
commit bd73214219
12 changed files with 135 additions and 160 deletions

View file

@ -6,7 +6,6 @@
/* core */ /* core */
@import 'media-box';
@import 'entypo'; @import 'entypo';
@import 'icons'; @import 'icons';
@import 'mentions'; @import 'mentions';

View file

@ -1,12 +1,11 @@
.comment_stream { .comment_stream {
.show_comments { .show_comments {
margin-top: 5px;
border-top: 1px solid $border-grey; border-top: 1px solid $border-grey;
padding: 10px;
a { a {
color: $text-grey; color: $text-grey;
font-size: 13px; font-size: 13px;
} }
.media { margin-top: 10px; }
} }
.comments > .comment, .comment.new_comment_form_wrapper { .comments > .comment, .comment.new_comment_form_wrapper {
.avatar { .avatar {
@ -34,11 +33,9 @@
float: right; float: right;
} }
padding-left: 12px; padding-left: 12px;
width: 95%;
display: none; display: none;
} }
.comment_box { .comment_box {
width: 95%;
height: 35px; height: 35px;
resize: none; resize: none;
} }

View file

@ -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; }

View file

@ -19,9 +19,6 @@
line-height: $font-size-base; line-height: $font-size-base;
} }
} }
.bd {
padding-left: 10px;
}
} }
.near-from { .near-from {
color: $text-grey; color: $text-grey;

View file

@ -1,8 +1,5 @@
#main_stream .stream_element, #main_stream .stream_element,
#main_stream > div > .photo { #main_stream > div > .photo {
& > .media {
margin: 0px;
}
&.deleting { &.deleting {
> .media { opacity: 0.3; } > .media { opacity: 0.3; }
.control-icons { display: none !important; } .control-icons { display: none !important; }
@ -11,48 +8,43 @@
#main_stream > div > .photo { #main_stream > div > .photo {
& > .media { & > .media {
overflow: visible; background: $white;
> .bd { box-shadow: $card-shadow;
position: relative; margin: 0 0 15px;
overflow: inherit; padding: 10px;
> .control-icons { > .control-icons {
border-radius: 4px; border-radius: 4px;
padding-left: 5px; padding-left: 5px;
position: absolute; position: absolute;
right: 6px; right: 20px;
text-align: center; text-align: center;
top: 1px; top: 1px;
}
} }
&:hover > .bd > .control-icons { background: $white; } &:hover > .control-icons { background: $white; }
} }
.thumbnail { .thumbnail {
padding: 10px; border: none;
margin: 0 0 15px;
background: $white;
border-radius: 0; border-radius: 0;
box-shadow: $card-shadow; margin: 0;
padding: 0;
img.big_photo { max-height: 200px; } img.big_photo { max-height: 200px; }
} }
} }
#main_stream .stream_element { #main_stream .stream_element {
padding: 10px;
margin-bottom: 20px;
background-color: $white; background-color: $white;
border: 1px solid $light-grey; border: 1px solid $light-grey;
box-shadow: $card-shadow; box-shadow: $card-shadow;
margin-bottom: 20px;
padding: 10px;
& > .media { & > .media {
&.shield-active .nsfw-hidden { display: none; } &.shield-active .nsfw-hidden { display: none; }
&:not(.shield-active) .nsfw-shield { display: none; } &:not(.shield-active) .nsfw-shield { display: none; }
&:not(.shield-off) .nsfw-off { display: none; } &:not(.shield-off) .nsfw-off { display: none; }
& > .img > .avatar { > .media-object .avatar.small {
margin-top: 5px; height: 50px;
&.small { width: 50px;
height: 50px;
width: 50px;
}
} }
.author-name { .author-name {
font-weight: bold; font-weight: bold;
@ -66,10 +58,10 @@
line-height: $font-size-small; line-height: $font-size-small;
} }
.likes { .likes {
margin-top: 10px; margin: 10px;
font-size: 12px; font-size: 12px;
line-height: 16px; line-height: 16px;
.author-name, .bd { display: inline-block; } .author-name { display: inline-block; }
.author-name { margin-right: 3px; } .author-name { margin-right: 3px; }
.entypo-heart { .entypo-heart {
display: inline-block; display: inline-block;
@ -78,6 +70,7 @@
margin-top: -2px; margin-top: -2px;
margin-right: 5px; margin-right: 5px;
} }
.media-left { padding-right: 0; }
} }
.stream_photo { .stream_photo {
float: left; float: left;
@ -103,10 +96,10 @@
div.reshare { div.reshare {
border-left: 2px solid $border-grey; border-left: 2px solid $border-grey;
margin-top: 3px; padding-left: 10px;
& > .media .avatar { & > .media .avatar {
margin-top: 5px; margin-top: 3px;
height: 30px; height: 30px;
width: 30px; width: 30px;
} }

View file

@ -12,13 +12,15 @@
{{#if loggedIn}} {{#if loggedIn}}
<div class="comment media new_comment_form_wrapper {{#unless commentsCount}} hidden {{/unless}}"> <div class="comment media new_comment_form_wrapper {{#unless commentsCount}} hidden {{/unless}}">
{{#with current_user}} <div class="media-object media-left">
<a href="/people/{{guid}}" class="img"> {{#with current_user}}
{{{personImage this}}} <a href="/people/{{guid}}">
</a> {{{personImage this}}}
{{/with}} </a>
{{/with}}
</div>
<div class="bd"> <div class="media-body">
<form accept-charset="UTF-8" action="/posts/{{id}}/comments" class="new_comment" id="new_comment_on_{{id}}" method="post"> <form accept-charset="UTF-8" action="/posts/{{id}}/comments" class="new_comment" id="new_comment_on_{{id}}" method="post">
<textarea class="comment_box form-control" id="comment_text_on_{{id}}" name="text" rows="1" required placeholder="{{t "stream.comment"}}" /> <textarea class="comment_box form-control" id="comment_text_on_{{id}}" name="text" rows="1" required placeholder="{{t "stream.comment"}}" />
<div class="submit_button"> <div class="submit_button">

View file

@ -1,11 +1,11 @@
<div id="{{guid}}"> <div id="{{guid}}" class="media">
<div class="img"> <div class="media-object media-left">
{{#linkToAuthor author}} {{#linkToAuthor author}}
{{{personImage this "small" "small"}}} {{{personImage this "small" "small"}}}
{{/linkToAuthor}} {{/linkToAuthor}}
</div> </div>
<div class="bd"> <div class="media-body">
<div class="control-icons"> <div class="control-icons">
{{#if loggedIn}} {{#if loggedIn}}
{{#if canRemove}} {{#if canRemove}}

View file

@ -1,23 +1,23 @@
{{#if likesCount}} {{#if likesCount}}
<div class="comment"> <div class="media">
<div class="media"> <div class="media-object media-left">
<i class="entypo-heart"></i> <i class="entypo-heart"></i>
</div>
<div class="bd"> <div class="media-body">
{{#unless likes_fetched}} {{#unless likes_fetched}}
<a href="#" class="expand_likes grey"> <a href="#" class="expand_likes grey">
{{t "stream.likes" count=likesCount}} {{t "stream.likes" count=likesCount}}
</a> </a>
{{else}} {{else}}
{{#each likes}} {{#each likes}}
{{#linkToAuthor author}} {{#linkToAuthor author}}
{{{personImage this 'small' 'micro'}}} {{{personImage this 'small' 'micro'}}}
{{/linkToAuthor}} {{/linkToAuthor}}
{{/each}} {{/each}}
{{/unless}} {{/unless}}
</div>
</div> </div>
</div> </div>
{{/if}} {{/if}}

View file

@ -1,29 +1,27 @@
<div class="media"> <div class="media">
<div class="bd"> {{#if loggedIn}}
{{#if loggedIn}} <div class="control-icons">
<div class="control-icons"> {{#if authorIsCurrentUser}}
{{#if authorIsCurrentUser}} <a href="#" rel="nofollow" class="delete remove_post" title="{{t "delete"}}">
<a href="#" rel="nofollow" class="delete remove_post" title="{{t "delete"}}"> <i class="entypo-trash"></i>
<i class="entypo-trash"></i> </a>
</a> {{else}}
{{else}} <a href="#" rel="nofollow" data-type="post" class="post_report" title="{{t "report.name"}}">
<a href="#" rel="nofollow" data-type="post" class="post_report" title="{{t "report.name"}}"> <i class="entypo-warning"></i>
<i class="entypo-warning"></i> </a>
</a> <a href="#" rel="nofollow" class="block_user" title="{{t "ignore"}}">
<a href="#" rel="nofollow" class="block_user" title="{{t "ignore"}}"> <i class="entypo-block"></i>
<i class="entypo-block"></i> </a>
</a> <a href="#" rel="nofollow" class="delete hide_post" title="{{t "stream.hide"}}">
<a href="#" rel="nofollow" class="delete hide_post" title="{{t "stream.hide"}}"> <i class="entypo-cross"></i>
<i class="entypo-cross"></i> </a>
</a> {{/if}}
{{/if}}
</div>
{{/if}}
<div class="thumbnail img-thumbnail">
<a href="{{sizes.large}}" class="photo-link gallery-picture">
<img src="{{sizes.large}}" class="photo big_photo">
</a>
</div> </div>
{{/if}}
<div class="thumbnail img-thumbnail">
<a href="{{sizes.large}}" class="photo-link gallery-picture">
<img src="{{sizes.large}}" class="photo big_photo">
</a>
</div> </div>
</div> </div>

View file

@ -2,11 +2,13 @@
<div class="media"> <div class="media">
{{#if root}} {{#if root}}
{{#with root}} {{#with root}}
<a href="/people/{{author.guid}}" class="img {{{hovercardable this}}}"> <div class="media-object media-left">
{{{personImage author 'small'}}} <a href="/people/{{author.guid}}" class="{{{hovercardable this}}}">
</a> {{{personImage author 'small'}}}
</a>
</div>
<div class="bd"> <div class="media-body">
<div> <div>
{{#linkToAuthor author}} {{#linkToAuthor author}}
{{name}} {{name}}

View file

@ -2,65 +2,67 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="row"> <div class="row">
<div id="post-info" class="col-md-8"> <div id="post-info" class="col-md-8">
<div class="img pull-left"> <div class="media">
{{#if root}} <div class="media-object media-left">
{{#linkToAuthor root.author}}
{{{personImage this "medium"}}}
{{/linkToAuthor}}
{{else}}
{{#linkToAuthor author}}
{{{personImage this "medium"}}}
{{/linkToAuthor}}
{{/if}}
</div>
<div class="bd">
<span class="author">
{{#if root}} {{#if root}}
{{#linkToAuthor root.author}} {{#linkToAuthor root.author}}
{{name}} {{{personImage this "medium"}}}
{{/linkToAuthor}} {{/linkToAuthor}}
{{else}} {{else}}
{{#linkToAuthor author}} {{#linkToAuthor author}}
{{name}} {{{personImage this "medium"}}}
{{/linkToAuthor}} {{/linkToAuthor}}
{{/if}} {{/if}}
</span> </div>
<div class="info"> <div class="media-body">
{{#if public}} <span class="author">
<span class="post_scope" title="{{t "stream.public"}}">
<i class="entypo-globe small"></i>
</span>
{{else}}
<span class="post_scope" title="{{t "stream.limited"}}">
<i class="entypo-lock small"></i>
</span>
{{/if}}
<span class="post-time">
{{#if root}} {{#if root}}
<a href="/posts/{{root.id}}"> {{#linkToAuthor root.author}}
<time datetime="{{root.created_at}}" title="{{localTime root.created_at}}" /> {{name}}
</a> {{/linkToAuthor}}
{{else}} {{else}}
<a href="/posts/{{id}}"> {{#linkToAuthor author}}
<time datetime="{{created_at}}" title="{{localTime created_at}}" /> {{name}}
</a> {{/linkToAuthor}}
{{/if}} {{/if}}
</span> </span>
{{#if root}}
{{#if root.provider_display_name}} <div class="info">
{{t "stream.via" provider=root.provider_display_name}} {{#if public}}
<span class="post_scope" title="{{t "stream.public"}}">
<i class="entypo-globe small"></i>
</span>
{{else}}
<span class="post_scope" title="{{t "stream.limited"}}">
<i class="entypo-lock small"></i>
</span>
{{/if}} {{/if}}
{{else}} <span class="post-time">
{{#if provider_display_name}} {{#if root}}
{{t "stream.via" provider=provider_display_name}} <a href="/posts/{{root.id}}">
<time datetime="{{root.created_at}}" title="{{localTime root.created_at}}" />
</a>
{{else}}
<a href="/posts/{{id}}">
<time datetime="{{created_at}}" title="{{localTime created_at}}" />
</a>
{{/if}}
</span>
{{#if root}}
{{#if root.provider_display_name}}
{{t "stream.via" provider=root.provider_display_name}}
{{/if}}
{{else}}
{{#if provider_display_name}}
{{t "stream.via" provider=provider_display_name}}
{{/if}}
{{/if}} {{/if}}
{{/if}} </div>
{{#unless root}}
<div id="single-post-moderation" />
{{/unless}}
</div> </div>
{{#unless root}}
<div id="single-post-moderation" />
{{/unless}}
</div> </div>
</div> </div>
{{#unless root}} {{#unless root}}

View file

@ -1,11 +1,13 @@
<div class="media {{#if showPost}} {{#if nsfw}} shield-off {{/if}} {{else}} shield-active {{/if}}"> <div class="media {{#if showPost}} {{#if nsfw}} shield-off {{/if}} {{else}} shield-active {{/if}}">
{{#with author}} <div class="media-object media-left">
<a href="/people/{{guid}}" class="img {{{hovercardable this}}}"> {{#with author}}
{{{personImage this}}} <a href="/people/{{guid}}" class="{{{hovercardable this}}}">
</a> {{{personImage this}}}
{{/with}} </a>
{{/with}}
</div>
<div class="bd"> <div class="media-body">
{{#if loggedIn}} {{#if loggedIn}}
<div class="control-icons"> <div class="control-icons">
{{#if authorIsCurrentUser}} {{#if authorIsCurrentUser}}