132 lines
6.1 KiB
PHP
132 lines
6.1 KiB
PHP
|
<?php
|
||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||
|
$pCategories = $this->projectsModel->getEntryCategories($data['ID']);
|
||
|
$pCategoriesList = [];
|
||
|
$categoryUrls = [];
|
||
|
$lang = isset($_SESSION['site_lang']) ? $_SESSION['site_lang'] : 'de';
|
||
|
|
||
|
foreach ($pCategories as $pCategory) {
|
||
|
if ($lang == 'fr' && $pCategory['displaynameFrench'] != NULL) {
|
||
|
$pCategoriesList[] = $pCategory['displaynameFrench'];
|
||
|
$categoryUrls[$pCategory['displaynameFrench']] = $pCategory['collection'];
|
||
|
} else if ($lang == 'en' && $pCategory['displaynameEnglish'] != NULL) {
|
||
|
$pCategoriesList[] = $pCategory['displaynameEnglish'];
|
||
|
$categoryUrls[$pCategory['displaynameEnglish']] = $pCategory['collection'];
|
||
|
} else {
|
||
|
$pCategoriesList[] = $pCategory['displayname'];
|
||
|
$categoryUrls[$pCategory['displayname']] = $pCategory['collection'];
|
||
|
}
|
||
|
}
|
||
|
sort($pCategoriesList);
|
||
|
|
||
|
$pCategoriesListUrls = [];
|
||
|
foreach ($pCategoriesList as $pCategory) {
|
||
|
$pCategoriesListUrls[] = '<a href="' . base_url('projects/' . $categoryUrls[$pCategory]) . '">' . $pCategory . '</a>';
|
||
|
}
|
||
|
|
||
|
$pCategoriesListUrls = implode(', ', $pCategoriesListUrls);
|
||
|
?>
|
||
|
<section class="container">
|
||
|
<div class="vote-container" data-id="<?= $data['ID'] ?>">
|
||
|
<a href="#" class="vote-btn upvote">
|
||
|
<i class="fa<?= $voteType == 1 ? '' : 'r' ?> fa-thumbs-up"></i>
|
||
|
</a>
|
||
|
<span><?= $voteCount ?></span>
|
||
|
<a href="#" class="vote-btn downvote">
|
||
|
<i class="fa<?= $voteType == -1 ? '' : 'r' ?> fa-thumbs-down"></i>
|
||
|
</a>
|
||
|
</div>
|
||
|
<div class="row">
|
||
|
<?php if (!empty($prevProject)):
|
||
|
$prevProject = $prevProject[0]; ?>
|
||
|
<div class="col-xs-6 col-sm-6 col-md-5 col-lg-4">
|
||
|
<div class="project-card">
|
||
|
<a href="<?= base_url('projects/entry/' . $prevProject['name']) ?>">
|
||
|
<div class="float-left rounded project-image"
|
||
|
style="background-image:url(<?= $prevProject['source'] ?>?w=200)"></div>
|
||
|
<div class="prev-project">
|
||
|
<h5>
|
||
|
<i class="fa fa-arrow-left"></i> <?= lang('projects_previous') ?></h5>
|
||
|
<h4><?= $prevProject['title'] ?></h4>
|
||
|
</div>
|
||
|
</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php endif; ?>
|
||
|
<div class="col-xs-12 col-xs-pull-12 col-md-2 col-md-pull-0 col-lg-4 text-center">
|
||
|
<a href="<?= base_url('projects') ?>">
|
||
|
<i class="fa fa-arrow-circle-up"></i>
|
||
|
<span style="display: block;">
|
||
|
<?= lang('projects_back_to_overview') ?>
|
||
|
</span>
|
||
|
</a>
|
||
|
</div>
|
||
|
<?php if (!empty($nextProject)):
|
||
|
$nextProject = $nextProject[0]; ?>
|
||
|
<div class="col-xs-6 col-sm-6 col-md-5 col-lg-4 float-right">
|
||
|
<div class="project-card next-project-card">
|
||
|
<a href="<?= base_url('projects/entry/' . $nextProject['name']) ?>">
|
||
|
<div class="float-right rounded project-image"
|
||
|
style="background-image:url(<?= $nextProject['source'] ?>?w=200)"></div>
|
||
|
<div class="next-project">
|
||
|
<h5><?= lang('projects_next') ?>
|
||
|
<i class="fa fa-arrow-right"></i>
|
||
|
</h5>
|
||
|
<h4><?= $nextProject['title'] ?></h4>
|
||
|
</div>
|
||
|
</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php endif; ?>
|
||
|
</div>
|
||
|
</section>
|
||
|
|
||
|
<section class="primary">
|
||
|
<div class="container">
|
||
|
<div class="row">
|
||
|
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
|
||
|
<img src="<?= $data['source'] ?>?w=600" class="img-fluid rounded">
|
||
|
</div>
|
||
|
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
|
||
|
<span data-toggle="tooltip" data-placement="top" title="Kategorien">
|
||
|
<i class="fa fa-folder-open"></i> <?= $pCategoriesListUrls ?>
|
||
|
</span>
|
||
|
<span data-toggle="tooltip" data-placement="top"
|
||
|
title="Datum: <?= strftime("%d. %B %Y", strtotime($data['datetime'])) ?>"
|
||
|
style="margin-left:50px">
|
||
|
<i class="far fa-calendar"></i> <?= $data['time_existing'] ?>
|
||
|
</span>
|
||
|
<?php if (isset($_SESSION['user']) && !empty($_SESSION['user'])): ?>
|
||
|
<a href="<?= base_url('admin/projects/edit/' . $data['ID']) ?>" target="_blank"
|
||
|
style="margin-left: 50px" data-toggle="tooltip" data-placement="top" title="Bearbeiten">
|
||
|
<i
|
||
|
class="fa fa-edit"></i>
|
||
|
Bearbeiten
|
||
|
</a>
|
||
|
<?php endif; ?>
|
||
|
<h1><?= $data['title'] ?></h1>
|
||
|
<p class="lead"><?= $data['description'] ?></p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php if ($data['customLink'] != NULL): ?>
|
||
|
<a href="<?= $data['customLink'] ?>" class="btn btn-orange round raised" target="_blank"><?= $data['customLinkName'] ?></a>
|
||
|
<?php endif; ?>
|
||
|
|
||
|
<?php if ($data['isDownloadable']): ?>
|
||
|
<a href="<?= $data['downloadLink'] ?>" class="btn btn-transparent round <?= $data['downloadLink'] == NULL ? 'disabled' : '' ?>" target="_blank">Download <?= $data['downloadName'] ?></a>
|
||
|
<?php endif; ?>
|
||
|
|
||
|
<?php if ($data['isOpenSource']): ?>
|
||
|
<a href="<?= $data['openSourceLink'] ?>" class="btn btn-transparent round <?= $data['openSourceLink'] == NULL ? 'disabled' : '' ?>" target="_blank">OpenSource <?= $data['openSourceName'] ?></a>
|
||
|
<?php endif; ?>
|
||
|
</div>
|
||
|
</section>
|
||
|
|
||
|
<section class="container">
|
||
|
<div class="row">
|
||
|
<div class="col-sm-12 col-md-8 offset-md-2 project-content-container">
|
||
|
<?= $data['content'] ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
</section>
|