Template:Vote

 This template is for testing KurwaAntics's voting script. The original content is hidden unless it's transcluded to another page.

What it does
You can set the starting date and the ending date of the voting. It only allows autoconfirmed users to vote.

Configuration
Put the following code onto MediaWiki:Common.js: $('.voting').each(function{   var voting = $(this);    var currentDate = new Date;    var startDate = new Date(voting.data('start'));    var endDate = new Date(voting.data('end'));    if ($.inArray('autoconfirmed', wgUserGroups) < 0) {        // Not an autoconfirmed user        voting.find('input').attr('disabled',true);        voting.find('input[name="wpVote"]').replaceWith('You are not an eligible voter, therefore you cannot vote.');    } else {        // Is an autoconfirmed user        if (currentDate.valueOf < startDate.valueOf) {            // Before session            voting.find('input').attr('disabled',true);            voting.find('input[name="wpVote"]').replaceWith('The session has not started yet, therefore you cannot vote.');        } else if (currentDate.valueOf > endDate.valueOf) {            // After session            voting.find('input').attr('disabled',true); voting.find('input[name="wpVote"]').replaceWith('The session has ended, therefore you cannot vote.'); }   } });

Example
undefined