Skip to content

Commit 2f96ea3

Browse files
authored
Merge pull request #455 from mpsonntag/fixesRelease2019
Favourite abstract style updates LGTM
2 parents 4cbc2e5 + 96bfa96 commit 2f96ea3

File tree

3 files changed

+48
-12
lines changed

3 files changed

+48
-12
lines changed

app/assets/stylesheets/layout.less

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ body {
160160
}
161161

162162
.favour{
163-
color: white !important;
164-
background-color: gold !important;
163+
color: @color-dark-gray-dark !important;
164+
background-color: white !important;
165165
border-radius: 4px;
166166
}
167+
167168
.disfavour{
168-
color: white;
169-
background-color: darkred;
169+
color: rgb(184, 134, 11);
170+
background-color: rgb(255, 250, 120);
170171
border-radius: 4px;
171-
border: none;
172172
}
173173

174174
.abstract-text {
@@ -411,3 +411,33 @@ body {
411411
.tab-content {
412412
margin-top: 10px;
413413
}
414+
415+
/* Tooltip container */
416+
.gn-tooltip {
417+
color: black;
418+
}
419+
420+
/* Tooltip text */
421+
.gn-tooltip .gn-tooltiptext {
422+
visibility: hidden;
423+
background-color: #555;
424+
color: #fff;
425+
text-align: center;
426+
padding: 5px;
427+
border-radius: 5px;
428+
429+
/* Position the tooltip text */
430+
position: fixed;
431+
z-index: 1;
432+
margin-top: -60px;
433+
434+
/* Fade in tooltip */
435+
opacity: 0;
436+
transition: opacity 0.3s;
437+
}
438+
439+
/* Show the tooltip text when you mouse over the tooltip container */
440+
.gn-tooltip:hover .gn-tooltiptext {
441+
visibility: visible;
442+
opacity: 1;
443+
}

app/views/abstractlist.scala.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,16 @@ <h4 class="list-group-item-heading" data-bind="text: title"></h4>
8686

8787
@if(account.isDefined) {
8888
<li data-bind="visible: !$root.isFavouriteAbstract()">
89-
<a class="favour" data-bind="click: $root.favourAbstract">&#9733</a>
89+
<a class="favour gn-tooltip" data-bind="click: $root.favourAbstract" href="">
90+
&#9733
91+
<span class="gn-tooltiptext">Add abstract to favourites</span>
92+
</a>
9093
</li>
9194
<li data-bind="visible: $root.isFavouriteAbstract">
92-
<a class="disfavour" data-bind="click: $root.disfavourAbstract">&#9733</a>
95+
<a class="disfavour gn-tooltip" data-bind="click: $root.disfavourAbstract" href="">
96+
&#9733
97+
<span class="gn-tooltiptext">Remove abstract from favourites</span>
98+
</a>
9399
</li>
94100
}
95101

app/views/dashboard/favouriteabstracts.scala.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h4>Loading data</h4>
2020
<!-- If no Favourites -->
2121
<div data-bind="if: noFavouriteAbstracts">
2222
<div class="alert alert-info fade in out">
23-
<h4>You have no favourite abstracts yet. Click the star button shown for abstracts to add them.</h4>
23+
<h4>You have no favourite abstracts yet. Click the star button on an abstract to add it.</h4>
2424
</div>
2525
</div>
2626

@@ -48,11 +48,11 @@ <h4 class="panel-title" data-bind="text: name"></h4>
4848
<span data-bind="text: cite"></span>
4949
</div>
5050
<ul id="abstract-list" class="list-group" data-bind="foreach: abstracts">
51-
<a data-bind="attr: { href: createLink().absLink }">
52-
<li id="abstract-list-item" class="list-group-item abstract">
51+
<li id="abstract-list-item" class="list-group-item abstract">
52+
<a data-bind="attr: { href: createLink().absLink }">
5353
<span data-bind="text: title"></span>
54-
</li>
55-
</a>
54+
</a>
55+
</li>
5656
</ul>
5757
</div>
5858
</div>

0 commit comments

Comments
 (0)