index.html.ep 971 Bytes
% 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>