Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Add Build CSS Option
Browse files Browse the repository at this point in the history
  • Loading branch information
mrenvoize authored and root committed Nov 1, 2019
1 parent f1b537b commit 28bbe11
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions sandbox_manager/lib/SandboxManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ sub startup {
$r->any('/restart_all/:name')->to('sandboxes#restart_all');
$r->any('/reindex_full/:name')->to('sandboxes#reindex_full');
$r->any('/rebuild_dbic/:name')->to('sandboxes#rebuild_dbic');
$r->any('/build_css/:name')->to('sandboxes#build_css');
$r->any('/clear_database/:name')->to('sandboxes#clear_database');
}

Expand Down
17 changes: 17 additions & 0 deletions sandbox_manager/lib/SandboxManager/Controller/Sandboxes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ sub rebuild_dbic {
);
}

sub build_css {
my $self = shift;
my $name = $self->stash('name');

$self->redirect_to('/') unless -f "$config_dir/$name.yml";

my $output = qx{ docker exec koha-$name /bin/bash -c "(cd koha; yarn install)" } . "\n";
$output .= qx{ docker exec koha-$name /bin/bash -c "(cd koha; yarn build)" } . "\n";
$output .= qx{ docker exec koha-$name /bin/bash -c "(cd koha; yarn build --view=opac)" } . "\n";

$self->render(
title => "Rebuild of css from scss",
text => $output,
format => 'txt'
);
}

sub delete {
my $self = shift;
my $name = $self->stash('name');
Expand Down
1 change: 1 addition & 0 deletions sandbox_manager/templates/sandboxes/list.html.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<div class="dropdown-menu" aria-labelledby="btnGroupDropActions">
<a class="dropdown-item" target="_blank" href="/restart_all/[% s.KOHA_INSTANCE | html %]"><i class="fas fa-sync"></i> Restart services</a>
<a class="dropdown-item" target="_blank" href="/reindex_full/[% s.KOHA_INSTANCE | html %]"><i class="fas fa-file-alt"></i> Full Zebra Reindex</a>
<a class="dropdown-item" target="_blank" href="/build_css/[% s.KOHA_INSTANCE | html %]"><i class="fas fa-file-alt"></i> Build CSS</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" target="_blank" href="/rebuild_dbic/[% s.KOHA_INSTANCE | html %]"><i class="fas fa-database"></i> Refresh schema</a>
<a class="dropdown-item" target="_blank" href="/clear_database/[% s.KOHA_INSTANCE | html %]"><i class="fas fa-database"></i> Clear database</a>
Expand Down

0 comments on commit 28bbe11

Please sign in to comment.