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:
parent
075f30d9e5
commit
8b4125a25d
9
apps/note/forms.py
Normal file
9
apps/note/forms.py
Normal 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__'
|
11
templates/note/transactiontemplate_form.html
Normal file
11
templates/note/transactiontemplate_form.html
Normal 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 %}
|
24
templates/note/transactiontemplate_list.html
Normal file
24
templates/note/transactiontemplate_list.html
Normal 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 %}
|
Loading…
Reference in New Issue
Block a user