mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-17 12:50:08 -07:00
Cleanup
This commit is contained in:
parent
69aaca9740
commit
5fb396d62f
@ -82,14 +82,7 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{#<div class="ui grid stackable">#}
|
||||
{#<div class="right floated right aligned four wide column">#}
|
||||
|
||||
{#</div>#}
|
||||
{#<div class="left floated left aligned twelve wide column">#}
|
||||
<h1 class="ui header">{% block header %}{% endblock %}</h1>
|
||||
{#</div>#}
|
||||
{#</div>#}
|
||||
|
||||
{% for label, flashes in app.session.flashbag.all %}
|
||||
{% for flash in flashes %}
|
||||
|
@ -43,10 +43,12 @@
|
||||
<div class="ui header segment vertical sort">
|
||||
<div class="ui grid stackable">
|
||||
<div class="five wide column">
|
||||
{% if models.paginationData['totalCount'] %}
|
||||
<div class="ui text left floated menu">
|
||||
<div class="header item">Showing</div>
|
||||
<span class="item">{{ models.paginationData['firstItemNumber']~' - '~models.paginationData['lastItemNumber'] }} of {{ models.getTotalItemCount }} items</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="eleven wide column">
|
||||
@ -56,6 +58,7 @@
|
||||
{{ knp_pagination_sortable(models, 'Name', 'm.name') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui segment vertical">
|
||||
|
@ -51,10 +51,12 @@
|
||||
<div class="ui header segment vertical sort">
|
||||
<div class="ui grid stackable">
|
||||
<div class="five wide column">
|
||||
{% if sets.paginationData['totalCount'] %}
|
||||
<div class="ui text left floated menu">
|
||||
<div class="header item">Showing</div>
|
||||
<span class="item">{{ sets.paginationData['firstItemNumber']~' - '~sets.paginationData['lastItemNumber'] }} of {{ sets.getTotalItemCount }} items</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="eleven wide column">
|
||||
@ -67,6 +69,7 @@
|
||||
{{ knp_pagination_sortable(sets, 'Parts', ['s.partCount']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui segment vertical">
|
||||
|
@ -42,7 +42,7 @@ class BricksetClient
|
||||
/**
|
||||
* BricksetClient constructor.
|
||||
*
|
||||
* @param string $apikey Brickset API key
|
||||
* @param string $apiKey Brickset API key
|
||||
* @param array $options A array of config values
|
||||
*
|
||||
* @throws ApiException
|
||||
|
@ -98,5 +98,7 @@ class LoadLdrawCommand extends ContainerAwareCommand
|
||||
}
|
||||
|
||||
$this->release();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,9 @@ class AjaxController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/set_tab/{tab}", name="set_tab", requirements={"tab"=".+"})
|
||||
* @param Request $request
|
||||
* @param $tab
|
||||
* @return Response
|
||||
*/
|
||||
public function setDefaultTabAction(Request $request, $tab)
|
||||
{
|
||||
|
@ -17,6 +17,8 @@ class ColorController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/", name="color_index")
|
||||
* @param ColorService $colorService
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function indexAction(ColorService $colorService)
|
||||
{
|
||||
|
@ -135,8 +135,7 @@ class Color
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Inventory_Part $part_building_kit
|
||||
*
|
||||
* @param Inventory_Part $inventoryPart
|
||||
* @return Color
|
||||
*/
|
||||
public function addPartInventoryPart(Inventory_Part $inventoryPart)
|
||||
@ -147,7 +146,7 @@ class Color
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Inventory_Part $part_building_kit
|
||||
* @param Inventory_Part $inventoryPart
|
||||
*
|
||||
* @return Color
|
||||
*/
|
||||
|
@ -166,6 +166,8 @@ class Model
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return Model
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
@ -48,20 +48,6 @@ class Inventory_Part
|
||||
*/
|
||||
protected $inventory;
|
||||
|
||||
/**
|
||||
* Set count.
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return Inventory_Part
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get count.
|
||||
*
|
||||
|
@ -68,6 +68,7 @@ class SetSearchType extends AbstractType
|
||||
'choice_label' => 'fullName',
|
||||
'choice_translation_domain' => false,
|
||||
'group_by' => function ($theme, $key, $index) {
|
||||
/** @var Theme $theme */
|
||||
$parent = $theme->getParent();
|
||||
|
||||
return $parent ? $parent->getParent() ? $parent->getParent()->getName() : $parent->getName() : $theme->getName();
|
||||
|
@ -11,7 +11,7 @@ class ColorRepository extends BaseRepository
|
||||
{
|
||||
public function findAllBySet(Set $set)
|
||||
{
|
||||
$inventory = $this->getEntityManager()->getRepository(Inventory::class)->findNewestInventoryBySetNumber($set->getNumber());
|
||||
$inventory = $this->getEntityManager()->getRepository(Inventory::class)->findNewestInventoryBySetNumber($set->getId());
|
||||
|
||||
$queryBuilder = $this->createQueryBuilder('color');
|
||||
|
||||
|
@ -16,8 +16,10 @@ class SubpartRepository extends BaseRepository
|
||||
/**
|
||||
* Create new Subpart relation entity or retrieve one by foreign keys.
|
||||
*
|
||||
* @param $name
|
||||
*
|
||||
* @param $parent
|
||||
* @param $child
|
||||
* @param $count
|
||||
* @param $colorId
|
||||
* @return Subpart
|
||||
*/
|
||||
public function getOrCreate($parent, $child, $count, $colorId)
|
||||
@ -29,6 +31,7 @@ class SubpartRepository extends BaseRepository
|
||||
|
||||
$colorRepository = $this->getEntityManager()->getRepository(Color::class);
|
||||
if (!($color = $colorRepository->find($colorId))) {
|
||||
/** @var Color $color */
|
||||
$color = $colorRepository->find(-1);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ class SetRepository extends Repository
|
||||
|
||||
$boolQuery->addMust($query);
|
||||
} else {
|
||||
$query = new \Elastica\Query\MatchAll();
|
||||
$query = new Query\MatchAll();
|
||||
$boolQuery->addMust($query);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ class ColorService
|
||||
|
||||
/**
|
||||
* ColorService constructor.
|
||||
* @param EntityManagerInterface $em
|
||||
*/
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
|
@ -12,7 +12,6 @@ use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Asset\Exception\LogicException;
|
||||
use Symfony\Component\Console\Helper\ProgressBar;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Debug\Exception\ContextErrorException;
|
||||
|
||||
abstract class BaseLoader
|
||||
{
|
||||
@ -65,6 +64,7 @@ abstract class BaseLoader
|
||||
* Initialize new progress bar.
|
||||
*
|
||||
* @param $total
|
||||
* @param string $format
|
||||
*/
|
||||
protected function initProgressBar($total, $format = 'loader')
|
||||
{
|
||||
|
@ -60,6 +60,7 @@ class ImageLoader extends BaseLoader
|
||||
// Get models without image
|
||||
$missing = [];
|
||||
$models = $this->em->getRepository(Model::class)->findAll();
|
||||
/** @var Model $model */
|
||||
foreach ($models as $model) {
|
||||
if (!$this->mediaFilesystem->has('images'.DIRECTORY_SEPARATOR.'-1'.DIRECTORY_SEPARATOR.$model->getId().'.png')) {
|
||||
$missing[] = $model;
|
||||
|
@ -134,7 +134,7 @@ class ModelLoader extends BaseLoader
|
||||
try {
|
||||
$connection->beginTransaction();
|
||||
|
||||
$this->getFileContext($file);
|
||||
$this->loadFileContext($file);
|
||||
$this->loadModel($file);
|
||||
|
||||
$connection->commit();
|
||||
@ -206,6 +206,7 @@ class ModelLoader extends BaseLoader
|
||||
|
||||
// Return model from database if rewrite is not enabled
|
||||
if (!$this->rewrite && $model = $modelRepository->find(basename($file, '.dat'))) {
|
||||
/** @var Model $model */
|
||||
return $model;
|
||||
}
|
||||
|
||||
@ -329,7 +330,6 @@ class ModelLoader extends BaseLoader
|
||||
*
|
||||
*
|
||||
* @param $id
|
||||
* @param Filesystem $context
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@ -359,18 +359,14 @@ class ModelLoader extends BaseLoader
|
||||
* Get new filesystem context of current file.
|
||||
*
|
||||
* @param $file
|
||||
*
|
||||
* @return Filesystem
|
||||
*/
|
||||
private function getFileContext($file)
|
||||
private function loadFileContext($file)
|
||||
{
|
||||
try {
|
||||
$adapter = new Local(dirname($file));
|
||||
$this->fileContext = new Filesystem($adapter);
|
||||
} catch (Exception $exception) {
|
||||
$this->logger->error($exception->getMessage());
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,9 +27,9 @@ class LDModelParser
|
||||
*
|
||||
* LDraw.org Standards: Official Library Header Specification (http://www.ldraw.org/article/398.html)
|
||||
*
|
||||
* @throws ErrorParsingLineException
|
||||
*
|
||||
* @param $string
|
||||
* @return array
|
||||
* @throws ErrorParsingLineException
|
||||
*/
|
||||
public function parse($string)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user