If no gist

This commit is contained in:
Simon Vieille 2015-11-23 22:04:48 +01:00
parent 13ceb37df7
commit b98915509a
3 changed files with 30 additions and 22 deletions

View file

@ -19,6 +19,7 @@ app:
my: my:
title: 'My gists' title: 'My gists'
nothing: 'Nothing yet!'
gist: gist:
untitled: 'Untitled' untitled: 'Untitled'

View file

@ -19,6 +19,7 @@ app:
my: my:
title: 'Mes Gists' title: 'Mes Gists'
nothing: 'Rien pour le moment !'
gist: gist:
untitled: 'Sans titre' untitled: 'Sans titre'

View file

@ -11,30 +11,36 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="tab-content"> <div class="tab-content">
{% for gist in user.gists %} {% set gists = user.gists %}
<div class="commit">
<p>
<strong>{{ gist.title ? gist.title : 'gist.untitled'|trans }}</strong>,
{{ gist.createdAt|date('date.format'|trans) }}
</p>
<p>
<button class="btn btn-info btn-sm">
{{ gist.type }}
</button>
{% if not gist.cipher %} {% if gists|length == 0 %}
<a href="{{ path('view', {gist: gist.file}) }}" class="btn btn-warning btn-sm"> {{ 'my.nothing'|trans }}
View {% else %}
</a> {% for gist in user.gists %}
{% else %} <div class="commit">
<button class="btn btn-error btn-sm"> <p>
<span class="glyphicon glyphicon-lock"></span> <strong>{{ gist.title ? gist.title : 'gist.untitled'|trans }}</strong>,
{{ gist.createdAt|date('date.format'|trans) }}
</p>
<p>
<button class="btn btn-info btn-sm">
{{ gist.type }}
</button> </button>
{% endif %}
</p> {% if not gist.cipher %}
</div> <a href="{{ path('view', {gist: gist.file}) }}" class="btn btn-warning btn-sm">
{% endfor %} View
</a>
{% else %}
<button class="btn btn-error btn-sm">
<span class="glyphicon glyphicon-lock"></span>
</button>
{% endif %}
</p>
</div>
{% endfor %}
{% endif %}
</div> </div>
</div> </div>
</div> </div>