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
5
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
3784e97d
Commit
3784e97d
authored
4 years ago
by
ynerant
Browse files
Options
Downloads
Patches
Plain Diff
Hide the credit interface when editing a WEI registration
parent
6567d2f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!104
Beta
,
!98
Morefront
,
!91
Documents
Pipeline
#8441
passed with stages
in 3 minutes and 44 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/wei/forms/registration.py
+2
-1
2 additions, 1 deletion
apps/wei/forms/registration.py
apps/wei/templates/wei/weiregistration_form.html
+22
-20
22 additions, 20 deletions
apps/wei/templates/wei/weiregistration_form.html
apps/wei/views.py
+5
-0
5 additions, 0 deletions
apps/wei/views.py
with
29 additions
and
21 deletions
apps/wei/forms/registration.py
+
2
−
1
View file @
3784e97d
...
...
@@ -129,7 +129,8 @@ class WEIMembershipForm(forms.ModelForm):
attrs
=
{
'
api_url
'
:
'
/api/wei/team/
'
,
'
placeholder
'
:
'
Équipe ...
'
,
}
},
resetable
=
True
,
),
}
...
...
This diff is collapsed.
Click to expand it.
apps/wei/templates/wei/weiregistration_form.html
+
22
−
20
View file @
3784e97d
...
...
@@ -16,27 +16,29 @@
{% endblock %}
{% block extrajavascript %}
<script>
$
(
document
).
ready
(
function
()
{
function
refreshTeams
()
{
let
buses
=
[];
$
(
"
input[name='bus']:checked
"
).
each
(
function
(
ignored
)
{
buses
.
push
(
$
(
this
).
parent
().
text
().
trim
());
});
console
.
log
(
buses
);
$
(
"
input[name='team']
"
).
each
(
function
()
{
let
label
=
$
(
this
).
parent
();
$
(
this
).
parent
().
addClass
(
'
d-none
'
);
buses
.
forEach
(
function
(
bus
)
{
if
(
label
.
text
().
includes
(
bus
))
label
.
removeClass
(
'
d-none
'
);
{% if not object.membership %}
<script>
$
(
document
).
ready
(
function
()
{
function
refreshTeams
()
{
let
buses
=
[];
$
(
"
input[name='bus']:checked
"
).
each
(
function
(
ignored
)
{
buses
.
push
(
$
(
this
).
parent
().
text
().
trim
());
});
});
}
console
.
log
(
buses
);
$
(
"
input[name='team']
"
).
each
(
function
()
{
let
label
=
$
(
this
).
parent
();
$
(
this
).
parent
().
addClass
(
'
d-none
'
);
buses
.
forEach
(
function
(
bus
)
{
if
(
label
.
text
().
includes
(
bus
))
label
.
removeClass
(
'
d-none
'
);
});
});
}
$
(
"
input[name='bus']
"
).
change
(
refreshTeams
);
$
(
"
input[name='bus']
"
).
change
(
refreshTeams
);
refreshTeams
();
});
</script>
refreshTeams
();
});
</script>
{% endif %}
{% endblock %}
This diff is collapsed.
Click to expand it.
apps/wei/views.py
+
5
−
0
View file @
3784e97d
...
...
@@ -607,6 +607,11 @@ class WEIUpdateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Update
if
not
PermissionBackend
.
check_perm
(
self
.
request
.
user
,
"
wei.change_membership_
"
+
field_name
,
self
.
object
.
membership
):
field
.
widget
=
HiddenInput
()
del
membership_form
.
fields
[
"
credit_type
"
]
del
membership_form
.
fields
[
"
credit_amount
"
]
del
membership_form
.
fields
[
"
first_name
"
]
del
membership_form
.
fields
[
"
last_name
"
]
del
membership_form
.
fields
[
"
bank
"
]
context
[
"
membership_form
"
]
=
membership_form
elif
not
self
.
object
.
first_year
and
PermissionBackend
.
check_perm
(
self
.
request
.
user
,
"
wei.change_weiregistration_information_json
"
,
self
.
object
):
...
...
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