init python rewrite
This commit is contained in:
parent
d0029c26c7
commit
e0ec6cb9a4
126 changed files with 15064 additions and 0 deletions
3
pythonrewrite/templates/empty.cs
Normal file
3
pythonrewrite/templates/empty.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs # what else would you expect here? ?>
|
3
pythonrewrite/templates/error.cs
Normal file
3
pythonrewrite/templates/error.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs call:error(Data.Error) ?>
|
36
pythonrewrite/templates/footer.cs
Normal file
36
pythonrewrite/templates/footer.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs if:Data.Redirect ?>
|
||||
<p class="warning"><a href="<?cs if:Data.Redirect.URL ?><?cs var:Data.Redirect.URL ?><?cs else ?><?cs call:link('action',Data.Redirect.Action,'','','','') ?><?cs /if ?>"><?cs var:html_escape(Lang.Text.RedirectNote) ?></a></p>
|
||||
<?cs /if ?>
|
||||
|
||||
</div><!-- end of 'words' -->
|
||||
|
||||
<div id="footer">
|
||||
<?cs # Development or not ?>
|
||||
<?cs if:(Data.Status.DevelopmentMode == 1) ?>
|
||||
<div id="development">!Development Mode!</div>
|
||||
<?cs /if ?>
|
||||
<?cs # Version ?>
|
||||
v<?cs var:Data.Version ?>
|
||||
<a href="http://cryptobox.org" title="<?cs var:html_escape(Lang.Text.ProjectHomePage) ?>">CryptoBox-Home</a> <?cs var:html_escape(Lang.Text.ProjectNote) ?> <a href="https://systemausfall.org/senselab" title="systemausfall.org">sense.lab</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CBOX-STATUS-begin - used for validation - do not touch!
|
||||
Data.Config.IP=<?cs var:Data.Config.IP ?>
|
||||
Data.Config.Language=<?cs var:Data.Config.Language ?>
|
||||
Data.Config.TimeOut=<?cs var:Data.Config.TimeOut ?>
|
||||
Data.Status.Config=<?cs var:Data.Status.Config ?>
|
||||
Data.Status.InitRunning=<?cs var:Data.Status.InitRunning ?>
|
||||
Data.Status.IP=<?cs var:Data.Status.IP ?>
|
||||
Data.Status.Mounted=<?cs var:Data.Status.Mounted ?>
|
||||
CBOX-STATUS-end -->
|
||||
|
||||
<?cs # $Revision$ ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
34
pythonrewrite/templates/form_config.cs
Normal file
34
pythonrewrite/templates/form_config.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<div id="config">
|
||||
<h1><?cs var:html_escape(Lang.Title.Config) ?></h1>
|
||||
|
||||
<?cs call:print_form_header() ?>
|
||||
<?cs if:Data.Config.AdminPasswordIsSet ?>
|
||||
<p><label for="current_admin_password"><?cs var:html_escape(Lang.Text.EnterCurrentAdminPassword) ?></label><br/>
|
||||
<input type="password" id="current_admin_password" name="current_admin_password" size="20" maxlength="40" /> </p>
|
||||
<?cs /if ?>
|
||||
|
||||
<!-- turned off - will get moved to system-settings
|
||||
<p><label for="ip"><?cs var:html_escape(Lang.Text.IPAddress) ?></label><br/>
|
||||
<input type="text" id="ip" size="16" maxsize="15" name="ip"
|
||||
value="<?cs var:Data.Config.IP ?>" /><p>
|
||||
-->
|
||||
|
||||
<p><label for="timeout"><?cs var:html_escape(Lang.Text.TimeOut) ?></label><br/>
|
||||
<input type="text" id="timeout" size="5" maxsize="5" name="timeout"
|
||||
value="<?cs var:Data.Config.TimeOut ?>" /></p>
|
||||
|
||||
<p><label for="language"><?cs var:html_escape(Lang.Text.SelectLanguage) ?></label><br/>
|
||||
<select name="language">
|
||||
<?cs each:item = Data.Languages ?>
|
||||
<option value="<?cs name:item ?>" <?cs if:(name(item) == Data.Config.Language) ?>selected="selected"<?cs /if ?>><?cs var:item ?></option>
|
||||
<?cs /each ?>
|
||||
</select></p>
|
||||
|
||||
<input type="hidden" name="action" value="config_do" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.SaveConfig) ?></button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
27
pythonrewrite/templates/form_init.cs
Normal file
27
pythonrewrite/templates/form_init.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Init) ?></h1>
|
||||
|
||||
<div class="init">
|
||||
<?cs call:print_form_header() ?>
|
||||
|
||||
<p class="note"><?cs var:html_escape(Lang.Text.InitWarning) ?></p>
|
||||
<p><label for="confirm"><?cs var:html_escape(Lang.Text.ConfirmInitHint) ?><br/>
|
||||
<span class="note" id="confirmtext"><?cs var:html_escape(Lang.Text.ConfirmInit)
|
||||
?></span></label><br/>
|
||||
<input type="text" id="confirm" name="confirm" size="30" maxlength="50" /></p>
|
||||
<input type="hidden" name="action" value="init_do" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.DoInit) ?></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<!-- TODO: maybe place here some kind of initialization information
|
||||
this should be open for different kinds of init methods (live-cd, ???)
|
||||
<div class="partition_info">
|
||||
<h2><?cs var:html_escape(Lang.Text.PartitionInfo) ?></h2>
|
||||
<p><?cs var:Data.PartitionInfo ?></p>
|
||||
</div>
|
||||
|
||||
-->
|
33
pythonrewrite/templates/form_init_partition.cs
Normal file
33
pythonrewrite/templates/form_init_partition.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Init) ?></h1>
|
||||
|
||||
<?cs call:print_form_header() ?>
|
||||
|
||||
<p class="note"><?cs var:html_escape(Lang.Text.InitWarning) ?></p>
|
||||
<?cs if:Data.Config.AdminPasswordIsSet ?>
|
||||
<p><label for="current_admin_password"><?cs
|
||||
var:html_escape(Lang.Text.EnterCurrentAdminPassword) ?></label><br/>
|
||||
<input type="password" id="current_admin_password" name="current_admin_password"
|
||||
size="20" maxlength="40" /></p><?cs /if ?>
|
||||
<?cs if:Data.CurrentDisk.InitParams.encrypted ?>
|
||||
<p><label for="crypto_password"><?cs var:html_escape(Lang.Text.EnterNewCryptoPassword)
|
||||
?></label><br/>
|
||||
<input type="password" id="crypto_password" name="crypto_password"
|
||||
size="20" maxlength="40" /></p>
|
||||
<p><label for="crypto_password2"><?cs var:html_escape(Lang.Text.EnterSameCryptoPassword)
|
||||
?></label><br/>
|
||||
<input type="password" id="crypto_password2" name="crypto_password2"
|
||||
size="20" maxlength="40" />
|
||||
<input type="hidden" name="encryption" value="selected" /></p>
|
||||
<?cs /if ?>
|
||||
|
||||
<p><label for="confirm"><?cs var:html_escape(Lang.Text.ConfirmInitHint) ?><br/>
|
||||
<span class="note" id="confirmtext"><?cs var:html_escape(Lang.Text.ConfirmInit) ?></span></label><br/>
|
||||
<input type="text" id="confirm" name="confirm" size="30" maxlength="50" /></p>
|
||||
|
||||
<p><input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
||||
<input type="hidden" name="action" value="volume_init_do" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.InitContainer) ?></button></p>
|
||||
</form>
|
||||
|
40
pythonrewrite/templates/form_mount.cs
Normal file
40
pythonrewrite/templates/form_mount.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs if:subcount(Data.Disks.passive) == 0 ?>
|
||||
|
||||
<?cs call:warning('NoDiskAvailableForMount') ?>
|
||||
|
||||
<?cs else ?>
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Mount) ?></h1>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<?cs call:print_form_header() ?>
|
||||
|
||||
<?cs if:subcount(Data.Disks.passive) > 1 ?>
|
||||
<p><label for="device"><?cs var:html_escape(Lang.Text.ChoosePartition) ?></label>
|
||||
<select name="device" id="device" size="0">
|
||||
<?cs each:partition = Data.Disks.passive ?><option value="<?cs
|
||||
var:partition.device ?>"><?cs
|
||||
var:partition.name ?></option>
|
||||
<?cs /each ?>
|
||||
</select></p>
|
||||
<?cs else ?>
|
||||
<p><?cs var:html_escape(Lang.Text.ChosenPartition) ?>: <?cs
|
||||
var:Data.Disks.passive.0.name ?></p>
|
||||
<input type="hidden" name="device" value="<?cs
|
||||
var:Data.Disks.passive.0.device ?>"/>
|
||||
<?cs /if ?>
|
||||
<p><label for="crypto_passwort"><?cs var:html_escape(Lang.Text.EnterCurrentCryptoPassword)
|
||||
?></label>
|
||||
<input type="password" id="crypto_password" name="crypto_password" size="20" maxlength="40" /></p>
|
||||
|
||||
<input type="hidden" name="action" value="mount_do" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.Mount) ?></button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?cs /if ?>
|
||||
|
29
pythonrewrite/templates/form_system.cs
Normal file
29
pythonrewrite/templates/form_system.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.System) ?></h1>
|
||||
|
||||
<p><ul>
|
||||
|
||||
<?cs # poweroff ?>
|
||||
<li><a href="<?cs call:link('action','shutdown_do','type','poweroff','','') ?>" title="<?cs
|
||||
var:html_escape(Lang.Button.PowerOff) ?>"><?cs var:html_escape(Lang.Button.PowerOff) ?></a></li>
|
||||
|
||||
<?cs # reboot ?>
|
||||
<li><a href="<?cs call:link('action','shutdown_do','type','reboot','','') ?>" title="<?cs
|
||||
var:html_escape(Lang.Button.ReBoot) ?>"><?cs var:html_escape(Lang.Button.ReBoot) ?></a></li>
|
||||
|
||||
<?cs # config ?>
|
||||
<li><a href="<?cs call:link('action','config_ask','','','','') ?>" title="<?cs
|
||||
var:html_escape(Lang.Button.Config) ?>"><?cs var:html_escape(Lang.Button.Config) ?></a></li>
|
||||
|
||||
<?cs # initialize ?>
|
||||
<li><a href="<?cs call:link('action','init_ask','','','','') ?>" title="<?cs
|
||||
var:html_escape(Lang.Button.DoInit) ?>"><?cs var:html_escape(Lang.Button.DoInit) ?></a></li>
|
||||
|
||||
<?cs # show log files ?>
|
||||
<li><a href="<?cs call:link('action','show_log','','','','') ?>" title="<?cs
|
||||
var:html_escape(Lang.Button.Protocol) ?>"><?cs var:html_escape(Lang.Button.Protocol) ?></a></li>
|
||||
|
||||
</ul></p>
|
||||
|
||||
</div>
|
37
pythonrewrite/templates/form_umount.cs
Normal file
37
pythonrewrite/templates/form_umount.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs if:subcount(Data.Disks.active) == 0 ?>
|
||||
|
||||
<?cs call:warning('NoDiskAvailableForUmount') ?>
|
||||
|
||||
<?cs else ?>
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Umount) ?></h1>
|
||||
|
||||
<div align="center">
|
||||
<?cs call:print_form_header() ?>
|
||||
|
||||
<?cs if:subcount(Data.Disks.active) > 1 ?>
|
||||
<p><label for="device"><?cs var:html_escape(Lang.Text.ChoosePartition) ?></label>
|
||||
<select name="device" id="device" size="0">
|
||||
<?cs each:partition = Data.Disks.active ?><option value="<?cs
|
||||
var:partition.device ?>"><?cs
|
||||
var:partition.name ?></option>
|
||||
<?cs /each ?>
|
||||
</select></p>
|
||||
<?cs else ?>
|
||||
<?cs # the perl code should take care, that there is at least
|
||||
one mounted disk - otherwise it should display a warning ?>
|
||||
<p><?cs var:html_escape(Lang.Text.ChosenPartition) ?>: <?cs
|
||||
var:Data.Disks.active.0.name ?></p>
|
||||
<input type="hidden" name="device" value="<?cs
|
||||
var:Data.Disks.active.0.device ?>"/>
|
||||
<?cs /if ?>
|
||||
<input type="hidden" name="action" value="umount_do" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.Umount) ?></button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?cs /if ?>
|
||||
|
54
pythonrewrite/templates/header.cs
Normal file
54
pythonrewrite/templates/header.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CryptoBox</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" media="screen" href="<?cs var:Settings.Stylesheet ?>" type="text/css" />
|
||||
<?cs if:Data.Redirect.URL ?><meta http-equiv="refresh" content="<?cs var:Data.Redirect.Delay ?>;url=<?cs var:Data.Redirect.URL ?>" /><?cs
|
||||
elif:Data.Redirect.Action ?><meta http-equiv="refresh" content="<?cs var:Data.Redirect.Delay ?>;url=<?cs call:link('action',Data.Redirect.Action,'','','','') ?>" /><?cs /if ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?cs if:subcount(Data.Disks.available) > 0 ?>
|
||||
<div id="volumes">
|
||||
<?cs include:Settings.TemplateDir + '/show_volumes.cs' ?>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
|
||||
<div id="lang">
|
||||
<?cs each:item = Data.Languages ?>
|
||||
<a href="<?cs call:link('weblang',name(item),'','','','') ?><?cs
|
||||
if:Data.QueryString ?>&<?cs var:Data.QueryString ?><?cs /if ?>"><?cs
|
||||
var:item ?></a><br/>
|
||||
<?cs /each ?>
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
<?cs if:subcount(Data.Disks.active) > 0 ?>
|
||||
<div id="head_red">
|
||||
<?cs else ?>
|
||||
<div id="head_green">
|
||||
<?cs /if ?>
|
||||
<h1><?cs var:html_escape(Lang.Title.Top) ?></h1>
|
||||
<h2><?cs var:html_escape(Lang.Title.Slogan) ?></h2>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div id="menu">
|
||||
<?cs if:Data.Redirect.URL ?>
|
||||
<?cs # the menu bar is disabled if redirection has been suggested ?>
|
||||
|
||||
<?cs else ?>
|
||||
<?cs include:Settings.TemplateDir + '/nav.cs' ?>
|
||||
<?cs /if ?>
|
||||
</div>
|
||||
|
||||
<div id="words">
|
||||
|
82
pythonrewrite/templates/macros.cs
Normal file
82
pythonrewrite/templates/macros.cs
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?cs # $Id$ ?><?cs
|
||||
|
||||
def:warning(warnname)
|
||||
?><div class="warning"><?cs
|
||||
if:?Lang.WarningMessage[warnname].Title
|
||||
?>
|
||||
<h1><?cs var:html_escape(Lang.WarningMessage[warnname].Title) ?></h1>
|
||||
<p><?cs var:html_escape(Lang.WarningMessage[warnname].Text) ?></p>
|
||||
<?cs else ?>
|
||||
<h1>unknown warning message</h1>
|
||||
<p>could not find warning message: '<?cs var:warnname ?>'</p>
|
||||
<?cs /if ?></div><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
||||
def:error(errname)
|
||||
?><div class="error"><?cs
|
||||
if:?Lang.ErrorMessage[errname].Title
|
||||
?>
|
||||
<h1><?cs var:html_escape(Lang.ErrorMessage[errname].Title) ?></h1>
|
||||
<p><?cs var:html_escape(Lang.ErrorMessage[errname].Text) ?></p>
|
||||
<?cs else ?>
|
||||
<h1>unknown error message</h1>
|
||||
<p>could not find error message: '<?cs var:errname ?>'</p>
|
||||
<?cs /if ?></div><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
||||
def:success(succname)
|
||||
?><div class="success"><?cs
|
||||
if:?Lang.SuccessMessage[succname].Title
|
||||
?>
|
||||
<h1><?cs var:html_escape(Lang.SuccessMessage[succname].Title) ?></h1>
|
||||
<p><?cs var:html_escape(Lang.SuccessMessage[succname].Text) ?></p>
|
||||
<?cs else ?>
|
||||
<h1>unknown success message</h1>
|
||||
<p>could not find success message: '<?cs var:succname ?>'</p>
|
||||
<?cs /if ?></div><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
||||
def:parseTree(root) ?><?cs #
|
||||
# the output looks quite ugly and is not very helpful as there are
|
||||
# only a few values
|
||||
?><!-- data tree
|
||||
<?cs each:item = root ?><?cs
|
||||
name:item ?>: <?cs var:item ?><?cs
|
||||
each:subitem = item ?> / <?cs name:subitem ?>=<?cs var:subitem ?><?cs /each ?>
|
||||
<?cs /each ?>
|
||||
--><?cs
|
||||
/def ?><?cs
|
||||
|
||||
def:link(attr1, value1, attr2, value2, attr3, value3)
|
||||
?><?cs each:attrs = Temp
|
||||
?><?cs set:attrs = ""
|
||||
?><?cs /each
|
||||
?><?cs each:attrs = Settings.LinkAttrs
|
||||
?><?cs set:Temp[url_escape(name(attrs))] = url_escape(attrs)
|
||||
?><?cs /each
|
||||
?><?cs if:attr1 != "" ?><?cs set:Temp[attr1] = value1 ?><?cs /if
|
||||
?><?cs if:attr2 != "" ?><?cs set:Temp[attr2] = value2 ?><?cs /if
|
||||
?><?cs if:attr3 != "" ?><?cs set:Temp[attr3] = value3 ?><?cs /if
|
||||
?><?cs var:ScriptName
|
||||
?><?cs set:first_each = 1
|
||||
?><?cs if:subcount(Temp) > 0
|
||||
?><?cs each:attrs = Temp
|
||||
?><?cs if:(name(attrs) != "") && (attrs != "")
|
||||
?><?cs if:first_each == 1 ?><?cs
|
||||
set:first_each = 0 ?>?<?cs
|
||||
else
|
||||
?>&<?cs /if
|
||||
?><?cs var:url_escape(name(attrs)) ?>=<?cs var:url_escape(attrs)
|
||||
?><?cs /if
|
||||
?><?cs /each
|
||||
?><?cs /if ?><?cs
|
||||
/def ?><?cs
|
||||
|
||||
def:print_form_header() ?><?cs #
|
||||
# the header of a form - including Setting.LinkAttrs
|
||||
?><form action="<?cs call:link("","","","","","") ?>" method="post" enctype="application/x-www-from-urlencoded" accept-charset="utf-8"><?cs
|
||||
/def ?>
|
||||
|
16
pythonrewrite/templates/main.cs
Normal file
16
pythonrewrite/templates/main.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs include:Settings.TemplateDir + '/macros.cs' ?>
|
||||
<?cs include:Settings.TemplateDir + '/header.cs' ?>
|
||||
|
||||
<!-- chosen cryptobox template: <?cs var:Data.Action ?> -->
|
||||
|
||||
<?cs if:Data.Error ?>
|
||||
<?cs include:Settings.TemplateDir + '/error.cs' ?>
|
||||
<?cs else ?>
|
||||
<?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?>
|
||||
<?cs if:Data.Success ?><?cs call:success(Data.Success) ?><?cs /if ?>
|
||||
<?cs include:Settings.TemplateDir + '/' + Data.Action + '.cs' ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs include:Settings.TemplateDir + '/footer.cs' ?>
|
26
pythonrewrite/templates/nav.cs
Normal file
26
pythonrewrite/templates/nav.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs # mounting possible? ?>
|
||||
<?cs if:((Data.Status.Config == 1) && (Data.Status.InitRunning == 0)) ?>
|
||||
|
||||
<!-- TODO: remove the following lines, as soon as we completely switched to the volume-based user interface
|
||||
<?cs if:subcount(Data.Disks.passive) > 0 ?>
|
||||
<a href="<?cs call:link('action','mount_ask','','','','') ?>" title="<?cs var:html_escape(Lang.Text.DoMount) ?>"><?cs var:html_escape(Lang.Button.Mount) ?></a><?cs /if ?>
|
||||
<?cs if:subcount(Data.Disks.active) > 0 ?>
|
||||
<a href="<?cs call:link('action','umount_ask','','','','') ?>" title="<?cs var:html_escape(Lang.Text.DoUmount) ?>"><?cs var:html_escape(Lang.Button.Umount) ?></a><?cs /if ?>
|
||||
-->
|
||||
|
||||
<a href="<?cs if:subcount(Data.Disks.available) > 1
|
||||
?><?cs call:link('action','show_status','','','','')
|
||||
?><?cs else
|
||||
?><?cs call:link('action','show_volume','device',Data.Disks.available.0.device,'','')
|
||||
?><?cs /if
|
||||
?>" title="<?cs var:html_escape(Lang.Button.Status) ?>"><?cs var:html_escape(Lang.Button.Status) ?></a>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # manual ?>
|
||||
<a href="<?cs call:link('action','doc','','','','') ?>" title="<?cs var:html_escape(Lang.Button.Documentation) ?>"><?cs var:html_escape(Lang.Button.Documentation) ?></a>
|
||||
|
||||
<?cs # system ?>
|
||||
<a href="<?cs call:link('action','system_ask','','','','') ?>" title="<?cs var:html_escape(Lang.Button.System) ?>"><?cs var:html_escape(Lang.Button.System) ?></a>
|
||||
|
7
pythonrewrite/templates/show_doc.cs
Normal file
7
pythonrewrite/templates/show_doc.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<div id="doc">
|
||||
|
||||
<?cs include:Settings.DocDir + '/' + Settings.DocLang + '/' + Data.Doc.Page + '.html' ?>
|
||||
|
||||
</div>
|
13
pythonrewrite/templates/show_log.cs
Normal file
13
pythonrewrite/templates/show_log.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<div id="log">
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Log) ?></h1>
|
||||
|
||||
<?cs if:Data.Log ?>
|
||||
<p class="console"><?cs var:Data.Log ?></p>
|
||||
<?cs else ?>
|
||||
<p><?cs var:html_escape(Lang.Text.EmptyLog) ?></p>
|
||||
<?cs /if ?>
|
||||
|
||||
</div>
|
28
pythonrewrite/templates/show_status.cs
Normal file
28
pythonrewrite/templates/show_status.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Status) ?></h1>
|
||||
|
||||
<?cs if:subcount(Data.Disks.available) == 0 ?>
|
||||
<?cs # there are no partitions available ?>
|
||||
<?cs # this case may never be true, as it should trigger a warning before ?>
|
||||
<p>Sorry - you should have never seen this ...</p>
|
||||
<?cs # elif:subcount(Data.Disks.active) == subcount(Data.Disks.available) ?>
|
||||
<?cs # all available disks are mounted ?>
|
||||
<?cs # we do not use this special condition now - or should we? ?>
|
||||
<?cs # elif:subcount(Data.Disks.passive) == subcount(Data.Disks.available) ?>
|
||||
<?cs # no available disk is mounted ?>
|
||||
<?cs # we do not use this special condition now - or should we? ?>
|
||||
<?cs else ?>
|
||||
<?cs # some are mounted - and some are not ... ?>
|
||||
<?cs if:subcount(Data.Disks.active) > 0 ?>
|
||||
<p><?cs var:html_escape(Lang.Text.ActivePartitions) ?>:
|
||||
<ul><?cs each:partition = Data.Disks.active ?>
|
||||
<li><a href="<?cs call:link('action','show_volume','device',partition.device,'','')
|
||||
?>"><?cs var:partition.name ?></a></li><?cs /each ?></ul><?cs /if ?>
|
||||
<?cs if:subcount(Data.Disks.passive) > 0 ?>
|
||||
<p><?cs var:html_escape(Lang.Text.PassivePartitions) ?>:
|
||||
<ul><?cs each:partition = Data.Disks.passive ?>
|
||||
<li><a href="<?cs call:link('action','show_volume','device',partition.device,'','')
|
||||
?>"><?cs var:partition.name ?></a></li><?cs /each ?></ul><?cs /if ?>
|
||||
<?cs /if ?>
|
||||
|
71
pythonrewrite/templates/show_volume.cs
Normal file
71
pythonrewrite/templates/show_volume.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Volume) ?> <i><?cs var:html_escape(Data.CurrentDisk.name) ?></i></h1>
|
||||
|
||||
<?cs # is the disc accessible? ?>
|
||||
<?cs if:Data.CurrentDisk.encryption || Data.CurrentDisk.plaintext ?>
|
||||
<?cs # is the disc active? ?>
|
||||
<?cs if:!Data.CurrentDisk.active ?>
|
||||
<h2>Mount container</h2>
|
||||
<?cs call:print_form_header() ?>
|
||||
<p>
|
||||
<?cs if:Data.CurrentDisk.encryption ?>
|
||||
<label for="crypto_passwort"><?cs var:html_escape(Lang.Text.EnterCurrentCryptoPassword) ?></label>
|
||||
<input type="password" id="crypto_password" name="crypto_password" size="20" maxlength="40" />
|
||||
<?cs /if ?>
|
||||
<input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
||||
<input type="hidden" name="action" value="mount_do" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.Mount) ?></button></p>
|
||||
</form>
|
||||
<?cs else ?>
|
||||
<h2>Unmount container</h2>
|
||||
<?cs call:print_form_header() ?>
|
||||
<p><input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
||||
<input type="hidden" name="action" value="umount_do" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.Umount) ?></button></p>
|
||||
</form>
|
||||
<?cs /if ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # name change is only possible if the volume is not mounted ?>
|
||||
<?cs if:!Data.CurrentDisk.active ?>
|
||||
<h2>Change the name of the container</h2>
|
||||
<?cs call:print_form_header() ?>
|
||||
<p><label for="vol_name"><?cs var:html_escape(Lang.Text.ContainerName) ?></label>
|
||||
<input type="text" name="volume_name" size="20" id="volume_name" value="<?cs var:html_escape(Data.CurrentDisk.name) ?>" />
|
||||
<input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
||||
<input type="hidden" name="action" value="volume_name_set" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.ContainerNameSet) ?></button></p>
|
||||
</form>
|
||||
<?cs /if ?>
|
||||
|
||||
|
||||
<?cs # move initialization to the "system" menu ?>
|
||||
<?cs if:!Data.CurrentDisk.active ?>
|
||||
<h2>Reinitialize container</h2>
|
||||
<?cs call:print_form_header() ?>
|
||||
<p><input type="checkbox" name="encryption" id="encryption" value="selected" checked="checked" />
|
||||
<label for="encryption"><?cs var:html_escape(Lang.Text.ContainerEncryption) ?></label>
|
||||
<input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
||||
<input type="hidden" name="action" value="volume_init_ask" />
|
||||
<button type="submit"><?cs var:html_escape(Lang.Button.InitContainer) ?></button></p>
|
||||
</form>
|
||||
<?cs /if ?>
|
||||
|
||||
<h2>Some more stuff</h2>
|
||||
<p>For example: changing password? / backup? / access control?</p>
|
||||
|
||||
<h2>Details</h2>
|
||||
<p><ul>
|
||||
<li>Name of container: <?cs var:html_escape(Data.CurrentDisk.name) ?></li>
|
||||
<li>Name of device: <?cs var:html_escape(Data.CurrentDisk.device) ?></li>
|
||||
<li>Current status: <?cs if:Data.CurrentDisk.active ?>active<?cs else ?>passive<?cs /if ?></li>
|
||||
<li>Encryption: <?cs if:Data.CurrentDisk.encryption ?>on<?cs else ?>off<?cs /if ?></li>
|
||||
<?cs if:Data.CurrentDisk.active ?>
|
||||
<li>Size of container: <?cs var:html_escape(Data.CurrentDisk.capacity.size) ?></li>
|
||||
<li>Available space of container: <?cs var:html_escape(Data.CurrentDisk.capacity.free) ?></li>
|
||||
<li>Used space of container: <?cs var:html_escape(Data.CurrentDisk.capacity.used)
|
||||
?> / <?cs var:html_escape(Data.CurrentDisk.capacity.percent) ?></li>
|
||||
<?cs /if ?>
|
||||
</ul></p>
|
||||
|
15
pythonrewrite/templates/show_volumes.cs
Normal file
15
pythonrewrite/templates/show_volumes.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?cs # $Id$ ?>
|
||||
|
||||
<?cs each:volume = Data.Disks.available ?>
|
||||
|
||||
<a href="<?cs call:link('action','show_volume','device',volume.device,'','') ?>" title="<?cs
|
||||
var:volume.name ?>">
|
||||
<?cs # the "div" is the container for the background image ?>
|
||||
<div class="<?cs if:volume.isActive ?>active<?cs else ?>passive<?cs /if ?><?cs
|
||||
if:volume.device == Data.CurrentDisk.device ?> current<?cs /if ?>">
|
||||
<p><?cs var:volume.name ?></p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<?cs /each ?>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue