Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
7230f9c5
Commit
7230f9c5
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Patches
Plain Diff
transaction_type -> category
parent
b18e5b03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!19
Import nk15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/note/views.py
+2
-2
2 additions, 2 deletions
apps/note/views.py
templates/note/conso_form.html
+7
-7
7 additions, 7 deletions
templates/note/conso_form.html
with
9 additions
and
9 deletions
apps/note/views.py
+
2
−
2
View file @
7230f9c5
...
...
@@ -138,8 +138,8 @@ class ConsoView(LoginRequiredMixin, CreateView):
Add some context variables in template such as page title
"""
context
=
super
().
get_context_data
(
**
kwargs
)
context
[
'
transaction_templates
'
]
=
TransactionTemplate
.
objects
.
all
(
)
\
.
order_by
(
'
template_type
'
)
context
[
'
transaction_templates
'
]
=
TransactionTemplate
.
objects
.
filter
(
display
=
True
)
\
.
order_by
(
'
category
'
)
context
[
'
title
'
]
=
_
(
"
Consommations
"
)
# select2 compatibility
...
...
This diff is collapsed.
Click to expand it.
templates/note/conso_form.html
+
7
−
7
View file @
7230f9c5
...
...
@@ -7,7 +7,7 @@
{% block content %}
{# Regroup buttons under categories #}
{% regroup transaction_templates by
template_type as template_typ
es %}
{% regroup transaction_templates by
category as categori
es %}
<form
method=
"post"
onsubmit=
"window.onbeforeunload=null"
>
{% csrf_token %}
...
...
@@ -44,10 +44,10 @@
{# Tabs for button categories #}
<div
class=
"card-header"
>
<ul
class=
"nav nav-tabs nav-fill card-header-tabs"
>
{% for
template_type in template_typ
es %}
{% for
category in categori
es %}
<li
class=
"nav-item"
>
<a
class=
"nav-link"
data-toggle=
"tab"
href=
"#{{
template_type
.grouper|slugify }}"
>
{{
template_type
.grouper }}
<a
class=
"nav-link"
data-toggle=
"tab"
href=
"#{{
category
.grouper|slugify }}"
>
{{
category
.grouper }}
</a>
</li>
{% endfor %}
...
...
@@ -57,10 +57,10 @@
{# Tabs content #}
<div
class=
"card-body"
>
<div
class=
"tab-content"
>
{% for
template_type in template_typ
es %}
<div
class=
"tab-pane"
id=
"{{
template_type
.grouper|slugify }}"
>
{% for
category in categori
es %}
<div
class=
"tab-pane"
id=
"{{
category
.grouper|slugify }}"
>
<div
class=
"d-inline-flex flex-wrap justify-content-center"
>
{% for button in
template_type
.list %}
{% for button in
category
.list %}
<button
class=
"btn btn-outline-dark rounded-0 flex-fill"
name=
"button"
value=
"{{ button.name }}"
>
{{ button.name }} ({{ button.amount | pretty_money }})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment