captive: Allow selecting highlight colour in web interface

To be able to customise the access page, we now allow the
user to select a brand colour.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2017-04-26 12:03:08 +01:00
parent 4b33d29de7
commit f8d35875d8
15 changed files with 34 additions and 14 deletions

View File

@@ -73,6 +73,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){
$settings{'AUTH'} = $cgiparams{'AUTH'};
$settings{'TITLE'} = $cgiparams{'TITLE'};
$settings{'UNLIMITED'} = $cgiparams{'UNLIMITED'};
$settings{'COLOR'} = $cgiparams{'COLOR'};
if (!$errormessage){
#Check if we need to upload a new logo
@@ -311,6 +312,13 @@ END
print"<td><br>$Lang::tr{'no'}</td></tr>";
}
print<<END
<tr>
<td>$Lang::tr{'Captive brand color'}</td>
<td>
<input type="color" name="COLOR" value="$settings{'COLOR'}">
</td>
</tr>
<tr>
<td>
</td>

View File

@@ -148,6 +148,7 @@ if ($settings{'AUTH'} eq "VOUCHER") {
}
$tmpl->param(TITLE => $settings{'TITLE'});
$tmpl->param(COLOR => $settings{'COLOR'});
$tmpl->param(ERROR => $errormessage);
$tmpl->param(TAC => &gettac());

View File

@@ -8,6 +8,14 @@
<link rel="stylesheet" href="../assets/bootstrap-grid.min.css">
<link rel="stylesheet" href="../assets/captive.css">
<TMPL_IF NAME="COLOR">
<style>
.box-block {
background-color: <TMPL_VAR NAME="COLOR">;
}
</style>
</TMPL_IF>
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">