This commit is contained in:
Eelco Dolstra 2008-11-18 12:13:34 +00:00
parent f0eb8cf08c
commit 6aa0ddda51
2 changed files with 25 additions and 25 deletions

View file

@ -360,7 +360,7 @@ input.string {
font-family: sans-serif; font-family: sans-serif;
font-size: 100%; font-size: 100%;
background-color: #fffff0; background-color: #fffff0;
width: 13em; width: 20em;
} }
input.shortString { input.shortString {

View file

@ -25,15 +25,18 @@
[% END %] [% END %]
[% BLOCK renderInputAlt %]
[% IF edit %]<button type="button" onclick='$(this).parents(".inputalt").remove()'><img src="/static/images/failure.gif" alt="Delete value" /></button>[% END -%]
[% INCLUDE maybeEditString param=param value=alt.value %]
[% IF edit %]<br />[% END %]
[% END %]
[% BLOCK renderInput %] [% BLOCK renderInput %]
<tr class="input [% extraClass %]" id="[% id %]"> <tr class="input [% extraClass %]" id="[% id %]">
[% IF edit %]
<td>
[% IF edit %]<a href="javascript:" onclick='$(this).parents(".input").remove()'>[X]</a>[% END -%]
</td>
[% END %]
<td> <td>
[% IF edit %]<button type="button" onclick='$(this).parents(".input").remove()'><img src="/static/images/failure.gif" alt="Delete input" /></button>[% END -%]
<tt>[% INCLUDE maybeEditString param="$baseName-name" value=input.name extraClass="shortString" %]</tt> <tt>[% INCLUDE maybeEditString param="$baseName-name" value=input.name extraClass="shortString" %]</tt>
</td> </td>
<td> <td>
@ -45,12 +48,11 @@
[% IF input.type == "string" && !edit %] [% IF input.type == "string" && !edit %]
"[% HTML.escape(alt.value) %]" "[% HTML.escape(alt.value) %]"
[% ELSE %] [% ELSE %]
[% INCLUDE maybeEditString param="$baseName-values" value=alt.value %] [% INCLUDE renderInputAlt alt=alt param="$baseName-values" %]
[% IF edit %]<a href="javascript:" onclick='$(this).parents(".inputalt").remove()'>[X]</a><br />[% END %]
[% END %] [% END %]
</tt> </tt>
[% END %] [% END %]
[% IF edit %]<a href="javascript:" class="add-inputalt">[+]</a>[% END %] [% IF edit %]<button type="button" onclick='return false' class="add-inputalt">+</button>[% END %]
</td> </td>
</tr> </tr>
@ -61,7 +63,10 @@
<div class="jobset[% IF edit %] jobset-edit[% END %]" id="[% "jobset-$baseName" %]"> <div class="jobset[% IF edit %] jobset-edit[% END %]" id="[% "jobset-$baseName" %]">
<h3>[% IF jobset %]Jobset <tt>[% jobset.name %]</tt>[% ELSE %]New jobset[% END %]</h3> <h3>
[% IF edit %]<button type="button" onclick='$(this).parents(".jobset").remove()'><img src="/static/images/failure.gif" alt="Delete value" /></button>[% END %]
[% IF jobset %]Jobset <tt>[% jobset.name %]</tt>[% ELSE %]New jobset[% END %]
</h3>
<h4>Information</h4> <h4>Information</h4>
@ -87,26 +92,22 @@
<h4>Inputs</h4> <h4>Inputs</h4>
[% IF edit %]
<p><button class="add-input">Add a new input</button></p>
[% END %]
<table class="tablesorter"> <table class="tablesorter">
<thead> <thead>
<tr>[% IF edit %]<th></th>[% END %]<th>Input name</th><th>Type</th><th>Values</th></tr> <tr><th>Input name</th><th>Type</th><th>Values</th></tr>
</thead> </thead>
<tbody class="inputs"> <tbody class="inputs">
[% FOREACH input IN jobset.jobsetinputs -%] [% FOREACH input IN jobset.jobsetinputs -%]
[% INCLUDE renderInput input=input baseName="jobset-$baseName-input-$input.name" %] [% INCLUDE renderInput input=input baseName="jobset-$baseName-input-$input.name" %]
[% END %] [% END %]
[% IF edit %]
<tr>
<td colspan="3"><button type="button" class="add-input">Add a new input</button></td>
</tr>
[% END %]
</tbody> </tbody>
</table> </table>
[% IF edit %]
<hr />
<p><button onclick='$(this).parents(".jobset").remove()'>Delete this jobset</button></p>
[% END %]
</div> </div>
[% END %] [% END %]
@ -155,7 +156,7 @@
[% IF curProject.jobsets && curProject.jobsets.size > 0 || edit %] [% IF curProject.jobsets && curProject.jobsets.size > 0 || edit %]
[% IF edit %] [% IF edit %]
<p><button id="add-jobset">Add a new jobset</button></p> <p><button type="button" id="add-jobset">Add a new jobset</button></p>
<div id="jobset-template" class="template"> <div id="jobset-template" class="template">
[% INCLUDE renderJobset jobset="" baseName="template" %] [% INCLUDE renderJobset jobset="" baseName="template" %]
@ -165,9 +166,8 @@
[% INCLUDE renderInput input="" extraClass="template" id="input-template" baseName="input-template" %] [% INCLUDE renderInput input="" extraClass="template" id="input-template" baseName="input-template" %]
</table> </table>
<tt id="inputalt-template" class="inputalt template"> <tt class="inputalt template" id="inputalt-template">
<input type="text" class="string" /> [% INCLUDE renderInputAlt alt=alt %]
<a href="javascript:" onclick='$(this).parents(".inputalt").remove()'>[X]</a>
</tt> </tt>
<script> <script>
@ -189,7 +189,7 @@
var jobset = $(this).parents(".jobset"); var jobset = $(this).parents(".jobset");
var inputid = jobset.attr("id"); var inputid = jobset.attr("id");
var newid = inputid + "-input-" + id++; var newid = inputid + "-input-" + id++;
var x = $("#input-template").clone(true).attr("id", "").appendTo($(".inputs", jobset)).show(); var x = $("#input-template").clone(true).attr("id", "").insertBefore($(this).parents("tr")).show();
$("#input-template-name", x).attr("name", newid + "-name"); $("#input-template-name", x).attr("name", newid + "-name");
$("#input-template-type", x).attr("name", newid + "-type"); $("#input-template-type", x).attr("name", newid + "-type");
$("#input-template", x).attr("id", newid); $("#input-template", x).attr("id", newid);