Module:Mayor/Elections/doc

Election Database Editing Tips
If you use the tool below to get the data, please pay special attention to the "nil" fields that you might need to replace, and double check on the output UI for safety.

Get Last Election Data Get Current Election Data

"Get Last Election Data" is for getting the results of the last election
 * It should replace the in-progress table for the same year, if exists.
 * The "last" values are grabbed from the in-progress table, if exists - not from the API.

"Get Current Election Data" is for getting the results for an ongoing election
 * The "last" values must be inputted manually, according to what displayed in-game. For candidates without "last elected" shown, this field can be left as "nil".
 * To reduce error, you must check the generated Mayor Election UI with in-game after punching the information!

Election Pages Editing Tips
Every election is recorded on a page named Mayor Election/Year #, indexed with the year that the mayor election started ("Election Year"). Note that a mayor election ends in the following year, when the new mayor is elected.

A good reference is similar pages that was created: Category:Mayor UI Subpages.

Election Starts
During a mayor election, use "Get Current Election Data" to update the database. Then, a page should be created as follows (replace # with the Election Year) (click to copy). Mayor Election UI uses the database to make a clickable UI, and you are advised to use it rather than copying a static UI. 

Election Year #
After that, Mayor Election/Viewer should be updated to include the new page. You must double check the generated Election UI with the in-game UI!

Election Ends
After a mayor election, use "Get Last Election Data" to update the database. Then, the page should be modified as follows. When copying UI, remember to disable the link of the ballot box (use none; none,). Even though it is possible to use database to generate a mayor UI using Mayor UI, you are advised to copy the (static) UI from in-game for highest retaining accuracy. Mayor UI should only ever be used to produce a lookalike when we have the data, but the UI was not copied at that time. 

Mayor of Year #+1


Alpha Network
Everything is the same, except:
 * Pages are named Mayor Election/Alpha Hypixel Network/Year #
 * Mayor Election/Alpha Hypixel Network should be updated to include new subpages.
 * As AHN elections do not use a database, the election UI cannot be generated using Mayor Election UI. Copy the (static) UI instead.