mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 12:49:01 +02:00
Submit/edit form tweaks
* Don't specify action on form - this is best practice and avoids the need to have separate form tags for submit and edit * Add a short introduction to the submit form * Focus first field on load only if first field is empty (avoids doing this focusing on the edit form which is not really useful). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
a8ae70a600
commit
482abdcc8a
|
@ -30,14 +30,14 @@
|
|||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block formtag %}
|
||||
{% block formtop %}
|
||||
{% if form.was_saved %}
|
||||
<div class="alert alert-success">
|
||||
Changes saved successfully.
|
||||
</div>
|
||||
{% endif %}
|
||||
<form id="edit_layer_form" action="{% url edit_layer form.instance.name %}" method="post">
|
||||
{% endblock %}
|
||||
<form id="edit_layer_form" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{ hidden }}
|
||||
|
@ -235,6 +235,10 @@
|
|||
$('#addanothermaintainer').click(expand_maintainer)
|
||||
|
||||
$('#id_vcs_url').change(auto_web_fields)
|
||||
|
||||
firstfield = $("#edit_layer_form input:text, #edit_layer_form textarea").first();
|
||||
if( ! firstfield.val() )
|
||||
firstfield.focus()
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -72,6 +72,10 @@ padding: 8px;
|
|||
margin: 0px;
|
||||
}
|
||||
|
||||
.submitformintro {
|
||||
padding-bottom: 0.75em;
|
||||
}
|
||||
|
||||
.formfields input {
|
||||
width: 50%;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,10 @@
|
|||
{% endblock %}
|
||||
|
||||
|
||||
{% block formtag %}
|
||||
<form id="edit_layer_form" action="{% url submit_layer %}" method="post">
|
||||
{% block formtop %}
|
||||
<div class="submitformintro">
|
||||
<p>Please enter the details for the layer you wish to add to the index.</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block submitbuttons %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user