From d3ed0317bbbe180bd9be5427c857577088e1a46a Mon Sep 17 00:00:00 2001 From: Virgil Grigoras Date: Mon, 25 Feb 2019 19:25:08 +0100 Subject: [PATCH] styling and javascript for hiding authors --- cps/static/css/style.css | 6 ++++++ cps/static/js/main.js | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/cps/static/css/style.css b/cps/static/css/style.css index 9e2e82b3..e75457e3 100644 --- a/cps/static/css/style.css +++ b/cps/static/css/style.css @@ -36,6 +36,11 @@ a{color: #45b29d}a:hover{color: #444;} .container-fluid .book .meta .title{font-weight:bold;font-size:15px;color:#444} .container-fluid .book .meta .author{font-size:12px;color:#999} .container-fluid .book .meta .rating{margin-top:5px}.rating .glyphicon-star{color:#999}.rating .glyphicon-star.good{color:#45b29d} + +.container-fluid .author .author-hidden, .container-fluid .author .author-hidden-divider { + display: none; +} + .navbar-brand{font-family: 'Grand Hotel', cursive; font-size: 35px; color: #45b29d !important;} .more-stuff{margin-top: 20px; padding-top: 20px; border-top: 1px solid #ccc} .more-stuff>li{margin-bottom: 10px;} @@ -52,6 +57,7 @@ span.glyphicon.glyphicon-tags {padding-right: 5px;color: #999;vertical-align: te -moz-box-shadow: 0 5px 8px -6px #777; box-shadow: 0 5px 8px -6px #777; } + .navbar-default .navbar-toggle .icon-bar {background-color: #000;} .navbar-default .navbar-toggle {border-color: #000;} .cover { margin-bottom: 10px;} diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 7cd07e18..0893a905 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -204,4 +204,12 @@ $(function() { $(window).resize(function() { $(".discover .row").isotope("layout"); }); + + $(".author-expand").click(function() { + $(this).parent().find('a.author-name').slice($(this).data("authors-max")).toggle(); + $(this).parent().find('span.author-hidden-divider').toggle(); + $(this).html()==$(this).data("collapse-caption")? $(this).html('(...)'):$(this).html($(this).data("collapse-caption")); + $(".discover .row").isotope("layout"); + }); + });