|
|
@@ -27,489 +27,672 @@
|
|
|
${ commonheader(_("Oozie App"), "oozie", user, "100px") }
|
|
|
${ layout.menubar(section='coordinators') }
|
|
|
|
|
|
+<style>
|
|
|
+ .steps {
|
|
|
+ min-height: 350px;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ #add-dataset-form, #edit-dataset-form {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .nav {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ .help-block {
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<script src="/static/ext/js/knockout-2.1.0.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+<script src="/static/ext/js/routie-0.3.0.min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
<h1>${ _('Coordinator') } ${ coordinator.name }</h1>
|
|
|
|
|
|
- <div class="well">
|
|
|
- ${ _('Description') }: ${ coordinator.description or _("N/A") }
|
|
|
- % if coordinator.workflow:
|
|
|
- <br/>
|
|
|
- ${ _('Workflow') }: <a href="${ coordinator.workflow.get_absolute_url() }">${ coordinator.workflow }</a>
|
|
|
- % endif
|
|
|
- </div>
|
|
|
+ <div class="row-fluid">
|
|
|
+ <div class="span2">
|
|
|
+ <div class="well sidebar-nav">
|
|
|
+ <ul class="nav nav-list">
|
|
|
+ <li class="nav-header">${ _('Name') }</li>
|
|
|
+ <li><a id="coordinatorName" href="#steps">${ coordinator.name }</a></li>
|
|
|
|
|
|
- <ul class="nav nav-tabs">
|
|
|
- <li class="active"><a href="#editor" data-toggle="tab">${ _('Editor') }</a></li>
|
|
|
- <li><a href="#datasets" data-toggle="tab">${ _('Datasets') }</a></li>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <li><a href="#history" data-toggle="tab">${ _('History') }</a></li>
|
|
|
- % endif
|
|
|
- </ul>
|
|
|
-
|
|
|
- <form class="form-horizontal" id="jobForm" action="${ url('oozie:edit_coordinator', coordinator=coordinator.id) }" method="POST">
|
|
|
- <div class="tab-content">
|
|
|
- <div class="tab-pane active" id="editor">
|
|
|
- <div class="row-fluid">
|
|
|
- <div class="span2">
|
|
|
- </div>
|
|
|
- <div class="span8">
|
|
|
- <h2>${ _('Coordinator') }</h2>
|
|
|
- <div class="fieldWrapper">
|
|
|
- ${ utils.render_field(coordinator_form['name']) }
|
|
|
- ${ utils.render_field(coordinator_form['description']) }
|
|
|
-
|
|
|
- <div class="control-group ">
|
|
|
- <label class="control-label">
|
|
|
- <a href="#" id="advanced-btn" onclick="$('#advanced-container').toggle('hide')">
|
|
|
- <i class="icon-share-alt"></i> ${ _('advanced') }
|
|
|
- </a>
|
|
|
- </label>
|
|
|
- <div class="controls"></div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id="advanced-container" class="hide">
|
|
|
- ${ utils.render_field(coordinator_form['is_shared']) }
|
|
|
- ${ utils.render_field(coordinator_form['workflow']) }
|
|
|
- ${ properties.print_key_value(coordinator_form['parameters'], 'parameters', parameters) }
|
|
|
- ${ utils.render_field(coordinator_form['timeout']) }
|
|
|
- <div class="row-fluid">
|
|
|
- <div class="span6">
|
|
|
- ${ utils.render_field(coordinator_form['concurrency']) }
|
|
|
- </div>
|
|
|
- <div class="span6">
|
|
|
- ${ utils.render_field(coordinator_form['throttle']) }
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- ${ utils.render_field(coordinator_form['execution']) }
|
|
|
- ${ coordinator_form['schema_version'] }
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ % if coordinator.workflow:
|
|
|
+ <li class="nav-header">${ _('Workflow') }</li>
|
|
|
+ <li id="workflowName"><a href="${ coordinator.workflow.get_absolute_url() }" target="_blank">${ coordinator.workflow }</a></li>
|
|
|
+ % endif
|
|
|
|
|
|
- <hr/>
|
|
|
- <h2>${ _('Frequency') }</h2>
|
|
|
+ <li class="nav-header">${ _('Datasets') }</li>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <li><a href="#createDataset">${ _('Create new') }</a></li>
|
|
|
+ % endif
|
|
|
+ <li><a href="#listDataset">${ _('Show existing') }</a></li>
|
|
|
+
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <li class="nav-header">${ _('History') }</li>
|
|
|
+ <li><a href="#listHistory">${ _('Show history') }</a></li>
|
|
|
+ % endif
|
|
|
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="span10">
|
|
|
+ <form id="jobForm" class="form-horizontal" action="${ url('oozie:edit_coordinator', coordinator=coordinator.id) }" method="POST">
|
|
|
+ <div id="steps" class="section">
|
|
|
+ <ul class="nav nav-pills">
|
|
|
+ <li class="active"><a href="#step1" class="step">${ _('Step 1: General') }</a></li>
|
|
|
+ <li><a href="#step2" class="step">${ _('Step 2: Frequency') }</a></li>
|
|
|
+ <li><a href="#step3" class="step">${ _('Step 3: Inputs') }</a></li>
|
|
|
+ <li><a href="#step4" class="step">${ _('Step 4: Outputs') }</a></li>
|
|
|
+ <li><a href="#step5" class="step">${ _('Step 5: Advanced settings') }</a></li>
|
|
|
+ </ul>
|
|
|
+ ${ dataset_formset.management_form }
|
|
|
+ ${ data_input_formset.management_form }
|
|
|
+ ${ data_output_formset.management_form }
|
|
|
+ ${ properties.init_viewmodel('parameters', parameters) }
|
|
|
+ <div class="steps">
|
|
|
+
|
|
|
+ <div id="step1" class="stepDetails">
|
|
|
+ <div class="alert alert-info"><h3>${ _('Coordinator data') }</h3></div>
|
|
|
+ <div class="fieldWrapper">
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['name'], extra_attrs = {'validate':'true'}) }
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['description']) }
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['workflow'], extra_attrs = {'validate':'true'}) }
|
|
|
+ ${ coordinator_form['parameters'] }
|
|
|
+ <div class="hide">
|
|
|
+ ${ utils.render_field(coordinator_form['timeout']) }
|
|
|
+ ${ coordinator_form['schema_version'] }
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="step2" class="stepDetails hide">
|
|
|
+ <div class="alert alert-info"><h3>${ _('Frequency') }</h3></div>
|
|
|
<div class="fieldWrapper">
|
|
|
<div class="row-fluid">
|
|
|
<div class="span6">
|
|
|
- ${ utils.render_field(coordinator_form['frequency_number']) }
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['frequency_number']) }
|
|
|
</div>
|
|
|
<div class="span6">
|
|
|
- ${ utils.render_field(coordinator_form['frequency_unit']) }
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['frequency_unit']) }
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="fieldWrapper">
|
|
|
<div class="row-fluid">
|
|
|
- <div class="span6">
|
|
|
- ${ utils.render_field(coordinator_form['start']) }
|
|
|
- </div>
|
|
|
- <div class="span6">
|
|
|
- ${ utils.render_field(coordinator_form['end']) }
|
|
|
+ <div class="span6">
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['start']) }
|
|
|
+ </div>
|
|
|
+ <div class="span6">
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['end']) }
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['timezone']) }
|
|
|
</div>
|
|
|
- ${ utils.render_field(coordinator_form['timezone']) }
|
|
|
</div>
|
|
|
|
|
|
- ${ dataset_formset.management_form }
|
|
|
- ${ data_input_formset.management_form }
|
|
|
- ${ data_output_formset.management_form }
|
|
|
-
|
|
|
- % if coordinator.id:
|
|
|
- <hr/>
|
|
|
- <h2>Data</h2>
|
|
|
- <br/>
|
|
|
- <p>
|
|
|
- % if coordinator.workflow:
|
|
|
- ${ _('The inputs and outputs of the workflow must be mapped to some data.') }
|
|
|
- ${ _('The data is represented by some datasets that can be created on the ') }
|
|
|
- <a href="#" id="datasets-btn" class="btn">${ _('Datasets') }</a> ${ _('page') }.
|
|
|
- % endif
|
|
|
- </p>
|
|
|
- </br>
|
|
|
- <div class="row-fluid">
|
|
|
- <h3>${ _('Inputs') }</h3>
|
|
|
-
|
|
|
- % if data_input_formset.forms:
|
|
|
- <table class="table table-striped table-condensed" cellpadding="0" cellspacing="0" data-missing="#dataset_input_missing">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th width="10%">${ _('Name') }</th>
|
|
|
- <th width="10%">${ _('Dataset') }</th>
|
|
|
- <th>${ _('Path') }</th>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <th width="1%">${ _('Delete') }</th>
|
|
|
- % endif
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- % for form in data_input_formset.forms:
|
|
|
- <tr>
|
|
|
- ${ form['id'] }
|
|
|
- <td>${ form['name'] }</td>
|
|
|
- <td>${ form['dataset'] }</td>
|
|
|
- <td>${ form['dataset'].form.instance.dataset.uri }</td>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <td><a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a></td>
|
|
|
- % endif
|
|
|
- </tr>
|
|
|
- % endfor
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- % endif
|
|
|
- <br/>
|
|
|
- <div id="dataset_input_missing" data-missing-bind="true" class="alert alert-error
|
|
|
- % if data_input_formset.forms:
|
|
|
- hide
|
|
|
- % endif
|
|
|
- ">
|
|
|
- ${ _('No inputs') }
|
|
|
+ <div id="step3" class="stepDetails hide">
|
|
|
+ % if coordinator.workflow:
|
|
|
+ <div class="alert alert-info"><h3>${ _('Inputs') }</h3>
|
|
|
+ ${ _('The inputs and outputs of the workflow must be mapped to some data.') }
|
|
|
+ ${ _('The data is represented by some datasets that can be created ') }<a href="#createDataset" class="btn btn-small">${ _('here') }</a>.
|
|
|
</div>
|
|
|
-
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- ${ coordinator_data.print_datasets(_('Datasets'), 'dataset_input', new_data_input_formset, 'input', not len(data_input_formset.forms)) }
|
|
|
- % endif
|
|
|
- </div>
|
|
|
-
|
|
|
- <br/>
|
|
|
- <br/>
|
|
|
- <br/>
|
|
|
-
|
|
|
- <div class="row-fluid">
|
|
|
- <h3>${ _('Outputs') }</h3>
|
|
|
- % if data_output_formset.forms:
|
|
|
- <table class="table table-striped table-condensed" cellpadding="0" cellspacing="0" data-missing="#dataset_output_missing">
|
|
|
+ % else:
|
|
|
+ <div class="alert alert-info"><h3>${ _('Inputs') }</h3></div>
|
|
|
+ <div class="alert">${ _('This type of coordinator does not require any dataset.') }</div>
|
|
|
+ % endif
|
|
|
+ % if data_input_formset.forms:
|
|
|
+ <table class="table table-striped table-condensed" cellpadding="0" cellspacing="0" data-missing="#dataset_input_missing">
|
|
|
<thead>
|
|
|
- <tr>
|
|
|
- <th width="10%">${ _('Name') }</th>
|
|
|
- <th width="10%">${ _('Dataset') }</th>
|
|
|
- <th>${ _('Path') }</th>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <th width="1%">${ _('Delete') }</th>
|
|
|
- % endif
|
|
|
- </tr>
|
|
|
+ <tr>
|
|
|
+ <th width="10%">${ _('Name') }</th>
|
|
|
+ <th width="10%">${ _('Dataset') }</th>
|
|
|
+ <th>${ _('Path') }</th>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <th width="1%">${ _('Delete') }</th>
|
|
|
+ % endif
|
|
|
+ </tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- % for form in data_output_formset.forms:
|
|
|
- <tr>
|
|
|
- ${ form['id'] }
|
|
|
- <td>${ form['name'] }</td>
|
|
|
- <td>${ form['dataset'] }</td>
|
|
|
- <td>${ form['dataset'].form.instance.dataset.uri }</td>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <td><a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a></td>
|
|
|
- % endif
|
|
|
- </tr>
|
|
|
- % endfor
|
|
|
+ % for form in data_input_formset.forms:
|
|
|
+ <tr>
|
|
|
+ ${ form['id'] }
|
|
|
+ <td>${ form['name'] }</td>
|
|
|
+ <td>${ form['dataset'] }</td>
|
|
|
+ <td>${ form['dataset'].form.instance.dataset.uri }</td>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <td><a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a></td>
|
|
|
+ % endif
|
|
|
+ </tr>
|
|
|
+ % endfor
|
|
|
</tbody>
|
|
|
</table>
|
|
|
- % endif
|
|
|
- <br/>
|
|
|
- <div id="dataset_output_missing" data-missing-bind="true" class="alert alert-error
|
|
|
- % if data_output_formset.forms:
|
|
|
- hide
|
|
|
- % endif
|
|
|
- ">
|
|
|
- ${ _('No outputs') }
|
|
|
- </div>
|
|
|
-
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- ${ coordinator_data.print_datasets(_('Datasets'), 'dataset_output', new_data_output_formset, 'output', not len(data_output_formset.forms)) }
|
|
|
- % endif
|
|
|
+ % endif
|
|
|
+ <br/>
|
|
|
+ <%
|
|
|
+ klass = "alert alert-error"
|
|
|
+ if data_input_formset.forms:
|
|
|
+ klass += " hide"
|
|
|
+ %>
|
|
|
+ <div id="dataset_input_missing" data-missing-bind="true" class="${klass}">
|
|
|
+ ${ _('There are currently no defined inputs.') }
|
|
|
</div>
|
|
|
- % endif
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
|
|
|
- <div class="tab-pane" id="datasets">
|
|
|
- <div class="row-fluid">
|
|
|
- <div class="span1">
|
|
|
% if coordinator.is_editable(user):
|
|
|
- <table cellpadding="5">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>${ _('Add a new dataset') }</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
+ ${ coordinator_data.print_datasets(_('Datasets'), 'dataset_input', new_data_input_formset, 'input', not len(data_input_formset.forms)) }
|
|
|
+ % endif
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="step4" class="stepDetails hide">
|
|
|
+ % if coordinator.workflow:
|
|
|
+ <div class="alert alert-info"><h3>${ _('Outputs') }</h3>
|
|
|
+ ${ _('The inputs and outputs of the workflow must be mapped to some data.') }
|
|
|
+ ${ _('The data is represented by some datasets that can be created ') }<a href="#createDataset" class="btn btn-small">${ _('here') }</a>.
|
|
|
+ </div>
|
|
|
+ % else:
|
|
|
+ <div class="alert alert-info"><h3>${ _('Outputs') }</h3></div>
|
|
|
+ <div class="alert">${ _('This type of coordinator does not require any dataset.') }</div>
|
|
|
+ % endif
|
|
|
+
|
|
|
+ % if data_output_formset.forms:
|
|
|
+ <table class="table table-striped table-condensed" cellpadding="0" cellspacing="0" data-missing="#dataset_output_missing">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th width="10%">${ _('Name') }</th>
|
|
|
+ <th width="10%">${ _('Dataset') }</th>
|
|
|
+ <th>${ _('Path') }</th>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <th width="1%">${ _('Delete') }</th>
|
|
|
+ % endif
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ % for form in data_output_formset.forms:
|
|
|
<tr>
|
|
|
- <td><a class="btn" data-toggle="modal" href="#add-dataset-modal">${ _('Create') }</a></td>
|
|
|
+ ${ form['id'] }
|
|
|
+ <td>${ form['name'] }</td>
|
|
|
+ <td>${ form['dataset'] }</td>
|
|
|
+ <td>${ form['dataset'].form.instance.dataset.uri }</td>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <td><a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a></td>
|
|
|
+ % endif
|
|
|
</tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ % endfor
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ % endif
|
|
|
+ <br/>
|
|
|
+ <%
|
|
|
+ klass = "alert alert-error"
|
|
|
+ if data_output_formset.forms:
|
|
|
+ klass += " hide"
|
|
|
+ %>
|
|
|
+ <div id="dataset_output_missing" data-missing-bind="true" class="${klass}">
|
|
|
+ ${ _('There are currently no defined outputs.') }
|
|
|
+ </div>
|
|
|
+
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ ${ coordinator_data.print_datasets(_('Datasets'), 'dataset_output', new_data_output_formset, 'output', not len(data_output_formset.forms)) }
|
|
|
% endif
|
|
|
</div>
|
|
|
|
|
|
- <div class="span9">
|
|
|
- % if coordinator.id:
|
|
|
- <div>
|
|
|
- <table class="table table-striped table-condensed" cellpadding="0" cellspacing="0" data-missing="#dataset_missing">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>${ _('Name') }</th>
|
|
|
- <th>${ _('Description') }</th>
|
|
|
- <th>${ _('Frequency') }</th>
|
|
|
- <th>${ _('Start') }</th>
|
|
|
- <th>${ _('URI') }</th>
|
|
|
- <th>${ _('Timezone') }</th>
|
|
|
- <th>${ _('Done flag') }</th>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <th>${ _('Delete') }</th>
|
|
|
- % endif
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- % for form in dataset_formset.forms:
|
|
|
- % for hidden in form.hidden_fields():
|
|
|
- ${ hidden }
|
|
|
- % endfor
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <a href="javascript:modalRequest('${ url('oozie:edit_coordinator_dataset', dataset=form.instance.id) }', '#edit-dataset-modal');"
|
|
|
- data-row-selector="true"/>
|
|
|
- % endif
|
|
|
- ${ form.instance.name }
|
|
|
- </td>
|
|
|
- <td>${ form.instance.description }</td>
|
|
|
- <td>${ form.instance.text_frequency }</td>
|
|
|
- <td>${ form.instance.start }</td>
|
|
|
- <td>${ form.instance.uri }</td>
|
|
|
- <td>${ form.instance.timezone }</td>
|
|
|
- <td>${ form.instance.done_flag }</td>
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <td data-row-selector-exclude="true">
|
|
|
- <a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a>
|
|
|
- </td>
|
|
|
- % endif
|
|
|
- </tr>
|
|
|
-
|
|
|
- <div class="hide">
|
|
|
- % for field in form.visible_fields():
|
|
|
- ${ field.errors }
|
|
|
- ${ field.label }: ${ field }
|
|
|
- % endfor
|
|
|
- </div>
|
|
|
-
|
|
|
- % endfor
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ <div id="step5" class="stepDetails hide">
|
|
|
+ <div class="alert alert-info"><h3>${ _('Advanced settings') }</h3></div>
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['is_shared']) }
|
|
|
+ ${ properties.print_key_value(coordinator_form['parameters'], 'parameters') }
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['timeout']) }
|
|
|
+ <div class="row-fluid">
|
|
|
+ <div class="span6">
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['concurrency']) }
|
|
|
</div>
|
|
|
- <div id="dataset_missing" data-missing-bind="true" class="alert alert-error
|
|
|
- % if dataset_formset.forms:
|
|
|
- hide
|
|
|
- % endif
|
|
|
- ">
|
|
|
- ${ _('No datasets') }
|
|
|
+ <div class="span6">
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['throttle']) }
|
|
|
</div>
|
|
|
- % endif
|
|
|
+ </div>
|
|
|
+ ${ utils.render_field_no_popover(coordinator_form['execution']) }
|
|
|
+ ${ coordinator_form['schema_version'] }
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <div class="tab-pane" id="history">
|
|
|
- <table class="table">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>${ _('Date') }</th>
|
|
|
- <th>${ _('Id') }</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- % if not history:
|
|
|
- <tr>
|
|
|
- <td>${ _('N/A') }</td><td></td>
|
|
|
- </tr>
|
|
|
- % endif
|
|
|
- % for record in history:
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-actions">
|
|
|
+ <a id="backBtn" class="btn disabled">${ _('Back') }</a>
|
|
|
+ <a id="nextBtn" class="btn btn-primary">${ _('Next') }</a>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <a class="btn btn-primary save" data-bind="visible: isSaveVisible()" style="margin-left: 30px">${ _('Save coordinator') }</a>
|
|
|
+ % endif
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="createDataset" class="section hide">
|
|
|
+ <div class="alert alert-info"><h3>${ _('Create a new dataset') }</h3></div>
|
|
|
+ <div class="alert alert-warning"><b>${ _('Warning') }</b>: ${ _('Save your modifications before creating a new dataset.') }</div>
|
|
|
+ <div id="add-dataset-body">
|
|
|
+ <%include file="create_coordinator_dataset.mako"/>
|
|
|
+ </div>
|
|
|
+ <div class="form-actions">
|
|
|
+ <a href="#" class="btn btn-primary" id="add-dataset-btn">${ _('Create dataset') }</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="editDataset" class="section hide">
|
|
|
+ <div class="alert alert-info"><h3>${ _('Edit dataset') }</h3></div>
|
|
|
+ <div class="alert alert-warning"><b>${ _('Warning') }</b>: ${ _('Save your modifications before editing a dataset.') }</div>
|
|
|
+ <div id="edit-dataset-body">
|
|
|
+ </div>
|
|
|
+ <div class="form-actions">
|
|
|
+ <a href="#" class="btn btn-primary" id="update-dataset-btn">${ _('Update dataset') }</a>
|
|
|
+ <a href="#listDataset" class="btn">${ _('Cancel') }</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div id="listDataset" class="section hide">
|
|
|
+ <div class="alert alert-info"><h3>${ _('Existing datasets') }</h3></div>
|
|
|
+ % if coordinator.id:
|
|
|
+ <div>
|
|
|
+ % if dataset_formset.forms:
|
|
|
+ <table class="table table-striped table-condensed" cellpadding="0" cellspacing="0" data-missing="#dataset_missing">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>${ _('Name') }</th>
|
|
|
+ <th>${ _('Description') }</th>
|
|
|
+ <th>${ _('Frequency') }</th>
|
|
|
+ <th>${ _('Start') }</th>
|
|
|
+ <th>${ _('URI') }</th>
|
|
|
+ <th>${ _('Timezone') }</th>
|
|
|
+ <th>${ _('Done flag') }</th>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <th>${ _('Delete') }</th>
|
|
|
+ % endif
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ % for form in dataset_formset.forms:
|
|
|
+ % for hidden in form.hidden_fields():
|
|
|
+ ${ hidden }
|
|
|
+ % endfor
|
|
|
<tr>
|
|
|
<td>
|
|
|
- <a href="${ url('oozie:list_history_record', record_id=record.id) }" data-row-selector="true"></a>
|
|
|
- ${ utils.format_date(record.submission_date) }
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <a href="javascript:void(0)" class="editDataset" data-url="${ url('oozie:edit_coordinator_dataset', dataset=form.instance.id) }" data-row-selector="true"/>
|
|
|
+ % endif
|
|
|
+ ${ form.instance.name }
|
|
|
</td>
|
|
|
- <td>${ record.oozie_job_id }</td>
|
|
|
+ <td>${ form.instance.description }</td>
|
|
|
+ <td>${ form.instance.text_frequency }</td>
|
|
|
+ <td>${ form.instance.start }</td>
|
|
|
+ <td>${ form.instance.uri }</td>
|
|
|
+ <td>${ form.instance.timezone }</td>
|
|
|
+ <td>${ form.instance.done_flag }</td>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <td data-row-selector-exclude="true">
|
|
|
+ <a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a>
|
|
|
+ </td>
|
|
|
+ % endif
|
|
|
</tr>
|
|
|
- % endfor
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- % endif
|
|
|
-
|
|
|
- <br/>
|
|
|
- </div>
|
|
|
|
|
|
- <div class="form-actions center">
|
|
|
- % if coordinator.is_editable(user):
|
|
|
- <input class="btn btn-primary" data-bind="click: submit" type="submit" value="${ _('Save') }"></input>
|
|
|
- % endif
|
|
|
- <a href="${ url('oozie:list_coordinators') }" class="btn">${ _('Back') }</a>
|
|
|
- </div>
|
|
|
+ <div class="hide">
|
|
|
+ % for field in form.visible_fields():
|
|
|
+ ${ field.errors }
|
|
|
+ ${ field.label }: ${ field }
|
|
|
+ % endfor
|
|
|
+ </div>
|
|
|
+ % endfor
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ % endif
|
|
|
+ </div>
|
|
|
+ <%
|
|
|
+ klass = "alert alert-error"
|
|
|
+ if dataset_formset.forms:
|
|
|
+ klass += " hide"
|
|
|
+ %>
|
|
|
+ <div id="dataset_missing" data-missing-bind="true" class="${klass}">
|
|
|
+ ${ _('There are currently no datasets.') } <a href="#createDataset">${ _('Do you want to create a new dataset ?') }</a>
|
|
|
+ </div>
|
|
|
+ % if dataset_formset.forms and coordinator.is_editable(user):
|
|
|
+ <div class="form-actions" style="padding-left:10px">
|
|
|
+ <a class="btn btn-primary save">${ _('Save coordinator') }</a>
|
|
|
+ </div>
|
|
|
+ % endif
|
|
|
+ % endif
|
|
|
+ </div>
|
|
|
|
|
|
- </form>
|
|
|
+ <div id="listHistory" class="section hide">
|
|
|
+ <div class="alert alert-info"><h3>${ _('History') }</h3></div>
|
|
|
+ % if coordinator.is_editable(user):
|
|
|
+ <div class="tab-pane" id="history">
|
|
|
+ <table class="table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>${ _('Date') }</th>
|
|
|
+ <th>${ _('Id') }</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ % if not history:
|
|
|
+ <tr>
|
|
|
+ <td>${ _('N/A') }</td><td></td>
|
|
|
+ </tr>
|
|
|
+ % endif
|
|
|
+ % for record in history:
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <a href="${ url('oozie:list_history_record', record_id=record.id) }" data-row-selector="true"></a>
|
|
|
+ ${ utils.format_date(record.submission_date) }
|
|
|
+ </td>
|
|
|
+ <td>${ record.oozie_job_id }</td>
|
|
|
+ </tr>
|
|
|
+ % endfor
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ % endif
|
|
|
+ </div>
|
|
|
|
|
|
-% if coordinator.id:
|
|
|
- <div class="modal hide" id="add-dataset-modal" style="z-index:1500;width:850px">
|
|
|
- <form class="form-horizontal" id="add-dataset-form">
|
|
|
- <div class="modal-header">
|
|
|
- <button class="close" data-dismiss="modal">×</button>
|
|
|
- <h3>${ _('Create a dataset') }</h3>
|
|
|
- <hr/>
|
|
|
- <div class="alert alert-warning"><b>${ _('Warning') }</b>: ${ _('Save your modifications before creating a new dataset.') }</div>
|
|
|
- </div>
|
|
|
+ </form>
|
|
|
|
|
|
- <div class="modal-body" id="add-dataset-body">
|
|
|
- <%include file="create_coordinator_dataset.mako"/>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="modal-footer">
|
|
|
- <a href="#" class="btn" data-dismiss="modal">${ _('Close') }</a>
|
|
|
- <a href="#" class="btn btn-primary" id="add-dataset-btn">${ _('Add dataset') }</a>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
</div>
|
|
|
|
|
|
- <div class="modal hide" id="edit-dataset-modal" style="z-index:1500;width:850px">
|
|
|
-
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
-<style type="text/css">
|
|
|
- .delete-row input {
|
|
|
- display: none;
|
|
|
- }
|
|
|
-</style>
|
|
|
|
|
|
-<link rel="stylesheet" href="/static/ext/css/jquery-ui-datepicker-1.8.23.css" type="text/css" media="screen" title="no title" charset="utf-8" />
|
|
|
-<link rel="stylesheet" href="/static/ext/css/jquery-timepicker.css" type="text/css" media="screen" title="no title" charset="utf-8" />
|
|
|
|
|
|
-<script src="/static/ext/js/jquery/plugins/jquery-ui-datepicker-1.8.23.min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
-<script src="/static/ext/js/jquery/plugins/jquery-timepicker.min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
-<script src="/static/ext/js/knockout-2.1.0.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+<form class="form-horizontal" id="add-dataset-form"></form>
|
|
|
+<form class="form-horizontal" id="edit-dataset-form"></form>
|
|
|
|
|
|
-<script type="text/javascript" charset="utf-8">
|
|
|
- var timeOptions = {
|
|
|
- show24Hours: false,
|
|
|
- startTime: '00:00',
|
|
|
- endTime: '23:59',
|
|
|
- step: 60
|
|
|
- };
|
|
|
-
|
|
|
- function modalRequest(url, el) {
|
|
|
- $.ajax({
|
|
|
- url: url,
|
|
|
- beforeSend: function(xhr){
|
|
|
- xhr.setRequestHeader("X-Requested-With", "Hue");
|
|
|
- },
|
|
|
- dataType: "html",
|
|
|
- success: function(data){
|
|
|
- $(el).html(data);
|
|
|
- $(el).modal("show");
|
|
|
- $("input.date").datepicker();
|
|
|
- $("input.time").timePicker(timeOptions);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * Initial state is used to define when to display the "initial state" of a table.
|
|
|
- * IE: if there are no formset forms to display, show an "empty" message.
|
|
|
- *
|
|
|
- * First, we build a registry of all functions that need to pass in order for us to display the initial state.
|
|
|
- * Things that 'remove' or 'add' elements will need to trigger 'reinit' and 'initOff' events on their respective 'initial state' elements.
|
|
|
- * 'Initial state' elements should have 'data-missing-bind="true"' so that custom events can be binded to them.
|
|
|
- *
|
|
|
- * args:
|
|
|
- * test_func - function that, if true, will indicate that the initial state should be shown.
|
|
|
- * hook - If we do show the initial state, run this function before showing it.
|
|
|
- */
|
|
|
- var initialStateRegistry = {};
|
|
|
-
|
|
|
- $("*[data-missing-bind='true']").on('register', function(e, test_func, hook) {
|
|
|
- var id = $(this).attr('id');
|
|
|
- if (!initialStateRegistry[id]) {
|
|
|
- initialStateRegistry[id] = [];
|
|
|
- }
|
|
|
- initialStateRegistry[id].push({ test: test_func, hook: hook });
|
|
|
- });
|
|
|
-
|
|
|
- $("*[data-missing-bind='true']").on('reinit', function(e) {
|
|
|
- var show = true;
|
|
|
- var id = $(this).attr('id');
|
|
|
- for (var i in initialStateRegistry[id]) {
|
|
|
- show = show && initialStateRegistry[id][i].test();
|
|
|
+% if coordinator.id:
|
|
|
+
|
|
|
+ <div class="modal hide" id="edit-dataset-modal" style="z-index:1500;width:850px"></div>
|
|
|
+
|
|
|
+
|
|
|
+ <style type="text/css">
|
|
|
+ .delete-row input {
|
|
|
+ display: none;
|
|
|
}
|
|
|
- if (show) {
|
|
|
+ </style>
|
|
|
+
|
|
|
+ <script src="/static/ext/js/knockout-2.1.0.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+
|
|
|
+ <script type="text/javascript" charset="utf-8">
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Initial state is used to define when to display the "initial state" of a table.
|
|
|
+ * IE: if there are no formset forms to display, show an "empty" message.
|
|
|
+ *
|
|
|
+ * First, we build a registry of all functions that need to pass in order for us to display the initial state.
|
|
|
+ * Things that 'remove' or 'add' elements will need to trigger 'reinit' and 'initOff' events on their respective 'initial state' elements.
|
|
|
+ * 'Initial state' elements should have 'data-missing-bind="true"' so that custom events can be binded to them.
|
|
|
+ *
|
|
|
+ * args:
|
|
|
+ * test_func - function that, if true, will indicate that the initial state should be shown.
|
|
|
+ * hook - If we do show the initial state, run this function before showing it.
|
|
|
+ */
|
|
|
+ var initialStateRegistry = {};
|
|
|
+
|
|
|
+ $("*[data-missing-bind='true']").on('register', function (e, test_func, hook) {
|
|
|
+ var id = $(this).attr('id');
|
|
|
+ if (!initialStateRegistry[id]) {
|
|
|
+ initialStateRegistry[id] = [];
|
|
|
+ }
|
|
|
+ initialStateRegistry[id].push({ test:test_func, hook:hook });
|
|
|
+ });
|
|
|
+
|
|
|
+ $("*[data-missing-bind='true']").on('reinit', function (e) {
|
|
|
+ var show = true;
|
|
|
+ var id = $(this).attr('id');
|
|
|
for (var i in initialStateRegistry[id]) {
|
|
|
- if (!!initialStateRegistry[id][i].hook) {
|
|
|
- initialStateRegistry[id][i].hook();
|
|
|
+ show = show && initialStateRegistry[id][i].test();
|
|
|
+ }
|
|
|
+ if (show) {
|
|
|
+ for (var i in initialStateRegistry[id]) {
|
|
|
+ if (!!initialStateRegistry[id][i].hook) {
|
|
|
+ initialStateRegistry[id][i].hook();
|
|
|
+ }
|
|
|
}
|
|
|
+ $(this).show();
|
|
|
}
|
|
|
- $(this).show();
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+
|
|
|
+ $("*[data-missing-bind='true']").on('initOff', function (e) {
|
|
|
+ $(this).hide();
|
|
|
+ });
|
|
|
|
|
|
- $("*[data-missing-bind='true']").on('initOff', function(e) {
|
|
|
- $(this).hide();
|
|
|
- });
|
|
|
|
|
|
+ $(document).ready(function () {
|
|
|
+
|
|
|
+ % if not coordinator.is_editable(user):
|
|
|
+ $("#jobForm input, select").attr("disabled", "disabled");
|
|
|
+ $("#jobForm .btn").not("#nextBtn, #backBtn").attr("disabled", "disabled").addClass("btn-disabled");
|
|
|
+ % endif
|
|
|
+
|
|
|
+ $("#datasets-btn").click(function () {
|
|
|
+ $('[href=#datasets]').tab('show');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#add-dataset-btn').click(function () {
|
|
|
+ $("#add-dataset-form").empty();
|
|
|
+ $("#add-dataset-body").find("input, select").each(function () {
|
|
|
+ $(this).clone().appendTo($("#add-dataset-form"));
|
|
|
+ });
|
|
|
+ $.post("${ url('oozie:create_coordinator_dataset', coordinator=coordinator.id) }",
|
|
|
+ $("#add-dataset-form").serialize(),
|
|
|
+ function (response) {
|
|
|
+ if (response['status'] != 0) {
|
|
|
+ $("#add-dataset-form").empty();
|
|
|
+ $('#add-dataset-body').html(response['data']);
|
|
|
+ decorateDateTime();
|
|
|
+ } else {
|
|
|
+ window.location.replace(response['data']);
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".editDataset").click(function () {
|
|
|
+ var el = $(this);
|
|
|
+ $("#edit-dataset-body").data("url", el.data("url"));
|
|
|
+ $.ajax({
|
|
|
+ url:el.data("url"),
|
|
|
+ beforeSend:function (xhr) {
|
|
|
+ xhr.setRequestHeader("X-Requested-With", "Hue");
|
|
|
+ },
|
|
|
+ dataType:"json",
|
|
|
+ success:function (response) {
|
|
|
+ $("#edit-dataset-body").html(response['data']);
|
|
|
+ decorateDateTime();
|
|
|
+ routie("editDataset");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#update-dataset-btn').click(function () {
|
|
|
+ $("#edit-dataset-form").empty();
|
|
|
+ $("#edit-dataset-body").find("input, select").each(function () {
|
|
|
+ $(this).clone().appendTo($("#edit-dataset-form"));
|
|
|
+ });
|
|
|
+ $.post($("#edit-dataset-body").data("url"),
|
|
|
+ $("#edit-dataset-form").serialize(),
|
|
|
+ function (response) {
|
|
|
+ if (response['status'] != 0) {
|
|
|
+ $("#edit-dataset-form").empty();
|
|
|
+ $('#edit-dataset-body').html(response['data']);
|
|
|
+ decorateDateTime();
|
|
|
+ } else {
|
|
|
+ window.location.replace(response['data']);
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.delete-row').click(function () {
|
|
|
+ var el = $(this);
|
|
|
+ var row = el.closest('tr');
|
|
|
+ var table = el.closest('table');
|
|
|
+ el.find(':input').attr('checked', 'checked');
|
|
|
+ row.hide();
|
|
|
+ $(table.attr('data-missing')).trigger('reinit', table);
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.delete-row').closest('table').each(function () {
|
|
|
+ var table = $(this);
|
|
|
+ var id = table.attr('data-missing');
|
|
|
+ if (!!id) {
|
|
|
+ $(id).trigger('register', [ function () {
|
|
|
+ return table.find('tbody tr').length == table.find('tbody tr:hidden').length;
|
|
|
+ }, function () {
|
|
|
+ table.hide();
|
|
|
+ } ]);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- $(document).ready(function() {
|
|
|
- $("input.date").datepicker();
|
|
|
- $("input.time").timePicker(timeOptions);
|
|
|
+ $("a[data-row-selector='true']").jHueRowSelector();
|
|
|
|
|
|
- $("#datasets-btn").click(function() {
|
|
|
- $('[href=#datasets]').tab('show');
|
|
|
- });
|
|
|
+ window.viewModel.isSaveVisible = ko.observable(false);
|
|
|
+ ko.applyBindings(window.viewModel);
|
|
|
|
|
|
- $('#add-dataset-btn').click(function() {
|
|
|
- $.post("${ url('oozie:create_coordinator_dataset', coordinator=coordinator.id) }",
|
|
|
- $("#add-dataset-form").serialize(),
|
|
|
- function(response) {
|
|
|
- if (response['status'] != 0) {
|
|
|
- $('#add-dataset-body').html(response['data']);
|
|
|
- } else {
|
|
|
- window.location.replace(response['data']);
|
|
|
+ $("*[rel=popover]").popover({
|
|
|
+ placement:'top',
|
|
|
+ trigger:'hover'
|
|
|
+ });
|
|
|
+
|
|
|
+ var currentStep = "step1";
|
|
|
+
|
|
|
+ routie({
|
|
|
+ "step1":function () {
|
|
|
+ showStep("step1");
|
|
|
+ window.viewModel.isSaveVisible(false);
|
|
|
+ },
|
|
|
+ "step2":function () {
|
|
|
+ if (validateStep("step1")) {
|
|
|
+ showStep("step2");
|
|
|
+ window.viewModel.isSaveVisible(false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "step3":function () {
|
|
|
+ if (validateStep("step1") && validateStep("step2")) {
|
|
|
+ showStep("step3");
|
|
|
+ window.viewModel.isSaveVisible(false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "step4":function () {
|
|
|
+ if (validateStep("step1") && validateStep("step2")) {
|
|
|
+ showStep("step4");
|
|
|
+ window.viewModel.isSaveVisible(true);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "step5":function () {
|
|
|
+ if (validateStep("step1") && validateStep("step2")) {
|
|
|
+ showStep("step5");
|
|
|
+ window.viewModel.isSaveVisible(true);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "steps":function () {
|
|
|
+ showSection("steps");
|
|
|
+ },
|
|
|
+ "createDataset":function () {
|
|
|
+ showSection("createDataset");
|
|
|
+ },
|
|
|
+ "editDataset":function () {
|
|
|
+ if ($("#edit-dataset-body").children().length > 0) {
|
|
|
+ showSection("editDataset");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ routie("listDataset");
|
|
|
}
|
|
|
+ },
|
|
|
+ "listDataset":function () {
|
|
|
+ showSection("listDataset");
|
|
|
+ },
|
|
|
+ "listHistory":function () {
|
|
|
+ showSection("listHistory");
|
|
|
}
|
|
|
- );
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- $('.delete-row').click(function() {
|
|
|
- var el = $(this);
|
|
|
- var row = el.closest('tr');
|
|
|
- var table = el.closest('table');
|
|
|
- el.find(':input').attr('checked', 'checked');
|
|
|
- row.hide();
|
|
|
- $(table.attr('data-missing')).trigger('reinit', table);
|
|
|
- });
|
|
|
+ function showStep(step) {
|
|
|
+ showSection("steps");
|
|
|
+ currentStep = step;
|
|
|
+ if (step != "step1") {
|
|
|
+ $("#backBtn").removeClass("disabled");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $("#backBtn").addClass("disabled");
|
|
|
+ }
|
|
|
+ if (step != $(".stepDetails:last").attr("id")) {
|
|
|
+ $("#nextBtn").removeClass("disabled");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $("#nextBtn").addClass("disabled");
|
|
|
+ }
|
|
|
+ $("a.step").parent().removeClass("active");
|
|
|
+ $("a.step[href=#" + step + "]").parent().addClass("active");
|
|
|
+ $(".stepDetails").hide();
|
|
|
+ $("#" + step).show();
|
|
|
+ }
|
|
|
|
|
|
- $('.delete-row').closest('table').each(function() {
|
|
|
- var table = $(this);
|
|
|
- var id = table.attr('data-missing');
|
|
|
- if (!!id) {
|
|
|
- $( id ).trigger('register', [ function() {
|
|
|
- return table.find('tbody tr').length == table.find('tbody tr:hidden').length;
|
|
|
- }, function() {
|
|
|
- table.hide();
|
|
|
- } ] );
|
|
|
+ function showSection(section) {
|
|
|
+ $(".section").hide();
|
|
|
+ $("#" + section).show();
|
|
|
}
|
|
|
- });
|
|
|
|
|
|
- $("a[data-row-selector='true']").jHueRowSelector();
|
|
|
+ function validateStep(step) {
|
|
|
+ var proceed = true;
|
|
|
+ $("#" + step).find("[validate=true]").each(function () {
|
|
|
+ if ($(this).val().trim() == "") {
|
|
|
+ proceed = false;
|
|
|
+ routie(step);
|
|
|
+ $(this).parents(".control-group").addClass("error");
|
|
|
+ $(this).parent().find(".help-inline").remove();
|
|
|
+ $(this).after("<span class=\"help-inline\"><strong>${ _('This field is required.') }</strong></span>");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return proceed;
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#backBtn").click(function () {
|
|
|
+ var nextStep = (currentStep.substr(4) * 1 - 1);
|
|
|
+ if (nextStep >= 1) {
|
|
|
+ routie("step" + nextStep);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#nextBtn").click(function () {
|
|
|
+ var nextStep = (currentStep.substr(4) * 1 + 1);
|
|
|
+ if (nextStep <= $(".step").length) {
|
|
|
+ routie("step" + nextStep);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $("[validate=true]").change(function () {
|
|
|
+ $(this).parents(".control-group").removeClass("error");
|
|
|
+ $(this).parent().find(".help-inline").remove();
|
|
|
+ });
|
|
|
|
|
|
- ko.applyBindings(window.viewModel);
|
|
|
+ $("#id_name").change(function () {
|
|
|
+ $("#coordinatorName").text($(this).val());
|
|
|
+ });
|
|
|
|
|
|
- $("*[rel=popover]").popover({
|
|
|
- placement: 'right',
|
|
|
- trigger: 'hover'
|
|
|
+ $("#id_workflow").change(function () {
|
|
|
+ $("#workflowName").text($("#id_workflow option[value='" + $(this).val() + "']").text());
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".save").click(function () {
|
|
|
+ window.viewModel.submit();
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
-</script>
|
|
|
+ </script>
|
|
|
|
|
|
% endif
|
|
|
|
|
|
-${ commonfooter(messages) }
|
|
|
+
|
|
|
+${ utils.decorate_datetime_fields() }
|
|
|
+
|
|
|
+${ commonfooter(messages) }
|