I guess you want to return different S3 URL link (i.e. return different HTML) based on geolocation IP? Sounds very complicated
pkuanvil
Posts
-
NodeBB Assets - Object Storage -
[@pkuanvil/nodebb-plugin-poll] Poll plugin fully refreshed to ES2017 await/async, meta.settings, various user interaction improvement, and misc bug fixesThis plugin is built for pkuanvil, a free speech forum for the Peking University students, faculties and alumni: https://www.pkuanvil.com.
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!