Implement snip hiding
This commit is contained in:
@ -1,3 +1,13 @@
|
||||
{% if snip.visible %}
|
||||
<span class="badge bg-success">
|
||||
<i class="fa fa-eye"></i>
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">
|
||||
<i class="fa fa-eye-slash"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if snip.public %}
|
||||
<span class="badge bg-info">
|
||||
<i class="fa fa-lock-open"></i>
|
||||
|
@ -1,6 +1,10 @@
|
||||
{% extends 'base/single.column.html.twig' %}
|
||||
|
||||
{% set title = 'Snip edit ' ~ snip %}
|
||||
{% if snip.id %}
|
||||
{% set title = 'Edit Snip ' ~ snip %}
|
||||
{% else %}
|
||||
{% set title = 'Create Snip' %}
|
||||
{% endif %}
|
||||
|
||||
{% block body %}
|
||||
{% if snip.id %}
|
||||
|
@ -1,22 +1,24 @@
|
||||
{% extends 'base/single.column.html.twig' %}
|
||||
|
||||
{% set title = 'My Snips' %}
|
||||
|
||||
{% block body %}
|
||||
<a class="btn btn-success" href="{{ path('snip_new') }}">
|
||||
<i class="fa fa-plus"></i> Add
|
||||
</a>
|
||||
{% if request.onlyVisible %}
|
||||
<a class="btn btn-secondary" href="{{ path('snip_index', {onlyVisible: false}) }}">Show hidden</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href="{{ path('snip_index', {onlyVisible: true}) }}">Hide hidden</a>
|
||||
{% endif %}
|
||||
<br><br>
|
||||
<div class="list-group">
|
||||
{% for snip in snips %}
|
||||
<a class="list-group-item d-flex justify-content-between" href="{{ path('snip_single', {snip: snip.id}) }}">
|
||||
<span>
|
||||
{% if snip.createdBy == app.user %}
|
||||
{{ include('snip/badge.html.twig', {snip: snip}) }}
|
||||
{% endif %}
|
||||
{{ include('snip/badge.html.twig', {snip: snip}) }}
|
||||
{{ snip }}
|
||||
</span>
|
||||
{% if snip.createdBy != app.user %}
|
||||
{{ include('user/badge.html.twig', {user: snip.createdBy}) }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
16
templates/snip/public.html.twig
Normal file
16
templates/snip/public.html.twig
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends 'base/single.column.html.twig' %}
|
||||
|
||||
{% set title = 'Public Snips' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="list-group">
|
||||
{% for snip in snips %}
|
||||
<a class="list-group-item d-flex justify-content-between" href="{{ path('snip_single', {snip: snip.id}) }}">
|
||||
<span>
|
||||
{{ snip }}
|
||||
</span>
|
||||
{{ include('user/badge.html.twig', {user: snip.createdBy}) }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user