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
2b533018
Commit
2b533018
authored
2 years ago
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add availability to make member adding new shifts
parent
2546a5fa
dev_cooperatic
…
#5673_bug_calendrier_echange_service
3832-makeups-and-member-status-update
4081
4444_improve_presence_recording
4709
4778-reception-dont-get-finished-orders
4809-remove-shelf-value-col-to-reduce-server-load
4880-rapports-reception-faux
4950-douchage-appli-reception
5474-et-5462-Voir-les-rattrapages-choisis-dans-admin-bdm-et-corrige-lenteur-affichage-admin-rattrapages
5641-reception-trier-a-la-maj-prix-dans-ordre-de-pointage-quantites
6286_bug_encaissement_souscription_cheque_espece
6832--certaines-absences-engendrent-une-erreur
adaptation_supercafoutch
adaptation_supercoop_supercafoutch
adpatation_chouette
assistance_import_article
coop_dev_necessitant_modules_bdm_odoo_modifies
correctif_nb_rattrapages_creation_binome_avec_ajout_automatique_au_point_negatif
export_capital_detenu
fix_bug_process_picking
fusion_custom_graoucoop
graoucoop_backup
graoucoop_prod
graoucoop_tmp
hot_fix_shelf_labels_auto_print
impression_etiquettes_rayons
integration_lien_precommandes_dans_espace_membre
lacagette_prod
local_branch
meal-voucher-and-label-printer-software-bug
migration-v12
refonte_espace_membre_sc
retouches_tickets_supercoop
sc-setup-stock-app
supercafoutch-preprod
supercafoutch-prod-20221003
supercafoutch_prod
ticket_4146
supercafoutch_20240909_080630
supercafoutch_20240609_115709
supercafoutch_20240212_082431
supercafoutch_20240107_181851
supercafoutch_prod_until_240107
supercafoutch-prod-20221003
supercafoutch-230911
supercafoutch-230824
supercafoutch-230823
supercafoutch-230823-the-true-one
lacagette_20240310_074751
lacagette_20240107_122554
lacagette_20240107_120916
graoucoop_20240609_122614
cagette_testtag
cagette-230814
cagette-230630
2 merge requests
!218
Ticket 4292
,
!196
Adaptation supercoop supercafoutch
Pipeline
#2353
passed with stage
in 1 minute 29 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
8 deletions
+58
-8
members-space-shifts-exchange.css
members_space/static/css/members-space-shifts-exchange.css
+1
-0
members-space-shifts-exchange.js
members_space/static/js/members-space-shifts-exchange.js
+42
-7
views.py
members_space/views.py
+3
-0
config.md
outils/config.md
+4
-0
views.py
shifts/views.py
+4
-1
index.html
templates/members_space/index.html
+1
-0
shifts_exchange.html
templates/members_space/shifts_exchange.html
+3
-0
No files found.
members_space/static/css/members-space-shifts-exchange.css
View file @
2b533018
...
...
@@ -39,6 +39,7 @@
justify-content
:
space-between
;
}
@media
screen
and
(
max-width
:
992px
)
{
#calendar_top_info
{
display
:
flex
;
...
...
This diff is collapsed.
Click to expand it.
members_space/static/js/members-space-shifts-exchange.js
View file @
2b533018
var
calendar
=
null
,
selected_shift
=
null
,
vw
=
null
;
vw
=
null
,
adding_mode
=
false
;
/* - Logic */
...
...
@@ -51,6 +52,9 @@ function add_or_change_shift(new_shift_id) {
if
(
selected_shift
===
null
)
{
tUrl
=
'/shifts/add_shift'
;
if
(
partner_data
.
makeups_to_do
>
0
)
{
tData
+=
'&is_makeup=1'
;
}
}
else
{
tUrl
=
'/shifts/change_shift'
;
tData
=
tData
+
'&idOldShift='
+
selected_shift
.
shift_id
[
0
]
+
'&idRegister='
+
selected_shift
.
id
;
...
...
@@ -143,6 +147,8 @@ function add_or_change_shift(new_shift_id) {
},
300
);
}
});
adding_mode
=
false
;
$
(
'#start_adding_shift'
).
prop
(
'disabled'
,
false
);
}
return
null
;
...
...
@@ -315,6 +321,7 @@ function init_shifts_list() {
if
(
!
can_exchange_shifts
())
{
shift_line_template
.
find
(
".selectable_shift_line"
).
addClass
(
"btn"
);
shift_line_template
.
find
(
".checkbox"
).
prop
(
"disabled"
,
"disabled"
);
$
(
'#start_adding_shift'
).
prop
(
'disabled'
,
true
);
}
else
{
if
(
shift
.
is_makeup
==
true
)
{
shift_line_template
.
find
(
".selectable_shift_line"
).
addClass
(
"btn--warning"
);
...
...
@@ -577,12 +584,27 @@ function init_calendar_page() {
"Valider"
);
}
else
if
(
selected_shift
===
null
&&
can_exchange_shifts
())
{
/* could exchange shift but no old shift selected */
openModal
(
"Je dois sélectionner un service à échanger."
,
closeModal
,
"J'ai compris"
);
if
(
adding_mode
===
false
)
{
/* could exchange shift but no old shift selected */
openModal
(
"Je dois sélectionner un service à échanger."
,
closeModal
,
"J'ai compris"
);
}
else
{
// Display modal
let
modal_template
=
$
(
"#modal_add_shift_template"
);
modal_template
.
find
(
".date_new_shift"
).
text
(
new_shift_date
);
modal_template
.
find
(
".time_new_shift"
).
text
(
new_shift_time
);
openModal
(
modal_template
.
html
(),
()
=>
{
add_or_change_shift
(
new_shift_id
);
},
"Valider"
);
}
}
else
if
(
should_select_makeup
())
{
/* choose a makeup service */
// Check if selected new shift is in less than 6 months
...
...
@@ -811,6 +833,19 @@ function init_shifts_exchange() {
init_calendar_page
();
}
$
(
'#start_adding_shift'
).
click
((
c
)
=>
{
openModal
(
"<p>Je souhaite sélectionner un service supplémentaire.</p>"
,
()
=>
{
$
(
c
.
target
).
prop
(
'disabled'
,
true
);
adding_mode
=
true
;
closeModal
();
},
"Confirmer"
,
false
);
});
$
(
window
).
smartresize
(
function
()
{
// only apply if a width threshold is passed
if
(
...
...
This diff is collapsed.
Click to expand it.
members_space/views.py
View file @
2b533018
...
...
@@ -130,6 +130,8 @@ def index(request, exception=None):
if
hasattr
(
settings
,
'SHIFT_EXCHANGE_DAYS_TO_HIDE'
):
days_to_hide
=
settings
.
SHIFT_EXCHANGE_DAYS_TO_HIDE
context
[
'daysToHide'
]
=
days_to_hide
can_add_shift
=
getattr
(
settings
,
'CAN_ADD_SHIFT'
,
False
)
context
[
'canAddShift'
]
=
"true"
if
can_add_shift
is
True
else
"false"
msettings
=
MConfig
.
get_settings
(
'members'
)
context
[
'forms_link'
]
=
msettings
[
'forms_link'
][
'value'
]
if
'forms_link'
in
msettings
else
''
...
...
@@ -203,6 +205,7 @@ def shifts_exchange(request):
template
=
loader
.
get_template
(
'members_space/shifts_exchange.html'
)
context
=
{
'title'
:
'Échange de Services'
,
'canAddShift'
:
getattr
(
settings
,
'CAN_ADD_SHIFT'
,
False
)
}
return
HttpResponse
(
template
.
render
(
context
,
request
))
...
...
This diff is collapsed.
Click to expand it.
outils/config.md
View file @
2b533018
...
...
@@ -342,6 +342,10 @@
-
BLOCK_ACTIONS_FOR_ATTACHED_PEOPLE = False
Attached people can or not change his services
-
CAN_ADD_SHIFT = True
By default, False. Set if coop can or not add shifts in their memberspace calendar
### Reception
-
RECEPTION_ADD_ADMIN_MODE = True
...
...
This diff is collapsed.
Click to expand it.
shifts/views.py
View file @
2b533018
...
...
@@ -281,8 +281,11 @@ def add_shift(request):
"idPartner"
:
int
(
request
.
POST
[
'idPartner'
]),
"idShift"
:
int
(
request
.
POST
[
'idNewShift'
]),
"shift_type"
:
request
.
POST
[
'shift_type'
],
"is_makeup"
:
Tru
e
"is_makeup"
:
Fals
e
}
if
'is_makeup'
in
request
.
POST
and
request
.
POST
[
'is_makeup'
]
==
"1"
:
data
[
'is_makeup'
]
=
True
#Insertion du nouveau shift
st_r_id
=
False
...
...
This diff is collapsed.
Click to expand it.
templates/members_space/index.html
View file @
2b533018
...
...
@@ -153,6 +153,7 @@
"extra_shift_done"
:
parseInt
(
"{{partnerData.extra_shift_done}}"
,
10
)
};
var
block_actions_for_attached_people
=
'{{block_actions_for_attached_people}}'
;
const
canAddShift
=
{{
canAddShift
}};
</script>
<script
src=
"{% static "
js
/
all_common
.
js
"
%}?
v=
1651853225"
></script>
<script
src=
"{% static "
js
/
members-space-home
.
js
"
%}?
v=
1651853225"
></script>
...
...
This diff is collapsed.
Click to expand it.
templates/members_space/shifts_exchange.html
View file @
2b533018
...
...
@@ -50,6 +50,9 @@
<i
class=
"fas fa-spinner fa-spin fa-lg"
></i>
</div>
<div
id=
"shifts_list"
></div>
{% if canAddShift %}
<button
class=
"btn--primary selectable_shift_line"
id=
"start_adding_shift"
><strong>
+ Ajouter un service
</strong></button>
{% endif %}
</div>
<div
id=
"calendar_explaination_area"
></div>
<button
id=
"calendar_explaination_button"
class=
"btn--success"
>
Légende du calendrier
</button>
...
...
This diff is collapsed.
Click to expand it.
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