-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apps/userdashboard: add moderation detail page with list and comment …
…component filled with dummy data
- Loading branch information
Showing
9 changed files
with
139 additions
and
9 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
apps/userdashboard/assets/js/a4_candy_userdashboard/ModerationComment.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, { Component } from 'react' | ||
import django from 'django' | ||
|
||
export default class ModerationComment extends Component { | ||
constructor (props) { | ||
super(props) | ||
|
||
this.state = { | ||
project: this.props.key | ||
} | ||
} | ||
|
||
render () { | ||
const postedText = django.gettext(' posted a ') | ||
const offensiveText = django.gettext(' for being offensive') | ||
const categoryText = django.gettext('Categories: ') | ||
const blockText = django.gettext(' Block') | ||
const dismissText = django.gettext(' Dismiss') | ||
const replyText = django.gettext(' Reply') | ||
|
||
return ( | ||
<div className="mt-5"> | ||
<ul className="pl-0"> | ||
<li className="list-item "> | ||
<div className="row"> | ||
<div className="col-2 col-md-1"> | ||
<div className="user-avatar user-avatar--small user-avatar--shadow mb-1 userindicator__btn-img" /> | ||
</div> | ||
<div className="col-7 col-md-8"> | ||
<div><span className="fa-stack fa-2x" aria-hidden="true"><i className="fas fa-exclamation fa-stack-1x" /><i className="far fa-circle fa-stack-2x" /></span> | ||
<a href="/">Profile name</a> | ||
<span>{postedText}<a href="/">comment link</a>{offensiveText}</span> | ||
</div> | ||
<div>8.4.2021, 14:09</div> | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="a4-comments__box--comment"> | ||
<div className="col-12"> | ||
<span className="sr-only">{categoryText}</span> | ||
<span className="badge a4-comments__badge a4-comments__badge--que">Category</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col-12"> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliter homines, aliter philosophos loqui putas oportere? Igitur neque stultorum quisquam beatus neque sapientium non beatus.</p> | ||
</div> | ||
</div> | ||
<div className="text-muted mt-3 d-flex justify-content-between"> | ||
<div><i className="fas fa-reply" aria-hidden="true" />{replyText}</div> | ||
<div><i className="far fa-times-circle" aria-hidden="true" />{dismissText}</div> | ||
<div><i className="fas fa-ban" aria-hidden="true" />{blockText}</div> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
apps/userdashboard/assets/js/a4_candy_userdashboard/ModerationCommentList.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import django from 'django' | ||
|
||
import ModerationComment from './ModerationComment' | ||
|
||
export default function (props) { | ||
const byText = django.gettext('By ') | ||
|
||
return ( | ||
<div className="row mb-2"> | ||
<div className="col-12"> | ||
<h1 className="m-0">project title</h1> | ||
<span className="text-muted">{byText}organisation</span> | ||
<ModerationComment /> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/userdashboard/assets/js/a4_candy_userdashboard/react_moderation_comment_list.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import ModerationCommentList from './ModerationCommentList' | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
|
||
function init () { | ||
$('[data-aplus-widget="moderation_comment_list"]').each(function (i, element) { | ||
const moderationCommentList = element.getAttribute('data-moderation-comment-list') | ||
const projectApiUrl = element.getAttribute('data-project-api-url') | ||
ReactDOM.render( | ||
<ModerationCommentList | ||
moderationCommentList={moderationCommentList} | ||
projectApiUrl={projectApiUrl} | ||
/>, | ||
element) | ||
}) | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', init, false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/userdashboard/templates/a4_candy_userdashboard/userdashboard_moderation_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends "a4_candy_userdashboard/base_userdashboard.html" %} | ||
{% load i18n static %} | ||
|
||
{% block extra_js %} | ||
{{ block.super }} | ||
<script type="text/javascript" src="{% static 'moderation_comment_list.js' %}"></script> | ||
{% endblock %} | ||
|
||
{% block dashboard_content %} | ||
<a class="btn btn--none pl-0 pt-0" href="{% url 'userdashboard-moderation' %}"> | ||
<i class="fa fa-chevron-left" aria-hidden="true"></i> | ||
<span>{% trans 'Back' %}</span> | ||
</a> | ||
<div data-aplus-widget="moderation_comment_list" | ||
data-moderation-projects="{{ moderation_comment_list }}" | ||
data-project-api-url="{{ project_api_url }}" > | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters