[@pkuanvil/nodebb-plugin-poll] Poll plugin fully refreshed to ES2017 await/async, meta.settings, various user interaction improvement, and misc bug fixes

NodeBB Plugins
  • This plugin is built for pkuanvil, a free speech forum for the Peking University students, faculties and alumni:


    We refactored this plugin to ES2017 await/async, migrated the Settings to meta.settings (because we don't want to work with the old Settings). The user interaction should also be more intuitive:

    • Ended poll will now correctly show result panel, instead of showing an ended vote panel
    • An "Has Date Time" input option is added for the convenience of polls which don't has end time
    • Guest visit: disabling "Allow guests to view poll results" now don't throw an error message on every topic that has a poll; it now returns the vote options, but not the vote counts. The details and create privilege also no longer unconditionally throws an error for guest

    This is not a seamless upgrade from the previous nodebb-plugin-poll; we especially made a fork instead of only some patches, because we want to add features that is likely only interesting for pkuanvil (like hiding voters by default). But largely speaking, the poll plugin should work mostly like before (especially, the database structure of poll: is unchanged). Some breaking changes:

    • Due to the migration to meta.settings, the old settings need to be set in ACP again. (It should be possible to provide a upgrade script since it's principally a matter of JSON.parse(Config.settings.get()._))
    • Various semantics changes, like the "Allow guests to view poll results" above. These changes will no longer unconditionally throws error for guest visits, but will honor the settings in ACP.
    • We currently unconditionally hide voters from the frontend (so the frontend can't see which user voted which option, effectively disabling the "details" panel). This should be configurable in ACP, but not written yet.
    • We dropped the flatpickr date setting library in favour of native browser <input> elements.

    Source code: https://github.com/pkuanvil/nodebb-plugin-poll. Happy hacking and cherry-picking changes!

  • Very nice, thanks.
    However, your site is not using HTTPS, which in this day and age isn't the greatest of security models as everything including usernames and password etc will be sent in clear text.

    You might like to address that.

  • Thank you @pkuanvil — it is nice to see this plugin forked and worked on 😄 It's been around awhile and has not seen much dedicated support. Would you consider backporting some of those changes to the upstream repo?

    Who maintains the forum, a student group? 😃

  • @julian Definately, we will contribute some changes to upstream.

    We are a group of student developers who are deliberately not affiliated to the university to fight against censorship. The university have a history of tooking over administration from the student developers and grant censorship privilege to the "youth studies center", and we refuse to become yet another website that does so. We already lost https://bbs.pku.edu.cn and https://treehole.pku.edu.cn, and there's not yet a libre and civilzed forum for the Peking University students, faculties and almuni.

    FYI, forum-based approach isn't pretty attractive these days. Although we specially desired and wished a forum-based approach to build an online community, we failed to attract a larger userbase, at least in the short term. Currently, most students are more interested in a "tree hollow"-based pesudo anonymous approach. We have a modest user base of around 150~200 users in 2 months, but compared to the new "tree hollow" https://top2.life (which attracted >2400 users in just 3 days after creation) it's really a tiny fraction. top2.life administrators may are better than us in advocacy and have a larger social circle to attract users, but we think the primary reason is that students get accustomed to "tree hollow" fashion and don't really like traditional forums anymore.

Suggested Topics