Commit 6ab6dba2 by Őry Máté

one: extend Template model

parent bc204dd0
......@@ -244,6 +244,16 @@ class Template(models.Model):
state = models.CharField(max_length=10, choices=TEMPLATE_STATES, default='NEW')
public = models.BooleanField(verbose_name=_('public'), default=False,
help_text=_('If other users can derive templates of this one.'))
description = models.TextField(verbose_name=_('description'), blank=True)
system = models.TextField(verbose_name=_('operating system'), blank=True,
help_text=(_('Name of operating system in format like "%s".') %
"Ubuntu 12.04 LTS Desktop amd64"))
def os_type(self):
if self.access_type == 'rdp':
return "win"
else:
return "linux"
def __unicode__(self):
return self.name
......
......@@ -49,7 +49,8 @@
<div class="details-container">
<ul>
<li class="name">{% trans "Hostname" %}: <span class="value">{{i.name}}</span></li>
<li class="os-linux">{% trans "System" %}: <span class="value">{{i.template.disk.name}}</span></li>
<li class="os-{{i.template.os_type}}">{% trans "System" %}: <span class="value">{{i.template.system}}</span></li>
<li class="tpl">{% trans "Template" %}: <span class="value">{{i.template.name}}</span></li>
<li class="type">{% trans "Size" %}: <span class="value">{{i.template.instance_type.name}}</span></li>
<li class="date">{% trans "Created at" %}: <span class="value">{{i.created_at}}</span></li>
<li class="date">{% trans "Expiration" %}: <span class="value"><abbr title="1 nap, 5 óra, 34 perc">1 nap</abbr></span></li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment