128 lines
4.4 KiB
HTML
128 lines
4.4 KiB
HTML
<section data-ng-controller="ViewFormController" data-ng-init="findOne()" class="container admin-form">
|
||
|
||
<!-- Modal Delete Dialog Template -->
|
||
<script type="text/ng-template" id="myModalContent.html">
|
||
<div class="modal-header">
|
||
<h2 class="modal-title">Are you ABSOLUTELY sure?</h3>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="modal-body-alert">
|
||
Unexpected bad things will happen if you don’t read this!
|
||
</div>
|
||
<p>This action <strong>CANNOT</strong> be undone. This will permanently delete the <strong>{{myform.title}}</strong> form, form submissions and remove all associated pdfs.</p>
|
||
<p>Please type in the name of the repository to confirm.</p>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<p>
|
||
<input type="text" data-ng-model="deleteConfirm" class="input-block" autofocus required aria-label="Type in the name of the form to confirm that you want to delete this form.">
|
||
</p>
|
||
<button type="submit" ng-click="remove()" class="btn btn-block btn-danger" ng-disabled="myform.title != deleteConfirm">I understand the consequences, delete this form</button>
|
||
</div>
|
||
</script>
|
||
|
||
<div class="page-header row" style="padding-bottom: 0px;">
|
||
<div class="col-xs-6">
|
||
<h1 data-ng-bind="myform.title" style="margin-bottom: 0px;"></h1>
|
||
</div>
|
||
<div class="col-xs-2 col-xs-offset-2">
|
||
<small class=" pull-right">
|
||
<button class="btn btn-danger" ng-click="openDeleteModal()"><i class="fa fa-trash-o"></i> Delete Form</button>
|
||
</small>
|
||
</div>
|
||
<div class="col-xs-2">
|
||
<small class=" pull-right">
|
||
<a class="btn btn-default" href="/#!/forms/{{myform._id}}">
|
||
<span ng-show="myform.isLive">View Live</span> <span ng-hide="myform.isLive">Preview</span> Form
|
||
<i class="status-light status-light-on fa fa-dot-circle-o" ng-show="myform.isLive"></i>
|
||
<i class="status-light status-light-off fa fa-dot-circle-o" ng-hide="myform.isLive"></i>
|
||
<!-- <i class="fa fa-sign-out"></i> -->
|
||
</a>
|
||
</small>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" cg-busy="{promise:updatePromise,message:'Updating form...',backdrop:true}">
|
||
<!-- <div > -->
|
||
<tabset class="col-xs-12">
|
||
<tab>
|
||
<tab-heading>
|
||
Edit Form Fields
|
||
</tab-heading>
|
||
<edit-form-directive myform="myform" user="user"></edit-form-directive>
|
||
</tab>
|
||
<tab disabled="true">
|
||
<tab-heading >
|
||
Edit Design
|
||
</tab-heading>
|
||
<div cg-busy="promise:updatePromise"></div>
|
||
<edit-form-directive myform="myform" user="user">
|
||
</edit-form-directive>
|
||
</tab>
|
||
<tab>
|
||
<tab-heading>
|
||
Configure
|
||
</tab-heading>
|
||
<div cg-busy="promise:updatePromise"></div>
|
||
<configure-form-directive myform="myform" user="user">
|
||
</configure-form-directive>
|
||
</tab>
|
||
<tab data-ng-click="showSubmissions()">
|
||
<tab-heading>
|
||
View Submissions
|
||
</tab-heading>
|
||
<div class="submissions-table" ng-show="viewSubmissions">
|
||
|
||
<div class="row">
|
||
<div class="col-xs-1">
|
||
<button class="btn btn-danger" ng-click="deleteSelectedSubmissions()" ng-disabled="!isAtLeastOneChecked();"><i class="fa fa-trash-o"></i> Delete Selected</button>
|
||
</div>
|
||
|
||
</div>
|
||
<table class="table table-striped table-hover table-condensed">
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
<input ng-model="table.masterChecker" ng-change="toggleAllCheckers()" type="checkbox"/>
|
||
</th>
|
||
<th>#</th>
|
||
<th data-ng-repeat="(key, value) in myform.form_fields">
|
||
{{value.title}}
|
||
</th>
|
||
<th>
|
||
Time Elapsed
|
||
</th>
|
||
<th>
|
||
Date Submitted (UTC)
|
||
</th>
|
||
<th ng-if="myform.autofillPDFs">
|
||
Generated PDF
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr data-ng-repeat="row in table.rows" ng-click="rowClicked(row)">
|
||
<td>
|
||
<input ng-model="row.selected" type="checkbox"/>
|
||
</td>
|
||
<th class="scope">{{$index+1}}</th>
|
||
<td data-ng-repeat="(key, value) in row.form_fields">
|
||
{{value.fieldValue}}
|
||
</td>
|
||
<td>
|
||
{{row.timeElapsed}}
|
||
</th>
|
||
<td>
|
||
{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}
|
||
</td>
|
||
<td ng-if="row.pdf">
|
||
<a href="{{row.pdfFilePath}}" download="{{row.pdf.name}}" target="_self">Generated PDF</a>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</tab>
|
||
</tabset>
|
||
<!-- </div> -->
|
||
</div>
|
||
</section> |