Adds styles for comment as administrator
This commit is contained in:
committed by
Juanjo Bazán
parent
cfd25042b6
commit
dffb8e8a5e
BIN
app/assets/images/admin_avatar.png
Normal file
BIN
app/assets/images/admin_avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -249,6 +249,7 @@
|
||||
|
||||
.panel {
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
margin-bottom: 0;
|
||||
min-height: rem-calc(192);
|
||||
padding: 0 rem-calc(12) rem-calc(2) rem-calc(12);
|
||||
@@ -568,10 +569,14 @@
|
||||
padding: rem-calc(6) rem-calc(12);
|
||||
}
|
||||
|
||||
&.is-moderator {
|
||||
background: $comment-moderator;
|
||||
&.is-admin {
|
||||
background: $comment-admin;
|
||||
padding: rem-calc(6) rem-calc(12);
|
||||
}
|
||||
|
||||
&.is-moderator {
|
||||
@extend .is-admin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -692,7 +692,7 @@ form {
|
||||
}
|
||||
}
|
||||
|
||||
img.moderator-avatar {
|
||||
img.admin-avatar, img.moderator-avatar {
|
||||
border-radius: rem-calc(1000);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ $association: #C0392B;
|
||||
|
||||
$comment-author: rgba(45,144,248,.15);
|
||||
$comment-level-5: rgba(255,241,204,1);
|
||||
$comment-moderator: rgba(45,144,248,.15);
|
||||
$comment-admin: rgba(45,144,248,.15);
|
||||
$comment-official: rgba(70,219,145,.3);
|
||||
|
||||
// 06. Responsive
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<% end %>
|
||||
<!--
|
||||
<% if comment.user.moderator? %> <!-- AND has activated CHECKBOX comment as moderator ->
|
||||
<%= image_tag('moderator_avatar.png', size: 32, class: "moderator-avatar left") %>
|
||||
<% else %>
|
||||
<%= avatar_image(comment.user, size: 32, class: "left") %>
|
||||
<%= image_tag("moderator_avatar.png", size: 32, class: "moderator-avatar left") %>
|
||||
<% elsif comment.user.administrator? %> <!-- AND has activated CHECKBOX comment as admin ->
|
||||
<%= image_tag("admin_avatar.png", size: 32, class: "admin-avatar left") %>
|
||||
<% end %>
|
||||
-->
|
||||
<div class="comment-body">
|
||||
@@ -28,7 +28,9 @@
|
||||
<% else %>
|
||||
|
||||
<% if comment.user.moderator? %> <!-- AND activate moderator CHECKBOX -->
|
||||
<span class="user-name"><%= t("debates.comment.moderator") %></span>
|
||||
<span class="user-name"><%= t("debates.comment.moderator") %> #ID</span> <!-- Add ID to Moderator name -->
|
||||
<% elsif comment.user.administrator? %> <!-- AND activate administrator CHECKBOX -->
|
||||
<span class="user-name"><%= t("debates.comment.admin") %> #ID</span> <!-- Add ID to Admin name -->
|
||||
<% else %>
|
||||
<span class="user-name"><%= comment.user.name %></span>
|
||||
<% end %>
|
||||
@@ -64,8 +66,10 @@
|
||||
<p class="comment-user level-<%= comment.user.official_level %> is-author"><%= comment.body %></p>
|
||||
<% elsif comment.user.official? %>
|
||||
<p class="comment-user level-<%= comment.user.official_level %>"><%= comment.body %></p>
|
||||
<% elsif comment.user.moderator? %> <!-- AND has activated CHECKBOX comment as moderator & all badges are hidden (100% anonymous) -->
|
||||
<% elsif comment.user.moderator? %> <!-- AND has activated CHECKBOX comment as moderator (all badges are hidden: 100% anonymous) -->
|
||||
<p class="comment-user is-moderator"><%= comment.body %></p>
|
||||
<% elsif comment.user.administrator? %> <!-- AND has activated CHECKBOX comment as admin (all badges are hidden: 100% anonymous) -->
|
||||
<p class="comment-user is-admin"><%= comment.body %></p>
|
||||
<% elsif comment.user_id == @debate.author_id %>
|
||||
<p class="comment-user is-author"><%= comment.body %></p>
|
||||
<% else %>
|
||||
|
||||
@@ -12,5 +12,11 @@
|
||||
<%#= f.label :, t("comments.form.comment_as_moderator"), class: "checkbox" %>
|
||||
</div>
|
||||
end -->
|
||||
<!-- if user is admin
|
||||
<div class="right">
|
||||
<%#= f.check_box :, label: false %>
|
||||
<%#= f.label :, t("comments.form.comment_as_admin"), class: "checkbox" %>
|
||||
</div>
|
||||
end -->
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -50,6 +50,7 @@ en:
|
||||
comment:
|
||||
author: Debate's author
|
||||
moderator: Moderator
|
||||
admin: Administrator
|
||||
deleted: This comment has been deleted
|
||||
user_deleted: Deleted user
|
||||
responses:
|
||||
@@ -96,7 +97,8 @@ en:
|
||||
comments:
|
||||
form:
|
||||
leave_comment: Write a comment
|
||||
comment_as_moderator: Comentar como moderador
|
||||
comment_as_moderator: Comment as moderator
|
||||
comment_as_admin: Comment as administrator
|
||||
comments_helper:
|
||||
comment_link: Comment
|
||||
comment_button: Publish comment
|
||||
|
||||
@@ -50,6 +50,7 @@ es:
|
||||
comment:
|
||||
author: Autor del debate
|
||||
moderator: Moderador
|
||||
admin: Administrador
|
||||
deleted: Este comentario ha sido eliminado
|
||||
user_deleted: Usuario eliminado
|
||||
responses:
|
||||
@@ -97,6 +98,7 @@ es:
|
||||
form:
|
||||
leave_comment: Deja tu comentario
|
||||
comment_as_moderator: Comentar como moderador
|
||||
comment_as_admin: Comentar como administrador
|
||||
comments_helper:
|
||||
comment_link: Comentar
|
||||
comment_button: Publicar comentario
|
||||
|
||||
Reference in New Issue
Block a user