From 3f0962e972a70cbb6793ab4b5076c9e042377bbf Mon Sep 17 00:00:00 2001
From: rlacko <rlacko@sch.bme.hu>
Date: Mon, 10 Feb 2020 22:51:55 +0100
Subject: [PATCH] number of applicants displayed

---
 src/components/pages/Applications.js | 69 ++++++++++++++++++----------
 1 file changed, 44 insertions(+), 25 deletions(-)

diff --git a/src/components/pages/Applications.js b/src/components/pages/Applications.js
index 83f13dc..f3c2a1a 100644
--- a/src/components/pages/Applications.js
+++ b/src/components/pages/Applications.js
@@ -50,20 +50,20 @@ class Applications extends Component {
               {profile.full_name}
             </Link>
           </Table.Cell>
-          <Table.Cell textAlign='center'>
           { format.role === 'Staff' ? null :
-            <ConfirmModal
-            button = {<Button
-              color='blue'
-              size='tiny'
-            >
-              ADD STAFF STATUS
-            </Button>}
-            text='staff jogot adsz neki'
-            onAccept={() => this.props.setStatus(profile.id, 'Staff')}
-            />
+            <Table.Cell textAlign='center'>
+              <ConfirmModal
+              button = {<Button
+                color='blue'
+                size='tiny'
+              >
+                ADD STAFF STATUS
+              </Button>}
+              text='staff jogot adsz neki'
+              onAccept={() => this.props.setStatus(profile.id, 'Staff')}
+              />
+            </Table.Cell>
           }
-          </Table.Cell>
         </Table.Row>
       : null
       );
@@ -80,20 +80,20 @@ class Applications extends Component {
               {profile.full_name}
             </Link>
           </Table.Cell>
-          <Table.Cell textAlign='center'>
           { format.role === 'Staff' ? null :
-            <ConfirmModal
-            button = {<Button
-              color='blue'
-              size='tiny'
-            >
-              ADD STAFF STATUS
-            </Button>}
-            text='staff jogot adsz neki'
-            onAccept={() => this.props.setStatus(profile.id, 'Staff')}
-            />
+            <Table.Cell textAlign='center'>
+              <ConfirmModal
+              button = {<Button
+                color='blue'
+                size='tiny'
+              >
+                ADD STAFF STATUS
+              </Button>}
+              text='staff jogot adsz neki'
+              onAccept={() => this.props.setStatus(profile.id, 'Staff')}
+              />
+            </Table.Cell>
           }
-          </Table.Cell>
         </Table.Row>
       : null
       );
@@ -108,7 +108,26 @@ class Applications extends Component {
             <Table.HeaderCell textAlign='center'>
               <Label color={format.color}>{format.text}</Label>
             </Table.HeaderCell>
-            <Table.HeaderCell width={3} />
+            {format.role !== 'Staff' ?
+              <Table.HeaderCell width={3} textAlign='center'>
+                <Label color={null}>
+                  {format.role === 'no' ?
+                    this.props.profiles.filter(profile => {
+                      return profile.signed === false 
+                        && profile.role !== 'Staff'
+                    }).length
+                  :
+                    this.props.profiles.filter(profile => {
+                      return profile.role === format.role 
+                        && (profile.signed === true 
+                            || profile.role === 'Staff')
+                    }).length
+                  } fő
+                </Label>
+              </Table.HeaderCell>
+              : null
+            }
+            
           </Table.Row>
         </Table.Header>
         <Table.Body>
-- 
GitLab