Suggestions needed for poll plugin
-
@psychobunny thanks, I'll keep that in mind.
I currently have the following "flow" in mind:
- Post gets saved (
filter:post.save
), poll is recognized before MD parses it - Poll is saved to database and markup is removed from post
- Using
action:post.gotTopic
, a poll is retrieved and client renders it
- Post gets saved (
-
Ah okay, makes sense. I thought you were rendering it in
filter:post.parse
, yours is a better strategy then. As far as your original question I'd say the second one feels neater I guess, but whatever works better for you -
@psychobunny doesn't really matter yet, but I also agree that the second will be the better option. It's both cleaner and can be extended easier.
-
So anyone feel like designing / creating some visuals? Specifically the poll view Would include both the vote and results screen.
-
@Carl I have this very ugly and quick mockup for testing purposes:
http://i.imgur.com/Lm1jv48.pngI've chosen to "embed" them inside the first post for theme compatibility reasons. In my opinion it would look best just above the first post, but I can't guarantee compatibility with all themes that way.
-
By the way... I got voting working
-
@Schamper Looks nice!
-
@baris Good catch hehe, this poll survived a few iterations and had a vote prior to adding a check if you had already voted, which wasn't backwards compatible. So the total count is at 2, but the option count is only at 1
-
I don't want to fully "release" just yet, so for anyone that wants to help out with the development of this: https://github.com/Schamper/nodebb-plugin-poll
I really need some code in there that's not mine (for new insights, you know), most of the stuff can probably be done better and more efficient.So for anyone reading, please help out
-
No promises ofc coz have a ton of other things on my plate, but will fork it and check it out, coz obviously I'm a bit impatient and all that
-
Small update on this. I've implemented the basics of poll settings. The syntax is as follows:
[poll title="Poll title here" max="3"] - Poll options ... [/poll]
The default values for these will be editable from the AdminCP soon.
If anyone is willing to help out on this, I've added a small todo list to the readme of the repo. It includes the things I could currently think of. If you see any improvements yourself or think of cool features, feel free to contribute!
-
Just kinda using this as an "update" thread for this plugin, at least until it's released.
I added a bunch of more stuff:
- Automatic poll ending, select a date and time and the poll will close then
- Multiple choice polls
- Details on the votes:
In the background you can also see a slight change in design.
When I implement the visualization of states on a poll (closed, deleted, etc) I feel that this can have it's first release.