many small fixes

This commit is contained in:
Dennis Eichhorn 2023-02-10 18:20:57 +01:00
parent 77abadbf58
commit 527b14d054

View File

@ -37,7 +37,7 @@ echo $this->getData('nav')->render();
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/base}/{/lang}/{/api}qa/question/vote?id=' . $question->getId());?>&type=1", "method": "PUT", "request_type": "json"}
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/api}qa/question/vote?id=' . $question->getId());?>&type=1", "method": "PUT", "request_type": "json"}
]
}
]' href="#">
@ -49,7 +49,7 @@ echo $this->getData('nav')->render();
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/base}/{/lang}/{/api}qa/question/vote?id=' . $question->getId());?>&type=-1", "method": "PUT", "request_type": "json"}
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/api}qa/question/vote?id=' . $question->getId());?>&type=-1", "method": "PUT", "request_type": "json"}
]
}
]' href="#">
@ -75,17 +75,17 @@ echo $this->getData('nav')->render();
</div>
<?php $files = $question->getMedia(); foreach ($files as $file) : ?>
<span><a class="content" href="<?= UriFactory::build('{/lang}/{/app}/media/single?id=' . $file->getId());?>"><?= $file->name; ?></a></span>
<span><a class="content" href="<?= UriFactory::build('{/app}/media/single?id=' . $file->getId());?>"><?= $file->name; ?></a></span>
<?php endforeach; ?>
<a class="account-info" href="<?= UriFactory::build('{/lang}/{/app}/profile/single?{?}&id=' . $question->createdBy->getId()); ?>">
<a class="account-info" href="<?= UriFactory::build('{/app}/profile/single?{?}&id=' . $question->createdBy->getId()); ?>">
<span class="name">
<div class="content"><?= $this->printHtml($question->createdBy->account->name2); ?> <?= $this->printHtml($question->createdBy->account->name1); ?></div>
<div class="name-score">Score: <?= $scores[$question->createdBy->account->getId()] ?? 0; ?></div>
</span>
<?php if ($question->createdBy->image !== null && !($question->createdBy->image instanceof NullMedia)) : ?>
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/lang}/{/app}/' . $question->createdBy->image->getPath()); ?>">
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/app}/' . $question->createdBy->image->getPath()); ?>">
<?php endif; ?>
</a>
</div>
@ -105,11 +105,11 @@ echo $this->getData('nav')->render();
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/base}/{/lang}/{/api}qa/answer/vote?id=' . $answer->getId());?>&type=1", "method": "PUT", "request_type": "json"}
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/api}qa/answer/vote?id=' . $answer->getId());?>&type=1", "method": "PUT", "request_type": "json"}
]
}
]' href="#">
<i class="fa fa-chevron-up qa-vote<?= $this->printHtml($answer->getAccountVoteScore($this->request->header->account) > 0 ? ' voted' : ' open'); ?>"></i>
<i class="fa fa-chevron-up qa-vote<?= $answer->getAccountVoteScore($this->request->header->account) > 0 ? ' voted' : ' open'; ?>"></i>
</a>
<span class="counter"><?= $answer->getVoteScore(); ?></span>
<span class="text">Score</span>
@ -117,11 +117,11 @@ echo $this->getData('nav')->render();
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/base}/{/lang}/{/api}qa/answer/vote?id=' . $answer->getId());?>&type=-1", "method": "PUT", "request_type": "json"}
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/api}qa/answer/vote?id=' . $answer->getId());?>&type=-1", "method": "PUT", "request_type": "json"}
]
}
]' href="#">
<i class="fa fa-chevron-down qa-vote<?= $this->printHtml($answer->getAccountVoteScore($this->request->header->account) < 0 ? ' voted' : ' open'); ?>"></i>
<i class="fa fa-chevron-down qa-vote<?= $answer->getAccountVoteScore($this->request->header->account) < 0 ? ' voted' : ' open'; ?>"></i>
</a>
</div>
<div class="counter-container">
@ -129,7 +129,7 @@ echo $this->getData('nav')->render();
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/base}/{/lang}/{/api}qa/answer/accept?id=' . $answer->getId());?>&type=1", "method": "PUT", "request_type": "json"}
{"key": 2, "type": "message.request", "uri": "<?= UriFactory::build('{/api}qa/answer/accept?id=' . $answer->getId());?>&type=1", "method": "PUT", "request_type": "json"}
]
}
]' href="#">
@ -147,16 +147,16 @@ echo $this->getData('nav')->render();
</div>
<div class="portlet-foot qa-portlet-foot">
<?php $files = $answer->getMedia(); foreach ($files as $file) : ?>
<span><a class="content" href="<?= UriFactory::build('{/lang}/{/app}/media/single?id=' . $file->getId());?>"><?= $file->name; ?></a></span>
<span><a class="content" href="<?= UriFactory::build('{/app}/media/single?id=' . $file->getId());?>"><?= $file->name; ?></a></span>
<?php endforeach; ?>
<a class="account-info" href="<?= UriFactory::build('{/lang}/{/app}/profile/single?{?}&id=' . $answer->createdBy->getId()); ?>">
<a class="account-info" href="<?= UriFactory::build('{/app}/profile/single?{?}&id=' . $answer->createdBy->getId()); ?>">
<span class="name">
<div class="content"><?= $this->printHtml($answer->createdBy->account->name2); ?> <?= $this->printHtml($answer->createdBy->account->name1); ?></div>
<div class="name-score">Score: <?= $scores[$answer->createdBy->account->getId()] ?? 0; ?></div>
</span>
<?php if ($answer->createdBy->image !== null && !($answer->createdBy->image instanceof NullMedia)) : ?>
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/lang}/{/app}/' . $answer->createdBy->image->getPath()); ?>">
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/app}/' . $answer->createdBy->image->getPath()); ?>">
<?php endif; ?>
</a>
</div>