Commit c0675619 by Etienne Freiss

Merge branch 'evolution_bdm' of…

Merge branch 'evolution_bdm' of https://gl.cooperatic.fr/cooperatic-foodcoops/third-party into ticket_1674
parents 90c64d98 934b8216
...@@ -59,7 +59,11 @@ body { ...@@ -59,7 +59,11 @@ body {
} }
#home_tile_services_exchange .tile_content { #home_tile_services_exchange .tile_content {
justify-content: center; height: 100%;
flex-direction: column;
align-items: center;
text-align: center;
} }
......
...@@ -68,6 +68,10 @@ function goto(page) { ...@@ -68,6 +68,10 @@ function goto(page) {
/** /**
* Define which html content to load from server depending on the window location * Define which html content to load from server depending on the window location
*
* WARNING: For the routing system to work,
* public urls (those the users will see & navigate to) must be different than the server urls used to fetch resources
* (ex: public url: /members_space/mes-info ; server url: /members_space/my_info)
*/ */
function update_dom() { function update_dom() {
$(".nav_item").removeClass('active'); $(".nav_item").removeClass('active');
......
...@@ -5,12 +5,12 @@ from . import views ...@@ -5,12 +5,12 @@ from . import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.index), url(r'^$', views.index),
url(r'^homepage$', views.home), url(r'^homepage$', views.home), # These endpoints must be different than in-app url
url(r'^my_info$', views.my_info), url(r'^my_info$', views.my_info),
url(r'^my_shifts$', views.my_shifts), url(r'^my_shifts$', views.my_shifts),
url(r'^shifts_exchange$', views.shifts_exchange), url(r'^shifts_exchange$', views.shifts_exchange),
url(r'^faq$', views.faq), url(r'^faq$', views.faq),
url(r'^no_content$', views.no_content), url(r'^no_content$', views.no_content),
url(r'^get_shifts_history$', views.get_shifts_history), url(r'^get_shifts_history$', views.get_shifts_history),
url('/*$', views.index), url('/*$', views.index), # Urls unknown from the server will redirect to index
] ]
...@@ -151,6 +151,12 @@ def index(request, exception=None): ...@@ -151,6 +151,12 @@ def index(request, exception=None):
return _get_response_according_to_credentials(request, credentials, context, template) return _get_response_according_to_credentials(request, credentials, context, template)
def home(request): def home(request):
"""
Endpoint the front-end will call to load the "home" page.
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
"""
template = loader.get_template('members_space/home.html') template = loader.get_template('members_space/home.html')
context = { context = {
'title': 'Espace Membres', 'title': 'Espace Membres',
...@@ -164,6 +170,7 @@ def home(request): ...@@ -164,6 +170,7 @@ def home(request):
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def my_info(request): def my_info(request):
""" Endpoint the front-end will call to load the "My info" page. """
template = loader.get_template('members_space/my_info.html') template = loader.get_template('members_space/my_info.html')
context = { context = {
'title': 'Mes Infos', 'title': 'Mes Infos',
...@@ -171,6 +178,7 @@ def my_info(request): ...@@ -171,6 +178,7 @@ def my_info(request):
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def my_shifts(request): def my_shifts(request):
""" Endpoint the front-end will call to load the "My shifts" page. """
template = loader.get_template('members_space/my_shifts.html') template = loader.get_template('members_space/my_shifts.html')
context = { context = {
'title': 'Mes Services', 'title': 'Mes Services',
...@@ -178,6 +186,7 @@ def my_shifts(request): ...@@ -178,6 +186,7 @@ def my_shifts(request):
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def shifts_exchange(request): def shifts_exchange(request):
""" Endpoint the front-end will call to load the "Shifts exchange" page. """
template = loader.get_template('members_space/shifts_exchange.html') template = loader.get_template('members_space/shifts_exchange.html')
context = { context = {
'title': 'Échange de Services', 'title': 'Échange de Services',
...@@ -195,6 +204,7 @@ def faq(request): ...@@ -195,6 +204,7 @@ def faq(request):
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def no_content(request): def no_content(request):
""" Endpoint the front-end will call to load the "No content" page. """
template = loader.get_template('members_space/no_content.html') template = loader.get_template('members_space/no_content.html')
context = { context = {
'title': 'Contenu non trouvé', 'title': 'Contenu non trouvé',
......
...@@ -62,6 +62,9 @@ ...@@ -62,6 +62,9 @@
Échange de services Échange de services
</div> </div>
<div class="tile_content"> <div class="tile_content">
<div>
Un empêchement ? J'anticipe et déplace mes services jusqu'à 24h avant leur début !
</div>
<div class="home_link_button_area"> <div class="home_link_button_area">
<button type="button" class="btn--primary home_link_button" id="go_to_shifts_calendar"> <button type="button" class="btn--primary home_link_button" id="go_to_shifts_calendar">
Accéder au calendrier d'échange de services Accéder au calendrier d'échange de services
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment