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,26 +91,37 @@ if ($attrs){
</div> </div>
</div> </div>
<div class="projectmembers"> <?php
<h2>Medlemmer</h2> if(sizeof($normal_members) > 0){
<?php foreach($members as $i => $data){ ?>
if($data['lead']){ continue; } <div class="projectmembers">
?> <h2>Medlemmer</h2>
<div class="projectmember" style="border-color: #6a0;"> <?php foreach($normal_members as $i => $data){
<p><?= $data['name']; ?></p> ?>
<p class="memberrole"><?= $data['role'] ? $data['role'] : 'Deltaker' ?></p> <div class="projectmember" style="border-color: #6a0;">
<p class="memberuname"><?= $data['uname']; ?></p> <p><?= $data['name']; ?></p>
<p class="memberemail"><?= $data['mail']; ?></p> <p class="memberrole"><?= $data['role'] ? $data['role'] : 'Deltaker' ?></p>
</div> <p class="memberuname"><?= $data['uname']; ?></p>
<?php } ?> <p class="memberemail"><?= $data['mail']; ?></p>
</div> </div>
<form action="update.php", method="post"><p> <?php } ?>
<input type="hidden" name="title" value="derp"/> </div>
<input type="hidden" name="desc" value="derp"/> <?php
<input type="hidden" name="active" value="derp"/> }
<input type="hidden" name="id" value="<?= $projectID ?>"/>
<input type="submit" class="btn" name="join_or_leave" value="<?= ($is_member ? 'Forlat' : 'Bli med!') ?>"></input> if(!$is_owner){
</p></form> ?>
<form action="update.php", method="post"><p>
<input type="hidden" name="title" value="derp"/>
<input type="hidden" name="desc" value="derp"/>
<input type="hidden" name="active" value="derp"/>
<input type="hidden" name="id" value="<?= $projectID ?>"/>
<input type="submit" class="btn" name="join_or_leave" value="<?= ($is_member ? 'Forlat' : 'Bli med!') ?>"></input>
</p></form>
<?php
}
?>
</div> </div>
</div> </div>
</main> </main>