Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/tidying up and removing old cruft #1775

Merged
merged 5 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Controller/Backend/AuthenticationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ public function resetPassword(): Response
'subtitle' => 'controller.authentication.reset_subtitle',
];

return $this->render('@bolt/pages/placeholder.html.twig', $twigVars);
return $this->render('@bolt/security/resetpassword.html.twig', $twigVars);
}
}
9 changes: 9 additions & 0 deletions src/Controller/Backend/ContentEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ public function status(Content $content): Response
$params = ['contentType' => $content->getContentTypeSlug()];
$url = $this->urlGenerator->generate('bolt_content_overview', $params);

$event = new ContentEvent($content);
$this->dispatcher->dispatch($event, ContentEvent::POST_STATUS_CHANGE);

return new RedirectResponse($url);
}

Expand All @@ -251,6 +254,9 @@ public function delete(Content $content): Response
{
$this->validateCsrf('delete');

$event = new ContentEvent($content);
$this->dispatcher->dispatch($event, ContentEvent::PRE_DELETE);

$this->em->remove($content);
$this->em->flush();

Expand All @@ -259,6 +265,9 @@ public function delete(Content $content): Response
$params = ['contentType' => $content->getContentTypeSlug()];
$url = $this->urlGenerator->generate('bolt_content_overview', $params);

$event = new ContentEvent($content);
$this->dispatcher->dispatch($event, ContentEvent::POST_DELETE);

return new RedirectResponse($url);
}

Expand Down
42 changes: 0 additions & 42 deletions src/Controller/Backend/DatabaseIntegrityController.php

This file was deleted.

3 changes: 3 additions & 0 deletions src/Event/ContentEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class ContentEvent extends Event
public const ON_PREVIEW = 'bolt.pre_edit';
public const ON_DUPLICATE = 'bolt.on_duplicate';
public const PRE_STATUS_CHANGE = 'bolt.pre_status_change';
public const POST_STATUS_CHANGE = 'bolt.post_status_change';
public const PRE_DELETE = 'bolt.pre_delete';
public const POST_DELETE = 'bolt.post_delete';

/** @var Content */
private $content;
Expand Down
2 changes: 1 addition & 1 deletion templates/_base/layout.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# Check if aside has value and set hasAside variable #}
{% set hasAside = block('aside')|trim is not empty ? true : false %}
<!DOCTYPE html>
<html lang="{{ app.user.locale }}" {% if block('html_id') %}id="{% block html_id %}{% endblock %}"{% endif %}>
<html lang="{{ app.user.locale|default() }}" {% if block('html_id') %}id="{% block html_id %}{% endblock %}"{% endif %}>

<head>
<meta charset="utf-8">
Expand Down
4 changes: 2 additions & 2 deletions templates/pages/extension_details.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
{% endif %}
<dt class="col-sm-3">{{ 'extensions.title_version'|trans }}</dt>
<dd class="col-sm-9">{{ package.prettyVersion }}</dd>
<dt class="col-sm-3">Dependencies: </dt>
<dt class="col-sm-3">{{ 'extensions.title_dependencies'|trans }}: </dt>
<dd class="col-sm-9">
{% if dependencies is empty %}
<i>No known dependencies</i>
<i>{{ 'extensions.no_dependencies'|trans }}</i>
{% else %}
{% for dependency in dependencies %}
{{ dependency.name }}: {{ dependency.version }} <br>
Expand Down
18 changes: 18 additions & 0 deletions templates/security/resetpassword.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends '@bolt/_base/layout.html.twig' %}
{% import '@bolt/_macro/_macro.html.twig' as macro %}

{% block title %}{{ title|trans }}
{% if subtitle|default() %}» {{ subtitle|trans }} {% endif %}
{% endblock title %}

{% block main %}

<h2>{{ title|trans }}</h2>

<p>Your current version of Bolt does not support this feature. Please contact an administrator.</p>

{% endblock main %}

{% block aside %}

{% endblock %}
12 changes: 12 additions & 0 deletions translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2337,5 +2337,17 @@
<target>New</target>
</segment>
</unit>
<unit id="60xy4WG" name="extensions.no_dependencies">
<segment>
<source>extensions.no_dependencies</source>
<target>No known dependencies</target>
</segment>
</unit>
<unit id="LfwezhR" name="extensions.title_dependencies">
<segment>
<source>extensions.title_dependencies</source>
<target>Dependencies</target>
</segment>
</unit>
</file>
</xliff>