'show_volume' splitted into different pages

'/plugins' shows only plugins with 'system' capability
development draft for volume sub-page links
"access_denied" page added
This commit is contained in:
lars 2006-10-09 16:42:40 +00:00
parent 5fd04cf350
commit 0e8a5daa73
8 changed files with 75 additions and 87 deletions

View file

@ -0,0 +1,4 @@
<h1><?cs var:html_escape(Lang.Title.AccessDenied) ?></h2>
<div class="unavailable_action"><?cs var:html_escape(Lang.Text.AccessDenied) ?></div>

View file

@ -22,11 +22,3 @@
<hr/> <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>
-->

View file

@ -7,21 +7,12 @@
<?cs # sort the Plugins - using the most stupid way :) ?> <?cs # sort the Plugins - using the most stupid way :) ?>
<?cs loop: order = #0, #100, #1 <?cs loop: order = #0, #100, #1
?><?cs # plugins ?><?cs each:x = Settings.PluginList ?><?cs # plugins ?><?cs each:x = Settings.PluginList
?><?cs if:x.Rank == order ?> ?><?cs if:x.Types.system && x.Rank == order ?>
<li><a href="<?cs call:link('plugins/' + name(x),'','','','') ?>" title="<?cs <li><a href="<?cs call:link('plugins/' + name(x),'','','','') ?>" title="<?cs
var:html_escape(x.Link) ?>"><?cs var:html_escape(x.Link) ?></a></li><?cs var:html_escape(x.Link) ?>"><?cs var:html_escape(x.Link) ?></a></li><?cs
/if ?><?cs /if ?><?cs
/each ?><?cs /each ?><?cs
/loop ?> /loop ?>
<?cs # maybe someone forgot to set the rank of a plugin: we try to catch them ?>
<?cs # plugins ?><?cs each:x = Settings.PluginList ?><?cs
if:!x.Rank || !(x.Rank >= 0 && x.Rank <= 100) ?>
<li><a href="<?cs call:link('plugins/' + name(x),'','','','') ?>" title="<?cs
var:html_escape(x.Link) ?>"><?cs var:html_escape(x.Link) ?></a></li><?cs
/if ?><?cs
/each ?>
</ul></p> </ul></p>

View file

@ -5,12 +5,10 @@
<!-- chosen cryptobox template: <?cs var:Settings.TemplateFile ?> --> <!-- chosen cryptobox template: <?cs var:Settings.TemplateFile ?> -->
<?cs if:Data.Error ?> <?cs if:Data.Error ?><?cs include:Settings.TemplateDir + '/error.cs' ?><?cs /if ?>
<?cs include:Settings.TemplateDir + '/error.cs' ?>
<?cs else ?>
<?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?> <?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?>
<?cs if:Data.Success ?><?cs call:success(Data.Success) ?><?cs /if ?> <?cs if:Data.Success ?><?cs call:success(Data.Success) ?><?cs /if ?>
<?cs include:Settings.TemplateFile ?> <?cs include:Settings.TemplateFile ?>
<?cs /if ?>
<?cs include:Settings.TemplateDir + '/footer.cs' ?> <?cs include:Settings.TemplateDir + '/footer.cs' ?>

View file

@ -1,66 +1,10 @@
<?cs # $Id$ ?> <?cs # $Id$ ?>
<h1><?cs var:html_escape(Lang.Title.Volume) ?> <i><?cs var:html_escape(Data.CurrentDisk.name) ?></i></h1> <?cs include:Settings.TemplateDir + "/show_volume_header.cs" ?>
<?cs # is the disc accessible? ?> <div align="center">
<?cs if:Data.CurrentDisk.encryption || Data.CurrentDisk.plaintext ?> <image src="../cryptobox-misc/evil_stick.png" style="margin:20px">
<?cs # is the disc active? ?> <p>just a placeholder - any suggestions are welcome!</p>
<?cs if:!Data.CurrentDisk.active ?> </div>
<h2>Mount container</h2>
<?cs call:print_form_header("mount_do") ?>
<p>
<?cs if:Data.CurrentDisk.encryption ?>
<label for="crypto_passwort"><?cs var:html_escape(Lang.Text.EnterCurrentCryptoPassword) ?></label>
<input type="password" tabindex="1" 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) ?>" />
<button type="submit" tabindex="2"><?cs var:html_escape(Lang.Button.Mount) ?></button></p>
</form>
<?cs else ?>
<h2>Unmount container</h2>
<?cs call:print_form_header("umount_do") ?>
<p><input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
<button type="submit" tabindex="2"><?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("volume_name_set") ?>
<p><label for="volume_name"><?cs var:html_escape(Lang.Text.ContainerName) ?></label>
<input type="text" name="volume_name" tabindex="10" 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) ?>" />
<button type="submit" tabindex="11"><?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("volume_init_ask") ?>
<p><input type="checkbox" name="encryption" tabindex="20" 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) ?>" />
<button type="submit" tabindex="21"><?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.percent) ?>%</li>
<?cs /if ?>
</ul></p>
<?cs include:Settings.TemplateDir + "/show_volume_footer.cs" ?>

View file

@ -0,0 +1,13 @@
<!-- end of plugin pane -->
</div></td>
<td class="pane_right"></td>
</tr>
<?cs # bottom line of the pane ?>
<tr>
<td class="pane_bottom_left"></td>
<td class="pane_bottom" colspan="<?cs var:volume_plugin_count ?>"></td>
<td class="pane_bottom_right"></td>
</tr>
</table>

View file

@ -0,0 +1,24 @@
<?cs # $Id$ ?>
<?cs # TODO: show buttons for available plugins ?>
<h1><?cs var:html_escape(Lang.Title.Volume) ?> <i><?cs var:html_escape(Data.CurrentDisk.name) ?></i></h1>
<table id="volume_pane">
<tr>
<td class="pane_top_left"></td>
<?cs include:Settings.TemplateDir + '/volume_plugins.cs' ?>
<?cs # this case should never happen, but we have to have at least three rows ?>
<?cs if:volume_plugin_count == 0 ?><td class="pane_side_top"></td><?cs /if ?>
<td class="pane_top_right"></td>
</tr>
<tr>
<td class="pane_left" style="background-image: url(../cryptobox-misc/pane_side_left.png);"></td>
<!-- beginning of the plugin pane -->
<td colspan="<?cs var:volume_plugin_count ?>"><div>

View file

@ -0,0 +1,22 @@
<?cs # $Id$ ?>
<?cs set:volume_plugin_count=0 ?><?cs
each: x = Settings.PluginList ?><?cs
if:x.Types.volume ?><?cs set:volume_plugin_count=volume_plugin_count+1 ?><?cs /if ?><?cs
/each ?>
<?cs if:volume_plugin_count>0 ?>
<?cs # sort the Plugins - using the most stupid way :) ?>
<?cs loop: order = #0, #100, #1
?><?cs # plugins ?><?cs each:x = Settings.PluginList
?><?cs if:x.Types.volume && x.Rank == order ?>
<td <?cs if:Data.ActivePlugin == name(x)
?>class="volume_plugin_active"<?cs
else ?>class="volume_plugin_passive"<?cs
/if ?>><a href="<?cs call:link('plugins/' + name(x),'device',Data.CurrentDisk.device,'','') ?>" title="<?cs var:html_escape(x.Link) ?>"><?cs var:html_escape(x.Link) ?></a></td><?cs
/if ?><?cs
/each ?><?cs
/loop ?>
<?cs /if ?>