Fix rendering of jobset inputs

This commit is contained in:
Eelco Dolstra 2013-03-19 16:14:47 +01:00
parent c1aefc4c41
commit 50434d76c2
2 changed files with 12 additions and 12 deletions

View file

@ -1,13 +1,13 @@
[% WRAPPER layout.tt title=(create ? "Create jobset in project $project.name" : "Editing jobset $project.name:$jobset.name") %] [% WRAPPER layout.tt title=(create ? "Create jobset in project $project.name" : "Editing jobset $project.name:$jobset.name") %]
[% PROCESS common.tt %] [% PROCESS common.tt %]
[% BLOCK renderInputAlt %] [% BLOCK renderJobsetInputAlt %]
<button type="button" class="btn btn-warning" onclick='$(this).parents(".inputalt").remove()'><i class="icon-trash icon-white"></i></button> <button type="button" class="btn btn-warning" onclick='$(this).parents(".inputalt").remove()'><i class="icon-trash icon-white"></i></button>
<input type="text" [% HTML.attributes(value => alt.value, name => name) %]></input> <input type="text" [% HTML.attributes(value => alt.value, name => name) %]></input>
<br /> <br />
[% END %] [% END %]
[% BLOCK renderInput %] [% BLOCK renderJobsetInput %]
<tr class="input [% extraClass %]" [% IF id %]id="[% id %]"[% END %]> <tr class="input [% extraClass %]" [% IF id %]id="[% id %]"[% END %]>
<td> <td>
<button type="button" class="btn btn-warning" onclick='$(this).parents(".input").remove()'><i class="icon-trash icon-white"></i></button> <button type="button" class="btn btn-warning" onclick='$(this).parents(".input").remove()'><i class="icon-trash icon-white"></i></button>
@ -19,7 +19,7 @@
<td class="inputalts" id="[% baseName %]"> <td class="inputalts" id="[% baseName %]">
[% FOREACH alt IN input.jobsetinputalts %] [% FOREACH alt IN input.jobsetinputalts %]
<span class="inputalt"> <span class="inputalt">
[% INCLUDE renderInputAlt alt=alt name="$baseName-values" %] [% INCLUDE renderJobsetInputAlt alt=alt name="$baseName-values" %]
</span> </span>
[% END %] [% END %]
[% IF edit %]<button type="button" class="add-inputalt btn btn-success" onclick='return false'><i class="icon-plus icon-white"></i></button>[% END %] [% IF edit %]<button type="button" class="add-inputalt btn btn-success" onclick='return false'><i class="icon-plus icon-white"></i></button>[% END %]
@ -27,14 +27,14 @@
</tr> </tr>
[% END %] [% END %]
[% BLOCK renderInputs %] [% BLOCK renderJobsetInputs %]
<table class="table table-striped table-condensed"> <table class="table table-striped table-condensed">
<thead> <thead>
<tr><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="input-$input.name" %] [% INCLUDE renderJobsetInput input=input baseName="input-$input.name" %]
[% END %] [% END %]
<tr> <tr>
<td colspan="3" style="text-align: center;"><button type="button" class="add-input btn btn-success"><i class="icon-plus icon-white"></i> Add a new input</button></td <td colspan="3" style="text-align: center;"><button type="button" class="add-input btn btn-success"><i class="icon-plus icon-white"></i> Add a new input</button></td
@ -105,7 +105,7 @@
</div> </div>
</div> </div>
[% INCLUDE renderInputs %] [% INCLUDE renderJobsetInputs %]
<div class="form-actions"> <div class="form-actions">
<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> [%IF create %]Create[% ELSE %]Apply changes[% END %]</button> <button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> [%IF create %]Create[% ELSE %]Apply changes[% END %]</button>
@ -126,11 +126,11 @@
</fieldset> </fieldset>
<table style="display: none"> <table style="display: none">
[% INCLUDE renderInput input="" extraClass="template" id="input-template" baseName="input-template" %] [% INCLUDE renderJobsetInput input="" extraClass="template" id="input-template" baseName="input-template" %]
</table> </table>
<tt class="inputalt" id="inputalt-template" style="display: none"> <tt class="inputalt" id="inputalt-template" style="display: none">
[% INCLUDE renderInputAlt alt=alt %] [% INCLUDE renderJobsetInputAlt alt=alt %]
</tt> </tt>
<script type="text/javascript"> <script type="text/javascript">

View file

@ -2,7 +2,7 @@
[% PROCESS common.tt %] [% PROCESS common.tt %]
[% BLOCK renderInput %] [% BLOCK renderJobsetInput %]
<tr class="input [% extraClass %]" [% IF id %]id="[% id %]"[% END %]> <tr class="input [% extraClass %]" [% IF id %]id="[% id %]"[% END %]>
<td> <td>
<tt>[% HTML.escape(input.name) %]</tt> <tt>[% HTML.escape(input.name) %]</tt>
@ -25,7 +25,7 @@
[% END %] [% END %]
[% BLOCK renderInputs %] [% BLOCK renderJobsetInputs %]
<h3>Inputs</h3> <h3>Inputs</h3>
<table class="tablesorter table table-striped table-condensed"> <table class="tablesorter table table-striped table-condensed">
<thead> <thead>
@ -33,7 +33,7 @@
</thead> </thead>
<tbody class="inputs"> <tbody class="inputs">
[% FOREACH input IN jobset.jobsetinputs %] [% FOREACH input IN jobset.jobsetinputs %]
[% INCLUDE renderInput input=input baseName="input-$input.name" %] [% INCLUDE renderJobsetInput input=input baseName="input-$input.name" %]
[% END %] [% END %]
</tbody> </tbody>
</table> </table>
@ -134,7 +134,7 @@
</tr> </tr>
</table> </table>
[% INCLUDE renderInputs %] [% INCLUDE renderJobsetInputs %]
</div> </div>
[% INCLUDE makeLazyTab tabName="tabs-jobs" uri=c.uri_for('/jobset' project.name jobset.name "jobs-tab") %] [% INCLUDE makeLazyTab tabName="tabs-jobs" uri=c.uri_for('/jobset' project.name jobset.name "jobs-tab") %]