diff --git a/cof/settings/common.py b/cof/settings/common.py index af344796..1bd6dcd8 100644 --- a/cof/settings/common.py +++ b/cof/settings/common.py @@ -94,6 +94,7 @@ INSTALLED_APPS = [ 'wagtail.wagtailadmin', 'wagtail.wagtailcore', 'wagtail.contrib.modeladmin', + 'wagtail.contrib.wagtailroutablepage', 'wagtailmenus', 'modelcluster', 'taggit', diff --git a/cof/urls.py b/cof/urls.py index e6e5d313..8be4a130 100644 --- a/cof/urls.py +++ b/cof/urls.py @@ -6,6 +6,7 @@ Fichier principal de configuration des urls du projet GestioCOF from django.conf import settings from django.conf.urls import include, url +from django.conf.urls.i18n import i18n_patterns from django.conf.urls.static import static from django.contrib import admin from django.views.generic.base import TemplateView @@ -26,73 +27,73 @@ admin.autodiscover() urlpatterns = [ # Page d'accueil - url(r'^$', gestioncof_views.home, name='home'), + url(r'^gestion/$', gestioncof_views.home, name='home'), # Le BdA - url(r'^bda/', include('bda.urls')), + url(r'^gestion/bda/', include('bda.urls')), # Les exports - url(r'^export/', include(export_patterns)), + url(r'^gestion/export/', include(export_patterns)), # Les petits cours - url(r'^petitcours/', include(petitcours_patterns)), + url(r'^gestion/petitcours/', include(petitcours_patterns)), # Les sondages - url(r'^survey/', include(surveys_patterns)), + url(r'^gestion/survey/', include(surveys_patterns)), # Evenements - url(r'^event/', include(events_patterns)), + url(r'^gestion/event/', include(events_patterns)), # Calendrier - url(r'^calendar/', include(calendar_patterns)), + url(r'^gestion/calendar/', include(calendar_patterns)), # Clubs - url(r'^clubs/', include(clubs_patterns)), + url(r'^gestion/clubs/', include(clubs_patterns)), # Authentification - url(r'^cof/denied$', TemplateView.as_view(template_name='cof-denied.html'), + url(r'^gestion/cof/denied$', TemplateView.as_view(template_name='cof-denied.html'), name="cof-denied"), - url(r'^cas/login$', django_cas_views.login, name="cas_login_view"), - url(r'^cas/logout$', django_cas_views.logout), - url(r'^outsider/login$', gestioncof_views.login_ext, + url(r'^gestion/cas/login$', django_cas_views.login, name="cas_login_view"), + url(r'^gestion/cas/logout$', django_cas_views.logout), + url(r'^gestion/outsider/login$', gestioncof_views.login_ext, name="ext_login_view"), - url(r'^outsider/logout$', django_views.logout, {'next_page': 'home'}), - url(r'^login$', gestioncof_views.login, name="cof-login"), - url(r'^logout$', gestioncof_views.logout, name="cof-logout"), + url(r'^gestion/outsider/logout$', django_views.logout, {'next_page': 'home'}), + url(r'^gestion/login$', gestioncof_views.login, name="cof-login"), + url(r'^gestion/logout$', gestioncof_views.logout, name="cof-logout"), # Infos persos - url(r'^profile$', gestioncof_views.profile, + url(r'^gestion/profile$', gestioncof_views.profile, name='profile'), - url(r'^outsider/password-change$', django_views.password_change, + url(r'^gestion/outsider/password-change$', django_views.password_change, name='password_change'), - url(r'^outsider/password-change-done$', + url(r'^gestion/outsider/password-change-done$', django_views.password_change_done, name='password_change_done'), # Inscription d'un nouveau membre - url(r'^registration$', gestioncof_views.registration, + url(r'^gestion/registration$', gestioncof_views.registration, name='registration'), - url(r'^registration/clipper/(?P[\w-]+)/' + url(r'^gestion/registration/clipper/(?P[\w-]+)/' r'(?P.*)$', gestioncof_views.registration_form2, name="clipper-registration"), - url(r'^registration/user/(?P.+)$', + url(r'^gestion/registration/user/(?P.+)$', gestioncof_views.registration_form2, name="user-registration"), - url(r'^registration/empty$', gestioncof_views.registration_form2, + url(r'^gestion/registration/empty$', gestioncof_views.registration_form2, name="empty-registration"), # Autocompletion - url(r'^autocomplete/registration$', autocomplete), - url(r'^user/autocomplete$', gestioncof_views.user_autocomplete, + url(r'^gestion/autocomplete/registration$', autocomplete), + url(r'^gestion/user/autocomplete$', gestioncof_views.user_autocomplete, name='cof-user-autocomplete'), # Interface admin - url(r'^admin/logout/', gestioncof_views.logout), - url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - url(r'^admin/(?P[\d\w]+)/(?P[\d\w]+)/csv/', + url(r'^gestion/admin/logout/', gestioncof_views.logout), + url(r'^gestion/admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^gestion/admin/(?P[\d\w]+)/(?P[\d\w]+)/csv/', csv_views.admin_list_export, {'fields': ['username', ]}), - url(r'^admin/', include(admin.site.urls)), + url(r'^gestion/admin/', include(admin.site.urls)), # Liens utiles du COF et du BdA - url(r'^utile_cof$', gestioncof_views.utile_cof, + url(r'^gestion/utile_cof$', gestioncof_views.utile_cof, name='utile_cof'), - url(r'^utile_bda$', gestioncof_views.utile_bda, + url(r'^gestion/utile_bda$', gestioncof_views.utile_bda, name='utile_bda'), - url(r'^utile_bda/bda_diff$', gestioncof_views.liste_bdadiff), - url(r'^utile_cof/diff_cof$', gestioncof_views.liste_diffcof), - url(r'^utile_bda/bda_revente$', gestioncof_views.liste_bdarevente), - url(r'^k-fet/', include('kfet.urls')), - url(r'^cms/', include(wagtailadmin_urls)), - url(r'^documents/', include(wagtaildocs_urls)), + url(r'^gestion/utile_bda/bda_diff$', gestioncof_views.liste_bdadiff), + url(r'^gestion/utile_cof/diff_cof$', gestioncof_views.liste_diffcof), + url(r'^gestion/utile_bda/bda_revente$', gestioncof_views.liste_bdarevente), + url(r'^gestion/k-fet/', include('kfet.urls')), + url(r'^gestion/cms/', include(wagtailadmin_urls)), + url(r'^gestion/documents/', include(wagtaildocs_urls)), # djconfig - url(r"^config", gestioncof_views.ConfigUpdate.as_view()), + url(r"^gestion/config", gestioncof_views.ConfigUpdate.as_view()), ] if 'debug_toolbar' in settings.INSTALLED_APPS: @@ -108,6 +109,6 @@ if settings.DEBUG: document_root=settings.MEDIA_ROOT) # Wagtail for uncatched -urlpatterns += [ +urlpatterns += i18n_patterns( url(r'', include(wagtail_urls)), -] +) diff --git a/gestioncof/cms/static/cofcms/css/screen.css b/gestioncof/cms/static/cofcms/css/screen.css index 617a6162..e29319cb 100644 --- a/gestioncof/cms/static/cofcms/css/screen.css +++ b/gestioncof/cms/static/cofcms/css/screen.css @@ -136,7 +136,7 @@ header h1 { } /* line 69, ../sass/screen.scss */ header nav ul { - display: flex; + display: inline-flex; } /* line 71, ../sass/screen.scss */ header nav ul li { @@ -152,35 +152,53 @@ header nav ul li > * { header nav ul li > *:hover { background: #280008; } +/* line 84, ../sass/screen.scss */ +header nav .lang-select { + display: inline-block; + height: 100%; + vertical-align: top; +} +/* line 89, ../sass/screen.scss */ +header nav .lang-select a { + padding: 5px; + display: block; +} +/* line 92, ../sass/screen.scss */ +header nav .lang-select a img { + display: block; + width: auto; + max-height: 30px; + vertical-align: middle; +} -/* line 87, ../sass/screen.scss */ +/* line 103, ../sass/screen.scss */ article { line-height: 1.4; } -/* line 89, ../sass/screen.scss */ +/* line 105, ../sass/screen.scss */ article p, article ul { margin: 0.4em 0; } -/* line 92, ../sass/screen.scss */ +/* line 108, ../sass/screen.scss */ article ul { padding-left: 20px; } -/* line 94, ../sass/screen.scss */ +/* line 110, ../sass/screen.scss */ article ul li { list-style: outside; } -/* line 98, ../sass/screen.scss */ +/* line 114, ../sass/screen.scss */ article:last-child { margin-bottom: 30px; } -/* line 103, ../sass/screen.scss */ +/* line 119, ../sass/screen.scss */ .container { max-width: 1000px; margin: 0 auto; position: relative; } -/* line 108, ../sass/screen.scss */ +/* line 124, ../sass/screen.scss */ .container .aside-wrap { position: absolute; top: 30px; @@ -188,7 +206,7 @@ article:last-child { width: 25%; left: 6px; } -/* line 115, ../sass/screen.scss */ +/* line 131, ../sass/screen.scss */ .container .aside-wrap .aside { color: #222; position: fixed; @@ -199,33 +217,33 @@ article:last-child { padding: 15px; box-shadow: -4px 4px 1px rgba(153, 118, 0, 0.3); } -/* line 125, ../sass/screen.scss */ +/* line 141, ../sass/screen.scss */ .container .aside-wrap .aside h2 { color: #fff; } -/* line 129, ../sass/screen.scss */ +/* line 145, ../sass/screen.scss */ .container .aside-wrap .aside .calendar { margin: 0 auto; display: block; } -/* line 134, ../sass/screen.scss */ +/* line 150, ../sass/screen.scss */ .container .aside-wrap .aside a { color: #997000; } -/* line 140, ../sass/screen.scss */ +/* line 156, ../sass/screen.scss */ .container .content { max-width: 900px; margin-left: auto; margin-right: 6px; } -/* line 145, ../sass/screen.scss */ +/* line 161, ../sass/screen.scss */ .container .content .intro { border-bottom: 3px solid #7f7f7f; margin: 20px 0; margin-top: 5px; padding: 15px 5px; } -/* line 154, ../sass/screen.scss */ +/* line 170, ../sass/screen.scss */ .container .content section article { background: #fff; padding: 20px 30px; @@ -233,31 +251,31 @@ article:last-child { border: 1px solid rgba(153, 118, 0, 0.1); border-radius: 2px; } -/* line 160, ../sass/screen.scss */ +/* line 176, ../sass/screen.scss */ .container .content section article a { color: #CC9500; } -/* line 165, ../sass/screen.scss */ +/* line 181, ../sass/screen.scss */ .container .content section article + h2 { margin-top: 15px; } -/* line 169, ../sass/screen.scss */ +/* line 185, ../sass/screen.scss */ .container .content section article + article { margin-top: 25px; } -/* line 173, ../sass/screen.scss */ +/* line 189, ../sass/screen.scss */ .container .content section .image { margin: 15px 0; text-align: center; padding: 20px; } -/* line 178, ../sass/screen.scss */ +/* line 194, ../sass/screen.scss */ .container .content section .image img { max-width: 100%; height: auto; box-shadow: -7px 7px 1px rgba(153, 118, 0, 0.2); } -/* line 186, ../sass/screen.scss */ +/* line 202, ../sass/screen.scss */ .container .content section.directory article.entry { width: 80%; max-width: 600px; @@ -265,7 +283,7 @@ article:last-child { position: relative; margin-left: 6%; } -/* line 193, ../sass/screen.scss */ +/* line 209, ../sass/screen.scss */ .container .content section.directory article.entry .entry-image { display: block; float: right; @@ -280,31 +298,31 @@ article:last-child { margin-bottom: 10px; transform: translateX(10px); } -/* line 207, ../sass/screen.scss */ +/* line 223, ../sass/screen.scss */ .container .content section.directory article.entry .entry-image img { width: auto; height: auto; max-width: 100%; max-height: 100%; } -/* line 215, ../sass/screen.scss */ +/* line 231, ../sass/screen.scss */ .container .content section.directory article.entry ul.links { margin-top: 10px; border-top: 1px solid #90001C; padding-top: 10px; } -/* line 223, ../sass/screen.scss */ +/* line 239, ../sass/screen.scss */ .container .content section.actuhome { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: top; } -/* line 229, ../sass/screen.scss */ +/* line 245, ../sass/screen.scss */ .container .content section.actuhome article + article { margin: 0; } -/* line 233, ../sass/screen.scss */ +/* line 249, ../sass/screen.scss */ .container .content section.actuhome article.actu { position: relative; background: none; @@ -314,7 +332,7 @@ article:last-child { min-width: 300px; flex: 1; } -/* line 242, ../sass/screen.scss */ +/* line 258, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header { position: relative; box-shadow: -4px 5px 1px rgba(153, 118, 0, 0.3); @@ -328,7 +346,7 @@ article:last-child { background-position: center center; background-repeat: no-repeat; } -/* line 255, ../sass/screen.scss */ +/* line 271, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 { position: absolute; width: 100%; @@ -338,11 +356,11 @@ article:last-child { text-shadow: 0 0 5px rgba(153, 118, 0, 0.8); background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); } -/* line 263, ../sass/screen.scss */ +/* line 279, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 a { color: #fff; } -/* line 269, ../sass/screen.scss */ +/* line 285, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc { background: white; box-shadow: -2px 2px 1px rgba(153, 118, 0, 0.2); @@ -352,17 +370,17 @@ article:last-child { padding: 15px; padding-top: 5px; } -/* line 278, ../sass/screen.scss */ +/* line 294, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-minical { display: block; } -/* line 281, ../sass/screen.scss */ +/* line 297, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-dates { display: block; text-align: right; font-size: 0.9em; } -/* line 288, ../sass/screen.scss */ +/* line 304, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-overlay { display: block; background: none; @@ -374,80 +392,80 @@ article:last-child { z-index: 5; opacity: 0; } -/* line 304, ../sass/screen.scss */ +/* line 320, ../sass/screen.scss */ .container .content section.actulist article.actu { display: flex; width: 100%; padding: 0; } -/* line 309, ../sass/screen.scss */ +/* line 325, ../sass/screen.scss */ .container .content section.actulist article.actu .actu-image { width: 30%; max-width: 200px; background-size: cover; background-position: center center; } -/* line 315, ../sass/screen.scss */ +/* line 331, ../sass/screen.scss */ .container .content section.actulist article.actu .actu-infos { padding: 15px; flex: 1; } -/* line 319, ../sass/screen.scss */ +/* line 335, ../sass/screen.scss */ .container .content section.actulist article.actu .actu-infos .actu-dates { font-weight: bold; font-size: 0.9em; } -/* line 329, ../sass/screen.scss */ +/* line 345, ../sass/screen.scss */ .container .aside-wrap + .content { max-width: 70%; } -/* line 334, ../sass/screen.scss */ +/* line 350, ../sass/screen.scss */ .calendar { color: rgba(0, 0, 0, 0.8); } -/* line 337, ../sass/screen.scss */ +/* line 353, ../sass/screen.scss */ .calendar td, .calendar th { text-align: center; vertical-align: middle; border: 2px solid transparent; padding: 1px; } -/* line 344, ../sass/screen.scss */ +/* line 360, ../sass/screen.scss */ .calendar th { font-weight: bold; } -/* line 348, ../sass/screen.scss */ +/* line 364, ../sass/screen.scss */ .calendar td { font-size: 0.8em; width: 28px; height: 28px; } -/* line 353, ../sass/screen.scss */ +/* line 369, ../sass/screen.scss */ .calendar td.out { opacity: 0.3; } -/* line 356, ../sass/screen.scss */ +/* line 372, ../sass/screen.scss */ .calendar td.today { border-bottom-color: #000; } -/* line 359, ../sass/screen.scss */ +/* line 375, ../sass/screen.scss */ .calendar td:nth-child(7), .calendar td:nth-child(6) { background: rgba(0, 0, 0, 0.2); } -/* line 362, ../sass/screen.scss */ +/* line 378, ../sass/screen.scss */ .calendar td.hasevent { position: relative; font-weight: bold; color: #90001C; font-size: 1em; } -/* line 368, ../sass/screen.scss */ +/* line 384, ../sass/screen.scss */ .calendar td.hasevent > a { padding: 3px; color: #90001C !important; } -/* line 373, ../sass/screen.scss */ +/* line 389, ../sass/screen.scss */ .calendar td.hasevent ul.cal-events { text-align: left; display: none; @@ -460,11 +478,11 @@ article:last-child { padding: 5px; background-color: #90001C; } -/* line 386, ../sass/screen.scss */ +/* line 402, ../sass/screen.scss */ .calendar td.hasevent ul.cal-events .datename { display: none; } -/* line 389, ../sass/screen.scss */ +/* line 405, ../sass/screen.scss */ .calendar td.hasevent ul.cal-events:before { top: -12px; left: 38px; @@ -473,33 +491,33 @@ article:last-child { border: 6px solid transparent; border-bottom-color: #90001C; } -/* line 397, ../sass/screen.scss */ +/* line 413, ../sass/screen.scss */ .calendar td.hasevent ul.cal-events a { color: #fff; } -/* line 402, ../sass/screen.scss */ +/* line 418, ../sass/screen.scss */ .calendar td.hasevent > a:hover { background-color: #90001C; color: #fff !important; } -/* line 406, ../sass/screen.scss */ +/* line 422, ../sass/screen.scss */ .calendar td.hasevent > a:hover + ul.cal-events { display: block; } -/* line 414, ../sass/screen.scss */ +/* line 430, ../sass/screen.scss */ #calendar-wrap .details { border-top: 1px solid #90001C; margin-top: 15px; padding-top: 10px; } -/* line 419, ../sass/screen.scss */ +/* line 435, ../sass/screen.scss */ #calendar-wrap .details li.datename { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } -/* line 420, ../sass/screen.scss */ +/* line 436, ../sass/screen.scss */ #calendar-wrap .details li.datename:after { content: " :"; } diff --git a/gestioncof/cms/static/cofcms/images/en.png b/gestioncof/cms/static/cofcms/images/en.png new file mode 100644 index 00000000..f69a5341 Binary files /dev/null and b/gestioncof/cms/static/cofcms/images/en.png differ diff --git a/gestioncof/cms/static/cofcms/images/fr.png b/gestioncof/cms/static/cofcms/images/fr.png new file mode 100644 index 00000000..eefa08ad Binary files /dev/null and b/gestioncof/cms/static/cofcms/images/fr.png differ diff --git a/gestioncof/cms/static/cofcms/sass/screen.scss b/gestioncof/cms/static/cofcms/sass/screen.scss index 9e2379d7..55ce00c5 100644 --- a/gestioncof/cms/static/cofcms/sass/screen.scss +++ b/gestioncof/cms/static/cofcms/sass/screen.scss @@ -67,7 +67,7 @@ header { } nav { ul { - display: flex; + display: inline-flex; li { display: inline-block; & > * { @@ -81,6 +81,22 @@ header { } } } + .lang-select { + display: inline-block; + height: 100%; + vertical-align: top; + + a { + padding: 5px; + display: block; + img { + display: block; + width: auto; + max-height: 30px; + vertical-align: middle; + } + } + } } } diff --git a/gestioncof/cms/templates/cofcms/base.html b/gestioncof/cms/templates/cofcms/base.html index 056e37ec..c11a2761 100644 --- a/gestioncof/cms/templates/cofcms/base.html +++ b/gestioncof/cms/templates/cofcms/base.html @@ -1,4 +1,4 @@ -{% load static menu_tags wagtailuserbar %} +{% load static menu_tags wagtailuserbar i18n wagtailcore_tags %} @@ -21,6 +21,20 @@