Some style changes

This commit is contained in:
Eduard Urbach 2017-11-05 20:39:19 +01:00
parent a423e64841
commit 4cdc23d8f7
4 changed files with 16 additions and 15 deletions

View File

@ -1,14 +0,0 @@
component TabLike(label string, icon string, track *arn.SoundTrack, user *arn.User)
if user == nil
a.tab.action(aria-label=label)
Icon(icon)
span.tab-text= label
else
if track.LikedBy(user.ID)
a.tab.action(data-api="/api" + track.Link(), data-action="unlike", data-trigger="click", aria-label=label)
Icon(icon)
span.tab-text= label
else
a.tab.action(data-api="/api" + track.Link(), data-action="like", data-trigger="click", aria-label=label)
Icon(icon)
span.tab-text= label

14
mixins/TabLikeTrack.pixy Normal file
View File

@ -0,0 +1,14 @@
component TabLikeTrack(label string, icon string, track *arn.SoundTrack, user *arn.User)
if user == nil
.tab.action(aria-label=label, title="Login to like this track")
Icon(icon)
span.tab-text= label
else
if track.LikedBy(user.ID)
.tab.action(data-api="/api" + track.Link(), data-action="unlike", data-trigger="click", aria-label=label, title="Click to unlike this track")
Icon(icon)
span.tab-text= label
else
.tab.action(data-api="/api" + track.Link(), data-action="like", data-trigger="click", aria-label=label, title="Click to like this track")
Icon(icon + "-o")
span.tab-text= label

View File

@ -52,4 +52,4 @@ component SoundTrackTabs(track *arn.SoundTrack, user *arn.User)
.tabs
Tab("Soundtrack", "music", track.Link())
Tab("Edit", "pencil", track.Link() + "/edit")
TabLike(strconv.Itoa(len(track.Likes)), "heart", track, user)
TabLikeTrack(strconv.Itoa(len(track.Likes)), "heart", track, user)

View File

@ -10,6 +10,7 @@
color text-color
background-color tab-hover-background
text-shadow none
cursor pointer
:active
transform none