Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Thumbs #134

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Thumbs #134

wants to merge 8 commits into from

Conversation

ksurya
Copy link
Member

@ksurya ksurya commented Aug 3, 2013

Reputation system for the site

  1. upvotes, down votes for submissions. Each revision object has its own reputation
  2. only upvotes for comments
  3. Reputation for user profile
  4. Search is ordered based on reputation

@lomegor
Copy link

lomegor commented Aug 3, 2013

Things to fix:

  1. What do you think about adding upvote and downvote buttons to the listings (like that main page, search, etc.)?
  2. Upvote and downvote buttons should have the cursor being a pointer (like it was a button or a link).
  3. I assume I can't vote if I'm not logged in, but there's no message about that and the arrows are still visible.
  4. It takes too long to see a change in the reputation. It should update automatically with javascript before the AJAX, and correct if there was an error making the change.
  5. I would change the up arrows for sections (to expand them and close them) to a plus and minus sign, maybe. Because now with upvotes it looks like I can upvote the sections.
  6. When I vote, the space between the upvote and downvote arrow gets bigger.
  7. There should be a way to remove votes. For example, it could be like Reddit, and if I click in the same arrow again it removes the vote.
  8. Are comments being ordered by reputation or just by date?

There may be more bugs, but I'm not founding them yet. I think you have a lot to fix between the two branches either way.

@lomegor
Copy link

lomegor commented Aug 3, 2013

So, a couple of question about the decision you made here:

  1. Why aren't there downvotes and upvotes in the listings of submissions? Do you think it would be good to have them?
  2. Why isn't there a downvote button in comments? Why only upvote?
  3. Why are comments ordered by date and nor by reputation (or viceversa)?

There is no correct answer for these questions, I just think that you should have an answer for them and understand what are the pros and cons of each solution.

@ksurya
Copy link
Member Author

ksurya commented Aug 3, 2013

[I will answer 1st comment later on after making some changes]
Regarding the 2nd comment:

  1. There is no point of voting in listing without actually reading the submission! that's why I thought not to add buttons in listing
  2. upvote for comments was put so that, you might want to admire someone's comment and nothing else.. probably, users might give particular attention to it while going through all comments
  3. sometimes people want to reply to previous comments! it makes no sense to me if I order based on reputation.

@lomegor
Copy link

lomegor commented Sep 13, 2013

