Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="data-list">
- <ul class="media-list mt-18">
- {{#comments}}
- <li class="media {{#featured}}featured{{/featured}}">
- <div class="media-body">
- <h1 class="media-heading-1">{{author}} <span class="data-1">{{created_at_formatted}}</span></h1>
- <p class="media-heading-2">
- {{comment}}
- </p>
- </div>
- </li>
- {{/comments}}
- {{^comments}}
- <div class="alert alert-info">Brak kometarzy</div>
- {{/comments}}
- </ul>
- </div>
- #comments .media {
- padding: 10px 15px;
- margin: 0;
- border-bottom: 1px solid #000;
- }
- #comments .featured {
- border-bottom: 0;
- background: #f28725;
- }
- #comments .featured .media-heading-1,
- #comments .featured .media-heading-2,
- #comments .featured .data-1{
- color: #FFF;
- }
- function renderComments(data){
- var comments = [];
- for(i in data){
- var comment = data[i];
- if(comment.featured == 1){
- comment.featured = true;
- } else comment.featured = false;
- comments.push(comment);
- }
- var html = $(Mustache.to_html(templates.commentsViewTemplate, {
- comments: comments, base_url: base_url
- }));
- $('#comments-list').html(html);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement