Skip to content

Commit

Permalink
Merge branch '5.0' of github.com:Kunstmaan/KunstmaanBundlesCMS
Browse files Browse the repository at this point in the history
* '5.0' of github.com:Kunstmaan/KunstmaanBundlesCMS:
  [NodeBundle] fix issue finding disctinct classes for deleted files (Kunstmaan#2148)
  Translate pagepart type name in delete modal (Kunstmaan#2160)
  [TranslatorBundle] fix non-unique locales in configurator (Kunstmaan#2156)
  [AdminListBundle] use datepicker for DateTimeType filters (Kunstmaan#2159)
  [Docs] Fix the links in the github contributing.md file (Kunstmaan#2166)
  Remove duplicate set in template (Kunstmaan#2168)
  Fixed issue where a date (and time) in the past could be selected when publishing later (Kunstmaan#2163)
  Improved error shown when a page does not have a view location (Kunstmaan#2162)
  [AdminListBundle] Feature/sortable adminlist (Kunstmaan#2143)
  [AdminBundle] revert ckeditor to original version - manual clone - no npm version available (Kunstmaan#2134)
  [NodeBundle] Revert "Fix bug in NodeChoiceType (Kunstmaan#2115)" (Kunstmaan#2133)
  • Loading branch information
diskwriter committed Oct 31, 2018
2 parents 08a4650 + a48099e commit 5883ccb
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 61 deletions.
12 changes: 9 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

We follow most of the procedures for contributions from the [Symfony](http://symfony.com/doc/current/contributing/index.html) and [Sylius](http://sylius.org) project, as such much of this info will look familiar as it embodies current best practices.

* [Reporting a bug or a security issue](../docs/99-01-reporting-issues.md)
* [Submitting pull requests](../docs/99-02-pull-requests.md)
* [Coding standards](../docs/99-03-coding-standards.md)
* [Reporting a bug or a security issue](../docs/contributing/reporting-issues.md)
* [Submitting pull requests](../docs/contributing/pull-requests.md)
* [Coding standards](../docs/contributing/coding-standards.md)
* [Preparing a new release](../docs/contributing/preparing-a-new-release.md)
* [Roadmap](../docs/contributing/roadmap.md)
* [Community bundles](../docs/contributing/community-bundles.md)
* [Release process](../docs/contributing/release-process.md)
* [Translations](../docs/contributing/contributing-translations.md)
* [Ground Control](../docs/contributing/groundcontrol.md)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"test": "gulp test",
"build": "gulp buildOptimized",
"testAndBuild": "gulp testAndBuildOptimized",
"buildGroundControlSkeleton": "gulp buildGroundControlSkeleton"
"buildGroundControlSkeleton": "gulp buildGroundControlSkeleton",
"postinstall": "git clone -b full/4.5.3 --single-branch https://github.com/ckeditor/ckeditor-releases.git node_modules/ckeditor"
},
"author": "Kunstmaan",
"license": "ISC",
Expand Down Expand Up @@ -53,7 +54,6 @@
"babel-polyfill": "^6.26.0",
"bootstrap-sass": "^3.3.7",
"cargobay": "Kunstmaan/cargobay#0.8.6-support",
"ckeditor": "ckeditor/ckeditor-releases.git#full/4.5.11",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"fuse.js": "^3.1.0",
"jstree": "^3.3.3",
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/AdminBundle/Resources/public/css/style.css

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions src/Kunstmaan/AdminBundle/Resources/public/js/admin-bundle.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
max-width: none;
}

.form-group--datetime {
@media (min-width: $screen-sm-min) {

> .form-group--date {
width: 180px;
}

> .form-group--time {
width: 130px;
}
}
}


/* Select 2 Fix
========================================================================== */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<nav role="navigation" id="app__sidebar__navigation" class="app__sidebar__module app__sidebar__navigation"
data-reorder-url="{% if nodebundleisactive is defined %}{{ path('KunstmaanNodeBundle_nodes_reorder') }}{% endif %}"
data-moving-confirmation="{{ "pages.movingconfirmation"|trans }}">
{% set currentMenuItem = adminmenu.current %}
<ul>
{% if lowestTopChild.appearInSidebar %}
<li class="jstree-open {% if lowestTopChild.internalname == currentMenuItem.internalname %}active{% endif %}" {% if lowestTopChild.role %} rel="{{lowestTopChild.role}}" {% endif %}>
Expand Down
28 changes: 26 additions & 2 deletions src/Kunstmaan/AdminListBundle/Controller/AdminListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Kunstmaan\AdminListBundle\Entity\LockableEntityInterface;
use Kunstmaan\AdminListBundle\Event\AdminListEvent;
use Kunstmaan\AdminListBundle\Event\AdminListEvents;
use Kunstmaan\NodeBundle\Entity\HasNodeInterface;
use Kunstmaan\NodeBundle\Entity\NodeTranslation;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Kunstmaan\AdminListBundle\Service\EntityVersionLockService;
Expand Down Expand Up @@ -405,7 +407,10 @@ protected function doMoveUpAction(AbstractAdminListConfigurator $configurator, $
{
$em = $this->getEntityManager();
$sortableField = $configurator->getSortableField();
$repo = $em->getRepository($configurator->getRepositoryName());

$repositoryName = $this->getAdminListRepositoryName($configurator);

$repo = $em->getRepository($repositoryName);
$item = $repo->find($entityId);

$setter = "set".ucfirst($sortableField);
Expand Down Expand Up @@ -438,7 +443,10 @@ protected function doMoveDownAction(AbstractAdminListConfigurator $configurator,
{
$em = $this->getEntityManager();
$sortableField = $configurator->getSortableField();
$repo = $em->getRepository($configurator->getRepositoryName());

$repositoryName = $this->getAdminListRepositoryName($configurator);

$repo = $em->getRepository($repositoryName);
$item = $repo->find($entityId);

$setter = "set".ucfirst($sortableField);
Expand Down Expand Up @@ -537,4 +545,20 @@ protected function buildSortableFieldActions(AbstractAdminListConfigurator $conf
$configurator->addItemAction($action);
}
}

/**
* @param AbstractAdminListConfigurator $configurator
* @return string
*/
protected function getAdminListRepositoryName(AbstractAdminListConfigurator $configurator) {
$em = $this->getEntityManager();
$className = $em->getClassMetadata($configurator->getRepositoryName())->getName();

$implements = class_implements($className);
if (isset($implements[HasNodeInterface::class])) {
return NodeTranslation::class;
}

return $configurator->getRepositoryName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,36 @@
</select>
</div>

<div class="form-group">
<input
type="text"
class="form-control form_datepicker{{ nameprefix }}{{ namesuffix }}"
name="{{ nameprefix }}value{{ namesuffix }}[date]"
{% if data.value['date'] is defined %}value="{{ data.value['date'] }}"{% endif %}
>
</div>
<div class="form-group form-group--datetime">
<div class="form-group form-group--date js-datepicker ">
<div class='input-group date' id='datetimepicker1'>
<input
type="text"
class="form-control form_datepicker{{ nameprefix }}{{ namesuffix }}"
name="{{ nameprefix }}value{{ namesuffix }}"
data-date-format="DD/MM/YYYY"
{% if data.value['date'] is defined %} value="{{ data.value['date'] }}"{% endif %}
{% if datePicker_startDate is defined %} data-startDate="{{ datePicker_startDate }}"{% endif %}
>
<span class="input-group-addon">
<span class="fa fa-calendar-o"></span>
</span>
</div>
</div>

<div class="form-group">
<input
type="text"
class="form-control form_timepicker{{ nameprefix }}{{ namesuffix }}"
name="{{ nameprefix }}value{{ namesuffix }}[time]"
{% if data.value['time'] is defined %}value="{{ data.value['time'] }}"{% endif %}
>
<div class="form-group form-group--time js-datepicker">
<div class='input-group date' id='datetimepicker2'>
<input
type="text"
class="form-control form_datepicker{{ nameprefix }}{{ namesuffix }}"
name="{{ nameprefix }}value{{ namesuffix }}"
data-date-format="HH:mm"
{% if data.value['time'] is defined %} value="{{ data.value['time'] }}"{% endif %}
{% if datePicker_startDate is defined %} data-startDate="{{ datePicker_startDate }}"{% endif %}
>
<span class="input-group-addon">
<span class="fa fa-clock-o"></span>
</span>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion src/Kunstmaan/NodeBundle/Controller/SlugController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function slugAction(Request $request, $url = null, $preview = false)

$view = $renderContext->getView();
if (empty($view)) {
throw $this->createNotFoundException('No page found for slug ' . $url);
throw $this->createNotFoundException(sprintf('Missing view path for page "%s"', get_class($entity)));
}

$template = new Template(array());
Expand Down
20 changes: 9 additions & 11 deletions src/Kunstmaan/NodeBundle/Form/NodeChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,18 @@ public function configureOptions(OptionsResolver $resolver)
$queryBuilder = call_user_func($queryBuilder, $options['em']->getRepository($options['class']));
}

$queryBuilder
->select('n, nt')
->innerJoin('n.nodeTranslations', 'nt')
->innerJoin('nt.publicNodeVersion', 'nv')
->andWhere('nt.online = :online')
->andWhere('nt.lang = :lang')
->andWhere('n.deleted != 1')
->setParameter('lang', $options['locale'] ? $options['locale'] : $this->getCurrentLocale())
->setParameter('online', $options['online']);

if (!empty($options['page_class'])) {
$queryBuilder
->select('n, nt')
->innerJoin('n.nodeTranslations', 'nt')
->innerJoin('nt.publicNodeVersion', 'nv')
->andWhere('nt.online = :online')
->andWhere('nt.lang = :lang')
->andWhere('n.deleted != 1')
->andWhere('n.refEntityName IN(:refEntityName)')
->setParameter('refEntityName', $options['page_class']);
->setParameter('lang', $options['locale'] ? $options['locale'] : $this->getCurrentLocale())
->setParameter('refEntityName', $options['page_class'])
->setParameter('online', $options['online']);
}

return $queryBuilder;
Expand Down
1 change: 1 addition & 0 deletions src/Kunstmaan/NodeBundle/Repository/NodeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ public function findAllDistinctPageClasses()
{
$qb = $this->createQueryBuilder('n')
->select('n.refEntityName')
->where('n.deleted = 0')
->distinct(true);

return $qb->getQuery()->getArrayResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div id="publish-later">
<!-- Date -->
<div class="form-group">
<div class="js-datepicker input-group" data-default-date="true">
<div class="js-datepicker input-group" data-min-date="today" data-default-date="true">
<input id="pub_date" type="text" name="pub_date" class="form-control">
<span class="input-group-addon input-group-addon--has-action">
<i class="fa fa-calendar-o"></i>
Expand All @@ -38,7 +38,7 @@

<!-- Time -->
<div class="form-group">
<div class="js-datepicker input-group" data-format="HH:mm" data-default-date="true" data-stepping="{{ publish_later_stepping }}">
<div class="js-datepicker input-group" data-min-date="today" data-format="HH:mm" data-default-date="true" data-stepping="{{ publish_later_stepping }}">
<input id="pub_tmpckr" type="text" name="pub_time" class="form-control">
<span class="input-group-addon input-group-addon--has-action">
<i class="fa fa-clock-o"></i>
Expand Down Expand Up @@ -67,4 +67,4 @@
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@
<i class="fa fa-times"></i>
</button>
<h3>
{{ 'kuma_pagepart.modal.delete.title.%type%'|trans({'%type%': pagepartadmin.getType(pagepart)}) }}
{{ 'kuma_pagepart.modal.delete.title.%type%'|trans({'%type%': (pagepartadmin.getType(pagepart)) | trans }) }}
</h3>
</div>

<!-- Body -->
<div class="modal-body">
<p>
{{ 'kuma_pagepart.modal.delete.text.%type%'|trans({'%type%': pagepartadmin.getType(pagepart)}) }}
{{ 'kuma_pagepart.modal.delete.text.%type%'|trans({'%type%': (pagepartadmin.getType(pagepart)) | trans }) }}
</p>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function getQueryBuilder()
if (!empty($locales)) {
$this->locales = $locales;
}
$this->locales = array_unique($this->locales);

// Field building hack...
foreach ($this->locales as $locale) {
Expand Down

0 comments on commit 5883ccb

Please sign in to comment.