1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

add templates forms and tags

This commit is contained in:
Pierre-antoine Comby 2019-08-11 19:55:04 +02:00
parent 075f30d9e5
commit 8b4125a25d
3 changed files with 44 additions and 0 deletions

9
apps/note/forms.py Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env python
from django import forms
from .models import TransactionTemplate
class TransactionTemplateForm(forms.ModelForm):
class Meta:
model = TransactionTemplate
fields ='__all__'

View File

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% load static %}
{% load crispy_forms_tags %}
{% block content %}
<p><a class="btn btn-default" href="{% url 'note:template_list' %}">book Listing</a></p>
<form method="post">
{% csrf_token %}
{{form|crispy}}
<button class="btn btn-primary" type="submit">Submit</button>
</form>
{% endblock %}

View File

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block content %}
<table class="table">
<tr>
<td>ID</td><td>Link</td>
<td>name</td>
<td>destinataire</td>
<td>montant</td>
<td>catégorie</td>
</tr>
{% for object in object_list %}
<tr>
<td>{{object.pk}}</td>
<td><a href="{{object.get_absolute_url}}">{{object}}</a></td>
<td>{{ object.name }}</td>
<td>{{ object.destination }}</td>
<td>{{ object.amount }}</td>
<td>{{ object.template_type }}</td>
</tr>
{% endfor %}
</table>
<a class="btn btn-primary" href="{% url 'note:template_create' %}">New Template</a>
{% endblock %}