mirror of
https://github.com/Karaka-Management/oms-Comments.git
synced 2026-01-11 16:18:41 +00:00
update
This commit is contained in:
parent
1fa7d96774
commit
46239c3ada
|
|
@ -18,10 +18,10 @@ use phpOMS\Uri\UriFactory;
|
|||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<form id="commentCreate" method="PUT" action="<?= UriFactory::build('{/api}comment/list?id={!#commentCreate [name=comment]}&csrf={$CSRF}'); ?>">
|
||||
<form id="commentCreate" class="Comments_create" method="PUT" action="<?= UriFactory::build('{/api}comment/list?id={!#commentCreate [name=comment]}&csrf={$CSRF}'); ?>">
|
||||
<div class="portlet-head">Create Comment</div>
|
||||
<div class="portlet-body">
|
||||
<textarea name="comment">For writing a new comment... of course this is just a placeholder</textarea>
|
||||
<textarea name="comment"></textarea>
|
||||
</div>
|
||||
<div class="portlet-foot"><input type="submit" name="createButton" id="iCreateButton" value="<?= $this->getHtml('Create', '0', '0'); ?>"></div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,12 @@ foreach ($comments as $comment) : ?>
|
|||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$comment->createdBy->name1, $comment->createdBy->name2, $comment->createdBy->name3, $comment->createdBy->login ?? ''])); ?>
|
||||
<a class="content" href="<?= UriFactory::build('profile/single?{?}&id=' . $comment->createdBy->id); ?>">
|
||||
<?= $this->printHtml($this->renderUserName(
|
||||
'%3$s %2$s %1$s',
|
||||
[$comment->createdBy->name1, $comment->createdBy->name2, $comment->createdBy->name3, $comment->createdBy->login ?? '']
|
||||
)); ?>
|
||||
</a>
|
||||
<span class="floatRight"><?= $comment->createdAt->format('Y-m-d H:i:s'); ?></span>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
3
Theme/Backend/css/styles.css
Normal file
3
Theme/Backend/css/styles.css
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.Comments_create textarea {
|
||||
height: 150px;
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->header->account = 1;
|
||||
|
||||
$this->module->apiCommentListCreate($request, $response);
|
||||
self::assertGreaterThan(0, $lId = $response->get('')['response']->id);
|
||||
self::assertGreaterThan(0, $lId = $response->getDataArray('')['response']->id);
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
|
@ -118,10 +118,10 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->setData('commentlist_status', '2');
|
||||
|
||||
$this->module->apiCommentListUpdate($request, $response);
|
||||
self::assertTrue($response->get('')['response']->allowEdit);
|
||||
self::assertFalse($response->get('')['response']->allowVoting);
|
||||
self::assertTrue($response->get('')['response']->allowFiles);
|
||||
self::assertEquals(2, $response->get('')['response']->status);
|
||||
self::assertTrue($response->getDataArray('')['response']->allowEdit);
|
||||
self::assertFalse($response->getDataArray('')['response']->allowVoting);
|
||||
self::assertTrue($response->getDataArray('')['response']->allowFiles);
|
||||
self::assertEquals(2, $response->getDataArray('')['response']->status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -137,7 +137,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->header->account = 1;
|
||||
|
||||
$this->module->apiCommentListCreate($request, $response);
|
||||
self::assertGreaterThan(0, $lId = $response->get('')['response']->id);
|
||||
self::assertGreaterThan(0, $lId = $response->getDataArray('')['response']->id);
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
|
@ -163,7 +163,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->setData('media', \json_encode([1]));
|
||||
|
||||
$this->module->apiCommentCreate($request, $response);
|
||||
self::assertGreaterThan(0, $cId = $response->get('')['response']->id);
|
||||
self::assertGreaterThan(0, $cId = $response->getDataArray('')['response']->id);
|
||||
|
||||
//read
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -173,8 +173,8 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->setData('id', $cId);
|
||||
|
||||
$this->module->apiCommentGet($request, $response);
|
||||
self::assertEquals('', $response->get('')['response']->title);
|
||||
self::assertEquals('Some **text**.', $response->get('')['response']->contentRaw);
|
||||
self::assertEquals('', $response->getDataArray('')['response']->title);
|
||||
self::assertEquals('Some **text**.', $response->getDataArray('')['response']->contentRaw);
|
||||
|
||||
// update
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -186,8 +186,8 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->setData('plain', 'New plain');
|
||||
|
||||
$this->module->apiCommentUpdate($request, $response);
|
||||
self::assertEquals('New title', $response->get('')['response']->title);
|
||||
self::assertEquals('New plain', $response->get('')['response']->contentRaw);
|
||||
self::assertEquals('New title', $response->getDataArray('')['response']->title);
|
||||
self::assertEquals('New plain', $response->getDataArray('')['response']->contentRaw);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -236,7 +236,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->setData('type', '1');
|
||||
|
||||
$this->module->apiChangeCommentVote($request, $response);
|
||||
self::assertGreaterThan(0, $vId = $response->get('')['response']->id);
|
||||
self::assertGreaterThan(0, $vId = $response->getDataArray('')['response']->id);
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
|
@ -246,6 +246,6 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->setData('type', '-1');
|
||||
|
||||
$this->module->apiChangeCommentVote($request, $response);
|
||||
self::assertEquals($vId, $response->get('')['response']->id);
|
||||
self::assertEquals($vId, $response->getDataArray('')['response']->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user