Commit e02cbfce by Őry Máté

one: fix new-template-flow.html (fileformat/syntax)

parent c3ccc727
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<form action="/" method="post" id="template-wizard"> <form action="/" method="post" id="template-wizard">
<div id="new-template-step-1" class="wizard"> <div id="new-template-step-1" class="wizard">
<div class="progress"> <div class="progress">
<div class="bar-container"> <div class="bar-container">
<div class="bar" style="width: 33%"></div> <div class="bar" style="width: 33%"></div>
</div> </div>
<h3>{% blocktrans with step=1 all=3 %}{{step}}/{{all}}{% endblocktrans %}</h3> <h3>{% blocktrans with step=1 all=3 %}{{step}}/{{all}}{% endblocktrans %}</h3>
</div> </div>
<h2>{% blocktrans with step=1 %}Step {{step}}{% endblocktrans %}</h2> <h2>{% blocktrans with step=1 %}Step {{step}}{% endblocktrans %}</h2>
<p>Leírás, mit is kéne itt ezen az ablakon csinálni, és miért jó, ha azt csinálja, amit.</p> <p>Leírás, mit is kéne itt ezen az ablakon csinálni, és miért jó, ha azt csinálja, amit.</p>
<ul> <ul>
<li> <li>
<label for="new-template-name">{% trans "Name" %}</label> <label for="new-template-name">{% trans "Name" %}</label>
<input type="text" placeholder="{% trans "Short name of template" %}" name="name" id="new-template-name" /> <input type="text" placeholder="{% trans "Short name of template" %}" name="name" id="new-template-name" />
<div class="clear"></div> <div class="clear"></div>
</li> </li>
<li> <li>
<label for="new-template-type">{% trans "Type" %}</label> <label for="new-template-type">{% trans "Type" %}</label>
<ul class="radio"> <ul class="radio">
<li> <li>
<input type="radio" name="type" value="labor" id="new-template-type-labor" /> <input type="radio" name="type" value="labor" id="new-template-type-labor" />
<label for="new-template-type-labor">{% trans "Lab" %}</label> <label for="new-template-type-labor">{% trans "Lab" %}</label>
</li> </li>
<li> <li>
<input type="radio" name="type" value="project" id="new-template-type-project" /> <input type="radio" name="type" value="project" id="new-template-type-project" />
<label for="new-template-type-project">{% trans "Project" %}</label> <label for="new-template-type-project">{% trans "Project" %}</label>
</li> </li>
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
</li> </li>
<li> <li>
<label for="new-template-size">{% trans "Size" %}</label> <label for="new-template-size">{% trans "Size" %}</label>
<ul class="radio"> <ul class="radio">
<li> <li>
<input type="radio" name="size" value="small" id="new-template-size-small" /> <input type="radio" name="size" value="small" id="new-template-size-small" />
<label for="new-template-size-small">Kicsi</label> <label for="new-template-size-small">Kicsi</label>
</li> </li>
<li> <li>
<input type="radio" name="size" value="medium" id="new-template-size-medium" /> <input type="radio" name="size" value="medium" id="new-template-size-medium" />
<label for="new-template-size-medium">Közepes</label> <label for="new-template-size-medium">Közepes</label>
</li> </li>
<li> <li>
<input type="radio" name="size" value="large" id="new-template-size-large" /> <input type="radio" name="size" value="large" id="new-template-size-large" />
<label for="new-template-size-large">Nagy</label> <label for="new-template-size-large">Nagy</label>
</li> </li>
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
</li> </li>
<li style="border: none"> <li style="border: none">
<label for="new-template-description">{% trans "Description" %}</label> <label for="new-template-description">{% trans "Description" %}</label>
<textarea name="description" id="new-template-description" placeholder="{% trans "Comments about the template" %}"></textarea> <textarea name="description" id="new-template-description" placeholder="{% trans "Comments about the template" %}"></textarea>
<div class="clear"></div> <div class="clear"></div>
</li> </li>
</ul> </ul>
<nav> <nav>
<a href="#" class="prev">{% trans "&laquo; Cancel" %}</a> <a href="#" class="prev">{% trans "&laquo; Cancel" %}</a>
<a href="#" class="next">{% trans "Next &raquo; %}</a> <a href="#" class="next">{% trans "Next &raquo;" %}</a>
<div class="clear"></div> <div class="clear"></div>
</nav> </nav>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('#new-template-step-1 nav .next').click(function(){ $('#new-template-step-1 nav .next').click(function(){
$('#new-template-step-1').hide(); $('#new-template-step-1').hide();
$('#new-template-step-2').show(); $('#new-template-step-2').show();
}) })
$('#new-template-step-1 nav .prev').click(function(){ $('#new-template-step-1 nav .prev').click(function(){
$('#modal').hide(); $('#modal').hide();
}) })
}) })
</script> </script>
</div> </div>
<div id="new-template-step-2" class="wizard" style="display: none"> <div id="new-template-step-2" class="wizard" style="display: none">
<div class="progress"> <div class="progress">
<div class="bar-container"> <div class="bar-container">
<div class="bar" style="width: 66%"></div> <div class="bar" style="width: 66%"></div>
</div> </div>
<h3>{% blocktrans with step=2 all=3 %}{{step}}/{{all}}{% endblocktrans %}</h3> <h3>{% blocktrans with step=2 all=3 %}{{step}}/{{all}}{% endblocktrans %}</h3>
</div> </div>
<h2>{% blocktrans with step=2 %}Step {{step}}{% endblocktrans %}</h2> <h2>{% blocktrans with step=2 %}Step {{step}}{% endblocktrans %}</h2>
<p>Leírás, mit is kéne itt ezen az ablakon csinálni, és miért jó, ha azt csinálja, amit.</p> <p>Leírás, mit is kéne itt ezen az ablakon csinálni, és miért jó, ha azt csinálja, amit.</p>
<div class="container"> <div class="container">
<ul class="wm-list modal"> <ul class="wm-list modal">
{% for m in templates %} {% for m in templates %}
<li class="wm"> <li class="wm">
<form method="POST" action="/vm/new/{{m.pk}}/">{% csrf_token %} <form method="POST" action="/vm/new/{{m.pk}}/">{% csrf_token %}
<div class="summary"> <div class="summary">
<div class="name wm-on">{{m.name}}</div> <div class="name wm-on">{{m.name}}</div>
<div class="status"> <div class="status">
<input type="submit" value="Indítás"/> <input type="submit" value="Indítás"/>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="details"> <div class="details">
<h3> <h3>
{% trans "Details" %} {% trans "Details" %}
</h3> </h3>
<ul> <ul>
<li class="name">{% trans "System" %}: <span class="value">{{m.disk.name}}</span></li> <li class="name">{% trans "System" %}: <span class="value">{{m.disk.name}}</span></li>
<li class="type">{% trans "Size" %}: <span class="value">{{m.instance_type.name}}</span></li> <li class="type">{% trans "Size" %}: <span class="value">{{m.instance_type.name}}</span></li>
<li class="memory">{% trans "Memory" %}: <span class="value">{{m.instance_type.RAM}} MiB</span></li> <li class="memory">{% trans "Memory" %}: <span class="value">{{m.instance_type.RAM}} MiB</span></li>
<li class="cpu">{% trans "CPU cores" %}: <span class="value">{{m.instance_type.CPU}}</span></li> <li class="cpu">{% trans "CPU cores" %}: <span class="value">{{m.instance_type.CPU}}</span></li>
</ul> </ul>
</div> </div>
</form> </form>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
<nav> <nav>
<a href="#" class="prev">{% trans "&laquo; Cancel" %}</a> <a href="#" class="prev">{% trans "&laquo; Cancel" %}</a>
<a href="#" class="next">{% trans "Next &raquo;" %}</a> <a href="#" class="next">{% trans "Next &raquo;" %}</a>
<div class="clear"></div> <div class="clear"></div>
</nav> </nav>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
console.log('foo'); console.log('foo');
$('#modal .wm .summary').each(function(){ $('#modal .wm .summary').each(function(){
$(this).next('.details').show(); $(this).next('.details').show();
console.log($(this).next('.details').css('display'), $(this).next('.details').css('height')); console.log($(this).next('.details').css('display'), $(this).next('.details').css('height'));
//this.originalHeight=parseInt($(this).next('.details').css('height')); //this.originalHeight=parseInt($(this).next('.details').css('height'));
}) })
$('#modal .wm .summary').click(function(){ $('#modal .wm .summary').click(function(){
if($(this).next('.details').is(':hidden')){ if($(this).next('.details').is(':hidden')){
$(this).next('.details') $(this).next('.details')
.slideDown(700); .slideDown(700);
$(this).parent('.wm').addClass('opened'); $(this).parent('.wm').addClass('opened');
} else { } else {
var that=this; var that=this;
$(this).next('.details') $(this).next('.details')
.removeClass('opened') .removeClass('opened')
.slideUp(700); .slideUp(700);
} }
}); });
$('#new-template-step-2 nav .prev').click(function(){ $('#new-template-step-2 nav .prev').click(function(){
$('#new-template-step-2').hide(); $('#new-template-step-2').hide();
$('#new-template-step-1').show(); $('#new-template-step-1').show();
}) })
$('#new-template-step-2 nav .next').click(function(){ $('#new-template-step-2 nav .next').click(function(){
$('#new-template-step-2').hide(); $('#new-template-step-2').hide();
$('#new-template-step-3').show(); $('#new-template-step-3').show();
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'url': '/ajax/templateWizard', 'url': '/ajax/templateWizard',
'data': $('#template-wizard').serialize() 'data': $('#template-wizard').serialize()
}) })
.done(function(){ console.log('ok')}); .done(function(){ console.log('ok')});
}) })
}) })
</script> </script>
</div> </div>
<div id="new-template-step-3" class="wizard" style="display: none"> <div id="new-template-step-3" class="wizard" style="display: none">
</div> </div>
</form> </form>
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