Skip to content

Commit

Permalink
Merge pull request GeoNode#115 from travislbrundage/GVSD-3589
Browse files Browse the repository at this point in the history
Disable update metadata button until the page has been fully loaded t…
  • Loading branch information
Clarence Davis authored Jan 17, 2018
2 parents 56adae7 + b2f1414 commit 7fdfa28
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions geonode/documents/templates/documents/document_metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h2 class="page-title">{% trans "Edit Metadata" %}</h2>
</ul>
{% endif %}
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="{% trans "Update" %}"/>
<input type="submit" id="update-metadata-top" class="btn btn-primary" value="{% trans "Update" %}" disabled="disabled" onclick="this.disabled=true,this.form.submit();"/>
</div>
{% csrf_token %}
<div class="form-controls">
Expand Down Expand Up @@ -79,7 +79,7 @@ <h2>{% trans "Metadata Provider" %}</h2>
{% endautoescape %}
</fieldset>
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="{% trans "Update" %}"/>
<input type="submit" id="update-metadata-bot" class="btn btn-primary" value="{% trans "Update" %}" disabled="disabled" onclick="this.disabled=true,this.form.submit();"/>
</div>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions geonode/layers/templates/layers/layer_metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h2 class="page-title">{% trans "Edit Metadata" %}</h2>

{% if not layer.metadata_uploaded_preserve %}
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="{% trans "Update" %}"/>
<input type="submit" id="update-metadata-top" class="btn btn-primary" value="{% trans "Update" %}" disabled="disabled" onclick="this.disabled=true,this.form.submit();"/>
</div>
{% endif %}

Expand Down Expand Up @@ -123,7 +123,7 @@ <h2>{% trans "Metadata Provider" %}</h2>

{% if not layer.metadata_uploaded_preserve %}
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="{% trans "Update" %}"/>
<input type="submit" id="update-metadata-bot" class="btn btn-primary" value="{% trans "Update" %}" disabled="disabled" onclick="this.disabled=true,this.form.submit();"/>
</div>
{% endif %}
</div>
Expand Down
4 changes: 2 additions & 2 deletions geonode/maps/templates/maps/map_metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h2 class="page-title">{% trans "Edit Metadata" %}</h2>
</div>
{% endif %}
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="{% trans "Update" %}"/>
<input type="submit" id="update-metadata-top" class="btn btn-primary" value="{% trans "Update" %}" disabled="disabled" onclick="this.disabled=true,this.form.submit();"/>
</div>
{% csrf_token %}
<div class="form-controls">
Expand Down Expand Up @@ -75,7 +75,7 @@ <h2>{% trans "Metadata Provider" %}</h2>
{% endautoescape %}
</fieldset>
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="{% trans "Update" %}"/>
<input type="submit" id="update-metadata-bot" class="btn btn-primary" value="{% trans "Update" %}" disabled="disabled" onclick="this.disabled=true,this.form.submit();"/>
</div>
</form>
</div>
Expand Down
5 changes: 5 additions & 0 deletions geonode/templates/metadata_form_js.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,10 @@
});
});
});

$(document).ready(function() {
$('#update-metadata-top').prop('disabled', false);
$('#update-metadata-bot').prop('disabled', false);
});
{% endautoescape %}
</script>

0 comments on commit 7fdfa28

Please sign in to comment.