mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-18 01:18:41 +00:00
cs fixes, bug fixes, code coverage
This commit is contained in:
parent
a6cd3bff7b
commit
e8f2c78bbb
|
|
@ -12,9 +12,7 @@ If you have a good idea for improvement feel free to create a new issue with all
|
||||||
|
|
||||||
### Issues
|
### Issues
|
||||||
|
|
||||||
Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the `Project.md` file in the `Docs` repository.
|
Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the code marked with `@todo` or in the [PROJECT.md](https://github.com/Orange-Management/Docs/blob/master/Project/PROJECT.md) file.
|
||||||
|
|
||||||
The issue information can be used to provide additional information such as priority, difficulty and type. For your first issue try to find a issue marked `[d:first]` or `[d:beginner]`.
|
|
||||||
|
|
||||||
### Code Style
|
### Code Style
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,17 +86,12 @@ echo $this->getData('nav')->render(); ?>
|
||||||
|
|
||||||
foreach ($newsList as $key => $news) : ++$count;
|
foreach ($newsList as $key => $news) : ++$count;
|
||||||
$url = UriFactory::build('{/prefix}news/article?{?}&id=' . $news->getId());
|
$url = UriFactory::build('{/prefix}news/article?{?}&id=' . $news->getId());
|
||||||
$color = 'darkred';
|
|
||||||
|
|
||||||
if ($news->getType() === NewsType::ARTICLE) { $color = 'green'; }
|
|
||||||
elseif ($news->getType() === NewsType::HEADLINE) { $color = 'purple'; }
|
|
||||||
elseif ($news->getType() === NewsType::LINK) { $color = 'yellow'; }
|
|
||||||
?>
|
?>
|
||||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||||
<td><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType()); ?></span></a>
|
<td><span class="tag"><?= $this->getHtml('TYPE' . $news->getType()); ?></span></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->title); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->title); ?></a>
|
||||||
<td><a class="content" href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $news->createdBy->getId()); ?>"><?= $this->printHtml($news->createdBy->name2 . ', ' . $news->createdBy->name1); ?></a>
|
<td><a class="content" href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $news->createdBy->getId()); ?>"><?= $this->printHtml($news->createdBy->name2 . ', ' . $news->createdBy->name1); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getPublish()->format('Y-m-d')); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->publish->format('Y-m-d')); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if ($count === 0) : ?>
|
<?php if ($count === 0) : ?>
|
||||||
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iPublish"><?= $this->getHtml('Publish'); ?></label>
|
<label for="iPublish"><?= $this->getHtml('Publish'); ?></label>
|
||||||
<input type="datetime-local" name="publish" id="iPublish" value="<?= $this->printHtml($news->getPublish()->format('Y-m-d\TH:i:s')); ?>">
|
<input type="datetime-local" name="publish" id="iPublish" value="<?= $this->printHtml($news->publish->format('Y-m-d\TH:i:s')); ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ use Modules\News\Models\NewsType;
|
||||||
use Modules\News\Models\NullNewsArticle;
|
use Modules\News\Models\NullNewsArticle;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
use phpOMS\Uri\HttpUri;
|
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
use phpOMS\Message\Http\RequestStatusCode;
|
||||||
use phpOMS\Utils\TestUtils;
|
|
||||||
use phpOMS\System\MimeType;
|
use phpOMS\System\MimeType;
|
||||||
|
use phpOMS\Uri\HttpUri;
|
||||||
|
use phpOMS\Utils\TestUtils;
|
||||||
|
|
||||||
trait ApiControllerNewsArticleTrait
|
trait ApiControllerNewsArticleTrait
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,12 @@ declare(strict_types=1);
|
||||||
namespace Modules\News\tests\Models;
|
namespace Modules\News\tests\Models;
|
||||||
|
|
||||||
use Modules\Admin\Models\NullAccount;
|
use Modules\Admin\Models\NullAccount;
|
||||||
|
use Modules\Media\Models\Media;
|
||||||
use Modules\News\Models\NewsArticle;
|
use Modules\News\Models\NewsArticle;
|
||||||
use Modules\News\Models\NewsStatus;
|
use Modules\News\Models\NewsStatus;
|
||||||
use Modules\News\Models\NewsType;
|
use Modules\News\Models\NewsType;
|
||||||
use phpOMS\Localization\ISO639x1Enum;
|
|
||||||
use Modules\Media\Models\Media;
|
|
||||||
use Modules\Tag\Models\Tag;
|
use Modules\Tag\Models\Tag;
|
||||||
|
use phpOMS\Localization\ISO639x1Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @testdox Modules\News\tests\Models\NewsArticleTest: News article
|
* @testdox Modules\News\tests\Models\NewsArticleTest: News article
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user