Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
6f10063e
Commit
6f10063e
authored
Apr 20, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
INS: register to comitees shift
parent
d893ecc1
Pipeline
#2147
passed with stage
in 1 minute 28 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
23 deletions
+43
-23
inscriptions.js
members/static/js/inscriptions.js
+3
-0
views.py
members/views.py
+21
-18
common.js
outils/static/js/common.js
+14
-2
inscriptions.html
templates/members/inscriptions.html
+5
-3
No files found.
members/static/js/inscriptions.js
View file @
6f10063e
...
...
@@ -773,4 +773,7 @@ $(document).ready(function() {
searchMembersForAssociate
();
});
if
(
committees_shift_id
!==
"None"
)
{
$
(
"#shift_choice button[data-select='Volant']"
).
text
(
"Comités"
);
}
});
members/views.py
View file @
6f10063e
...
...
@@ -87,24 +87,27 @@ def inscriptions(request, type=1):
"""
template
=
loader
.
get_template
(
'members/inscriptions.html'
)
context
=
{
'type'
:
type
,
'title'
:
'Inscriptions'
,
'couchdb_server'
:
settings
.
COUCHDB
[
'url'
],
'mag_place_string'
:
settings
.
MAG_NAME
,
'office_place_string'
:
settings
.
OFFICE_NAME
,
'max_begin_hour'
:
settings
.
MAX_BEGIN_HOUR
,
'payment_meanings'
:
settings
.
SUBSCRIPTION_PAYMENT_MEANINGS
,
'force_firstname_hyphen'
:
getattr
(
settings
,
'FORCE_HYPHEN_IN_SUBSCRIPTION_FIRSTNAME'
,
True
),
'input_barcode'
:
getattr
(
settings
,
'SUBSCRIPTION_INPUT_BARCODE'
,
False
),
'email_domain'
:
getattr
(
settings
,
'EMAIL_DOMAIN'
,
'lacagette-coop.fr'
),
'ask_for_sex'
:
getattr
(
settings
,
'SUBSCRIPTION_ASK_FOR_SEX'
,
False
),
'open_on_sunday'
:
getattr
(
settings
,
'OPEN_ON_SUNDAY'
,
False
),
'POUCHDB_VERSION'
:
getattr
(
settings
,
'POUCHDB_VERSION'
,
''
),
'max_chq_nb'
:
getattr
(
settings
,
'MAX_CHQ_NB'
,
12
),
'show_ftop_button'
:
getattr
(
settings
,
'SHOW_FTOP_BUTTON'
,
True
),
'db'
:
settings
.
COUCHDB
[
'dbs'
][
'member'
],
'ASSOCIATE_MEMBER_SHIFT'
:
getattr
(
settings
,
'ASSOCIATE_MEMBER_SHIFT'
,
''
),
'prepa_odoo_url'
:
getattr
(
settings
,
'PREPA_ODOO_URL'
,
'/members/prepa-odoo'
),
}
committees_shift_id
=
CagetteServices
.
get_committees_shift_id
()
context
=
{
'type'
:
type
,
'title'
:
'Inscriptions'
,
'couchdb_server'
:
settings
.
COUCHDB
[
'url'
],
'mag_place_string'
:
settings
.
MAG_NAME
,
'office_place_string'
:
settings
.
OFFICE_NAME
,
'max_begin_hour'
:
settings
.
MAX_BEGIN_HOUR
,
'payment_meanings'
:
settings
.
SUBSCRIPTION_PAYMENT_MEANINGS
,
'force_firstname_hyphen'
:
getattr
(
settings
,
'FORCE_HYPHEN_IN_SUBSCRIPTION_FIRSTNAME'
,
True
),
'input_barcode'
:
getattr
(
settings
,
'SUBSCRIPTION_INPUT_BARCODE'
,
False
),
'email_domain'
:
getattr
(
settings
,
'EMAIL_DOMAIN'
,
'lacagette-coop.fr'
),
'ask_for_sex'
:
getattr
(
settings
,
'SUBSCRIPTION_ASK_FOR_SEX'
,
False
),
'open_on_sunday'
:
getattr
(
settings
,
'OPEN_ON_SUNDAY'
,
False
),
'POUCHDB_VERSION'
:
getattr
(
settings
,
'POUCHDB_VERSION'
,
''
),
'max_chq_nb'
:
getattr
(
settings
,
'MAX_CHQ_NB'
,
12
),
'show_ftop_button'
:
getattr
(
settings
,
'SHOW_FTOP_BUTTON'
,
True
),
'db'
:
settings
.
COUCHDB
[
'dbs'
][
'member'
],
'ASSOCIATE_MEMBER_SHIFT'
:
getattr
(
settings
,
'ASSOCIATE_MEMBER_SHIFT'
,
''
),
'prepa_odoo_url'
:
getattr
(
settings
,
'PREPA_ODOO_URL'
,
'/members/prepa-odoo'
),
'committees_shift_id'
:
committees_shift_id
,
}
response
=
HttpResponse
(
template
.
render
(
context
,
request
))
return
response
...
...
outils/static/js/common.js
View file @
6f10063e
...
...
@@ -53,8 +53,13 @@ function subscribe_shift(shift_t_id) {
var
s_data
=
shift_templates
[
shift_t_id
].
data
;
var
shift_name
=
get_shift_name
(
s_data
);
if
(
committees_shift_id
!==
undefined
&&
committees_shift_id
!==
"None"
&&
shift_name
===
"Volant"
)
{
shift_name
=
'des Comités'
}
let
msg
=
'On inscrit le membre au créneau '
+
shift_name
openModal
(
'On inscrit le membre au créneau '
+
shift_name
,
msg
,
function
()
{
closeModal
();
current_coop
.
shift_template
=
shift_templates
[
shift_t_id
];
...
...
@@ -327,7 +332,14 @@ function retrieve_and_draw_shift_tempates() {
$
.
each
(
shift_templates
,
function
(
i
,
e
)
{
if
(
e
.
data
.
type
==
2
&&
volant
==
null
)
{
volant
=
e
.
data
.
id
;
// has comitee shift
if
(
committees_shift_id
!==
undefined
&&
committees_shift_id
!==
"None"
)
{
if
(
e
.
data
.
id
==
parseInt
(
committees_shift_id
))
{
volant
=
e
.
data
.
id
}
}
else
{
volant
=
e
.
data
.
id
;
}
}
});
...
...
templates/members/inscriptions.html
View file @
6f10063e
...
...
@@ -178,9 +178,11 @@
auto_compaction
:
false
});
var
mag_place_string
=
'{{mag_place_string}}'
;
var
office_place_string
=
'{{office_place_string}}'
var
max_begin_hour
=
'{{max_begin_hour}}'
var
email_domain
=
'{{email_domain}}'
var
office_place_string
=
'{{office_place_string}}'
;
var
max_begin_hour
=
'{{max_begin_hour}}'
;
var
email_domain
=
'{{email_domain}}'
;
var
committees_shift_id
=
'{{committees_shift_id}}'
;
</script>
<script
src=
"{% static "
js
/
all_common
.
js
"
%}?
v=
"></script>
<script src="
{%
static
"
js
/
common
.
js
"
%}?
v=
"></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment