Skip to content

Commit

Permalink
comments and ratings: small changes following mB redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
hom3mad3 committed Aug 15, 2024
1 parent c00f5f5 commit 4b66fe1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Comment from './comment'

const CommentList = (props) => {
return (
<ul className="u-list-reset">
<ul className="u-list-reset a4-comments">
{
props.comments.map((comment, index) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,22 @@ const CommentManageDropdown = (props) => {
>
<i className="fas fa-ellipsis-h" aria-hidden="true" />
</button>
<div className="dropdown-menu dropdown-menu-end">
{props.has_changing_permission && [
<button key="1" className="dropdown-item" type="button" onClick={props.handleToggleEdit}>{translated.edit}</button>,
<div className="divider" key="2" />
]}
{props.has_deleting_permission && [
<a key="3" className="dropdown-item" href={'#comment_delete_' + props.id} data-bs-toggle="modal">{translated.delete}</a>,
<div className="divider" key="4" />
]}
</div>
<ul className="dropdown-menu dropdown-menu-end">
{props.has_changing_permission && (
<li className="dropdown-item">
<button type="button" onClick={props.handleToggleEdit}>
{translated.edit}
</button>
</li>
)}
{props.has_deleting_permission && (
<li className="dropdown-item">
<a href={'#comment_delete_' + props.id} data-bs-toggle="modal">
{translated.delete}
</a>
</li>
)}
</ul>
</div>
)
}
Expand Down
6 changes: 5 additions & 1 deletion adhocracy4/ratings/static/ratings/react_ratings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import config from '../../../static/config'

const translations = {
upvote: django.gettext('Click to vote up'),
downvote: django.gettext('Click to vote down')
downvote: django.gettext('Click to vote down'),
likes: django.gettext('Likes'),
dislikes: django.gettext('Dislikes')
}

class RatingBox extends React.Component {
Expand Down Expand Up @@ -133,6 +135,7 @@ class RatingBox extends React.Component {
>
<i className="fa fa-chevron-up" aria-hidden="true" />
{this.state.positiveRatings}
<span className="rating__label">{translations.likes}</span>
</button>
<button
aria-label={translations.downvote}
Expand All @@ -142,6 +145,7 @@ class RatingBox extends React.Component {
>
<i className="fa fa-chevron-down" aria-hidden="true" />
{this.state.negativeRatings}
<span className="rating__label">{translations.dislikes}</span>
</button>
</div>
)
Expand Down

0 comments on commit 4b66fe1

Please sign in to comment.