From 0e19abb51a77eb3eade2970928c0e725099affdb Mon Sep 17 00:00:00 2001 From: Evarin Date: Wed, 27 Sep 2017 23:58:50 +0200 Subject: [PATCH] Cleaner homepage --- gestioncof/cms/static/cofcms/css/screen.css | 52 ++++++++++++------- gestioncof/cms/static/cofcms/sass/screen.scss | 25 +++++++-- .../cms/templates/cofcms/cof_root_page.html | 11 ++-- gestioncof/cms/templatetags/cofcms_tags.py | 1 - 4 files changed, 62 insertions(+), 27 deletions(-) diff --git a/gestioncof/cms/static/cofcms/css/screen.css b/gestioncof/cms/static/cofcms/css/screen.css index c12e478c..5f543bb4 100644 --- a/gestioncof/cms/static/cofcms/css/screen.css +++ b/gestioncof/cms/static/cofcms/css/screen.css @@ -263,7 +263,7 @@ article ul li { display: flex; flex-wrap: wrap; justify-content: space-around; - align-items: center; + align-items: top; } /* line 196, ../sass/screen.scss */ .container .content section.actuhome article + article { @@ -271,87 +271,103 @@ article ul li { } /* line 200, ../sass/screen.scss */ .container .content section.actuhome article.actu { + position: relative; background: none; box-shadow: none; max-width: 400px; min-width: 300px; flex: 1; } -/* line 207, ../sass/screen.scss */ +/* line 208, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header { position: relative; box-shadow: -4px 5px 1px rgba(0, 0, 0, 0.3); + min-height: 180px; padding: 0; margin: 0; overflow: hidden; background-size: cover; background-position: center center; } -/* line 216, ../sass/screen.scss */ +/* line 218, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 { + position: absolute; width: 100%; - height: 100%; + bottom: 0; + left: 0; padding: 5px; - padding-top: 150px; text-shadow: 0 0 5px rgba(0, 0, 0, 0.8); + background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); } -/* line 222, ../sass/screen.scss */ +/* line 226, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 a { color: #fff; } -/* line 228, ../sass/screen.scss */ +/* line 232, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc { background: white; - box-shadow: -4px 5px 1px rgba(0, 0, 0, 0.3); + box-shadow: -2px 2px 1px rgba(0, 0, 0, 0.2); margin: 0 10px; padding: 15px; padding-top: 5px; } -/* line 235, ../sass/screen.scss */ +/* line 239, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-minical { display: block; } -/* line 238, ../sass/screen.scss */ +/* line 242, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-dates { display: block; text-align: right; font-size: 0.9em; } +/* line 249, ../sass/screen.scss */ +.container .content section.actuhome article.actu .actu-overlay { + display: block; + background: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 5; + opacity: 0; +} -/* line 251, ../sass/screen.scss */ +/* line 268, ../sass/screen.scss */ .calendar td, .calendar th { text-align: center; vertical-align: center; border: 2px solid transparent; padding: 1px; } -/* line 258, ../sass/screen.scss */ +/* line 275, ../sass/screen.scss */ .calendar th { font-weight: bold; } -/* line 262, ../sass/screen.scss */ +/* line 279, ../sass/screen.scss */ .calendar td { font-size: 0.8em; width: 25px; height: 30px; } -/* line 267, ../sass/screen.scss */ +/* line 284, ../sass/screen.scss */ .calendar td.out { opacity: 0.3; } -/* line 270, ../sass/screen.scss */ +/* line 287, ../sass/screen.scss */ .calendar td.today { border-bottom-color: #000; } -/* line 273, ../sass/screen.scss */ +/* line 290, ../sass/screen.scss */ .calendar td:nth-child(7) { background: rgba(0, 0, 0, 0.3); } -/* line 276, ../sass/screen.scss */ +/* line 293, ../sass/screen.scss */ .calendar td:nth-child(6) { background: rgba(0, 0, 0, 0.2); } -/* line 279, ../sass/screen.scss */ +/* line 296, ../sass/screen.scss */ .calendar td.hasevent { font-weight: bold; color: #3cb3a6; diff --git a/gestioncof/cms/static/cofcms/sass/screen.scss b/gestioncof/cms/static/cofcms/sass/screen.scss index 50e24936..aa278464 100644 --- a/gestioncof/cms/static/cofcms/sass/screen.scss +++ b/gestioncof/cms/static/cofcms/sass/screen.scss @@ -191,13 +191,14 @@ article { display: flex; flex-wrap: wrap; justify-content: space-around; - align-items: center; + align-items: top; article + article { margin: 0; } article.actu { + position: relative; background: none; box-shadow: none; max-width: 400px; @@ -207,6 +208,7 @@ article { .actu-header { position: relative; box-shadow: -4px 5px 1px rgba(#000, 0.3); + min-height: 180px; padding: 0; margin: 0; overflow: hidden; @@ -214,11 +216,13 @@ article { background-position: center center; h2 { + position: absolute; width: 100%; - height: 100%; + bottom: 0; + left: 0; padding: 5px; - padding-top: 150px; text-shadow: 0 0 5px rgba(#000, 0.8); + background: linear-gradient(to top, rgba(#000, 0.7), rgba(#000, 0)); a { color: #fff; } @@ -227,7 +231,7 @@ article { .actu-misc { background: lighten($fond, 15%); - box-shadow: -4px 5px 1px rgba(#000, 0.3); + box-shadow: -2px 2px 1px rgba(#000, 0.2); margin: 0 10px; padding: 15px; padding-top: 5px; @@ -241,6 +245,19 @@ article { font-size: 0.9em; } } + + .actu-overlay { + display: block; + background: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 5; + opacity: 0; + } + } } } diff --git a/gestioncof/cms/templates/cofcms/cof_root_page.html b/gestioncof/cms/templates/cofcms/cof_root_page.html index 62c0a3d3..84b60b80 100644 --- a/gestioncof/cms/templates/cofcms/cof_root_page.html +++ b/gestioncof/cms/templates/cofcms/cof_root_page.html @@ -17,12 +17,15 @@

{{ actu.title }}

- {% if actu.is_event %} -
+
+ {% if actu.is_event %} {% get_current_language as curlang %} {% mini_calendar actu curlang %}{{ actu.dates }} -
- {% endif %} + {% else %} + {{ actu.body|safe|truncatewords_html:25 }} + {% endif %} +
+ {% endfor %} diff --git a/gestioncof/cms/templatetags/cofcms_tags.py b/gestioncof/cms/templatetags/cofcms_tags.py index 004fd21c..7d426e46 100644 --- a/gestioncof/cms/templatetags/cofcms_tags.py +++ b/gestioncof/cms/templatetags/cofcms_tags.py @@ -42,7 +42,6 @@ def calendar(): del events[k] else: curevents.append(e) - print(curevents) day = {'day': curday.day, 'class': (('today ' if (curday.day == now.day and curday.month == now.month) else '')