Closed brainstorm closed 10 years ago
ok, this is a bit more complicated to fix, this is very likely due to modification of the HTML body, the javascript code needs a well defined nesting and order of element so that it is able to detect where to create the comment box. The javascript function that triggers will navigate relative to the element that is clicked and inserts the comment box.
I am traveling in the next few days so I can't look at it until later
Aha, thanks a lot @ialbert for the pointers!
Now I'm getting suspicious on the {browserid_js}
include, it might have crippled some of the javascript nesting in main/server/templates/base.html
...
the browserid should not be the problem, the divs have to be nested and need to be named properly. Investigate the html structure before and after your edits
it is actually simpler than I recalled, I took a look, this is the javascript that is responsible for the commenting
https://github.com/ialbert/biostar-central/blob/master/main/static/js/comment.js
this integrates with the html at
see how it needs to extract the post.id from the hidden input, in your case you seem to be passing the csfr token instead of the post.id into the submit action
Thanks a lot @ialbert for your input, I just fixed it, that was a weird one in commit https://github.com/brainstorm/biostar-central/commit/5cb6d84ec600eebc0a3a943d146a5b4b0789f9da
I don't understand how your site generates the display:none
div with no additional code, since that widget is the same in both sites :-?
@satra, time to test :+1:
@brainstorm - happy to test - should i be creating a new account? or can you link to incf or orcid?
It runs with Mozilla Persona, which accepts any arbitrary email account:
http://www.mozilla.org/en-US/persona/
If it's Gmail or Yahoo email account it's even easier (you only have to accept an OAuth token).
the csfr_token should be rendered as a hidden input by default, this is a django internal template tag (maybe they changed it in 1.6) -
Right now trying to post comments in neurostars results in the following (example) 404:
http://neurostars.org/new/comment/f2qIJx936eyyzGhioTajkxmlx10hGeGb/
Additionally, clicking repeatedly on "comment" generates several
div=edit-action
sections.I suspect that Django's CSRF is getting in the way:
https://docs.djangoproject.com/en/1.6/ref/contrib/csrf/
Although it is correctly enabled in
MIDDLEWARE_CLASSES
insettings.py
via'django.middleware.csrf.CsrfViewMiddleware',
...@ialbert, sorry to bother you again, but if you have some insight in this matter, it would be very appreciated :)