Skip to content

Commit b707953

Browse files
Merge branch 'master' into pr/407
2 parents 7a01fdd + eba7c9f commit b707953

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1540
-318
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
!/var/cache
66
/var/cache/*
77
!var/cache/.gitkeep
8+
!/var/data
89
!/var/logs
910
/var/logs/*
1011
!var/logs/.gitkeep

app/AppKernel.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public function registerBundles()
2222
new CodeExplorerBundle\CodeExplorerBundle(),
2323
new AppBundle\AppBundle(),
2424
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), // used for initial population of non-SQLite databases in production envs
25-
// uncomment the following line if your application sends emails
26-
// new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
25+
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
2726
];
2827

2928
// Some bundles are only used while developing the application or during

app/Resources/translations/messages.en.xlf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@
202202
<source>label.published_at</source>
203203
<target>Published at</target>
204204
</trans-unit>
205+
<trans-unit id="label.tags">
206+
<source>label.tags</source>
207+
<target>Tags</target>
208+
</trans-unit>
205209
<trans-unit id="label.actions">
206210
<source>label.actions</source>
207211
<target>Actions</target>
@@ -243,6 +247,10 @@
243247
<source>menu.logout</source>
244248
<target>Logout</target>
245249
</trans-unit>
250+
<trans-unit id="menu.rss">
251+
<source>menu.rss</source>
252+
<target>Blog Posts RSS</target>
253+
</trans-unit>
246254

247255
<trans-unit id="post.to_publish_a_comment">
248256
<source>post.to_publish_a_comment</source>
@@ -277,6 +285,15 @@
277285
<target>Post deleted successfully!</target>
278286
</trans-unit>
279287

288+
<trans-unit id="notification.comment_created">
289+
<source>notification.comment_created</source>
290+
<target>Your post received a comment!</target>
291+
</trans-unit>
292+
<trans-unit id="notification.comment_created.description">
293+
<source>notification.comment_created.description</source>
294+
<target><![CDATA[Your post "%title%" has received a new comment. You can read the comment by following <a href="%link%">this link</a>]]></target>
295+
</trans-unit>
296+
280297
<trans-unit id="help.app_description">
281298
<source>help.app_description</source>
282299
<target><![CDATA[This is a <strong>demo application</strong> built in the Symfony Framework to illustrate the recommended way of developing Symfony applications.]]></target>
@@ -317,6 +334,15 @@
317334
<source>help.more_information</source>
318335
<target><![CDATA[For more information, check out the <a href="http://symfony.com/doc">Symfony doc</a>.]]></target>
319336
</trans-unit>
337+
338+
<trans-unit id="rss.title">
339+
<source>rss.title</source>
340+
<target>Symfony Demo blog</target>
341+
</trans-unit>
342+
<trans-unit id="rss.description">
343+
<source>rss.description</source>
344+
<target>Most recent posts published on the Symfony Demo blog</target>
345+
</trans-unit>
320346
</body>
321347
</file>
322348
</xliff>

app/Resources/translations/messages.es.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@
206206
<source>label.published_at</source>
207207
<target>Publicado el</target>
208208
</trans-unit>
209+
<trans-unit id="label.tags">
210+
<source>label.tags</source>
211+
<target>Etiquetas</target>
212+
</trans-unit>
209213
<trans-unit id="label.actions">
210214
<source>label.actions</source>
211215
<target>Acciones</target>

app/Resources/translations/validators.en.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<source>post.too_short_content</source>
1515
<target>Post content is too short ({{ limit }} characters minimum)</target>
1616
</trans-unit>
17+
<trans-unit id="post.too_many_tags">
18+
<source>post.too_many_tags</source>
19+
<target>Too many tags (add {{ limit }} tags or less)</target>
20+
</trans-unit>
1721
<trans-unit id="comment.blank">
1822
<source>comment.blank</source>
1923
<target>Please don't leave your comment blank!</target>

app/Resources/translations/validators.es.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<source>post.too_short_content</source>
1515
<target>El contenido del artículo es demasiado corto ({{ limit }} caracteres como mínimo)</target>
1616
</trans-unit>
17+
<trans-unit id="post.too_many_tags">
18+
<source>post.too_many_tags</source>
19+
<target>Demasiadas etiquetas (añade {{ limit }} como máximo)</target>
20+
</trans-unit>
1721
<trans-unit id="comment.blank">
1822
<source>comment.blank</source>
1923
<target>No es posible dejar el contenido del comentario vacío.</target>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{ include('blog/_delete_post_confirmation.html.twig') }}
2+
<form action="{{ url('admin_post_delete', { id: post.id }) }}" method="post" data-confirmation="true">
3+
<input type="hidden" name="token" value="{{ csrf_token('delete') }}" />
4+
<input type="submit" value="{{ 'action.delete_post'|trans }}" class="btn btn-lg btn-block btn-danger" />
5+
</form>

app/Resources/views/admin/blog/edit.html.twig

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,15 @@
66
<h1>{{ 'title.edit_post'|trans({'%id%': post.id}) }}</h1>
77

88
{{ include('admin/blog/_form.html.twig', {
9-
form: edit_form,
9+
form: form,
1010
button_label: 'action.save'|trans,
1111
include_back_to_home_link: true,
1212
}, with_context = false) }}
1313
{% endblock %}
1414

1515
{% block sidebar %}
1616
<div class="section actions">
17-
{{ include('admin/blog/_form.html.twig', {
18-
form: delete_form,
19-
button_label: 'action.delete_post'|trans,
20-
button_css: 'btn btn-lg btn-block btn-danger',
21-
show_confirmation: true,
22-
}, with_context = false) }}
17+
{{ include('admin/blog/_delete_form.html.twig', { post: post }, with_context = false) }}
2318
</div>
2419

2520
{{ parent() }}

app/Resources/views/admin/blog/index.html.twig

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,31 @@
55
{% block main %}
66
<h1>{{ 'title.post_list'|trans }}</h1>
77

8-
<table class="table table-striped">
8+
<table class="table table-striped table-middle-aligned">
99
<thead>
1010
<tr>
1111
<th scope="col">{{ 'label.title'|trans }}</th>
12-
<th scope="col"><i class="fa fa-user" aria-hidden="true"></i> {{ 'label.author'|trans }}</th>
1312
<th scope="col"><i class="fa fa-calendar" aria-hidden="true"></i> {{ 'label.published_at'|trans }}</th>
14-
<th scope="col"><i class="fa fa-cogs" aria-hidden="true"></i> {{ 'label.actions'|trans }}</th>
13+
<th scope="col" class="text-center"><i class="fa fa-cogs" aria-hidden="true"></i> {{ 'label.actions'|trans }}</th>
1514
</tr>
1615
</thead>
1716
<tbody>
1817
{% for post in posts %}
1918
<tr>
2019
<td>{{ post.title }}</td>
21-
<td>{{ post.authorEmail }}</td>
2220
{# it's not mandatory to set the timezone in localizeddate(). This is done to
2321
avoid errors when the 'intl' PHP extension is not available and the application
2422
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
25-
<td>{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short', null, 'UTC') }}{% endif %}</td>
26-
<td>
23+
<td>{{ post.publishedAt|localizeddate('medium', 'short', null, 'UTC') }}</td>
24+
<td class="text-right">
2725
<div class="item-actions">
2826
<a href="{{ path('admin_post_show', { id: post.id }) }}" class="btn btn-sm btn-default">
2927
{{ 'action.show'|trans }}
3028
</a>
3129

32-
{% if post.isAuthor(app.user) %}
33-
<a href="{{ path('admin_post_edit', { id: post.id }) }}" class="btn btn-sm btn-primary">
34-
<i class="fa fa-edit" aria-hidden="true"></i> {{ 'action.edit'|trans }}
35-
</a>
36-
{% endif %}
30+
<a href="{{ path('admin_post_edit', { id: post.id }) }}" class="btn btn-sm btn-primary">
31+
<i class="fa fa-edit" aria-hidden="true"></i> {{ 'action.edit'|trans }}
32+
</a>
3733
</div>
3834
</td>
3935
</tr>

app/Resources/views/admin/blog/new.html.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
{{ form_row(form.title) }}
1010
{{ form_row(form.summary) }}
1111
{{ form_row(form.content) }}
12-
{{ form_row(form.authorEmail) }}
1312
{{ form_row(form.publishedAt) }}
13+
{{ form_row(form.tags) }}
1414

1515
<input type="submit" value="{{ 'label.create_post'|trans }}" class="btn btn-primary" />
16-
1716
{{ form_widget(form.saveAndCreateNew, { label: 'label.save_and_create_new', attr: { class: 'btn btn-primary' } }) }}
18-
1917
<a href="{{ path('admin_post_index') }}" class="btn btn-link">
2018
{{ 'action.back_to_list'|trans }}
2119
</a>

0 commit comments

Comments
 (0)