Added read-only view of form

This commit is contained in:
David Taylor
2015-08-10 17:43:18 +03:00
committed by Tom Price
parent 58e06c1b3e
commit 8e600c8749
4 changed files with 46 additions and 3 deletions

View File

@@ -17,7 +17,18 @@
{% include 'form_errors.html' %}
<div ng-controller="FormController" class="col-sm-12">
<form name="theForm" sf-schema="schema" sf-form="form" sf-model="model" ng-submit="onSubmit(theForm)">
<form name="theForm" ng-submit="onSubmit(theForm)">
<div sf-schema="schema" sf-form="form" sf-model="model"
{% if not edit %}
sf-options="{ formDefaults: { readonly: true } }"
{% endif %}
></div>
{% if edit %}
<input class="btn btn-primary" type="submit" value="Save">
{% endif %}
</form>
</div>

View File

@@ -39,6 +39,9 @@
<td>{{ object.last_edited_by }} at {{ object.last_edited_at }}</td>
<td class="text-right">
<div class="btn-group">
<a href="{% url 'form_detail' object.pk %}" class="btn btn-default">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
<a href="{% url 'update_form' object.pk %}" class="btn btn-default">
<span class="glyphicon glyphicon-pencil"></span>
</a>