Ajout thème Viregul
This commit is contained in:
26
viregul/templates/index.html.ep
Normal file
26
viregul/templates/index.html.ep
Normal file
@@ -0,0 +1,26 @@
|
||||
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
|
||||
% title 'Lstu';
|
||||
<form class="form" method="POST" action="<%== url_for 'add' %>">
|
||||
<fieldset>
|
||||
<label class="sr-only" for="lsturl"><%= l('URL to shorten') %></label>
|
||||
<input type="url" name="lsturl" id="lsturl" class="form-control" placeholder="<%= l('URL to shorten') %>" required>
|
||||
<label class="sr-only" for="lsturl-custom"><%= l('Custom shortened text') %></label>
|
||||
<input type="text" name="lsturl-custom" id="lsturl-custom" class="form-control" placeholder="<%= l('Custom shortened text') %>">
|
||||
<%= submit_button l('Go!'), class => 'button' %>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
% if (defined(stash('short')) && defined(stash('url'))) {
|
||||
<fieldset class="result">
|
||||
<img class="qrcode-result" alt="QRCode" src="data:image/png;base64,<%= stash('qrcode') %>">
|
||||
<label><%= link_to stash('url') => begin %><h4><%= stash('url') %></h4><%= end %></label>
|
||||
⟹ <input id="input-short" value="<%== stash('short') %>" class="form-control">
|
||||
<span id="js" class="hidden"><a href="#" id="clipboard" class="button button-clear" title="<%= l('Copy to clipboard') %>" data-short="<%== stash('short') %>"><h5><span class="icon icon-clipboard"></span></h5></a><span>
|
||||
</fieldset>
|
||||
% }
|
||||
% if (defined(flash('msg'))) {
|
||||
<h3 class="alert alert-danger"><%= flash('msg') %></h3>
|
||||
% }
|
||||
% if (defined(stash('msg'))) {
|
||||
<h3 class="alert alert-danger"><%= stash('msg') %></h3>
|
||||
% }
|
59
viregul/templates/layouts/default.html.ep
Normal file
59
viregul/templates/layouts/default.html.ep
Normal file
@@ -0,0 +1,59 @@
|
||||
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
|
||||
% my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
|
||||
% $year += 1900;
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= title %></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="utf-8" />
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<link rel="icon" type="image/png" href="<%= url_for('/img/favicon.png') %>">
|
||||
<link rel="icon" sizes="128x128" href="<%= url_for('/img/lstu128.png') %>">
|
||||
<link rel="icon" sizes="196x196" href="<%= url_for('/img/lstu196.png') %>">
|
||||
<link rel="apple-touch-icon" href="<%= url_for('/img/lstu60.png') %>">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="<%= url_for('/img/lstu76.png') %>">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="<%= url_for('/img/lstu120.png') %>">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="<%= url_for('/img/lstu152.png') %>">
|
||||
<link rel="apple-touch-icon" sizes="128x128" href="<%= url_for('/img/lstu128.png') %>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="float-left hidden-xs logo">
|
||||
<img src="<%= url_for('/img/lstuviregul.png') %>" alt="lstu logo" width="100" height="100">
|
||||
</div>
|
||||
<%= link_to url_for('/') => (class => 'link_nocol') => begin %><h1 class="hennypenny">Et couic, le lien !</h1><% end %>
|
||||
<p>
|
||||
<small>© 2013 — <%= $year %> <%= link_to 'Luc Didry' => 'https://fiat-tux.fr' %> —
|
||||
<%= l('License:') %> <%= link_to 'WTFPL' => 'http://www.wtfpl.net/' %> —
|
||||
<%= link_to l('About') => 'https://framagit.org/luc/lstu/blob/master/README.md' %> —
|
||||
<%= link_to 'API' => url_for('api') %> —
|
||||
% if (defined(config('ldap')) || defined(config('htpasswd'))) {
|
||||
% if (is_user_authenticated()) {
|
||||
<%= link_to l('Statistics') => url_for('stats') %> —
|
||||
<%= link_to l('Logout') => url_for('/logout')%>
|
||||
% } else {
|
||||
<%= link_to l('Signin') => url_for('/login') %>
|
||||
% }
|
||||
% } else {
|
||||
<%= link_to l('Statistics') => url_for('stats') %>
|
||||
% }
|
||||
— <%= link_to l('Browser extensions') => url_for('extensions') %>
|
||||
</small>
|
||||
</p>
|
||||
<%= content %>
|
||||
</div>
|
||||
% if ($self->app->mode eq 'production') {
|
||||
%= stylesheet '/css/milli-lstu.min.css'
|
||||
% } else {
|
||||
%= stylesheet '/css/milligram.min.css'
|
||||
%= stylesheet '/css/lstu.css'
|
||||
%= stylesheet '/css/fontelico.css'
|
||||
% }
|
||||
% if (defined(stash('short')) && defined(stash('url'))) {
|
||||
%= javascript url_for('lstu.js')
|
||||
% }
|
||||
</body>
|
||||
</html>
|
86
viregul/templates/stats.html.ep
Normal file
86
viregul/templates/stats.html.ep
Normal file
@@ -0,0 +1,86 @@
|
||||
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
|
||||
% title 'Lstu stats';
|
||||
% use Mojo::Date;
|
||||
<h2><%= l('Statistics') %></h2>
|
||||
% if (defined(config('adminpwd')) || defined(config('hashed_adminpwd'))) {
|
||||
% if (!flash('banned')) {
|
||||
<form class="form" method="POST" action="<%== url_for 'stats' %>">
|
||||
<fieldset>
|
||||
% if (defined(stash('admin'))) {
|
||||
<input type="hidden" value="logout" name="action">
|
||||
<%= submit_button l('Logout from admin stats'), class => 'button' %>
|
||||
% } else {
|
||||
<label class="sr-only" for="adminpwd"><%= l('Admin password') %></label>
|
||||
<input type="password" name="adminpwd" id="adminpwd" class="form-control" placeholder="<%= l('Admin password') %>" required>
|
||||
<input type="hidden" value="0" name="page">
|
||||
<%= submit_button l('Go!'), class => 'button' %>
|
||||
% }
|
||||
</fieldset>
|
||||
</form>
|
||||
% }
|
||||
% if (defined(flash('msg'))) {
|
||||
<h3 class="alert alert-danger"><%= flash('msg') %></h3>
|
||||
% }
|
||||
% }
|
||||
|
||||
% if (defined(flash('success_msg'))) {
|
||||
<h3 class="alert alert-success"><%= flash('success_msg') %></h3>
|
||||
% }
|
||||
<form class="form" method="POST" action="<%== url_for 'import_cookie' %>" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<label for="file"><%= l('Import URLs') %></label>
|
||||
<input type="file" name="file" id="file" required>
|
||||
</fieldset>
|
||||
<%= submit_button l('Import URLs'), class => 'button' %>
|
||||
<a href="<%= url_for 'export_cookie' %>" class="button button-outline"><%= l('Export your URLs') %></a>
|
||||
</form>
|
||||
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><%= l('URL') %></th>
|
||||
<th><%= l('Shortened URL') %></th>
|
||||
<th><%= l('Counter') %></th>
|
||||
<th><%= l('Created') %></th>
|
||||
% if (defined(config('adminpwd')) || defined(config('hashed_adminpwd'))) {
|
||||
% unless (defined(stash('admin'))) {
|
||||
<th><%= l('QRCode') %></th>
|
||||
% } else {
|
||||
<th><%= l('Delete') %></th>
|
||||
% }
|
||||
% }
|
||||
</tr>
|
||||
% my $i = 1;
|
||||
% if (defined(stash('page')) && stash('page') >= 0) {
|
||||
% $i = 1 + config('page_offset') * stash('page');
|
||||
% }
|
||||
% my $j = $i;
|
||||
% for my $url (@{$urls}) {
|
||||
<tr>
|
||||
<td><%= $i++ %></td>
|
||||
<td><%= link_to $url->{url} => $url->{url} %></td>
|
||||
<td><%= link_to $prefix.$url->{short} => $prefix.$url->{short} %></td>
|
||||
<td><%= $url->{counter} %></td>
|
||||
<td><%= Mojo::Date->new($url->{timestamp})->to_string %></td>
|
||||
% if (defined(config('adminpwd')) || defined(config('hashed_adminpwd'))) {
|
||||
% unless (defined(stash('admin'))) {
|
||||
<td><img class="qrcode-stat" alt="QRCode" src="data:image/png;base64,<%= $url->{qrcode} %>"></td>
|
||||
% } else {
|
||||
<td><a href="<%= url_for('delete', {short => $url->{short}}) %>"><h5><span class="icon icon-trash"></span></h5></a></td>
|
||||
% }
|
||||
% }
|
||||
</tr>
|
||||
% }
|
||||
</table>
|
||||
% if (defined(config('adminpwd')) || defined(config('hashed_adminpwd'))) {
|
||||
% if (defined(stash('admin'))) {
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
<li class="previous<%= (stash('first')) ? ' disabled' : '' %>"><%= link_to url_for->query(page => (stash('first')) ? 0 : stash('page') - 1) => begin %><span aria-hidden="true">←</span> <%= l('Previous') %><% end %></li>
|
||||
<li class="center"><%= $j.'-'.--$i.'/'.stash('total') %></li>
|
||||
<li class="next<%= (stash('last')) ? ' disabled' : '' %>"><%= link_to url_for->query(page => (stash('last')) ? stash('page') : stash('page') + 1) => begin %><%= l('Next') %> <span aria-hidden="true">→</span><% end %></li>
|
||||
</ul>
|
||||
</nav>
|
||||
% }
|
||||
% }
|
||||
%= link_to l('Home') => '/' => (class => 'button')
|
Reference in New Issue
Block a user