From 916bf03adcd148e2e7530c734da7778d29601b85 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Wed, 6 Apr 2016 20:34:05 +0200 Subject: [PATCH] add social share --- prosopopee/prosopopee.py | 2 +- .../themes/exposure/static/css/style-page.css | 59 +++++++++++- .../exposure/static/img/social-share.png | Bin 0 -> 1650 bytes .../exposure/templates/gallery-index.html | 86 +++++++++--------- .../themes/exposure/templates/share.html | 17 ++++ .../material/templates/gallery-index.html | 5 + .../themes/material/templates/share.html | 23 +++++ 7 files changed, 149 insertions(+), 43 deletions(-) create mode 100644 prosopopee/themes/exposure/static/img/social-share.png create mode 100644 prosopopee/themes/exposure/templates/share.html create mode 100644 prosopopee/themes/material/templates/share.html diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index fde573a..50ff487 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -157,7 +157,7 @@ def main(): Image.target_dir = os.path.join(os.getcwd(), "build", gallery) template_to_render = page_template if gallery_settings.get("static") else gallery_index_template - open(os.path.join("build", gallery, "index.html"), "w").write(template_to_render.render(settings=settings, gallery=gallery_settings, Image=Image).encode("Utf-8")) + open(os.path.join("build", gallery, "index.html"), "w").write(template_to_render.render(settings=settings, gallery=gallery_settings, Image=Image, link=gallery).encode("Utf-8")) front_page_galleries_cover = reversed(sorted(front_page_galleries_cover, key=lambda x: x["date"])) diff --git a/prosopopee/themes/exposure/static/css/style-page.css b/prosopopee/themes/exposure/static/css/style-page.css index 8b6cbcf..561fdf2 100644 --- a/prosopopee/themes/exposure/static/css/style-page.css +++ b/prosopopee/themes/exposure/static/css/style-page.css @@ -148,7 +148,6 @@ footer { .back-to-home hr { width: 14%; - margin-top: 8em; color: #DDD; } @@ -253,3 +252,61 @@ footer a { margin-right: 11.5%; } +.center, .center-align { + text-align: center; +} + + +.share { + text-align: center; + height: auto; + position: relative; + bottom: 0; + padding: 0 0 10px 0; +} + + +ul.icon { + padding: 0; + margin: 10px 0 0 0; +} + +ul.icon li { + padding: 0; + list-style-type: none; + display:inline-block; +} + +ul.icon a { + display: block; + float: left; + background: url(../img/social-share.png) no-repeat; + background-size: 196px 23px; + border: none; +} + +ul.icon li, ul.icon a { + width: 32px; + height: 32px; + text-indent: -999999em; + overflow: hidden; + list-style-type: none; + display: inline-block; +} + +a.twitter { + background-position: 5px 0 !important; +} + +a.facebook { + background-position: -57px 0 !important; +} + +a.pinterest { + background-position: -114px 0 !important; +} + +a.google { + background-position: -172px 0 !important; +} + diff --git a/prosopopee/themes/exposure/static/img/social-share.png b/prosopopee/themes/exposure/static/img/social-share.png new file mode 100644 index 0000000000000000000000000000000000000000..3d78248f0c976bb2e923c608a03383fd8778bd58 GIT binary patch literal 1650 zcmV-&295cNP)q001rs1ONa4n0Q9&000I#NklM`C8g zJe)ER@KKoN7APd}sZF|mYCyax2#0k1Q-O=j+9RUHbC$p9@{c$m7aM$5bancmyY3( zQ3&)!h8!H0D4@!JnLReWnmGh=4D67A!ob2l5ge!}o)i4&l_#AIxNm1ma(MiSDKw>1MiR z^y{~+2Z9fnh%YG2Ssq-&3cNkiU#BvT(qf*AeZ}8C^PZ(W5CxA8;(>UUcBCbU>&2D> zp+|Ce!jMR)LLwGT`jz-*tm^?0*>$%duD@6k3dC77u2*#+1gx;D^1ov4%9IEoLNnHE zDW#y6P?&KxQ;gQ^Fs3S#f;oVq|{ z7&PXzBS756&R)0b2oY7LXu_PDTg#GUNy?dfk( zK&YyLuMZ!KeI}1uEjVL0#q#b~hp0Xf?jl0KtvVPXwx&NM0io4d!pekM&6!dcBtTFM z3I;|)LAC)GL>&R*K6dstf_s??xZ@FG!i+m$j!BH*%>u)3C=qMGac6+IR|Dc-!QHOm zSbmV2AQF&4SnRR41qme_h!5-Pw#E5C{rf(WlSkT)Oc|RYUBt-Z6E^iKs-fEQd>8) zE!VK3kF|hP4UfF|U?>bFaGFo71;>XT2*a&iDICKm?+N+}n%J5tE-kaP>e0 zmF@j%=n%PpIA0n4^r*K)%CDr6d&A)`!VW}4)BzwKq`CEiKp^Z3CXo!l84N{vi$e7` zZzK)PBumV*g9%P2fOwq_rxS)gk#=QgJ9HeKIQsWvhCja$2t>|4DH9xlIJ~2=d`QiT z6z-y?*12tbFyEmod>?|(EIXJs=7c4j@x*wM%E%oMa)2%RoWdpoQYyB()VFS!Gl+n- zJn*RD39KeXR;_<=qm|tyLB+e)T{oEuIUPZ380wnn^W$gd@lE zN~8;fBttzAp}7PpxQQ<_A6N65q1efmFi1+odLRTe*VJt=is!7WMRk+t7=_g`DbQf( zfp|;M5DKURS|Y>1^dK0xNE&(?5)?ut$SXmJ;lm-Rx_N3qyekHXoP>+-F)X1$QTAo| z2$4?Z;b3r}W=vhsl~V)aMKM4GBwyCgmNO^Qy>^=#5ElpmA|;tJKYg?si)`*Jx7UsH z1mb>n?zR(;dX1JA0)$7M6kI3-2ula{JMX>DpbzP9Yu~}n+=_mwIO1Eno7NK2$rMtr wUSnF3*0uKP?7U@Yor)vYA`yazgnC)(e|d6kd`y_(ZvX%Q07*qoM6N<$g3uM@YXATM literal 0 HcmV?d00001 diff --git a/prosopopee/themes/exposure/templates/gallery-index.html b/prosopopee/themes/exposure/templates/gallery-index.html index 1902c60..36d573f 100644 --- a/prosopopee/themes/exposure/templates/gallery-index.html +++ b/prosopopee/themes/exposure/templates/gallery-index.html @@ -1,49 +1,53 @@ - - - - - - - + + + + + + + - - - {{ gallery.title }} · {{ settings.title }} - + + + {{ gallery.title }} · {{ settings.title }} + - - {% for section in gallery.sections %} - {% include "sections/" + section.type + ".html" %} - {% endfor %} + + {% for section in gallery.sections %} + {% include "sections/" + section.type + ".html" %} + {% endfor %} - + {% if settings.share %} + {% include "share.html" %} + {% endif %} - - - - + + + - - +}); + + + {% include "footer.html" %} + + diff --git a/prosopopee/themes/exposure/templates/share.html b/prosopopee/themes/exposure/templates/share.html new file mode 100644 index 0000000..89dbbb6 --- /dev/null +++ b/prosopopee/themes/exposure/templates/share.html @@ -0,0 +1,17 @@ +{% set absolute_url = settings.url + "/" + link -%} + diff --git a/prosopopee/themes/material/templates/gallery-index.html b/prosopopee/themes/material/templates/gallery-index.html index 70784f5..69679cc 100644 --- a/prosopopee/themes/material/templates/gallery-index.html +++ b/prosopopee/themes/material/templates/gallery-index.html @@ -21,11 +21,16 @@ {% include "sections/" + section.type + ".html" %} {% endfor %} + + {% if settings.share %} + {% include 'share.html' -%} + {% else -%} + {% endif %} diff --git a/prosopopee/themes/material/templates/share.html b/prosopopee/themes/material/templates/share.html new file mode 100644 index 0000000..0fcef09 --- /dev/null +++ b/prosopopee/themes/material/templates/share.html @@ -0,0 +1,23 @@ +{% set absolute_url = settings.url + "/" + link -%} +
+ + + + +