Skip to content

Commit

Permalink
add spinner to archive/unarchive buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Pellegrino committed Apr 4, 2014
1 parent fe5218d commit f05124e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions couchforms/templates/form/partials/single_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,23 @@
<span class="help_popover" data-help-key="{% trans "Archiving Forms" %}">
<i class="icon icon-question-sign"></i>
</span>
<input type="submit" class="btn btn-danger" value="{% trans "Archive this form" %}"
id="archive-form-btn"
onclick="document.getElementById('archive-form-btn').disabled = true;document.getElementById('archive-form').submit();">
<button type="submit" class="btn btn-danger" id="archive-form-btn"
onclick="document.getElementById('archive-form-btn').disabled = true;document.getElementById('archive-form').submit();document.getElementById('archive-spinner').style.display='inline-block';">
{% trans "Archive this form" %}
<i class="icon-refresh icon-spin" id="archive-spinner" style="display:none"></i>
</button>
</form>
{% else %}
<form action="{% url "unarchive_form" domain instance.get_id %}" method="POST"
id="unarchive-form">
<span class="help_popover" data-help-key="{% trans "Restoring Forms" %}">
<i class="icon icon-question-sign"></i>
</span>
<input type="submit" class="btn btn-primary" value="{% trans "Restore this form" %}"
id="unarchive-form-btn"
onclick="document.getElementById('unarchive-form-btn').disabled = true;document.getElementById('unarchive-form').submit();">
<button type="submit" class="btn btn-primary" id="unarchive-form-btn"
onclick="document.getElementById('unarchive-form-btn').disabled = true;document.getElementById('unarchive-form').submit();document.getElementById('unarchive-spinner').style.display='inline-block';">
{% trans "Restore this form" %}
<i class="icon-refresh icon-spin" id="unarchive-spinner" style="display:none"></i>
</button>
</form>
{% endif %}
</p>
Expand Down

0 comments on commit f05124e

Please sign in to comment.