This repository was archived by the owner on Nov 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathshow.haml
More file actions
104 lines (103 loc) · 5.53 KB
/
Copy pathshow.haml
File metadata and controls
104 lines (103 loc) · 5.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
- content_for :title do @team.name end
%section
.row
.col-md-10
%h2.strong= @team.name
.col-md-2
%br
.btn-group.pull-right
- if @leader
%a.btn.btn-default.btn-sm{:href => edit_team_path(@team)} Manage
- if current_user
- if @team.is_accepted_member?(current_user) && !@team.membership_locked?(current_user)
%a.btn.btn-sm.btn-danger{:href => team_remove_member_path(@team, :user => current_user.id), :data => {:method => 'post', :confirm => "Are you sure you want to leave? #{@team.leader == current_user ? 'Your team will be disbanded.' : 'This can not be un-done.'}"}} Leave
- elsif @team.is_invited?(current_user)
%a.btn.btn-sm.btn-success{:href => team_update_invitation_path(@team, :decision => true), :data => {:method => 'post'}} Accept Invitation
%a.btn.btn-sm.btn-warning{:href => team_update_invitation_path(@team, :decision => false), :data => {:method => 'post'}} Decline Invitation
%hr
.row
.col-md-12
%h3.strong Team Stats
%h3.strong
.row
.col-md-3
= @stats[:wools]
%small Wools
.col-md-3
= @stats[:cores]
%small Cores
.col-md-3
= @stats[:destroyables]
%small Monuments
.row
.col-md-3
= @stats[:kk]
%small KK ratio
.col-md-3
= @stats[:kd]
%small KD ratio
.col-md-3
= @stats[:kills]
%small Kills
.col-md-3
= @stats[:deaths]
%small Deaths
%hr
.row
.col-md-12
%h3.strong
Members
%small= @team.member_count
= paginate @members
.table-container
%table.table.table-bordered.table-striped
%thead
%tr
%th Name
%th Role
- if @leader
%th Status
%th Accepted at
- if @leader
%th Actions
%tbody
- @members.each do |member|
%tr
%td
= avatar_for(member.user, 20, link: true, style: {'margin-right' => '4px'}, glow: true)
= link_to_user(member.user)
%td
= @team.leader == member.user ? 'Leader' : 'Member'
- if @leader
%td
= member.accepted ? 'Accepted' : 'Invited'
- if member.accepted
%td{:rel => 'tooltip', :title => format_time(member.accepted_at), :data => {:placement => 'left', :container => 'body'}}
= time_ago_in_words(member.accepted_at, false, :vague => true) + ' ago'
- else
%td N/A
- if @leader
%td
- unless member.user_id == current_user.id
- member_locked = @team.membership_locked?(member.user)
- msg = member.accepted ? {:verb => 'Eject', :message => "permanently remove #{member.user} from"} : {:verb => 'Cancel', :message => "cancel #{member.user.username}'s invitation to"}
%a.btn.btn-danger.btn-xs{:href => member_locked ? nil : team_remove_member_path(@team, :user => member.user_id), :data => member_locked ? nil : {:method => :post, :confirm => "Are you sure you want to #{msg[:message]} the team?"}, :disabled => member_locked ? '' : nil}= msg[:verb]
- if current_user.admin? && @team.leader != member.user
%a.btn.btn-warning.btn-xs{:href => team_reassign_leader_path(@team, :user => member.user_id), :data => {:method => :post}}= 'Set Leader'
= paginate @members
- if @leader
.row
.col-md-12
%hr
.row
.col-md-5
%br
%form.form-inline{:method => :post, :action => team_add_member_path(@team)}
= token_tag nil
%input.form-control.typeahead#teams{:name => 'user', :type => 'text', :autocomplete => 'off', :placeholder => 'Username'}
%input.btn.btn-primary{type: 'submit', name: 'submit', value: 'Invite'}
- if Tournament.can_manage?
%input.btn.btn-danger{type: 'submit', name: 'submit', value: 'Force Add'}
.col-md-7
%h4.strong Add Members
%p Adding a user to your team will send them an invitation. Once this invitation is accepted, the user will become a member of your team. Invitations may be cancelled if sent in error.