Формы
Сделал объединение ячеек Сделал выравнивание по правой стороне Переименовал кнопки
This commit is contained in:
@@ -48,6 +48,7 @@ class OrderForm(ModelForm):
|
|||||||
model = Order
|
model = Order
|
||||||
fields = ['product', 'price', 'paid', 'address', 'designer', 'deadline', 'delivery', 'lifting']
|
fields = ['product', 'price', 'paid', 'address', 'designer', 'deadline', 'delivery', 'lifting']
|
||||||
|
|
||||||
|
submit_text = "Добавить заказ"
|
||||||
product = forms.ModelChoiceField(
|
product = forms.ModelChoiceField(
|
||||||
required=False,
|
required=False,
|
||||||
queryset = Product.objects.all(),
|
queryset = Product.objects.all(),
|
||||||
@@ -60,6 +61,7 @@ class ProdTableForm(ModelForm):
|
|||||||
model = OrderCosts
|
model = OrderCosts
|
||||||
fields = ['cost_item', 'value']
|
fields = ['cost_item', 'value']
|
||||||
|
|
||||||
|
submit_text = "Добавить"
|
||||||
cost_item = forms.ModelChoiceField(
|
cost_item = forms.ModelChoiceField(
|
||||||
required=False,
|
required=False,
|
||||||
queryset = CostItem.objects.all(),
|
queryset = CostItem.objects.all(),
|
||||||
|
|||||||
@@ -57,6 +57,9 @@
|
|||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
|
table.paleblue td.align-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
body {
|
body {
|
||||||
background: #F5F5F5
|
background: #F5F5F5
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,19 +20,19 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if add_form %}
|
{% if add_form %}
|
||||||
{% if params %}
|
{% if params %}
|
||||||
<form action="{% url form_action params %}" method="POST" >
|
<form action="{% url form_action params %}" method="POST" >
|
||||||
{% else %}
|
{% else %}
|
||||||
<form action="{% url form_action %}" method="POST" >
|
<form action="{% url form_action %}" method="POST" >
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<tr>
|
<tr>
|
||||||
{% for field in add_form %}
|
{% for field in add_form %}
|
||||||
<td>{{field}}</td>
|
<td>{{field}}</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="submit" text="Добавить заказ"></td>
|
<td class="align-right" colspan="{{ add_form.fields|length }}"><input type="submit" value="{{ add_form.submit_text }}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user