Themes system
2
Makefile
|
@ -16,7 +16,7 @@ test:
|
||||||
clean:
|
clean:
|
||||||
rm -rf lufi.db files/
|
rm -rf lufi.db files/
|
||||||
dev: clean
|
dev: clean
|
||||||
$(CARTON) morbo $(LUFI) --listen http://0.0.0.0:3000
|
$(CARTON) morbo $(LUFI) --listen http://0.0.0.0:3000 --watch lib/ --watch script/ --watch themes/
|
||||||
|
|
||||||
devlog:
|
devlog:
|
||||||
multitail log/development.log
|
multitail log/development.log
|
||||||
|
|
17
lib/Lufi.pm
|
@ -11,7 +11,7 @@ sub startup {
|
||||||
|
|
||||||
my $config = $self->plugin('Config' => {
|
my $config = $self->plugin('Config' => {
|
||||||
default => {
|
default => {
|
||||||
provisioning => 100,
|
provisioning => 100,
|
||||||
provis_step => 5,
|
provis_step => 5,
|
||||||
length => 10,
|
length => 10,
|
||||||
token_length => 32,
|
token_length => 32,
|
||||||
|
@ -21,11 +21,20 @@ sub startup {
|
||||||
mail => {
|
mail => {
|
||||||
how => 'sendmail'
|
how => 'sendmail'
|
||||||
},
|
},
|
||||||
mail_sender => 'no-reply@lufi.io'
|
mail_sender => 'no-reply@lufi.io',
|
||||||
|
theme => 'default',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
die "You need to provide a contact information in lufi.conf!" unless (defined($config->{contact}));
|
die "You need to provide a contact information in lufi.conf!" unless (defined($self->config('contact')));
|
||||||
|
|
||||||
|
# Themes handling
|
||||||
|
shift @{$self->app->renderer->paths};
|
||||||
|
if ($config->{theme} ne 'default') {
|
||||||
|
my $theme = $self->home->rel_dir('themes/'.$config->{theme});
|
||||||
|
push @{$self->renderer->paths}, $theme.'/templates' if -d $theme.'/templates';
|
||||||
|
}
|
||||||
|
push @{$self->renderer->paths}, $self->home->rel_dir('themes/default/templates');
|
||||||
|
|
||||||
# Mail config
|
# Mail config
|
||||||
my $mail_config = {
|
my $mail_config = {
|
||||||
|
@ -43,7 +52,7 @@ sub startup {
|
||||||
# Debug
|
# Debug
|
||||||
$self->plugin('DebugDumperHelper');
|
$self->plugin('DebugDumperHelper');
|
||||||
|
|
||||||
$self->secrets($config->{secrets});
|
$self->secrets($self->config('secrets'));
|
||||||
|
|
||||||
# Helpers
|
# Helpers
|
||||||
$self->helper(
|
$self->helper(
|
||||||
|
|
|
@ -13,11 +13,20 @@ sub startup {
|
||||||
{
|
{
|
||||||
file => File::Spec->catfile($Bin, '..' ,'lufi.conf'),
|
file => File::Spec->catfile($Bin, '..' ,'lufi.conf'),
|
||||||
default => {
|
default => {
|
||||||
prefix => '/'
|
prefix => '/',
|
||||||
|
theme => 'default',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# Themes handling
|
||||||
|
shift @{$self->static->paths};
|
||||||
|
if ($config->{theme} ne 'default') {
|
||||||
|
my $theme = $self->home->rel_dir('themes/'.$config->{theme});
|
||||||
|
push @{$self->static->paths}, $theme.'/public' if -d $theme.'/public';
|
||||||
|
}
|
||||||
|
push @{$self->static->paths}, $self->home->rel_dir('themes/default/public');
|
||||||
|
|
||||||
$self->plugin('Mount' => {$config->{prefix} => File::Spec->catfile($Bin, '..', 'script', 'application')});
|
$self->plugin('Mount' => {$config->{prefix} => File::Spec->catfile($Bin, '..', 'script', 'application')});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
# optional, default is ['fdjsofjoihrei'], PLEASE, CHANGE IT
|
# optional, default is ['fdjsofjoihrei'], PLEASE, CHANGE IT
|
||||||
#secrets => ['fdjsofjoihrei'],
|
#secrets => ['fdjsofjoihrei'],
|
||||||
|
|
||||||
|
# choose a theme. See the available themes in `themes` directory
|
||||||
|
# optional, default is 'default'
|
||||||
|
#theme => 'default',
|
||||||
|
|
||||||
# length of the random URL
|
# length of the random URL
|
||||||
# optional, default is 8
|
# optional, default is 8
|
||||||
#length => 8,
|
#length => 8,
|
||||||
|
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 961 B After Width: | Height: | Size: 961 B |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -0,0 +1 @@
|
||||||
|
toto
|
|
@ -0,0 +1 @@
|
||||||
|
toto
|
|
@ -1,10 +1,10 @@
|
||||||
templates/layouts/default.html.ep
|
themes/default/templates/layouts/default.html.ep
|
||||||
templates/index.html.ep
|
themes/default/templates/index.html.ep
|
||||||
templates/delays.html.ep
|
themes/default/templates/delays.html.ep
|
||||||
templates/files.html.ep
|
themes/default/templates/files.html.ep
|
||||||
templates/mail.html.ep
|
themes/default/templates/mail.html.ep
|
||||||
templates/msg.html.ep
|
themes/default/templates/msg.html.ep
|
||||||
templates/render.html.ep
|
themes/default/templates/render.html.ep
|
||||||
templates/about.html.ep
|
themes/default/templates/about.html.ep
|
||||||
lib/Lufi/Controller/Files.pm
|
lib/Lufi/Controller/Files.pm
|
||||||
lib/Lufi/Controller/Mail.pm
|
lib/Lufi/Controller/Mail.pm
|
||||||
|
|