I suppose Newbie could be dynamically calculated from "Date joined", but there are also "Capitaine" and other roles which I think would be obtained from user.groups? (https://api.test-paris.happy-dev.fr/admin/djangoldp_account/ldpuser/37/change/) so it's probably simpler to add "Newbie" if the user has no other groups
Pulling data from two sources like this might complicate how the front-end accesses it, perhaps a property circle_member.roles could simplify it? e.g.
@propertydef roles: result = list(str(g) for g in self.user.groups.all()) if self.is_admin: result.append("Administrator") return result
My proposed system above does miss out how the front-end knows the source (to colour yellow or blue, unless it's just hardcoded to colour "Administrator" blue)
the difficulty with this issue front-end is that the team-members are displayed using a sib-display of team.. as such the widget template-team doesn't have access to the owner property (on circle object)
I think it would be cleaner if the back-end could return a set of user.roles concatenated as user.groups with user.is_owner (property to check if the user is the owner of the circle).. this will also be easily changeable for issue #278 (closed) (swapping is_owner with is_admin)
@jbpasquier what do you think?
This is working in branch circle-admin-role.. changed the sib-display to work with circle-members rather than team-members.. sorry @gaelleM @Mulletto_00 this has destroyed your beautiful CSS!
Also it depends on unreleased changes to DjangoLDP (#302 (closed)), for the CircleMember.is_admin field.. for now you can test the CSS by changing this line (26) in circle-team.pug
I need your help with it (posted some questions on that issue) but I think a couple of hours would be conservative? I'm not sure what the inheritance permission was about, though