File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
app/Resources/views/admin/blog
src/AppBundle/Controller/Admin Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 9
9
<thead >
10
10
<tr >
11
11
<th scope =" col" >{{ ' label.title' | trans }}</th >
12
- <th scope =" col" ><i class =" fa fa-user" aria-hidden =" true" ></i > {{ ' label.author' | trans }}</th >
13
12
<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 = " col-xs-1 " ><i class =" fa fa-cogs" aria-hidden =" true" ></i > {{ ' label.actions' | trans }}</th >
15
14
</tr >
16
15
</thead >
17
16
<tbody >
18
17
{% for post in posts %}
19
18
<tr >
20
19
<td >{{ post .title }}</td >
21
- <td >{{ post .authorEmail }}</td >
22
20
{# it's not mandatory to set the timezone in localizeddate(). This is done to
23
21
avoid errors when the 'intl' PHP extension is not available and the application
24
22
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
29
27
{{ ' action.show' | trans }}
30
28
</a >
31
29
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 >
37
33
</div >
38
34
</td >
39
35
</tr >
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class BlogController extends Controller
55
55
public function indexAction ()
56
56
{
57
57
$ entityManager = $ this ->getDoctrine ()->getManager ();
58
- $ posts = $ entityManager ->getRepository (Post::class)->findBy ([], ['publishedAt ' => 'DESC ' ]);
58
+ $ posts = $ entityManager ->getRepository (Post::class)->findBy ([' authorEmail ' => $ this -> getUser ()-> getEmail () ], ['publishedAt ' => 'DESC ' ]);
59
59
60
60
return $ this ->render ('admin/blog/index.html.twig ' , ['posts ' => $ posts ]);
61
61
}
You can’t perform that action at this time.
0 commit comments