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
f74ab6fb
Commit
f74ab6fb
authored
Oct 24, 2024
by
François COLOMBIER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout d'un bandeau avec bouton de connexion pour la boutique de précommande
parent
2ec97ba3
Pipeline
#3867
failed with stage
in 1 minute 20 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
+52
-3
views.py
members_space/views.py
+14
-2
config.md
outils/config.md
+10
-0
home.html
templates/members_space/home.html
+28
-1
No files found.
members_space/views.py
View file @
f74ab6fb
...
...
@@ -187,12 +187,14 @@ def home(request):
Consequently, the front-end url should be unknown from the server so the user is redirected to the index,
then the front-end index will call this endpoint to load the home page
"""
if
'id'
in
request
.
COOKIES
:
partner_id
=
request
.
COOKIES
[
'id'
]
template
=
loader
.
get_template
(
getattr
(
settings
,
'MEMBERS_SPACE_HOME_TEMPLATE'
,
'members_space/home.html'
))
coop_can_change_shift_template
=
getattr
(
settings
,
'COOP_CAN_CHANGE_SHIFT_TEMPLATE'
,
False
)
if
coop_can_change_shift_template
is
True
:
# make further investigation only if COOP_CAN_CHANGE_SHIFT_TEMPLATE is True
if
'id'
in
request
.
COOKIES
:
partner_id
=
request
.
COOKIES
[
'id'
]
cs
=
CagetteShift
()
partnerData
=
cs
.
get_data_partner
(
partner_id
)
if
partnerData
[
'cooperative_state'
]
==
"unsubscribed"
:
...
...
@@ -205,6 +207,16 @@ def home(request):
'coop_can_change_shift_template'
:
coop_can_change_shift_template
,
'max_begin_hour'
:
settings
.
MAX_BEGIN_HOUR
,
}
if
getattr
(
settings
,
'PREORDERS_AVAILABLE'
,
False
)
is
True
:
if
'partnerData'
not
in
locals
()
and
'partner_id'
in
locals
():
cs
=
CagetteShift
()
partnerData
=
cs
.
get_data_partner
(
partner_id
)
preorders_connect_url
=
getattr
(
settings
,
'PREORDER_SERVER_URL'
,
''
)
if
len
(
preorders_connect_url
)
>
0
:
preorders_connect_url
+=
"?email=
%
s&coop=
%
s&FirstName=&LastName=
%
s"
%
(
partnerData
[
'email'
],
str
(
partnerData
[
'id'
]),
partnerData
[
'display_name'
])
context
[
'preorders_connect_url'
]
=
preorders_connect_url
# Get messages to display
msettings
=
MConfig
.
get_settings
(
'members'
)
if
'msg_accueil'
in
msettings
:
...
...
outils/config.md
View file @
f74ab6fb
...
...
@@ -474,6 +474,16 @@
By defaut, True. Show "Gestion des binômes" in bdm admin
### Précommandes
-
PREORDERS_AVAILABLE=True
If True and PREODER_SERVER_URL is not empty, a message is displayed in members space home, allowing member to access preorder server
-
PREORDER_SERVER_URL='https://precommandes.xxxxx.tld/'
A wordpress server url, type of "Rayons fantomes" of La Louve
### Miscellious
-
EXPORT_COMPTA_FORMAT = 'Quadratus'
...
...
templates/members_space/home.html
View file @
f74ab6fb
<div
id=
"home"
>
<div
class=
"page_title txtcenter"
>
{% if preorders_connect_url %}
<style
type=
"text/css"
>
#preoders_message
{
background
:
#f2dd9e
;
padding
:
1em
;
font-weight
:
bold
;
}
#preoders_message
span
{
display
:
block
;
width
:
520px
;
margin
:
0
auto
;
}
#preoders_message
a
{
margin-left
:
1em
;
text-decoration
:
none
;
}
#preoders_message
a
:hover
,
#preoders_message
a
:visited
{
color
:
#FFF
;
}
</style>
<div
id=
"preoders_message"
>
<span>
La boutique de précommandes est ouverte !
<a
href=
"{{preorders_connect_url|safe}}"
class=
"btn btn--primary"
>
J'y vais
</a>
</span>
</div>
{% endif %}
<div
class=
"page_title txtcenter"
{%
if
preorders_connect_url
%}
style=
"margin-top: 0;"
{%
endif
%}
>
<h1>
Espace Membre
</h1>
</div>
<div
class=
"tiles_container"
>
...
...
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