Add enable_on_routes and disable_on_routes config options
Example usage: enable_on_routes: - '/blog' disable_on_routes: - /blog/blog-post-to-ignore - /ignore-this-route #- '/blog/daring-fireball-link'
This commit is contained in:
parent
fe66c4bfd6
commit
13252376e4
3 changed files with 89 additions and 37 deletions
|
@ -1,41 +1,44 @@
|
|||
<h3>{{'PLUGIN_COMMENTS.ADD_COMMENT'|t}}</h3>
|
||||
{% if grav.twig.enable %}
|
||||
|
||||
<form name="{{ grav.config.plugins.comments.form.name }}"
|
||||
action="{{ uri.rootUrl ~ (grav.config.plugins.comments.form.action|default(page.route)) }}"
|
||||
method="{{ grav.config.plugins.comments.form.method|upper|default('POST') }}">
|
||||
{% for field in grav.config.plugins.comments.form.fields %}
|
||||
<h3>{{'PLUGIN_COMMENTS.ADD_COMMENT'|t}}</h3>
|
||||
|
||||
{% set value = form.value(field.name) %}
|
||||
{% if field.evaluateDefault %}
|
||||
{% set value = evaluate(field.evaluateDefault) %}
|
||||
{% endif %}
|
||||
<div>
|
||||
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<form name="{{ grav.config.plugins.comments.form.name }}"
|
||||
action="{{ uri.rootUrl ~ (grav.config.plugins.comments.form.action|default(page.route)) }}"
|
||||
method="{{ grav.config.plugins.comments.form.method|upper|default('POST') }}">
|
||||
{% for field in grav.config.plugins.comments.form.fields %}
|
||||
|
||||
<div class="buttons">
|
||||
{% for button in grav.config.plugins.comments.form.buttons %}
|
||||
<button class="button" type="{{ button.type|default('submit') }}">{{ button.value|default('Submit') }}</button>
|
||||
{% set value = form.value(field.name) %}
|
||||
{% if field.evaluateDefault %}
|
||||
{% set value = evaluate(field.evaluateDefault) %}
|
||||
{% endif %}
|
||||
<div>
|
||||
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="alert">{{ form.message }}</div>
|
||||
|
||||
{% if grav.twig.comments|length %}
|
||||
|
||||
<h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3>
|
||||
|
||||
<table>
|
||||
{% for comment in grav.twig.comments|array_reverse %}
|
||||
<tr>
|
||||
<td>
|
||||
{{comment.text|e}}
|
||||
<br />
|
||||
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} {{comment.author|e}}
|
||||
</td>
|
||||
</tr>
|
||||
<div class="buttons">
|
||||
{% for button in grav.config.plugins.comments.form.buttons %}
|
||||
<button class="button" type="{{ button.type|default('submit') }}">{{ button.value|default('Submit') }}</button>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="alert">{{ form.message }}</div>
|
||||
|
||||
{% if grav.twig.comments|length %}
|
||||
|
||||
<h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3>
|
||||
|
||||
<table>
|
||||
{% for comment in grav.twig.comments|array_reverse %}
|
||||
<tr>
|
||||
<td>
|
||||
{{comment.text|e}}
|
||||
<br />
|
||||
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} {{comment.author|e}}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue