improves html structure for comments
This commit is contained in:
@@ -1601,7 +1601,10 @@ table {
|
||||
}
|
||||
|
||||
.comment-body {
|
||||
margin-left: rem-calc(42);
|
||||
|
||||
img {
|
||||
margin-right: $line-height/2;
|
||||
}
|
||||
|
||||
.reply {
|
||||
background: white;
|
||||
@@ -1609,15 +1612,19 @@ table {
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
font-size: $small-font-size;
|
||||
margin: rem-calc(6) 0;
|
||||
padding: rem-calc(6);
|
||||
margin: $line-height/4 0;
|
||||
padding: $line-height/4;
|
||||
position: relative;
|
||||
|
||||
a.relative, [class^="icon-arrow"] {
|
||||
padding-left: $line-height/2;
|
||||
}
|
||||
|
||||
[class^="icon-arrow"] {
|
||||
font-size: rem-calc(18);
|
||||
font-size: $base-font-size;
|
||||
left: -20px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.divider {
|
||||
@@ -1669,8 +1676,7 @@ table {
|
||||
.comment-info {
|
||||
color: $text-medium;
|
||||
font-size: $small-font-size;
|
||||
margin-top: $line-height/4;
|
||||
vertical-align: middle;
|
||||
line-height: rem-calc(32); // Same as avatar height
|
||||
|
||||
span.user-name {
|
||||
color: $text;
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (@comment_flags[comment.id] if @comment_flags)] do %>
|
||||
<div class="row">
|
||||
<ul id="<%= dom_id(comment) %>" class="comment no-bullet small-12 column">
|
||||
|
||||
<% if comment.hidden? || comment.user.hidden? %>
|
||||
<% if comment.children.size > 0 %>
|
||||
<div class="is-deleted">
|
||||
<p><%= t("comments.comment.deleted") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if comment.as_administrator? %>
|
||||
<%= image_tag("avatar_admin.png", size: 32, class: "admin-avatar float-left") %>
|
||||
<% elsif comment.as_moderator? %>
|
||||
<%= image_tag("avatar_moderator.png", size: 32, class: "moderator-avatar float-left") %>
|
||||
<% else %>
|
||||
<% if comment.user.hidden? || comment.user.erased? %>
|
||||
<span class="icon-deleted user-deleted"></span>
|
||||
<% elsif comment.user.organization? %>
|
||||
<%= image_tag("avatar_collective.png", size: 32, class: "avatar float-left") %>
|
||||
<% else %>
|
||||
<%= avatar_image(comment.user, seed: comment.user_id, size: 32, class: "float-left") %>
|
||||
<li class="comment-body">
|
||||
<% if comment.hidden? || comment.user.hidden? %>
|
||||
<% if comment.children.size > 0 %>
|
||||
<div class="is-deleted">
|
||||
<p><%= t("comments.comment.deleted") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if comment.as_administrator? %>
|
||||
<%= image_tag("avatar_admin.png", size: 32, class: "admin-avatar float-left") %>
|
||||
<% elsif comment.as_moderator? %>
|
||||
<%= image_tag("avatar_moderator.png", size: 32, class: "moderator-avatar float-left") %>
|
||||
<% else %>
|
||||
<% if comment.user.hidden? || comment.user.erased? %>
|
||||
<span class="icon-deleted user-deleted"></span>
|
||||
<% elsif comment.user.organization? %>
|
||||
<%= image_tag("avatar_collective.png", size: 32, class: "avatar float-left") %>
|
||||
<% else %>
|
||||
<%= avatar_image(comment.user, seed: comment.user_id, size: 32, class: "float-left") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<li class="comment-body">
|
||||
<div class="comment-info">
|
||||
|
||||
<% if comment.as_administrator? %>
|
||||
@@ -73,7 +72,7 @@
|
||||
</span>
|
||||
|
||||
<% if comment.children.size > 0 %>
|
||||
<%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
|
||||
<%= link_to "#{dom_id(comment)}", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
|
||||
<span class="sr-only js-child-toggle" style="display: none;"><%= t("shared.show") %></span>
|
||||
<span class="sr-only js-child-toggle"><%= t("shared.hide") %></span>
|
||||
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <%= t("comments.comment.responses", count: comment.children.size) %>
|
||||
@@ -94,11 +93,13 @@
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<ul id="<%= dom_id(comment) %>_children" class="no-bullet comment-children">
|
||||
<% child_comments_of(comment).each do |child| %>
|
||||
<%= render 'comments/comment', comment: child %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<li>
|
||||
<ul id="<%= dom_id(comment) %>_children" class="no-bullet comment-children">
|
||||
<% child_comments_of(comment).each do |child| %>
|
||||
<%= render 'comments/comment', comment: child %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user