Editing Selectricity/Custom widgets plan

From WikiDotMako

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
The widget works off 6 basic images: <br>
The widget works off 6 basic images:
1. Top Bar <br>
1. Top Bar
2. Corner Image <br>
2. Corner Image
3. Default Image for when Candidates don't have their own images <br>
3. Default Image for when Candidates don't have their own images
4. Background Type 1, which goes behind each 1/2 of the candidates and their descriptions <br>
4. Background Type 1, which goes behind each 1/2 of the candidates and their descriptions
5. Background Type 2, goes behind the remaining candidates <br>
5. Background Type 2, goes behind the remaining candidates
6. Bottom Bar <br>
6. Bottom Bar


Mako suggested having the user upload just one zip file, with all the images named properly. The other option, which I'm considering is having the files uploaded separatel (I don't know how to deal with zip files...) Are there any advantages to one method over the other? I guess uploading just one zip file is easier for the user, but then things would have to be named very specifically, wouldn't they?
Mako suggested having the user upload just one zip file, with all the images named properly. The other option, which I'm considering is having the files uploaded separatel (I don't know how to deal with zip files...) Are there any advantages to one method over the other? I guess uploading just one zip file is easier for the user, but then things would have to be named very specifically, wouldn't they?
Line 12: Line 12:
My current idea is to add two columns to the Pictures database:
My current idea is to add two columns to the Pictures database:
1. election_id, which would act as a link to elections model via belongs_to
1. election_id, which would act as a link to elections model via belongs_to
2. type, which would perform a function similar to the type column in the elections table <br>
2. type, which would perform a function similar to the type column in the elections table  
     6 types: 'top', 'icon', 'image', 'bg1', 'bg2', 'bottom'
     6 types: 'top', 'icon', 'image', 'bg1', 'bg2', 'bottom'


Then, from when creating widget in the view, have the code run a few checks. <br>
Then, from when creating widget in the view, have the code run a few checks.
if @election.top <br>
if @election.top
<img src=url_for @election.icon> <br>
<img src=url_for @election.icon>
else <br>
else
<img src="images/embed_header_icon"> <br>
<img src="images/embed_header_icon">


Any suggestions?
Any suggestions?


[[Category:Selectricity]]
[[Category:Selectricity]]
Please note that all contributions to WikiDotMako are considered to be released under the Attribution-Share Alike 3.0 Unported (see WikiDotMako:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)