This repository was archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Initial working upvote/downvotes #43
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,3 +36,5 @@ body{ | |
| .contentContainer a:hover{ | ||
| color: #d1d6d6; | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| div.upvote { | ||
| text-align: center; | ||
| } | ||
|
|
||
| div.upvote a.upvote-enabled { | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| div.upvote a { | ||
| color: transparent; | ||
| background-image: url('images/sprites-stackoverflow.png?v=1'); | ||
| background-repeat: no-repeat; | ||
| overflow: hidden; | ||
| display: block; | ||
| margin: 0 auto; | ||
| width: 41px; | ||
| height: 25px; | ||
| } | ||
|
|
||
| div.upvote span.count { | ||
| display: block; | ||
| font-size: 24px; | ||
| font-family: Arial, Liberation, Sans, DejaVu Sans, sans-serif; | ||
| color: #555; | ||
| text-align: center; | ||
| line-height: 1; | ||
| } | ||
|
|
||
| div.upvote a.upvote { | ||
| background-position: 0px -265px; | ||
| } | ||
|
|
||
| div.upvote a.upvote.upvote-on { | ||
| background-position: 0px -230px; | ||
| } | ||
|
|
||
| div.upvote a.downvote { | ||
| background-position: 0px -300px; | ||
| } | ||
|
|
||
| div.upvote a.downvote.downvote-on { | ||
| background-position: 0px -330px; | ||
| } | ||
|
|
||
| div.upvote a.star { | ||
| width: 33px; | ||
| height: 31px; | ||
| background-position: 0px -150px; | ||
| } | ||
|
|
||
| div.upvote a.star.star-on { | ||
| background-position: 0px -190px; | ||
| } | ||
|
|
||
| div.upvote-serverfault a { | ||
| background-image: url('images/sprites-serverfault.png?v=1'); | ||
| } | ||
|
|
||
| div.upvote-meta-stackoverflow a { | ||
| background-image: url('images/sprites-meta-stackoverflow.png?v=1'); | ||
| } | ||
|
|
||
| div.upvote-superuser a { | ||
| background-image: url('images/sprites-superuser.png?v=1'); | ||
| } | ||
|
|
||
| div.upvote-unix a { | ||
| background-image: url('images/sprites-unix.png?v=1'); | ||
| width: 42px; | ||
| height: 27px; | ||
| } | ||
|
|
||
| div.upvote-unix a.upvote { | ||
| background-position: 0px -237px; | ||
| } | ||
|
|
||
| div.upvote-unix a.upvote.upvote-on { | ||
| background-position: 0px -198px; | ||
| } | ||
|
|
||
| div.upvote-unix a.downvote { | ||
| background-position: 0px -281px; | ||
| } | ||
|
|
||
| div.upvote-unix a.downvote.downvote-on { | ||
| background-position: 0px -319px; | ||
| } | ||
|
|
||
| div.upvote-unix a.star { | ||
| width: 42px; | ||
| height: 30px; | ||
| background-position: 0px -126px; | ||
| } | ||
|
|
||
| div.upvote-unix a.star.star-on { | ||
| background-position: 0px -164px; | ||
| } | ||
|
|
||
| div.upvote-unix span.count { | ||
| color: #333; | ||
| line-height: 15px; | ||
| padding: 9px 0; | ||
| font-family: "DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",Courier,Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter",monospace; | ||
| text-shadow: 1px 1px 0 #ffffff; | ||
| font-weight: bold; | ||
| margin: 0; | ||
| border: 0; | ||
| vertical-align: baseline; | ||
| } | ||
|
|
||
| div.upvote-programmers a { | ||
| background-image: url('images/sprites-programmers.png?v=1'); | ||
| width: 42px; | ||
| height: 20px; | ||
| } | ||
|
|
||
| div.upvote-programmers a.upvote { | ||
| background-position: 5px -248px; | ||
| } | ||
|
|
||
| div.upvote-programmers a.upvote.upvote-on { | ||
| background-position: 5px -211px; | ||
| } | ||
|
|
||
| div.upvote-programmers a.downvote { | ||
| background-position: 5px -282px; | ||
| } | ||
|
|
||
| div.upvote-programmers a.downvote.downvote-on { | ||
| background-position: 5px -320px; | ||
| } | ||
|
|
||
| div.upvote-programmers a.star { | ||
| width: 42px; | ||
| height: 30px; | ||
| background-position: 6px -128px; | ||
| } | ||
|
|
||
| div.upvote-programmers a.star.star-on { | ||
| background-position: 6px -166px; | ||
| } | ||
|
|
||
| div.upvote-programmers span.count { | ||
| color: #333; | ||
| line-height: 15px; | ||
| padding: 5px 0 7px; | ||
| font-size: 20px; | ||
| font-weight: bold; | ||
| font-family: Tahoma,Geneva,Arial,sans-serif; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flask responses have a couple different forms (docs).
If you return a string, it will form a response with that string as the body and a status code of
200 OK.If you want to specify the status code or headers, you can return a tuple in either of the following forms:
This means that when you return '201', it gives a response with a body of '201' and a status code of
200 OKYou could return a JSON success message:
For line 132, you can use a similar style while specifying the response code:
There are a few other ways you could achieve this, this is just the one I think of first.