From fd87aeefb846f7986d936e07fee453fbb25d4833 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Feb 2011 16:13:50 +0100 Subject: cleanup rendering --- templates/vhosts/default.erb | 18 +++++++++--------- templates/vhosts/partials/header_default.erb | 14 +++++++------- templates/vhosts/partials/logs.erb | 28 ++++++++++++++-------------- 3 files changed, 30 insertions(+), 30 deletions(-) (limited to 'templates') diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb index 22aa391..69af8f0 100644 --- a/templates/vhosts/default.erb +++ b/templates/vhosts/default.erb @@ -1,4 +1,4 @@ -<%- +<% vhost_parts = case ssl_mode when 'only' then [:ssl] when false then [:normal] @@ -8,20 +8,20 @@ end vhost_parts.each do |vhost_part| scope.unsetvar('vhost_part') scope.setvar('vhost_part',vhost_part) -%> +-%> > - <%= scope.function_template('apache/vhosts/partials/header_default.erb') %> +<%= scope.function_template('apache/vhosts/partials/header_default.erb') %> - <%= scope.function_template('apache/vhosts/partials/logs.erb') %> +<%= scope.function_template('apache/vhosts/partials/logs.erb') %> - <%- if ssl_mode == 'force' && vhost_part == :normal %> + <% if ssl_mode == 'force' && vhost_part == :normal -%> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L] - <%- else %> - <%= scope.function_template(template_partial) %> - <%- end %> + <% else -%> +<%= scope.function_template(template_partial) %> + <% end -%> -<%- end %> +<% end -%> diff --git a/templates/vhosts/partials/header_default.erb b/templates/vhosts/partials/header_default.erb index 968cfeb..4080ac3 100644 --- a/templates/vhosts/partials/header_default.erb +++ b/templates/vhosts/partials/header_default.erb @@ -1,12 +1,12 @@ Include include.d/defaults.inc - <%- if vhost_part == :ssl %> + <% if vhost_part == :ssl -%> Include include.d/ssl_defaults.inc - <%- end %> + <% end -%> ServerName <%= servername %> - <%- unless serveralias.to_s.empty? || (serveralias.to_s == 'absent') %> - ServerAlias <%= serveralias %> - <%- end %> - <%- unless server_admin.to_s.empty? || (server_admin.to_s == 'absent') %> + <% unless serveralias.to_s.empty? || (serveralias.to_s == 'absent') -%> + ServerAlias <%= serveralias -%> + <% end -%> + <% unless server_admin.to_s.empty? || (server_admin.to_s == 'absent') -%> ServerAdmin <%= server_admin %> - <%- end %> + <% end -%> DocumentRoot <%= documentroot %>/ diff --git a/templates/vhosts/partials/logs.erb b/templates/vhosts/partials/logs.erb index 9b03426..0342c49 100644 --- a/templates/vhosts/partials/logs.erb +++ b/templates/vhosts/partials/logs.erb @@ -1,14 +1,14 @@ - <%- case logmode.to_s - when 'nologs' %> - ErrorLog /dev/null - CustomLog /dev/null - <%- when 'semianonym' %> - ErrorLog <%= logdir %>/error_log - CustomLog <%= logdir %>/access_log noip - <%- when 'anonym' %> - ErrorLog /dev/null - CustomLog <%= logdir %>/access_log noip - <%- else %> - ErrorLog <%= logdir %>/error_log - CustomLog <%= logdir %>/access_log combined - <%- end %> + <% case logmode.to_s + when 'nologs' -%> + ErrorLog /dev/null + CustomLog /dev/null + <% when 'semianonym' -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log noip + <% when 'anonym' -%> + ErrorLog /dev/null + CustomLog <%= logdir %>/access_log noip + <% else -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log combined + <% end -%> -- cgit v1.2.3