• Members 3 posts
    July 7, 2017, 6:44 a.m.

    I'm trying to build a Q/A forum with "correct answer" functionality (similar to stackoverflow). I've gone over this thread and it seems the only way to add a new button is through forking and editing the JS?

    I'll be placing the "correct answer" button next to the like button, so I suspect I'll be dealing with misago/thread/posts/post/footer.html
    Like previous posts, the html will render with JS disabled. It's being overwritten by the JS frontend.

    How would I start modifying the js frontend?

    ps. I'm also a newbie programmer.

  • July 7, 2017, 8:36 p.m.

    Hey there,

    Getting such feature into Misago is little more complex than this. Not only you'll need to edit JS for UI to support such feature, but you'll also have to implement it in application's backend. This would involve:

    • adding "answer" field on thread model that would point to post model (or be null)
    • adding its serialization to JSON api
    • writing JSON api for setting and changing selected answer

    Assuming that one's familiar with the technologies involved and the codebase, and will not implement feature in configurable matter, or include tests suite for it, one may have relatively okay implemementation after 8-12 hours of work. It's much harder to estimate somebody new to codebase, or without experience with technology stack.

    Still, if you persist, you are up to great learning experience.

    As for starting up with the frontend, I would start with setting up Misago locally for development, following project's readme. Next, I would clone Misago near to your project, uninstall Misago from your virtualenv and create directory named misago that would be symlinked to misago directory in cloned repo. That way your Misago forum will use codebase you've just cloned instead of one buried within your virtualenv. Next, I would edit cloned frontend/gulpfile.js to point to my dev installation's theme directory, so my custom frontend would be easily accessible for deploying, instead of being buried in Misago's source.

  • Members 3 posts
    July 7, 2017, 8:53 p.m.

    Hey Rafal,

    Thanks for the pointers! Yes, I've been learning about each piece of technology and poking around the code base since I made this post. Up for the challenge. Getting started on your advice now. I'll most likely pop back up here with updates/questions.