Touch up project info member list

Small stuff like not showing the members title when there are no members, hiding leave/join buttons to the owner, etc.
This commit is contained in:
Markus Wang Halvorsen 2018-08-19 14:51:08 +02:00
parent 6cc8e5e0da
commit b29106bcbe
1 changed files with 38 additions and 20 deletions

View File

@ -21,6 +21,13 @@ if (!$project) {
} }
$members = $projectManager->getProjectMembers($projectID); $members = $projectManager->getProjectMembers($projectID);
$normal_members = $members;
foreach($normal_members as $i => $data){
if($data['lead']){
unset($normal_members[$i]);
}
}
$is_owner = False; $is_owner = False;
$is_member = False; $is_member = False;
if ($attrs){ if ($attrs){
@ -84,10 +91,12 @@ if ($attrs){
</div> </div>
</div> </div>
<?php
if(sizeof($normal_members) > 0){
?>
<div class="projectmembers"> <div class="projectmembers">
<h2>Medlemmer</h2> <h2>Medlemmer</h2>
<?php foreach($members as $i => $data){ <?php foreach($normal_members as $i => $data){
if($data['lead']){ continue; }
?> ?>
<div class="projectmember" style="border-color: #6a0;"> <div class="projectmember" style="border-color: #6a0;">
<p><?= $data['name']; ?></p> <p><?= $data['name']; ?></p>
@ -97,6 +106,12 @@ if ($attrs){
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<?php
}
if(!$is_owner){
?>
<form action="update.php", method="post"><p> <form action="update.php", method="post"><p>
<input type="hidden" name="title" value="derp"/> <input type="hidden" name="title" value="derp"/>
<input type="hidden" name="desc" value="derp"/> <input type="hidden" name="desc" value="derp"/>
@ -104,6 +119,9 @@ if ($attrs){
<input type="hidden" name="id" value="<?= $projectID ?>"/> <input type="hidden" name="id" value="<?= $projectID ?>"/>
<input type="submit" class="btn" name="join_or_leave" value="<?= ($is_member ? 'Forlat' : 'Bli med!') ?>"></input> <input type="submit" class="btn" name="join_or_leave" value="<?= ($is_member ? 'Forlat' : 'Bli med!') ?>"></input>
</p></form> </p></form>
<?php
}
?>
</div> </div>
</div> </div>
</main> </main>