index.html.ep
971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% if ( my $login = session 'login' ) {
<div class="row">
<div class="span1 offset10">
<a href="/news/new" class="btn btn-primary">
<i class="icon-pencil icon-white"></i>
<span><strong>New</strong></span>
</a>
</div>
</div>
<br>
% }
<div class="row">
<div class="well">
<div class="row">
<div class="span9">
<div class="box">
<div class="box-header">Welcome</div>
<div class="box-body">
<h1>Добро пожаловать</h1>
%# dumper $news
</div>
</div>
<hr>
% foreach my $article (@$news ) {
<div class="box">
<div class="box-header"><%= $article->{'name'} %></div>
<div class="box-body">
<%= $article->{'article'} %>
</div>
</div>
% if ( my $login = session 'login' ) {
<div class="btn-group">
<a href="/news/<%= $article->{'id'} %>?a=edit"><button class="btn">Edit</button></a>
<a href="/news/<%= $article->{'id'} %>?a=delete"><button class="btn">Delete</button></a>
</div>
% }
<hr>
% }
</div>
</div>
</div>
</div>