forked from DGNum/gestioCOF
few improvements on article category
- add verbose names to ArticleCategory fields - add button to view categories list from articles list - fix article_update template in form validation - improve interface for articlecategory_update - revert vanished urls (happened in merge with master...)
This commit is contained in:
parent
42728e58be
commit
3ee9de93d9
|
@ -14,6 +14,11 @@ class Migration(migrations.Migration):
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='articlecategory',
|
model_name='articlecategory',
|
||||||
name='has_addcost',
|
name='has_addcost',
|
||||||
field=models.BooleanField(default=True),
|
field=models.BooleanField(default=True, help_text="Si oui et qu'une majoration est active, celle-ci sera appliquée aux articles de cette catégorie.", verbose_name='majorée'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='articlecategory',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(max_length=45, verbose_name='nom'),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -341,8 +341,12 @@ class CheckoutStatement(models.Model):
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class ArticleCategory(models.Model):
|
class ArticleCategory(models.Model):
|
||||||
name = models.CharField(max_length=45)
|
name = models.CharField("nom", max_length=45)
|
||||||
has_addcost = models.BooleanField(default=True)
|
has_addcost = models.BooleanField("majorée", default=True,
|
||||||
|
help_text="Si oui et qu'une majoration "
|
||||||
|
"est active, celle-ci sera "
|
||||||
|
"appliquée aux articles de "
|
||||||
|
"cette catégorie.")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
<a class="btn btn-primary btn-lg" href="{% url 'kfet.article.create' %}">
|
<a class="btn btn-primary btn-lg" href="{% url 'kfet.article.create' %}">
|
||||||
Nouvel article
|
Nouvel article
|
||||||
</a>
|
</a>
|
||||||
|
<a class="btn btn-primary btn-lg" href="{% url 'kfet.category' %}">
|
||||||
|
Catégories
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<div class="row form-only">
|
<div class="row form-only">
|
||||||
<div class="col-sm-12 col-md-8 col-md-offset-2">
|
<div class="col-sm-12 col-md-8 col-md-offset-2">
|
||||||
<div class="content-form">
|
<div class="content-form">
|
||||||
<form submit="" method="post" class="form-horizontal">
|
<form action="" method="post" class="form-horizontal">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% include 'kfet/form_snippet.html' with form=form %}
|
{% include 'kfet/form_snippet.html' with form=form %}
|
||||||
{% if not perms.kfet.change_article %}
|
{% if not perms.kfet.change_article %}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>Nom</td>
|
<td>Nom</td>
|
||||||
<td class="text-right">Nombre d'articles</td>
|
<td class="text-right">Nombre d'articles</td>
|
||||||
<td class="text-right">Peut-être majoré</td>
|
<td class="text-right">Peut être majorée</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
|
@ -5,13 +5,21 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<form action="" method="post">
|
{% include "kfet/base_messages.html" %}
|
||||||
|
|
||||||
|
<div class="row form-only">
|
||||||
|
<div class="col-sm-12 col-md-8 col-md-offset-2">
|
||||||
|
<div class="content-form">
|
||||||
|
<form action="" method="post" class="form-horizontal">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form.as_p }}
|
{% include 'kfet/form_snippet.html' with form=form %}
|
||||||
{% if not perms.kfet.change_articlecategory %}
|
{% if not perms.kfet.edit_articlecategory %}
|
||||||
<input type="password" name="KFETPASSWORD">
|
{% include 'kfet/form_authentication_snippet.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<input type="submit" value="Mettre à jour">
|
{% include 'kfet/form_submit_snippet.html' with value="Enregistrer"%}
|
||||||
</form>
|
<form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -69,6 +69,12 @@ urlpatterns = [
|
||||||
name='kfet.account.negative'),
|
name='kfet.account.negative'),
|
||||||
|
|
||||||
# Account - Statistics
|
# Account - Statistics
|
||||||
|
url(r'^accounts/(?P<trigramme>.{3})/stat/operations/list$',
|
||||||
|
views.AccountStatOperationList.as_view(),
|
||||||
|
name='kfet.account.stat.operation.list'),
|
||||||
|
url(r'^accounts/(?P<trigramme>.{3})/stat/operations$',
|
||||||
|
views.AccountStatOperation.as_view(),
|
||||||
|
name='kfet.account.stat.operation'),
|
||||||
|
|
||||||
url(r'^accounts/(?P<trigramme>.{3})/stat/balance/list$',
|
url(r'^accounts/(?P<trigramme>.{3})/stat/balance/list$',
|
||||||
views.AccountStatBalanceList.as_view(),
|
views.AccountStatBalanceList.as_view(),
|
||||||
|
|
Loading…
Reference in a new issue