OvercastNetwork / Issues

Public issue tracker for Overcast Network
https://oc.tc
53 stars 42 forks source link

"Back" button on oc.tc/punishments - incorrectly linked #1825

Open patrickdundas opened 9 years ago

patrickdundas commented 9 years ago

I recently viewed a player's infraction via their profile page, and clicked the back button after reading over the details of their infraction. Instead of bringing me back to that player's profile page, I was brought to the oc.tc/punishments page.

To reproduce this problem

  1. Go to any player's profile (they must have an infraction for this to work)
  2. Click the "infractions" tab on their profile
  3. Click the date link of the infraction
  4. Click the back button

What actually happens

Instead of being brought back to the player's profile page, the back button brings you to the oc.tc/punishments page

What I expected to happen

I expected to be brought back to the previous page that I visited. In this case, the player's profile page.

How to fix this problem

This problem can be easily fixed by altering just one line of code. Currently, the code attached to the button is <a class="btn pull-right" href="/punishments">Back</a>. This tells the button to be a direct link to oc.tc/punishments.

This can be fixed by changing that line of code to <a class="btn pull-right" href="javascript:history.go(-1)">Back</a>. In this case, the button will go back to whatever page the viewer was last on, just like every back button should.

This also could be fixed by re-labeling the button as "punishments" rather than "back"

itsmartin commented 9 years ago

Browsers have back buttons anyway. It would make sense to re-label the button as 'punishments', or just remove it.

patrickdundas commented 9 years ago

True. I will add that as a possible solution

Matic0B commented 9 years ago

Same on /matches but I really don't see this as an issue. Then again, this is also on /reports pages where its "All Reports".

patrickdundas commented 9 years ago

Even though this issue is across multiple pages, I think that the biggest issue lies with the back button on the punishments page. This is because the punishments pages are linked to by multiple pages (profiles, appeals, /punishments), and the system shouldn't just assume that everybody is coming from /punishments.