Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Add removal UI for both team and member; #1100
Browse files Browse the repository at this point in the history
Teams can remove any of their members, members can remove themselves.
  • Loading branch information
chadwhitacre committed Jul 1, 2013
1 parent 88a8589 commit 2be7c21
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 6 deletions.
1 change: 1 addition & 0 deletions gittip/models/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ def get_memberships(self, current_user):
members.append(self.get_teams_membership())
budget = balance = self.get_dollars_receiving()
for member in members:
member['removal_allowed'] = current_user == self
member['editing_allowed'] = False
if member['username'] == current_user.username:
member['is_current_user'] = True
Expand Down
20 changes: 20 additions & 0 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -791,3 +791,23 @@ END;

ALTER TABLE memberships ADD COLUMN recorder text NOT NULL
REFERENCES participants(username) ON UPDATE CASCADE ON DELETE RESTRICT;


-------------------------------------------------------------------------------
-- Recreate the current_memberships view. It had been including participants
-- who used to be members but weren't any longer.

CREATE OR REPLACE VIEW current_memberships AS
SELECT * FROM (

SELECT DISTINCT ON (member, team) m.*
FROM memberships m
JOIN participants p1 ON p1.username = member
JOIN participants p2 ON p2.username = team
WHERE p1.is_suspicious IS NOT TRUE
AND p2.is_suspicious IS NOT TRUE
ORDER BY member
, team
, mtime DESC

) AS anon WHERE take > 0;
4 changes: 4 additions & 0 deletions scss/team.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
TD.take.moderate { color: green; }
TD.take.high { color: orange; }
TD.take.max { color: red; }
SPAN.remove:hover {
text-decoration: line-through;
cursor: pointer;
}
#take INPUT {
text-align: right;
width: 48pt;
Expand Down
Loading

0 comments on commit 2be7c21

Please sign in to comment.