Styles for the submit layers form

Improve styling and layout

Signed-off-by: Belen Barros <belen.barros.pena@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Belen Barros 2013-02-27 10:47:49 +00:00 committed by Paul Eggleton
parent 0e14cf17d8
commit f178ea3151
4 changed files with 146 additions and 55 deletions

1
TODO
View File

@ -10,7 +10,6 @@ TODO:
* Need an admin contact in footer * Need an admin contact in footer
* Show recipes from non-software/base layers differently in recipes list * Show recipes from non-software/base layers differently in recipes list
* Submit layer form fixes: * Submit layer form fixes:
* Layout for maintainers (js collapse?)
* Captcha * Captcha
Later: Later:

View File

@ -17,23 +17,39 @@
{% block content %} {% block content %}
{% autoescape on %} {% autoescape on %}
<div class="container-fluid">
<div class="row-fluid">
{% block heading %}
<div class="page-header">
<h1>Edit layer</h1>
</div>
{% endblock %}
{% block formtag %} {% block formtag %}
{% if form.was_saved %} {% if form.was_saved %}
<div class="alert alert-success"> <div class="alert alert-success">
Changes saved successfully. Changes saved successfully.
</div> </div>
{% endif %} {% endif %}
<form action="{% url edit_layer form.instance.name %}" method="post"> <form id="edit_layer_form" action="{% url edit_layer form.instance.name %}" method="post">
{% endblock %} {% endblock %}
{% csrf_token %} {% csrf_token %}
{% for hidden in form.hidden_fields %} {% for hidden in form.hidden_fields %}
{{ hidden }} {{ hidden }}
{% endfor %} {% endfor %}
<div class="formfields">
{% for field in form.visible_fields %} {% for field in form.visible_fields %}
<div class="fieldWrapper"> {% if field.errors %}
<div class="control-group alert alert-error">
{{ field.errors }} {{ field.errors }}
{% else %}
<div class="control-group">
{% endif %}
<div class="control-label">
{{ field.label_tag }} {{ field.label_tag }}
</div>
<div class="controls">
{% if field.name = 'deps' %} {% if field.name = 'deps' %}
<div class="scrolling"> <div class="scrolling">
<table><tbody> <table><tbody>
@ -66,35 +82,54 @@
{% else %} {% else %}
{{ field }} {{ field }}
{% endif %} {% endif %}
<span class="help-inline custom-help">
{{ field.help_text }} {{ field.help_text }}
</span>
</div>
</div> </div>
{% endfor %} {% endfor %}
<h3>Maintainers</h3> </div>
<h3 id="maintainers">Maintainers</h3>
{{ maintainerformset.non_form_errors }} {{ maintainerformset.non_form_errors }}
{{ maintainerformset.management_form }} {{ maintainerformset.management_form }}
{% for maintainerform in maintainerformset %} {% for maintainerform in maintainerformset %}
<div class="maintainerform" id="maintainerform-{{forloop.counter0}}"> <div class="maintainerform" id="maintainerform-{{forloop.counter0}}">
<h4>Maintainer {{forloop.counter}}</h4> <h4>Maintainer {{forloop.counter}}</h4>
<div class="maintainerformfields">
{% for hidden in maintainerform.hidden_fields %} {% for hidden in maintainerform.hidden_fields %}
{{ hidden }} {{ hidden }}
{% endfor %} {% endfor %}
{% for field in maintainerform.visible_fields %} {% for field in maintainerform.visible_fields %}
<div class="fieldWrapper"> {% if field.errors %}
<div class="control-group alert alert-error">
{{ field.errors }} {{ field.errors }}
{% else %}
<div class="control-group">
{% endif %}
<div class="control-label">
{{ field.label_tag }} {{ field.label_tag }}
</div>
{{ field }} {{ field }}
<span class="help-inline custom-help">
{{ field.help_text }} {{ field.help_text }}
</span>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div>
{% endfor %} {% endfor %}
<p><a href="#" class="btn" id="addanothermaintainer">Add another maintainer</a><p> <p><a href="#" class="btn btn-small" id="addanothermaintainer"><i class="icon-plus"></i>Add maintainer</a><p>
<div class="submitbuttons">
{% block submitbuttons %} {% block submitbuttons %}
<input type="submit" value="Save" class="btn btn-primary" /> <input type="submit" value="Save layer" class="btn btn-primary btn-large" />
{% endblock %} {% endblock %}
</div>
</form> </form>
</div>
</div>
{% endautoescape %} {% endautoescape %}
{% endblock %} {% endblock %}

View File

@ -59,9 +59,60 @@ h1 .btn {
height: auto; height: auto;
max-height: 120px; max-height: 120px;
overflow: auto; overflow: auto;
width: 40.1709%;
border: 1px solid #DDDDDD;
padding: 8px;
}
.scrolling td {
padding: 4px;
}
.scrolling checkbox, label {
margin: 0px;
}
.formfields input {
width: 50%;
}
.formfields textarea {
width: 50%;
}
#maintainers {
padding-top: 0.75em;
}
.maintainerform {
/* Fix slight jumping at end of expand in Firefox */
padding-top: 1px;
}
.maintainerformfields input {
width: 25em;
}
.custom-help {
margin-left: 10px;
max-width: 40%;
color: #999;
vertical-align:top;
}
.errorlist {
color: #b94a48;
list-style-type: none;
margin-left: 0px;
} }
.copyable { .copyable {
padding-left: 5px; padding-left: 5px;
padding-right: 3px; padding-right: 3px;
} }
.submitbuttons {
margin-top: 2em;
padding-top: 1em;
border-top: 1px solid rgb(238, 238, 238);
}

View File

@ -14,16 +14,22 @@
{% block title %}OpenEmbedded metadata index - submit layer{% endblock %} {% block title %}OpenEmbedded metadata index - submit layer{% endblock %}
--> -->
{% block heading %}
<div class="page-header">
<h1>Submit layer</h1>
</div>
{% endblock %}
{% block submitlink %} {% block submitlink %}
<!-- Disable submit link, otherwise clicking it will blank the form! --> <!-- Disable submit link, otherwise clicking it will blank the form! -->
<li><a href="#">Submit layer</a></li> <li><a href="#">Submit layer</a></li>
{% endblock %} {% endblock %}
{% block formtag %} {% block formtag %}
<form action="{% url submit_layer %}" method="post"> <form id="edit_layer_form" action="{% url submit_layer %}" method="post">
{% endblock %} {% endblock %}
{% block submitbuttons %} {% block submitbuttons %}
<input type="submit" value="Submit" class="btn btn-primary" /> <input type="submit" value="Submit layer" class="btn btn-primary btn-large" />
{% endblock %} {% endblock %}