Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
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
7313e5a3
Commit
7313e5a3
authored
5 years ago
by
ynerant
Committed by
Maxime Bombar
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix minor front bugs
parent
dac14b13
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!57
Page de consommations
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
static/js/consos.js
+23
-7
23 additions, 7 deletions
static/js/consos.js
templates/note/conso_form.html
+2
-2
2 additions, 2 deletions
templates/note/conso_form.html
templates/note/transaction_form.html
+14
-4
14 additions, 4 deletions
templates/note/transaction_form.html
with
39 additions
and
13 deletions
static/js/consos.js
+
23
−
7
View file @
7313e5a3
...
...
@@ -24,40 +24,56 @@ $(document).ready(function() {
});
// Switching in double consumptions mode should update the layout
$
(
"
#double_conso
"
).
click
(
function
()
{
let
double_conso_obj
=
$
(
"
#double_conso
"
);
double_conso_obj
.
click
(
function
()
{
$
(
"
#consos_list_div
"
).
show
();
$
(
"
#infos_div
"
).
attr
(
'
class
'
,
'
col-sm-5 col-xl-6
'
);
$
(
"
#note_infos_div
"
).
attr
(
'
class
'
,
'
col-xl-3
'
);
$
(
"
#user_select_div
"
).
attr
(
'
class
'
,
'
col-xl-4
'
);
$
(
"
#buttons_div
"
).
attr
(
'
class
'
,
'
col-sm-7 col-xl-6
'
);
if
(
buttons
.
length
>
0
)
{
let
note_list_obj
=
$
(
"
#note_list
"
);
let
note_list_obj
=
$
(
"
#note_list
"
);
if
(
buttons
.
length
>
0
&&
note_list_obj
.
text
().
length
>
0
)
{
$
(
"
#consos_list
"
).
html
(
note_list_obj
.
html
());
note_list_obj
.
html
(
""
);
buttons
.
forEach
(
function
(
button
)
{
$
(
"
#conso_button_
"
+
button
.
id
).
click
(
removeNote
(
button
,
"
conso_button
"
,
buttons
,
"
consos_list
"
));
});
}
});
$
(
"
#single_conso
"
).
click
(
function
()
{
let
single_conso_obj
=
$
(
"
#single_conso
"
);
single_conso_obj
.
click
(
function
()
{
$
(
"
#consos_list_div
"
).
hide
();
$
(
"
#infos_div
"
).
attr
(
'
class
'
,
'
col-sm-5 col-md-4
'
);
$
(
"
#note_infos_div
"
).
attr
(
'
class
'
,
'
col-xl-5
'
);
$
(
"
#user_select_div
"
).
attr
(
'
class
'
,
'
col-xl-7
'
);
$
(
"
#buttons_div
"
).
attr
(
'
class
'
,
'
col-sm-7 col-md-8
'
);
let
consos_list_obj
=
$
(
"
#consos_list
"
);
if
(
buttons
.
length
>
0
)
{
if
(
notes_display
.
length
===
0
)
{
let
consos_list_obj
=
$
(
"
#consos_list
"
);
if
(
notes_display
.
length
===
0
&&
consos_list_obj
.
text
().
length
>
0
)
{
$
(
"
#note_list
"
).
html
(
consos_list_obj
.
html
());
consos_list_obj
.
html
(
""
);
buttons
.
forEach
(
function
(
button
)
{
$
(
"
#conso_button_
"
+
button
.
id
).
click
(
removeNote
(
button
,
"
conso_button
"
,
buttons
,
"
note_list
"
));
});
}
else
{
buttons
.
length
=
0
;
$
(
"
#
consos_list
"
)
.
html
(
""
);
consos_list
_obj
.
html
(
""
);
}
}
});
// Ensure we begin in single consumption. Removing these lines may cause problems when reloading.
single_conso_obj
.
prop
(
'
checked
'
,
'
true
'
);
double_conso_obj
.
removeAttr
(
'
checked
'
);
$
(
"
label[for='double_conso']
"
).
attr
(
'
class
'
,
'
btn btn-sm btn-outline-primary
'
);
$
(
"
#consos_list_div
"
).
hide
();
$
(
"
#consume_all
"
).
click
(
consumeAll
);
...
...
This diff is collapsed.
Click to expand it.
templates/note/conso_form.html
+
2
−
2
View file @
7313e5a3
...
...
@@ -121,11 +121,11 @@
<i
class=
"fa fa-edit"
></i>
{% trans "Edit" %}
</a>
<div
class=
"btn-group btn-group-toggle float-right"
data-toggle=
"buttons"
>
<label
class=
"btn btn-sm btn-outline-primary active"
>
<label
for=
"single_conso"
class=
"btn btn-sm btn-outline-primary active"
>
<input
type=
"radio"
name=
"conso_type"
id=
"single_conso"
checked
>
{% trans "Single consumptions" %}
</label>
<label
class=
"btn btn-sm btn-outline-primary"
>
<label
for=
"double_conso"
class=
"btn btn-sm btn-outline-primary"
>
<input
type=
"radio"
name=
"conso_type"
id=
"double_conso"
>
{% trans "Double consumptions" %}
</label>
...
...
This diff is collapsed.
Click to expand it.
templates/note/transaction_form.html
+
14
−
4
View file @
7313e5a3
...
...
@@ -10,19 +10,19 @@ SPDX-License-Identifier: GPL-2.0-or-later
<div
class=
"row"
>
<div
class=
"col-xl-12"
>
<div
class=
"btn-group btn-group-toggle"
style=
"width: 100%; padding: 0 0 2em 0"
data-toggle=
"buttons"
>
<label
class=
"btn btn-sm btn-outline-primary active"
>
<label
for=
"type_gift"
class=
"btn btn-sm btn-outline-primary active"
>
<input
type=
"radio"
name=
"transaction_type"
id=
"type_gift"
checked
>
{% trans "Gift" %}
</label>
<label
class=
"btn btn-sm btn-outline-primary"
>
<label
for=
"type_transfer"
class=
"btn btn-sm btn-outline-primary"
>
<input
type=
"radio"
name=
"transaction_type"
id=
"type_transfer"
>
{% trans "Transfer" %}
</label>
<label
class=
"btn btn-sm btn-outline-primary"
>
<label
for=
"type_credit"
class=
"btn btn-sm btn-outline-primary"
>
<input
type=
"radio"
name=
"transaction_type"
id=
"type_credit"
>
{% trans "Credit" %}
</label>
<label
class=
"btn btn-sm btn-outline-primary"
>
<label
type=
"type_debit"
class=
"btn btn-sm btn-outline-primary"
>
<input
type=
"radio"
name=
"transaction_type"
id=
"type_debit"
>
{% trans "Debit" %}
</label>
...
...
@@ -194,6 +194,16 @@ SPDX-License-Identifier: GPL-2.0-or-later
return
true
;
});
// Ensure we begin in gift mode. Removing these lines may cause problems when reloading.
$
(
"
#type_gift
"
).
prop
(
'
checked
'
,
'
true
'
);
$
(
"
#type_transfer
"
).
removeAttr
(
'
checked
'
);
$
(
"
#type_credit
"
).
removeAttr
(
'
checked
'
);
$
(
"
#type_debit
"
).
removeAttr
(
'
checked
'
);
$
(
"
label[for='type_gift']
"
).
attr
(
'
class
'
,
'
btn btn-sm btn-outline-primary
'
);
$
(
"
label[for='type_transfer']
"
).
attr
(
'
class
'
,
'
btn btn-sm btn-outline-primary
'
);
$
(
"
label[for='type_debit']
"
).
attr
(
'
class
'
,
'
btn btn-sm btn-outline-primary
'
);
});
$
(
"
#type_gift
"
).
click
(
function
()
{
...
...
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