Elections Plugin


(Sam) #21

Ah, okay. Yeah that would be it, everyone can vote but only admins can see the results.

I thought it might be a task for the poll plugin, but since this was the specific application I had in mind for admin-only results I thought it was worth asking, just in case. :slight_smile:


(Angus McLeod) #22

More updates

The poll itself now also has the full nominee details, i.e. avatar, @username and nomination statement excerpt. The results pane uses usernames only (it is too cramped otherwise).


Admins can toggle back and forth between the ‘nominate’ and ‘electing’ states at will, via topic edits. For example, rather than clicking “Start Election” you could update the state via this dropdown. Or if you wanted to go back to the nomination stage after starting the election, you can do so.

We can still add that as a setting in this plugin by overriding certain aspects of the polls plugin. I’ll do that tomorrow or the day after.


(Joshua Rosenfeld) #23

I personally think this would be a great expansion to the polls plugin. I see two neat areas for expansion: results only visible to admins, and users only visible to admins (everyone can see results). Your thoughts @erlend_sh?


In polls: Make results and users only visible to admins
(Christoph) #24

How about making that “badge” global, i.e. visible on all posts by the user and linking back to the election topic? This could help advertize the ongoing election.


(Angus McLeod) #25

Good idea. Will take a look at this.


(Erlend Sogge Heggen) #26

Yeah, I seem to recall this being requested before but I can’t find the topic. #pr-welcome for these two features @codinghorror?


(Sam Saffron) #27

Let’s specify the syntax for it and then sure this can be #pr-welcome, probably pull it out to another topic.


(Tobias Eigen) #28

I like how this plugin is evolving, and look forward to trying it out soon on my site. Nice job, @angus! And thank you! :sunflower:

I do think the suggestion to make election badges global to be a bit feature creepy and might have unintended consequences, and lead to you building more stuff than you really need. (e.g. is there an election nominee/candidate badge? Does each user get an elections tab on their profile indicating their nominee/candidate status throughout the election process?) So if I were you, I would try to limit the election functionality to the election topic and elections categories as much as possible, at least until the plugin has been thoroughly tested and taken through its paces.

Likewise changing who can see poll results - I do see that as a poll feature and separate from elections so am glad it’s #pr-welcome.


(Sam) #29

What needs to be done here to make the pr-welcome topic for those features? In case there’s something I could help with.

Interested in seeing that move forward, there’s a good chance I’m also the person that brought it up on the other thread alluded to. :slight_smile:


(Erlend Sogge Heggen) #30

I opened a new topic for it:


(Tobias Eigen) #31

@angus is this plugin safe to install on production yet? I’m eager to test it in the wild so I can give you better feedback. It’s looking pretty solid on your sandbox and you haven’t posted any updates in a few days. :wink:

I am hopeful that we can use it in our community for upcoming elections that we have planned. :ballot_box:


(Angus McLeod) #32

I’ve spent a fair amount of time on this this week, and yes I do think it’s ready for limited production use. The server structure is now stable. All data is saved in custom fields (i.e. isolated). A fair amount of work has been done on edge cases and error handling.

I’ve updated the first post in this topic with a more detailed description of the feature set. I would recommend reading that first. Also, I would recommend some initial testing on your own instance.

This is a big plugin and is interdependent on both Polls and some complex aspects of core Discourse. There will still be some issues. However, it is sufficiently stable for limited production use. It won’t break your site.

I’ve written some initial acceptance (qunit) tests and am currently working on the rspec tests.


(Angus McLeod) #33

Update: I’ve completed v1 of the qunit and rspec tests for the current feature set. Further work will be as per the to do list in the OP. Currently:

  • Restricted self nomination, i.e. allowing self nomination on the basis of user properties such as trust level.
  • Allow any user to be designated as an Election Admin
  • Allow selection of the author of the Election Post
  • Additional notifications
  • Email notifications
  • Nominee avatar flair selection
  • Nominee badges and titles
  • Topic list filters for Election Topic properties, e.g. Status

Happy to work with anyone who wants to test this out.


(Chris Beach) #34

Looks good @angus.

A minor UI suggestion. On mobile, the poll gets a bit squished and there are alignment issues.

Could the nominee text be placed underneath the nominee username, taking the full width?


(Tobias Eigen) #35

I like @ChrisBeach suggestion about the UI - good idea.

Having installed the plugin now on my site and in the middle of showing it to my colleagues, I suggest that you change START ELECTION to START POLL. People found that phrasing a bit confusing.

I also was thinking it might be helpful to make the nominee flair optional, and/or make the flair admin settable, like the group avatar flair. The way the flair looks now is a bit busy/quirky on my site - see below.


(Angus McLeod) #36

Yes, I should have mentioned, I pushed that responsive style update last night. See e.g..

Oops, yes. Thought I’d made all the Election / Poll distinctions, but I ignored most obvious one… Fixed.

Yes, I agree. Will do that now.


(Angus McLeod) #37

Ok, I’ve made the nominee avatar flair class a setting. Default is empty (off).


(Tobias Eigen) #38

Whoops - trying to add a second poll in a topic already containing a poll, even outside an election category, throws a weird error. Disabling for now.

Meanwhile, now noticing that to disable the plugin I have to comment out the line in the app.cnf file and rebuild - when you get a chance can you add the ability to disable/enable the plugin via the ui, and also get to the settings via the plugins list as typical with other plugins?

52 AM


(Angus McLeod) #39

Thanks again for the useful feedback.

Fixed.

Yes. This is a little tricker than it may seem :slight_smile:. But, you’re right it’s needed. I’ve added it.

I’ll add tests for both changes later today.


(Kane York) #40

If an anonymous user tries to self nominate, they get a 403 on /election/nomination and an infinispinner.