Labs/Jetpack/Jetpack Gallery
From MozillaWiki
The following are rough notes containing documentation and business rules for the Jetpack Gallery.
Contents
Home Page
- Editors Picks
- An admin may hand-select 3 Jetpacks to feature on the homepage. The Jetpacks must have been submitted by an active user, have a status of 1 and must be public.
- May be selected at http://jetpack.stage.mozilla.com/admin/jetpack_editor_picks
- Top * Lists
- Top Jetpacks - The 10 most downloaded jetpacks.
- Top Contributors - The 10 people who have committed the most jetpacks.
- Top Reviews - The 10 reviews that have been declared the most helpful. Must have at least a 50% helpful percentage and must have been voted on at least twice.
Admin
- The admin section is available at http://jetpack.stage.mozilla.com/admin
- A user must be logged-in and must have been granted admin access in order to see any of the pages found within this section.
Jetpacks
- A user must be logged-in to add a jetpack.
- A user must be logged-in and must be the owner of a jetpack in order to edit that jetpack or delete that jetpack.
- Jetpacks may be:
- The following fields are required in order to submit a jetpack:
- Title
- Teaser
- Description
- License
- Jetpack Code or Jetpack Code File
- Jetpack titles must be unique; if another jetpack on the site has the same title as the jetpack being added/edited, the site will throw an error.
- Jetpacks can be edited by admins at http://jetpack.stage.mozilla.com/admin/jetpacks
- If a user is removed from the site, none of the jetpacks they submitted will appear on the site.
- Jetpacks with a status of public = 0 will not appear in gallery pages or searches, and the jetpack view page will throw a 404 error.
- Jetpacks with a status of public = 0 will appear for the owner of those jetpacks, in the gallery for that user's jetpacks, and the owner will also be able to see the jetpack view page.
- Videos can be embedded by entering the URL into the Video field. Currently supports:
- Youtube - eg. http://youtube.com/watch?v=UWRyj5cHIQA
- Vimeo - eg. http://www.youtube.com/watch?v=UWRyj5cHIQA
- If not video is available, but a screenshot is available, provide a larger screenshot image where the video image would normally be located.
- A user must be logged-in to view the source code page for a Jetpack
- Jetpacks may be reviewed and approved by admins.
- If a Jetpack has not been approved, the user must acknowledge this by checking an input checkbox beside the download button in order to download that Jetpack.
- Admins may approve Jetpacks in the admin panel at http://mozilla.ryansnyder.me/admin/jetpacks_unreviewed
Jetpack Comments
- A user must be logged in to review a Jetpack.
- A Jetpack may only be rated once by the logged-in user; the logged-in user may, however, add comments to each jetpack more than once.
- Once a logged-in user reviews a Jetpack, it will send an email to the Jetpack owner notifying them of the added review.
- If a logged-in user adds comments to their own Jetpack, a notification email will not be sent out.
- The logged-in user may change their vote for a particular jetpack at any time by re-rating that jetpack.
- Upon review submission, all of the review votes will be calculated to determine the percentage of Thumbs-up / Thumbs-down votes.
- A logged-in user may rate a review as helpful or unhelpful.
- The logged-in can vote as many times as they want towards the helpfulness of a review. But each vote will only override your previous vote.
- All of the helpful votes will be calculated upon voting to determine helpful percentage that is displayed with that review.
- If the license associated with a Jetpack is not available on the site, the user may input their own license by selecting "Other" in the add/edit screen, and then fill in the text box to the right of that radio button.
Jetpack Code Files
- Jetpack code files are currently being stored outside of subversion.
- The user has the option of either adding code through the Bespin editor or through a file upload. If data is available in both the editor and file upload, Jetpack Gallery will assume that the file is where the user wants the javascript to be taken from.
- When uploaded, jetpack code files are being saved in ~/files/js/jetpacks/{x}/{jetpack_id}.js
- Round the jetpack_id down to the nearest multiple of 1000 to find x. For jetpack_id of 49, x = 0. For jetpack_id of 1049, x = 1000. For jetpack_id of 2049, x = 2000.
Jetpack Icons
- Jetpack icons are currently being stored outside of subversion.
- When uploaded, image files are being saved in ~/files/images/jetpacks/{x}/{jetpack_id}/{jetpack_id}-image-{screenshot_id}-{image_size}.jpg
- Round the jetpack_id down to the nearest multiple of 1000 to find x. For jetpack_id of 49, x = 0. For jetpack_id of 1049, x = 1000. For jetpack_id of 2049, x = 2000.
- Image sizes are:
- tiny (25x25)
- small (95x95)
- large (250x250)
- Current upload limit is 1MB.
- Accepted image types are .jpg, .gif and .png
Jetpack Screenshots
- Jetpack icons are currently being stored outside of subversion.
- When uploaded, icon files are being saved in ~/files/images/jetpacks/{x}/{jetpack_id}/{jetpack_id}_{image_size}.jpg
- Round the jetpack_id down to the nearest multiple of 1000 to find x. For jetpack_id of 49, x = 0. For jetpack_id of 1049, x = 1000. For jetpack_id of 2049, x = 2000.
- Image sizes are width x height, where height = width x .76, except for the large image, which maintains aspect ratio:
- tiny (115x87)
- small (220x167)
- medium (430x327)
- large (640x?) - Scale to width of 640px if width >= 640px; else maintain original image size
- Current upload limit is 3MB.
- Accepted image types are .jpg, .gif and .png
Licenses
- Each jetpack must have a license associated with it.
- The user may select a custom license, by filling in the License Other field when submitting their Jetpack. When this happens, this jetpack will receive a license_id of 999, which signifies that Jetpack Gallery should look at the "license_other" field.
- Licenses can be added and edited at http://jetpack.stage.mozilla.com/admin/licenses
Tags
- Tags may be added to any Jetpack.
- The Jetpack owner may add, edit and delete tags for a Jetpack.
- Tags support characters a-z A-Z and 0-9.
- Spaces, punctuation and all other unsupported characters will be removed when a user adds tags.
- Tags may be from 1 character to 24 characters in length.
- Double quotation marks must be used to add a single tag containing multiple words.
- Adding the tags `red blue "primary colors"` will result in 3 tags being added: `red`, `blue` and `primarycolors`.
- Admins may remove tags from individual jetpacks via the Jetpack Admin page.
Popular Tags Graph
- The popular tags graph displays the 10 tags that have been used the most for Jetpacks across the site.
- The graph displays the most popular of the 10 tags at the top of the graph and the least popular of the 10 tags at the bottom of the graph.
Users
- Username supports characters a-z A-Z 0-9 and "_".
- All uppercase characters found within the username will be converted to lowercase characters upon account creation.
- Username must be between 4-32 characters in length.
- Username must be unique; another user on the site cannot have that same Username.
- Passwords must be between 6-42 characters in length.
- Email address must be unique - another user on the site cannot have that email address.
- Verified will be set to 0 if the user has not verified their email address.
- All users who have not verified their email address within 24 hours will be deleted. Garbage collection happens randomly through the Auth Verification model.
- User Status will be set to 1 if the user has any associated login roles. User Status will be set to 0 if the user does not have any associated login roles.
- In order to login, user must have a Verified = 1, Status = 1, and must have an associated login role.
- Users may be designated as site admins through the User admin screen.
- A user cannot voluntary delete their account.
- Users can be edited at http://jetpack.stage.mozilla.com/admin/users
- Users may update their profiles and allow logged-in site users to view their email address, so that the users may contact the developer directly.