Merge branch 'feature/templates' into feature/base-theme

feature/node-rewrite
Sven Slootweg 11 years ago
commit b8ff50956c

@ -70,6 +70,7 @@ menu-admin-overview; Overview
menu-admin-users; Users
menu-admin-vpses; VPSes
menu-admin-nodes; Nodes
menu-admin-templates; Templates
## Global warnings and errors
error-form; One or more problems occurred.

@ -0,0 +1,18 @@
<?php
/*
* CVM is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
* to benefit other developers, but you are under no enforced
* obligation to do so :)
*
* Please read the accompanying LICENSE document for the full WTFPL
* licensing text.
*/
if(!isset($_APP)) { die("Unauthorized."); }
$sPageContents = NewTemplater::Render("{$sTheme}/admin/template/add", $locale->strings, array(
"templates" => array("ubuntu.tar.gz", "fedora.tar.gz", "debian7.tar.gz", "opensuse.tar.gz")
));

@ -186,6 +186,27 @@ try
'auth_error' => "modules/error/access.php",
'_menu' => "admin"
),
/* Admin - Templates - Overview */
'^/admin/templates/?$' => array(
'target' => "modules/admin/template/list.php",
'authenticator' => "authenticators/admin.php",
'auth_error' => "modules/error/access.php",
'_menu' => "admin"
),
/* Admin - Templates - Lookup */
'^/admin/templates/([0-9]+)/?$' => array(
'target' => "modules/admin/template/lookup.php",
'authenticator' => "authenticators/admin.php",
'auth_error' => "modules/error/access.php",
'_menu' => "admin"
),
/* Admin - Templates - Add */
'^/admin/templates/add/?$' => array(
'target' => "modules/admin/template/add.php",
'authenticator' => "authenticators/admin.php",
'auth_error' => "modules/error/access.php",
'_menu' => "admin"
),
/* Admin - Nodes - Overview */
'^/admin/nodes/?$' => array(
'target' => "modules/admin/node/list.php",

@ -1,6 +1,7 @@
<div class="sidebar">
<a class="sidebutton" href="/admin/">{%!menu-admin-overview}</a>
<a class="sidebutton" href="/admin/nodes/">{%!menu-admin-nodes}</a>
<a class="sidebutton" href="/admin/templates/">{%!menu-admin-templates}</a>
<a class="sidebutton" href="/admin/users/">{%!menu-admin-users}</a>
<a class="sidebutton" href="/admin/vpses/">{%!menu-admin-vpses}</a>
</div>

@ -0,0 +1,26 @@
<h2>Add templates</h2>
{%if isempty|templates == true}
<p>
To add new templates, add the corresponding tar.gz files to /etc/cvm/templates on the master node, and reload this page.
New files will be automatically detected, and you will be able to add them as templates from this page.
</p>
<p>
All templates will be automatically synchronized to slave nodes.
</p>
{%else}
<form method="post" action="/admin/template/add">
{%foreach template in templates}
<div class="darkform">
<h3>{%?template}</h3>
<div class="field">
<label>Name</label>
{%input type="text" group="addtemplate" name="name[]"}
<div class="clear"></div>
</div>
</div>
{%/foreach}
</form>
{%/if}

@ -568,7 +568,12 @@ button.column
background-color: #4E4D69;
}
form.dark
.darkform
{
margin-bottom: 6px;
}
form.dark, .darkform
{
background-color: #31305E;
color: white;
@ -578,7 +583,7 @@ form.dark
width: 75%;
}
form.dark label, form .filler
form.dark label, form .filler, .darkform label
{
display: block;
float: left;
@ -586,7 +591,7 @@ form.dark label, form .filler
width: 45.8%;
}
form.dark input, form.dark select
form.dark input, form.dark select, .darkform input
{
display: block;
float: left;
@ -597,13 +602,13 @@ form.dark input, form.dark select
box-sizing: content-box;
}
form.dark input[type="checkbox"]
form.dark input[type="checkbox"], .darkform input[type="checkbox"]
{
width: auto;
margin-top: 7px;
}
form.dark input[type="file"]
form.dark input[type="file"], .darkform input[type="file"]
{
height: 24px;
font-size: 13px;
@ -612,7 +617,7 @@ form.dark input[type="file"]
padding: 0px 0px;
}
form.dark button[type="submit"]
form.dark button[type="submit"], .darkform button[type="submit"]
{
float: right;
margin: 9px 7px 7px 7px;
@ -620,13 +625,13 @@ form.dark button[type="submit"]
font-weight: bold;
}
form.dark .field.disabled
form.dark .field.disabled, .darkform .field.disabled
{
background-color: #444452;
color: #B5B5B5;
}
form.dark .filler a
form.dark .filler a, .darkform .filler a
{
display: block;
color: white;
@ -634,6 +639,12 @@ form.dark .filler a
margin-top: 12px;
}
form.dark h3, .darkform h3
{
color: #F1F1F1;
margin: 6px 1% 4px 1%;
}
form.login
{
width: 40%;

Loading…
Cancel
Save