From 2f3ebf88a56e710a5191ca16b912b76fbdef006d Mon Sep 17 00:00:00 2001 From: Riccardo Graziosi <31478034+riggraz@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:27:32 +0200 Subject: [PATCH] Various improvements (#359) * Fix markdown paragraphs in comments * Remove autofocus on user registration form * Show (new) edit button for Post only to power users * Add email address under name in Likes box --- .../stylesheets/components/Comments.scss | 3 ++- app/assets/stylesheets/components/Post.scss | 21 ++++++++++++++++--- app/javascript/components/Post/LikeList.tsx | 7 +++++-- app/javascript/components/Post/PostP.tsx | 8 ++++--- app/views/devise/registrations/new.html.erb | 1 - 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/components/Comments.scss b/app/assets/stylesheets/components/Comments.scss index 57caf9f8..e6605bc4 100644 --- a/app/assets/stylesheets/components/Comments.scss +++ b/app/assets/stylesheets/components/Comments.scss @@ -102,7 +102,8 @@ .commentBody { @extend .my-2; - p { @extend .m-0; } + p { @extend .my-2; } + p:nth-child(1) { @extend .m-0; } } .commentFooter { diff --git a/app/assets/stylesheets/components/Post.scss b/app/assets/stylesheets/components/Post.scss index 917254f7..fc412570 100644 --- a/app/assets/stylesheets/components/Post.scss +++ b/app/assets/stylesheets/components/Post.scss @@ -63,14 +63,29 @@ max-height: 170px; overflow-y: scroll; + overflow-x: hidden; .likeListItem { @extend + .d-flex, .p-2, .my-1; - - .likeListItemName { - @extend .ml-2; + + .gravatar { + @extend .align-self-center; + } + + .likeListItemUserInfo { + @extend + .d-flex, + .flex-column, + .ml-3; + } + + .likeListItemEmail { + @extend .mutedText; + + font-size: 13px; } } } diff --git a/app/javascript/components/Post/LikeList.tsx b/app/javascript/components/Post/LikeList.tsx index d82c625a..86883d06 100644 --- a/app/javascript/components/Post/LikeList.tsx +++ b/app/javascript/components/Post/LikeList.tsx @@ -26,8 +26,11 @@ const LikeList = ({ likes, areLoading, error}: Props) => ( { likes.map((like, i) => (
- - {like.fullName} + +
+ {like.fullName} + {like.email} +
)) } diff --git a/app/javascript/components/Post/PostP.tsx b/app/javascript/components/Post/PostP.tsx index 99ae9692..e887066a 100644 --- a/app/javascript/components/Post/PostP.tsx +++ b/app/javascript/components/Post/PostP.tsx @@ -243,9 +243,11 @@ class PostP extends React.Component { postStatus.id === post.postStatusId)} /> - } customClass='editAction'> - {I18n.t('common.buttons.edit')} - + { isPowerUser && + } customClass='editAction'> + {I18n.t('common.buttons.edit')} + + } <%= f.label :full_name, class: "sr-only" %> <%= f.text_field :full_name, - autofocus: true, placeholder: t('common.forms.auth.full_name'), required: true, class: "form-control" %>