Commit fde21ea3 by Alex Bush

First commit

0 parents
#!/usr/bin/env perl
use Mojolicious::Lite;
# Documentation browser under "/perldoc"
plugin 'PODRenderer';
get '/' => sub {
my $self = shift;
$self->render('index');
};
get '/download' => sub {
my $self = shift;
my @files = <public/data/*.zip>;
my $data = [];
foreach my $file (@files) {
my ( undef, $path, $file ) = split (/\//, $file);
push $data, $path . "/" . $file;
}
$self->render(
template => 'download',
layout => 'default',
folders => $data,
);
};
get '/admin' => sub {
my $self = shift;
$self->render(
template => 'admin/files',
layout => 'admin',
);
};
app->start;
__DATA__
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
<div class="row">
<div class="span3">
<ul></ul>
</div>
<div class="span9">
</div>
</div>
\ No newline at end of file
<!--
<div class="row">
<div id="sidebar" class="span4">
<ul class="nav nav-list">
</ul>
</div>
-->
<div>
% foreach my $i (@{$folders}){
% my ($path, $file) = split (/\//, $i);
% my ($game, $ver, $sys) = split (/-/, $file);
% ($sys, undef) = split(/\./, $sys);
<a href="/<%= $i %>">Клиент для <%= $sys %> (версия <%= $ver %>)</a><br>
% }
</div>
% layout 'default';
% title 'Minecraft style';
Добро пожаловать нах
<!doctype html>
<html>
<head>
<title><%= title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/css/style.css" rel="stylesheet" media="screen">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#"><%= title %></a>
<ul class="nav">
<li><a href="#">Home</a></li>
<li><a href="/download">Download</a></li>
<li><a href="/download">wiki</a></li>
</ul>
</div>
</div>
<div id="wrapper" class="container well">
<%= content %>
</div>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
<title><%= title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/css/style.css" rel="stylesheet" media="screen">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#"><%= title %></a>
<ul class="nav">
<li><a href="#">Home</a></li>
<li><a href="/download">Download</a></li>
<li><a href="/download">wiki</a></li>
</ul>
</div>
</div>
<div id="wrapper" class="container well">
<%= content %>
</div>
</body>
</html>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!