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}) { |
if ($c->req->params->{save_template}) { |
68 |
|
|
69 |
|
$c->response->content_type('text/html; charset=utf-8'); |
70 |
|
|
71 |
my $t = $c->req->params->{template_content}; |
my $t = $c->req->params->{template_content}; |
72 |
my $size = length($t); |
my $size = length($t); |
73 |
$c->log->debug("saving $template_full_path, $size bytes"); |
$c->log->debug("saving $template_full_path, $size bytes"); |
83 |
|
|
84 |
if (! -r $template_full_path) { |
if (! -r $template_full_path) { |
85 |
$c->log->warn("can't find '$template_full_path': $!"); |
$c->log->warn("can't find '$template_full_path': $!"); |
86 |
|
$c->response->content_type('text/html; charset=utf-8'); |
87 |
$c->res->output("can't find template '$template_full_path'"); |
$c->res->output("can't find template '$template_full_path'"); |
88 |
return; |
return; |
89 |
} |
} |
121 |
my $css_full_path = "$css_path/$css_filename"; |
my $css_full_path = "$css_path/$css_filename"; |
122 |
|
|
123 |
if ($c->req->params->{save_css}) { |
if ($c->req->params->{save_css}) { |
124 |
|
|
125 |
|
$c->response->content_type('text/html; charset=utf-8'); |
126 |
|
|
127 |
my $t = $c->req->params->{css_content}; |
my $t = $c->req->params->{css_content}; |
128 |
my $size = length($t); |
my $size = length($t); |
129 |
$c->log->debug("saving $css_full_path, $size bytes"); |
$c->log->debug("saving $css_full_path, $size bytes"); |
168 |
|
|
169 |
my $webpac = $c->comp('Model::WebPAC'); |
my $webpac = $c->comp('Model::WebPAC'); |
170 |
|
|
171 |
|
$c->response->content_type('text/html; charset=utf-8'); |
172 |
$c->res->output( |
$c->res->output( |
173 |
$webpac->record( mfn => $mfn, template => $template_filename ) |
$webpac->record( mfn => $mfn, template => $template_filename ) |
174 |
); |
); |