Skip to content

Commit

Permalink
Rel 0.0.2 - Implements user reactions for objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
danirus committed May 21, 2022
1 parent 0abfbee commit f30e2d3
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion django_comments_ink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_form_target():
return reverse("comments-ink-post")


VERSION = (0, 0, 1, "a", 0) # following PEP 440
VERSION = (0, 0, 2, "a", 0) # following PEP 440


def get_version():
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion django_comments_ink/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
TmpInkComment,
)


InkComment = get_comment_model()


Expand Down Expand Up @@ -1083,7 +1084,11 @@ def react(request, comment_id, next=None):
)
for pth in _reacted_js_tmpl
]
context = {"comment": comment}
max_users_in_tooltip = settings.COMMENTS_INK_MAX_USERS_IN_TOOLTIP
context = {
"comment": comment,
"max_users_in_tooltip": max_users_in_tooltip,
}
status = 201 if created else 200
return json_res(request, template_list, context, status=status)

Expand Down
2 changes: 1 addition & 1 deletion js_tests/tests/scene1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h5 class="text-center">Post your comment</h5>
<script> // From https://unpkg.com/unfetch/polyfill.
self.fetch||(self.fetch=function(e,n){return n=n||{},new Promise(function(t,s){var r=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var c in r.open(n.method||"get",e,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},r.onerror=s,r.withCredentials="include"==n.credentials,n.headers)r.setRequestHeader(c,n.headers[c]);r.send(n.body||null)})});
</script>
<script src="http://localhost:3000/dist/dci-0.0.1.js"></script>
<script src="http://localhost:3000/dist/dci-0.0.2.js"></script>

<div style="display: none">
<section class="reply-form" data-dci="reply-form-template">
Expand Down
2 changes: 1 addition & 1 deletion js_tests/tests/scene2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h5 class="text-center">Post your comment</h5>
<script> // From https://unpkg.com/unfetch/polyfill.
self.fetch||(self.fetch=function(e,n){return n=n||{},new Promise(function(t,s){var r=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var c in r.open(n.method||"get",e,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},r.onerror=s,r.withCredentials="include"==n.credentials,n.headers)r.setRequestHeader(c,n.headers[c]);r.send(n.body||null)})});
</script>
<script src="http://localhost:3000/dist/dci-0.0.1.js"></script>
<script src="http://localhost:3000/dist/dci-0.0.2.js"></script>

<div style="display: none">
<section class="reply-form" data-dci="reply-form-template">
Expand Down
2 changes: 1 addition & 1 deletion js_tests/tests/scene3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h5 class="text-center">Post your comment</h5>
<script> // From https://unpkg.com/unfetch/polyfill.
self.fetch||(self.fetch=function(e,n){return n=n||{},new Promise(function(t,s){var r=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var c in r.open(n.method||"get",e,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},r.onerror=s,r.withCredentials="include"==n.credentials,n.headers)r.setRequestHeader(c,n.headers[c]);r.send(n.body||null)})});
</script>
<script src="http://localhost:3000/dist/dci-0.0.1.js"></script>
<script src="http://localhost:3000/dist/dci-0.0.2.js"></script>

<div style="display: none">
<section class="reply-form" data-dci="reply-form-template">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "django-comments-ink",
"private": true,
"version": "0.0.1",
"version": "0.0.2",
"description": "Test the frontend modules of django-comments-ink",
"scripts": {
"pretest": "eslint django_comments_ink/static/django_comments_ink",
Expand Down
14 changes: 0 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@ exclude_lines = [
line-length = 80
extend-exclude = '''pqenv|psenv'''

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 80
src_paths = ["django_comments_xtd", "demos"]
extend_skip_glob = [
"**/pqenv/**",
"**/psenv/**",
]

[tool.pytest]
addopts = "--create-db"
django_find_project = false
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name="django-comments-ink",
version="0.0.1",
version="0.0.2",
packages=find_packages(),
include_package_data=True,
license="MIT",
Expand Down

0 comments on commit f30e2d3

Please sign in to comment.