64 |
|
|
65 |
my $template_full_path = "$template_path/$template_filename"; |
my $template_full_path = "$template_path/$template_filename"; |
66 |
|
|
67 |
|
if ($c->req->params->{save_template}) { |
68 |
|
my $t = $c->req->params->{template_content}; |
69 |
|
my $size = length($t); |
70 |
|
$c->log->debug("saving $template_full_path, $size bytes"); |
71 |
|
if ($webpac->save_html( $template_full_path, $t )) { |
72 |
|
$c->res->output("<span>saved $template_filename, $size bytes</span>"); |
73 |
|
} else { |
74 |
|
$c->res->output("<span>error saving $template_filename!</span>"); |
75 |
|
} |
76 |
|
return; |
77 |
|
} |
78 |
|
|
79 |
$c->log->debug("loading $template_full_path"); |
$c->log->debug("loading $template_full_path"); |
80 |
|
|
81 |
if (! -r $template_full_path) { |
if (! -r $template_full_path) { |
110 |
sub css : Local { |
sub css : Local { |
111 |
my ( $self, $c ) = @_; |
my ( $self, $c ) = @_; |
112 |
|
|
113 |
my $css_file = $c->config->{webpac}->{default_css} || die("need default_css"); |
my $css_filename = $c->config->{webpac}->{default_css} || die("need default_css"); |
114 |
my $css_path = $c->config->{webpac}->{css_path} || die("need css_path"); |
my $css_path = $c->config->{webpac}->{css_path} || die("need css_path"); |
115 |
my $webpac = $c->comp('Model::WebPAC'); |
my $webpac = $c->comp('Model::WebPAC'); |
116 |
|
|
117 |
my $css_full_path = "$css_path/$css_file"; |
my $css_full_path = "$css_path/$css_filename"; |
118 |
|
|
119 |
|
if ($c->req->params->{save_css}) { |
120 |
|
my $t = $c->req->params->{css_content}; |
121 |
|
my $size = length($t); |
122 |
|
$c->log->debug("saving $css_full_path, $size bytes"); |
123 |
|
if ($webpac->save_html( $css_full_path, $t )) { |
124 |
|
$c->res->output("<span>saved $css_filename, $size bytes</span>"); |
125 |
|
} else { |
126 |
|
$c->res->output("<span>error saving $css_filename!</span>"); |
127 |
|
} |
128 |
|
return; |
129 |
|
} |
130 |
|
|
131 |
$c->log->debug("loading $css_full_path"); |
$c->log->debug("loading $css_full_path"); |
132 |
|
|