Skip to content

Commit

Permalink
optional use of schnack icon font
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed Oct 20, 2017
1 parent 3ca31d6 commit 36aa77e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/embed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/embed/comments.jst.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,28 @@
<% } %>
<ul class="schnack-comments">
<% data.comments.forEach((comment) => { %>
<li class="schnack-comment<% if (!comment.approved && !comment.trusted) { %> schnack-not-approved<% } %>">
<li data-id="<%= comment.id %>" class="schnack-comment<% if (!comment.approved && !comment.trusted) { %> schnack-not-approved<% } %>">
<div class="schnack-dateline">
<span class="schnack-author"><% if (comment.author_url) { %><a href="<%= comment.author_url %>" target="_blank"><% } %><%= comment.display_name || comment.name %><% if (comment.author_url) { %></a><% } %></span>
<span class="schnack-date"><%= comment.created_at_s %>:</span>
<% if (data.user && data.user.admin &&!comment.trusted) {
['trust', 'block'].forEach((action) => { %>
<button class="schnack-action" data-target="<%= comment.user_id %>" data-class="user" data-action="<%= action %>"><%= action %></button>
<button class="schnack-action" data-target="<%= comment.user_id %>" data-class="user" data-action="<%= action %>"><i class="icon schnack-icon-<%= action %>"></i> <span><%= action %></span></button>
<% }); } %>
<span class="schnack-date"><%= comment.created_at_s %></span>
</div>
<blockquote class="schnack-body">
<%= comment.comment %>
</blockquote>
<% if (!comment.approved && !comment.trusted) { %>
<div class="schnack-awaiting-approval">
This comment is still waiting for <%= data.user.admin ? 'your ' : '' %>approval<%= !data.user.admin ? ' by the site owner' : ''%>.
<% if (data.user && data.user.admin) {
['approve', 'reject'].forEach((action) => { %>
<button class="schnack-action" data-target="<%= comment.id %>" data-class="comment" data-action="<%= action %>"><%= action %></button>
<button class="schnack-action" data-target="<%= comment.id %>" data-class="comment" data-action="<%= action %>"><i class="icon schnack-icon-<%= action %>"></i> <span><%= action %></span></button>
<% }); } %>
This comment is still waiting for <%= data.user.admin ? 'your ' : '' %>approval<%= !data.user.admin ? ' by the site owner' : ''%>.
</div>
<% } else { %>
<button>reply</button>
<% } %>
</li>
<% }) %>
Expand Down
1 change: 1 addition & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>schnack.js test page</title>
<link rel="stylesheet" type="text/css" href="schnack.css">
<link rel="stylesheet" type="text/css" href="schnack-icons.css">
</head>
<body>
<script type="text/javascript"
Expand Down
18 changes: 18 additions & 0 deletions test/schnack.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,22 @@ li.schnack-comment {

.schnack-body p {
margin: 0;
}

button.schnack-action {
border:0;
background: none;
cursor: pointer;
padding:0;
opacity: 0.5;
}


button.schnack-action:hover {
color: #c00;
opacity: 1;
}

button.schnack-action span {
display: none;
}

0 comments on commit 36aa77e

Please sign in to comment.