climu / openstudyroom

Website for the Open Study Room online go/baduk/weiqi community.
https://openstudyroom.org
GNU General Public License v3.0
67 stars 33 forks source link

Group Markdown - Edit Button #437

Closed Xen-sits closed 3 years ago

Xen-sits commented 3 years ago

@climu , @LucasBertrand League members can't edit their markdown. It works with admin privileges.

image

climu commented 3 years ago

The button showing logic is here: https://github.com/climu/openstudyroom/blob/9cc5f99a1824b8fb72dafbbab8a7f316f4194e04/league/templates/league/results.html#L57-L59

and can_quit is rendered here: https://github.com/climu/openstudyroom/blob/9cc5f99a1824b8fb72dafbbab8a7f316f4194e04/league/models.py#L234-L256

can_quit will be false when a player has played a game (rightfully). I was lazy to just use that.

Maybe we have a user.is_in(division) somewhere to use in the template?