81 lines
3.1 KiB
Plaintext
81 lines
3.1 KiB
Plaintext
% my $categories = stash 'categories';
|
|
% if (!defined $categories) {
|
|
% $categories = MyRedland::Categories->new->Retrieve;
|
|
% }
|
|
% my $current_slug = stash 'current_slug';
|
|
% if (!defined $current_slug) {
|
|
% $current_slug = $categories->{index}{slug};
|
|
% }
|
|
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<script src="/js/index.js"></script>
|
|
<link rel="stylesheet" href="/css/styles.css"/>
|
|
<title><%= title %></title>
|
|
<meta name="description" content="Lee más sobre: <%= title %>"/>
|
|
<meta property="og:title" content="<%= title %>"/>
|
|
<meta property="og:site_name" content="Redland Official" />
|
|
% my $ogimage = stash 'ogimage';
|
|
% my $user_agent = stash 'useragent';
|
|
% if (defined $ogimage && $user_agent !~ /TelegramBot/) {
|
|
<meta name="image" property="og:image" content="<%= $ogimage %>?v=3"/>
|
|
% } else {
|
|
<meta name="image" property="og:image" content="https://redlandofficial.com/img/redland-logo.png?v=4">
|
|
% }
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
</head>
|
|
<body>
|
|
<div class="site-wrapper">
|
|
</div>
|
|
<div class="page-contents">
|
|
<nav class="desktop"><div><% for my $category_key (sort {
|
|
$categories->{$a}{priority} <=> $categories->{$b}{priority}
|
|
} keys %$categories) {
|
|
my $category = $categories->{$category_key};
|
|
my $selected = defined($current_slug) && $category->{slug} eq $current_slug;
|
|
%><a class="<%=$selected && "selected" %>" href="<%= '/'.$category->{slug} %>"><%==$category->{menu_text}%></a><%
|
|
}
|
|
%></div><%
|
|
if ($self->current_user) {
|
|
if ($self->current_user->avatar) {
|
|
%><a class="common-user-button profile-button" href="/perfil"><img alt="Tu avatar" src="/usuario/avatar"/></a><%
|
|
} else {
|
|
%><a class="common-user-button login-button" href="/perfil"><img alt="Icono de login" src="/img/person.svg"/></a><%
|
|
}
|
|
} else {
|
|
%><a class="common-user-button login-button" href="/login"><img alt="Icono de login" src="/img/person.svg"/></a><%
|
|
}
|
|
%></nav><nav class="mobile-shortcuts">
|
|
<a class="go-to-index" href="<%='/'.$categories->{index}{slug}%>"><%== $categories->{index}{menu_text} %></a>
|
|
<div></div>
|
|
<a href="#mobile-foldable" class="menu-expand"><img class="open-menu-icon" src="/img/menu.png" alt="Expandir el menú."/></a>
|
|
</nav><nav class="mobile-foldable" id="mobile-foldable"><%
|
|
my $first = 1;
|
|
for my $category_key (sort {
|
|
$categories->{$a}{priority} <=> $categories->{$b}{priority}
|
|
} keys %$categories) {
|
|
my $category = $categories->{$category_key};
|
|
%><a href="<%= '/'.$category->{slug} %>"><%==$category->{menu_text}%></a><%
|
|
}
|
|
%></nav><div class="divider">
|
|
% if (stash 'side_menu') {
|
|
<div class="side-menu">
|
|
<%= content 'side_menu' %>
|
|
</div>
|
|
% }
|
|
<div class="main-page-contents">
|
|
<%= content %>
|
|
<hr/>
|
|
<div class="footer description">
|
|
<p>©2022 Sergio Iglesias</p>
|
|
<p>Enterate de todas las novedades de Redland Official:</p>
|
|
<a class="suscribe-category-rss" href="/all.rss">
|
|
<img src="/img/rss.svg" alt="Icono de suscripción rss"/>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|