Two things that I need fix ASAP to continue testing:

  1. I get a server error whenever I try to vote anything (unless it's my own thing).
  2. I would change the text when trying to upvote own thing to "You cant vote your OWN ...". Also, the exclamation mark at the end of Oops loos like an l.

If you are not getting error 1, maybe you should try cloning SciPy master, ./quickstart.py, the checkout this branch and migrate (you will have to fake the first comment migration probably... that's something that should be added to quickstart - it could be in the same branch you are fixing the search problem).

@lomegor
Copy link

lomegor commented Sep 13, 2013

Ok, got voting to work. Number 2 still holds, though. Other things to improve:

  1. If I double click on upvote or downvote, I can do it multiple times.
  2. The points should change automatically when I click on the arrow, the arrow should change color immediately, without waiting for server's response; otherwise it looks weird. You can't either make the arrow change back on server error, or just don't tell anything to the user on error.
  3. It's taking a lot of time to vote a single submission... try to see if you are doing anything too much. Otherwise I'll take a look at the code later to see why it's taking so long.
  4. I would change the color of the arrows when they are disabled so it's clear that I can't vote (or maybe just remove them altogether).
  5. BTW, why did you choose not to let people vote their own submissions? I mean, most sites let you, it's an unnecessary restriction, and they can only vote once so it's not something that can be abused.
  6. All the things I said apply to comments as well.
  7. Something I'm not too sure about: did we always see all the revision on the home (including all revisions)?
  8. What do you think about votes carrying on to new submissions? I don't think it's necessarily a good idea because, it's after all a new thing... The same question goes for comments (i.e. if comments should be a part of submission instead of revision). I think new revisions are like new edits on comments, too, which would mean that the reputation should be part of the submission. What do you think?
  9. I think it's not clear on the home page (and I assume search) that the number besides the title is the reputation. Especially since there are no arrows. Either include the arrows, or figure out a way to make it clear that the number is the reputaiton.
  10. Maybe think about changing the color for the arrows when activated.
  11. If I click on an arrow and I immediately click on a link, for some reason the "server error" message appears on the arrow (even though I think it works).
  12. Are revisions ordered on the homepage on Top Rated? It doesn't seem like it.
  13. Also, on Top Rated page it seems that they are not correctly ordered (right now I have 6, 0, -2, -1. 2. 0 reputation in that order)
  14. It seems that the Recently Changed tab view all link is taking me to all-revision which is ordered by rank, not by recently changed.
  15. Is Most Viewed tab on homepage working?

That's a lot to do for now.

@ksurya
Copy link
Member Author

ksurya commented Sep 13, 2013

[2] The JS code waits for server to complete request. So, we see small lag which sometimes can be observed clearly. This kind of method ensures

  1. To display only when its successful
  2. The total number of votes is refreshed. If some other user votes in the middle, its also counted.

We can also do it in the other way
First update the data from the client code itself. Then, edit them only if they are different from server.

Please let me know if you have any better idea.

@lomegor
Copy link

lomegor commented Sep 13, 2013

As I said, I think it would be better to do it the other way. As it's not
important data, it's not really awful if we are showing incorrect data to
the user.

On 13 September 2013 18:16, Surya Kasturi [email protected] wrote:

[2] The JS code waits for server to complete request. So, we see small lag
which sometimes can be observed clearly. This kind of method ensures

  1. To display only when its successful
  2. The total number of votes is refreshed. If some other user votes in
    the middle, its also counted.

We can also do it in the other way
First update the data from the client code itself. Then, edit them only if
they are different from server.


Reply to this email directly or view it on GitHubhttps://github.com//pull/134#issuecomment-24409908
.

@ksurya
Copy link
Member Author

ksurya commented Sep 15, 2013

[1] I have observed it but didn't know the reason. But after making other changes, I didn't see it

[3] Roughly, its taking 250-400ms for a vote. Do you think its huge?. I tried to reduce number of queryset iterations required while counting number of up votes, down-votes. I think this should help a bit but not too much.

[4] I removed the arrows. Its clear that way

[5] It does not make sense voting their own submissions. Besides, if a person has 50 submissions, and votes on each of them, it gives him 250 reputation on his profile!! It seems to be considerable abuse

[7] Right now, we only see latest revision on home page while search queries contain all revisions!

[8] I have actually posted about it in mailinglist when I started thumbs but it didn't get any considerable discussion. I think if we are going to create revisions even for a typo in existing submission, carrying reputation makes sense. Otherwise, it may not be necessary.

[12][13] They are ordered based on wilson score. If you have changed "reputation" field from admin, try changing "score" fields and see. It has to work. Technically, the score fields range from 0-1

[15] This data is created based on "pagehits" app and its data. Sometimes, if we make less hits on our db, we don't see any submissions there. However, if there are hits and we delete respective revision from db, the homepage raises error. This has to be fixed though.

- (1 * scale.REVISION_VOTE['thumb']['down'])
return score

def update_reputation(self, vote, prev_vote, created):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the created argument really necessary? As I see it, when prev_vote == None then created == False. Instead of if created: you can have if prev_vote is None:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its necessary. created is not always False when prev_vote is None.
created is True only when a new object is created. i.e., the very first instance

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a new object is created, as there is no previous vote, prev_vote will be None. If it's not the very first instance, i.e., an object was not created, prev_vote will exist and it will not be None (or if it's None, for the calculation it's all the same).

1. Update `Thumbs` model to generic
2. add `reputation` field to Revision model
3. overwrite admin actions in Thumbs model
4. `calculate_reputation()` model method to update `reputation` field
5. `set_reputation()` can be used to reset reputation field. Can only be
used from command line and not used anywhere in code
6. `.spc-popover` class for bootstrap popoverENH: reputation for revision
obj
There is only "upvote" for comments. Downvote is not allowed
reputation onclick event is directly mentioned in list.html
1. New `score` field added to Revision model, which stores wilson, score
confidence
2. add new fields to haystack search_indexes
3. Filter "tag" search based on score and reputation
1. create another tab 'top rated' on front page to show submissions based
on score! Filter is created for it
Note: only revision having top Wilson score is showed

2. show all submissions based on score
The above "note" is applicable to [2]

3. create model property in Submission model to get top_revision of the
respective submission
1. `reputation` field in user profile is present before but never used!
2. reputation for user profile is done as soon as successful voting is
done
icon-arrow-up --> icon-minus
icon-arrow-down --> icon-plus

icon float right
Used in ".accordion-group" to toggle sections
Create `enable_reputation` field in attached objects to thumbs
Voting is possible if field set to True
Show user's votes on their profile page.
This tab is visible only for themselves and not others
@lomegor
Copy link

lomegor commented Sep 19, 2013

  1. I think Most Viewed isn't working, but I'm also seeing it in master. Can you please take a look and create an issue if it's like that? Also, should we be showing revisions instead of submissions on that tab?
  2. I would change the word "Votes" on the lists of items to "Points" or something like that.
  3. The score on the item page is not horizontally centered again.
  4. If I click multiple times on votes (really really fast, a lot of times), I start getting 500 server error.
  5. Related to number 4, when this happens, the votes keep updating itself each time a response gets a 500 server error (which looks weird). Maybe you can just avoid updating the score back on error.
  6. It's really taking too long to vote. I'm going to take a look at why that happens in the code, but you should invest more time on that. I'm getting about 1 second to get a response from the server.
  7. I think you have solved the problem with multiple clicking changing the reputation of an item too much, but it still changes the reputation of the user! For example, I just got SciPy Central to -4 and none of his submissions or comments are downvoted (just by multiple clicking on upvote and downvote, really really fast).
  8. I thought you were going to to change it so reputation carried on to new revisions? If you did, it's not working. I don't think reputation should be linked between revisions, just that when a new revision is created the reputation is copied.
  9. The message for Can't Vote is also not centered correctly, and the one for comments is not vertically centered (i.e. the arrow of the message is not pointing to the vote arrow).

@@ -32,6 +35,9 @@ body {
.pointer {
cursor: pointer;
}
.block-inline {
display: inline-block;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this repeated again? The same for pointer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "less" compilation is making this mistake. There seems to be quite a bit duplicate code.
We can create a new PR removing this error and correcting it.
Actually, we can't remove these css files from repo and only depend on less files each time to compile..
The reason is, these css files come under static files. {{static}} template tag won't work if we remove.

Returns:
updated reputation for Revision object
This can be used as
obj.reputation = obj.update_reputation(vote, prev_vote, created)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the method changed.

@lomegor
Copy link

lomegor commented Sep 19, 2013

I'm not sure if I already said it, but have you tried creating indexes for Thumbs to see if we can improve the performance?


var $SPC_POPOVER = $('.spc-popover');

function show_vote(thumb_as, thumb_for, target, other, vote_count) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If target and other are jQuery objects, their name should start with $

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

@lomegor
Copy link

lomegor commented Sep 19, 2013

Ok, I think that's it for now.

@@ -994,7 +995,7 @@ def show_items(request, what_view='', extra_info=''):
extra_info = ''
entry_order = list(all_revs)
elif what_view == 'show' and extra_info == 'all-unique-revisions':
all_subs = models.Submission.objects.all().order_by('-date_created')
all_subs = models.Submission.objects.all().order_by('-score', '-reputation', '-date_created')
page_title = 'All submissions'
extra_info = ' (only showing the latest revision)'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. In that case, I will take a look as to what we are getting here.
But entry_order = [sub.last_revision for sub in all_subs if sub.last_revision.is_displayed] clearly says that only latest revision is showed..

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said earlier, I thought this was another page. This was in particular is giving an error.

@gauteh
Copy link

gauteh commented Mar 7, 2014

👍

@gauteh
Copy link

gauteh commented May 23, 2014

Maybe something can be borrowed from: https://faq.i3wm.org/questions/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants