Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions www/sass/_likers.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.likers {
font-size: 12px;
color: $dark-grey;
}
12 changes: 4 additions & 8 deletions www/sass/blocks/_mini-like.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
}
}

.like-button {
@include border-radius(9px);
@include badge();
padding: 2px 9px;
color: white;
background-color: lighten($like-color, 30%);
.like-icon {
color: $dark-grey;
}

.like-button-liked {
background-color: $like-color;
.like-button {
color: $dark-grey;
}
1 change: 1 addition & 0 deletions www/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@
@import 'feed/item';

@import 'comment';
@import 'likers';
26 changes: 9 additions & 17 deletions www/templates/like.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<% if (obj.list.length || !my) { %>
<% if (currentUser && !my) { %>
<% if (meGusta) { %>
<a class="pull-self" href="#"><!--
--><% } else { %>
<a class="push-self" href="#"><!--
--><% } %><!--
--><% } %><!--

--><span class="like-button <%- (obj.meGusta || my) ? 'like-button-liked' : '' %>" data-toggle="tooltip" title="<%= list.slice(0, 10).join(', ') %><%= (list.length <= 10) ? '' : ' and ' + (list.length - 10) + ' more' %>">
<i class="<%- (obj.meGusta || my) ? 'icon-thumbs-up' : 'icon-thumbs-up-alt' %>"></i>
<%= list.length %>
</span><!--

--><% if (currentUser && !my) { %><!--
--></a>
<% } %>
<span class="like-button">
<% if (currentUser && !my) { %>
&bull;
<% if (_.contains(list,currentUser)) { %>
<a class="pull-self" href="#">Unlike</a>
<% } else { %>
<a class="push-self" href="#">Like</a>
<% } %>
<% } %>
</span>
24 changes: 24 additions & 0 deletions www/templates/partials.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@
<script type="text/template" class="upic-small"><a href="/player/<%- login %>"><img src="/api/user/<%- login %>/pic?s=small" alt="<%- login %>" title="<%- login %>" class="upic-small"/></a></script>
<script type="text/template" class="upic-normal"><img src="/api/user/<%- login %>/pic?s=normal" class="upic-normal"/></script>

<script type="text/template" class="likers">

<% if (list && list.length) { %>
<div class="likers">
<% var meGusta = _.contains(list, currentUser); %>
<% var topLikes = _.without(list, currentUser).slice(0, 3); %>
<% var otherLikes = _.without(list, currentUser).slice(3); %>
<span class="like-icon">
<i class="<%- meGusta ? 'icon-thumbs-up' : 'icon-thumbs-up-alt' %>"></i>
</span>

Liked by
<% if (meGusta) { %>you<% } %><!--
--><% _.each(topLikes, function(t, index) { %><!--
--><% if (index > 0 || meGusta) { %>, <% } %>
<%= partial.user({login: t}) %><!--
--><% }) %><!--
--><% if (otherLikes.length) { %>
and <%- otherLikes.length %> more<!--
--><% } %>.
</div>
<% } %>
</script>

<script type="text/template" class="quest-labels">
<span class="quest-tags">
<% if (obj.showRealm) { %>
Expand Down
5 changes: 3 additions & 2 deletions www/templates/quest/big.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@
<button class="quest-join btn btn-primary">Take</button>
</div>
<% } %>


<footer class="object-bottom-line">

<div class="quest-big-tags">
<%= partial.quest_labels(obj) %>
</div>

<<<<<<< HEAD

<a href="/realm/<%- realm %>/quest/<%- _id %>" class="time-anchor"><time class="timeago" datetime="<%= new Date(ts * 1000).toISOString() %>">
<%= new Date(ts * 1000).toISOString() %>
</time></a>
Expand Down
2 changes: 2 additions & 0 deletions www/templates/quest/feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
<%= partial.quest_labels(obj) %>
</div>

<%= partial.likers({list: likes, currentUser: currentUser, partial: partial}) %>

<a href="/realm/<%- realm %>/quest/<%- _id %>" class="time-anchor"><time class="timeago" datetime="<%= new Date(ts * 1000).toISOString() %>">
<%= new Date(ts * 1000).toISOString() %>
</time></a>
Expand Down