Make it possible to view projects in more detail
This commit is contained in:
parent
adab82964d
commit
34668cb0ea
|
@ -1,3 +1,9 @@
|
||||||
|
a.nostyle {
|
||||||
|
text-decoration: none;
|
||||||
|
color:inherit;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.project-card {
|
.project-card {
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
|
@ -90,13 +90,13 @@ $projects = $projectManager->getAll();
|
||||||
$owner = $projectManager->getProjectOwner($project->getID());
|
$owner = $projectManager->getProjectOwner($project->getID());
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="project-card">
|
<a class="nostyle" href="info.php?id=<?= $project->getID() ?>"><div class="project-card">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<h4 class="project-title"><?= $project->getName(); ?></h4>
|
<h4 class="project-title"><?= $project->getName(); ?></h4>
|
||||||
<p><?= implode('<br>',array_slice($project->getDescription(), 0, 2)); ?></p>
|
<p><?= implode('<br>',array_slice($project->getDescription(), 0, 2)); ?></p>
|
||||||
</div>
|
</div>
|
||||||
<p class="project-organizer">Organisert av <?= $owner['name']; ?></p>
|
<p class="project-organizer">Organisert av <?= $owner['name']; ?></p>
|
||||||
</div>
|
</div></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<center>
|
<center>
|
||||||
|
|
|
@ -9,12 +9,32 @@ if(isset($_GET['id'])){
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once(__DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||||
|
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||||
|
$attrs = $as->getAttributes();
|
||||||
|
|
||||||
$projectManager = new \pvv\side\ProjectManager($pdo);
|
$projectManager = new \pvv\side\ProjectManager($pdo);
|
||||||
$project = $projectManager->getByID($projectID);
|
$project = $projectManager->getByID($projectID);
|
||||||
|
|
||||||
$members = $projectManager->getProjectMembers($projectID);
|
$members = $projectManager->getProjectMembers($projectID);
|
||||||
|
$is_owner = False;
|
||||||
|
$is_member = False;
|
||||||
|
if ($attrs){
|
||||||
|
$uname = $attrs['uid'][0];
|
||||||
|
foreach($members as $member){
|
||||||
|
if ($member['uname'] == $uname){
|
||||||
|
if ($member['owner']==1){
|
||||||
|
$is_owner = True;
|
||||||
|
}
|
||||||
|
else if ($member['owner']==0){
|
||||||
|
$is_member = True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="no">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../../css/normalize.css">
|
<link rel="stylesheet" href="../../css/normalize.css">
|
||||||
|
@ -37,7 +57,7 @@ $members = $projectManager->getProjectMembers($projectID);
|
||||||
|
|
||||||
<div class="gridl">
|
<div class="gridl">
|
||||||
<div class="projectlead">
|
<div class="projectlead">
|
||||||
<h2>Prosjektledelse</h2>
|
<h2>Prosjektledelsen</h2>
|
||||||
<div class="projectmember">
|
<div class="projectmember">
|
||||||
<?php foreach($members as $i => $data){
|
<?php foreach($members as $i => $data){
|
||||||
if($data['lead']){
|
if($data['lead']){
|
||||||
|
@ -56,13 +76,21 @@ $members = $projectManager->getProjectMembers($projectID);
|
||||||
<?php foreach($members as $i => $data){
|
<?php foreach($members as $i => $data){
|
||||||
if($data['lead']){ continue; }
|
if($data['lead']){ continue; }
|
||||||
?>
|
?>
|
||||||
<div class="projectmember">
|
<div class="projectmember" style="border-color: #6a0;">
|
||||||
<p><?= $data['role'] ? $data['role'] : 'Deltaker' ?></p>
|
<p><?= $data['role'] ? $data['role'] : 'Deltaker' ?></p>
|
||||||
<p class="membername"><?= $data['name']; ?></p>
|
<p class="membername"><?= $data['name']; ?></p>
|
||||||
<p class="memberuname"><?= $data['uname']; ?></p>
|
<p class="memberuname"><?= $data['uname']; ?></p>
|
||||||
|
<p class="memberemail"><?= $data['mail']; ?></p>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
<p><form action="update.php", method="post">
|
||||||
|
<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>
|
||||||
|
</form></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue